From Jeremie.LEGUAY at fr.thalesgroup.com Wed Dec 1 07:34:20 2004 From: Jeremie.LEGUAY at fr.thalesgroup.com (Jeremie.LEGUAY@fr.thalesgroup.com) Date: Wed Dec 1 07:34:47 2004 Subject: [nsclick-users] geographical position of nodes Message-ID: <66CE949D18BCB249ABE8D9AF48C4F1CE01D7946E@helios.clb.tcfr.thales> Hello, I am using click with ns for the moment and I would like nodes to be able to get their own geographical position and even more, if possible, I would like them to be able to know the position of all the nodes involved in the simulation. I know that in ns2 a function called "getLoc" do the thing I want, do you know how can I access to this function in the c++ code of my element in click? regards, Jeremie From Michael.Neufeld at colorado.edu Thu Dec 2 07:21:10 2004 From: Michael.Neufeld at colorado.edu (Michael Neufeld) Date: Thu Dec 2 07:21:41 2004 Subject: [nsclick-users] geographical position of nodes In-Reply-To: <66CE949D18BCB249ABE8D9AF48C4F1CE01D7946E@helios.clb.tcfr.thales> References: <66CE949D18BCB249ABE8D9AF48C4F1CE01D7946E@helios.clb.tcfr.thales> Message-ID: <41AF24D6.3090901@colorado.edu> You can access ns-2 c++ functions from Click elements, but it does take a little work. The interface between Click and ns-2 is a C api, so you have to add an interface function on the Click side in include/click/simclick.h. Since you want to go from the Click side to the ns-2 side, your new function should be implemented over in ns-2 in the classifier/classifier-click.cc file. To call the function from your Click code, you'll need to get both the simulator ID and the Click ID from the router object associated with your graph, see the get_siminst() and get_clickinst() methods in router.hh in Click. The ToSimDevice and FromSimDevice elements would probably be a good place to start looking at code to see how things work. -Mike Jeremie.LEGUAY@fr.thalesgroup.com wrote: > Hello, > > I am using click with ns for the moment and I would like nodes to be able to > get their own geographical position and even more, if possible, I would like > them to be able to know the position of all the nodes involved in the > simulation. I know that in ns2 a function called "getLoc" do the thing I > want, do you know how can I access to this function in the c++ code of my > element in click? > > regards, > > Jeremie > _______________________________________________ > nsclick-users mailing list > nsclick-users@cs-lists.cs.colorado.edu > http://cs-lists.cs.colorado.edu/mailman/listinfo/nsclick-users From Jeremie.LEGUAY at fr.thalesgroup.com Mon Dec 6 01:58:31 2004 From: Jeremie.LEGUAY at fr.thalesgroup.com (Jeremie.LEGUAY@fr.thalesgroup.com) Date: Mon Dec 6 01:59:43 2004 Subject: [nsclick-users] geographical position of nodes Message-ID: <66CE949D18BCB249ABE8D9AF48C4F1CE01D79474@helios.clb.tcfr.thales> ok Thank you Michael for all these informations, I will test your stategy. best regards J?r?mie -----Message d'origine----- De : Michael Neufeld [mailto:Michael.Neufeld@colorado.edu] Envoy? : jeudi 2 d?cembre 2004 15:21 ? : Jeremie.LEGUAY@fr.thalesgroup.com Cc : nsclick-users@cs-lists.cs.colorado.edu Objet : Re: [nsclick-users] geographical position of nodes You can access ns-2 c++ functions from Click elements, but it does take a little work. The interface between Click and ns-2 is a C api, so you have to add an interface function on the Click side in include/click/simclick.h. Since you want to go from the Click side to the ns-2 side, your new function should be implemented over in ns-2 in the classifier/classifier-click.cc file. To call the function from your Click code, you'll need to get both the simulator ID and the Click ID from the router object associated with your graph, see the get_siminst() and get_clickinst() methods in router.hh in Click. The ToSimDevice and FromSimDevice elements would probably be a good place to start looking at code to see how things work. -Mike Jeremie.LEGUAY@fr.thalesgroup.com wrote: > Hello, > > I am using click with ns for the moment and I would like nodes to be able to > get their own geographical position and even more, if possible, I would like > them to be able to know the position of all the nodes involved in the > simulation. I know that in ns2 a function called "getLoc" do the thing I > want, do you know how can I access to this function in the c++ code of my > element in click? > > regards, > > Jeremie > _______________________________________________ > nsclick-users mailing list > nsclick-users@cs-lists.cs.colorado.edu > http://cs-lists.cs.colorado.edu/mailman/listinfo/nsclick-users