[ns] Routing protocol

juan manuel gomez garcia juanmagoga at hotmail.com
Thu Mar 23 03:52:18 PST 2006


Hello NS-users:
I  create another identical AODV ad hoc routing  protocol  in Ns-2 but I 
would like it to be renamed as zigbee. I copy all the files in AODV to a new 
folder call zigbee and renamed all AODV files (.cc & .h) to zigbee files 
(.cc & .h). Then I clone the code and  I have changed all the words where 
the aodv word appears by the zigbee word (C++ classes, packet headers, 
variables, TCL bindings,...). I do all modifications that are needed to 
integrate a new module  in NS2 (tutorial 
http://masimum.dif.um.es/nsrt-howto/html/ and Marc Greis s tutorials are 
very helpful).
After  "make depend" , I get this error in my "make" stage:

zigbee/zigbee.o: In function `BroadcastTimer::handle(Event*)':
zigbee.cc:(.text+0x848): multiple definition of 
`BroadcastTimer::handle(Event*)'
aodv/aodv.o:aodv.cc:(.text+0x848): first defined here
/usr/lib/gcc-lib/sparc-unknown-linux-gnu/3.3.5-20050130/../../../../sparc-unknown-linux-gnu/bin/ld: 
Disabling relaxation: it will not work with multiple definitions
zigbee/zigbee.o: In function `RouteCacheTimer::handle(Event*)':
zigbee.cc:(.text+0x9bc): multiple definition of 
`RouteCacheTimer::handle(Event*)'
aodv/aodv.o:aodv.cc:(.text+0x9bc): first defined here
zigbee/zigbee.o: In function `LocalRepairTimer::handle(Event*)':
zigbee.cc:(.text+0xa2c): multiple definition of 
`LocalRepairTimer::handle(Event*)'
aodv/aodv.o:aodv.cc:(.text+0xa2c): first defined here
zigbee/zigbee.o:(.bss+0x10): multiple definition of `hdr_zigbee::offset_'
zigbee/zigbee.o:(.bss+0x10): first defined here
zigbee/zigbee.o: In function `zigbee::command(int, char const* const*)':
zigbee.cc:(.text+0x0): multiple definition of `zigbee::command(int, char 
const* const*)'
zigbee/zigbee.o:zigbee.cc:(.text+0x0): first defined here
zigbee/zigbee.o: In function `BroadcastTimer::handle(Event*)':
zigbee.cc:(.text+0x848): multiple definition of 
`BroadcastTimer::handle(Event*)'
aodv/aodv.o:aodv.cc:(.text+0x848): first defined here
zigbee/zigbee.o: In function `RouteCacheTimer::handle(Event*)':
zigbee.cc:(.text+0x9bc): multiple definition of 
`RouteCacheTimer::handle(Event*)'
zigbee/zigbee.o: In function `zigbee::recvHello(Packet*)':
zigbee.cc:(.text+0x3e0c): multiple definition of 
`zigbee::recvHello(Packet*)'
zigbee/zigbee.o:zigbee.cc:(.text+0x3e0c): first defined here
zigbee/zigbee.o: In function `zigbee::sendReply(int, unsigned, int, 
unsigned, unsigned, double)':
zigbee.cc:(.text+0x3684): multiple definition of `zigbee::sendReply(int, 
unsigned, int, unsigned, unsigned, double)'
zigbee/zigbee.o:zigbee.cc:(.text+0x3684): first defined here
zigbee/zigbee.o: In function `zigbee::nb_lookup(int)':
zigbee.cc:(.text+0x3fb4): multiple definition of `zigbee::nb_lookup(int)'
zigbee/zigbee.o:zigbee.cc:(.text+0x3fb4): first defined here
zigbee/zigbee.o: In function `zigbee::nb_insert(int)':
zigbee.cc:(.text+0x3ec8): multiple definition of `zigbee::nb_insert(int)'
zigbee/zigbee.o:zigbee.cc:(.text+0x3ec8): first defined here
collect2: ld returned 1 exit status
make: *** [ns] Error 1

I don't understand this error= (make: *** [ns] Error 1). Is it one or more 
errors? This functions are the same that AODV functions but this functions 
are of my component. It would need to also change all these names of 
functions?. The next code is  of my zigbee.cc file:

int hdr_zigbee::offset_;
static class zigbeeHeaderClass : public PacketHeaderClass {
public:
        zigbeeHeaderClass() : PacketHeaderClass("PacketHeader/zigbee",
                                              sizeof(hdr_all_zigbee)) {
	  bind_offset(&hdr_zigbee::offset_);
	}
} class_rtProtozigbee_hdr;

static class zigbeeclass : public TclClass {
public:
        zigbeeclass() : TclClass("Agent/zigbee") {}
        TclObject* create(int argc, const char*const* argv) {
          assert(argc == 5);
          //return (new zigbee((nsaddr_t) atoi(argv[4])));
	  return (new zigbee((nsaddr_t) Address::instance().str2addr(argv[4])));
        }
} class_rtProtozigbee;


Help me, thank you very much.

_________________________________________________________________
Descarga gratis la Barra de Herramientas de MSN 
http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www.hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH



More information about the Ns-users mailing list