smita vishwakarma wrote:
> I have installed ns-2.31 on linux -fedora -5 with gcc-4.1 .it has been
> installed in following steps as

[snip!]

> same as for otcl,nsnam,ns-2.31,tclcl,xgraph .
>
> I am building a new protocol which uses ns underneath for TCP /IP network
> protocol I creatd very simple file to begin with which has the  following
> structure.
>
> #include"ping.h"
> static class PingHeaderClass : public PacketHeaderClass
> {
> public:
> PingHeaderClass():PacketHeaderClass("PacketHeader/Ping"sizeof(hdr_ping)){}
> }class_pinghdr;

First of all, you're missing a comma (",") between the two arguments given
to the base class of PingHeaderClass(), PacketHeaderClass().

Secondly, please take a look at the ns-2 manual, chapter 12: "Packet
Headers and Formats": under 12.1, it clearly states that you MUST call
bind_offset() in the constructor to bind the offset address of the packet
header in question. Clearly, you did not do that.

Apart from 12.1 which can be found here

http://www.isi.edu/nsnam/ns/doc/node128.html

please make sure you also followed 12.1.1 "Adding a New Packet Header Type":

http://www.isi.edu/nsnam/ns/doc/node129.html


If there are other errors remaining, please first take the time to look up
*all* relevant parts of the manual prior to re-posting. Should you still
need to post, always include compiler error messages.


Cheers,

--Timo

Reply via email to