About adding new ping agent in ns2

459 views
Skip to first unread message

snehal shendware

unread,
Feb 15, 2012, 10:18:18 AM2/15/12
to Network Simulator 2 (NS2)
After adding MyPing as describe several blogs
I get following error.

apps/myping.o:(.bss+0x0): multiple definition of `hdr_ping::offset_'
apps/ping.o:(.bss+0x0): first defined here
apps/myping.o: In function `PingAgent::PingAgent()':
myping.cc:(.text+0x84): multiple definition of
`PingAgent::PingAgent()'
apps/ping.o:ping.cc:(.text+0x84): first defined here
apps/myping.o: In function `PingAgent::PingAgent()':
myping.cc:(.text+0x0): multiple definition of `PingAgent::PingAgent()'
apps/ping.o:ping.cc:(.text+0x0): first defined here
apps/myping.o: In function `PingAgent::command(int, char const*
const*)':
myping.cc:(.text+0x108): multiple definition of
`PingAgent::command(int, char const* const*)'
apps/ping.o:ping.cc:(.text+0x108): first defined here
apps/myping.o: In function `PingAgent::recv(Packet*, Handler*)':
myping.cc:(.text+0x28a): multiple definition of
`PingAgent::recv(Packet*, Handler*)'
apps/ping.o:ping.cc:(.text+0x28a): first defined here
collect2: ld returned 1 exit status
make: *** [ns] Error 1

Please reply.

rupesh

unread,
Feb 23, 2012, 5:20:45 PM2/23/12
to Network Simulator 2 (NS2)
Hi..
there is already a ping agent in NS2. and you are giving same name to
your new agent thats why it is giving these error. Just try to give
some other name like instead of ping give it newping.

On Feb 15, 10:18 am, snehal shendware <snehalshendwa...@gmail.com>
wrote:

Mehwish Fatima

unread,
Feb 24, 2012, 9:49:58 AM2/24/12
to ns-u...@googlegroups.com
I tried TestPing by myself, there would be some problems due to header files which were not added. And second try to change the name as suggested in other reply and save these file in folder rather than apps.


--
You received this message because you are subscribed to the Google Groups "Network Simulator 2 (NS2)" group.
To post to this group, send email to ns-u...@googlegroups.com.
To unsubscribe from this group, send email to ns-users+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-users?hl=en.




--
Best Regards

Mehwish Fatima

 



snehal shendware

unread,
Feb 26, 2012, 6:41:29 AM2/26/12
to Network Simulator 2 (NS2)
What problems regarding header files are you pointing out?
Please ellaborate.
And new ping agent has name myping as given in blog.
http://skchaudhari.blogspot.in/2011/11/ns2-how-addimplement-new-protocol-into.html?showComment=1329318518657#c7405584936311921642

Please reply.

On Feb 24, 7:49 pm, Mehwish Fatima <mehwishfatima.r...@gmail.com>
wrote:

snehal shendware

unread,
Feb 26, 2012, 8:22:21 AM2/26/12
to Network Simulator 2 (NS2)
I already tried different name such as MyPing as given in blog.
http://skchaudhari.blogspot.in/2011/11/ns2-how-addimplement-new-protocol-into.html?showComment=1329318518657#c7405584936311921642
its not helping though.
Please reply if done this before.

snehal shendware

unread,
Feb 26, 2012, 8:26:23 AM2/26/12
to Network Simulator 2 (NS2)
I tried as you suggested. changed folder of myping.cc and myping.h
(renamed copy of ping.h and ping.cc )
make ns
then i tried to run simple ping.tcl script with my agent (Agent/
MyPing) i get following error :
invalid command name "Agent/MyPing"
while executing
"Agent/MyPing instproc recv {from rtt} {
$self instvar node_
puts "node [$node_ id] received ping answer from \
$from with round-trip-t..."
(file "ping.tcl" line 27)

Please help me with this.

On Feb 24, 7:49 pm, Mehwish Fatima <mehwishfatima.r...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages