Erwin Harahap

do Now or Never

Ping Agent : Problems of Marc Greis’ Tutorial

Posted by Erwin on December 27, 2011

I came out with the Marc Greis’ tutorial especially in binding C++ and OTcl classes.
Even this was a very old tutorial, but it really interesting and much easier to follow.
I changed agent name to “Ping_e” instead of “Ping” to avoid conflict, and it turn out error as

/root/work/ping-test/ping_e.cc:65: error: âoff_ip_â was not declared in this scope
/root/work/ping-test/ping_e.cc:97: error: no match for âoperator>>â in âhdrip->hdr_ip::src_ >> *(Address::instance()->Address::NodeShift_ + 4u)â

I try to fix it based on NarcissusHuang‘s answers, but still come error.
so I make a little changes in ping header file (in my case ping_e.h) with only this line to declare off_ip_

int off_ip_;

at one line below “protected: int off_ping_e_;”, and in ping_e.cc file,

(hdrip->src_).addr_

as replacement from “hdrip->src_ >> Address::instance().NodeShift_[1]“.
As the result, I successfully use “make” command with no error, and run the tcl test program as well, even though with  some warnings :D

I use NS-2.35 with Centos 5.7. Hope it can help to anyone who facing the same problem.
Thanks to Janaka Wijekoon for coding help.

Rgds,
Erwin.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.