Hi Ramya,

I'm using ns2.28 and I know that packet headers management changed a
little bit so the Marc Greis Tutorial could not work anymore.

Now, to add you new packet you have to :
- add you packet name to the enum structure containing packet names in
packet.h (under Common directory) (sorry I don't remeber its name)
- add the name of you packet as it should appears intraces in the same
file (another class just below the enum structure in the same file).

- define an offset and an access () method in the header structure of
you new agent like this :

struct hdr_newAgent{

   // Contents of a newAgent message
   double send_time;
   double weight;
   ....
  // Header access methods
        static int offset_; // required by PacketHeaderManager
        inline static int& offset() { return offset_; }
        inline static hdr_newAgent* access(const Packet* p) {
                return (hdr_newAgent*) p->access(offset_);
        }

};


notice also that accessing the header of a protocol changed. So for
example to access the IP headerof a received packet, you should do :

struct hdr_ip *ih = HDR_IP(p);

where HDR_IP(p) is defined as:
#define HDR_IP(p)  ((struct hdr_ip*)hdr_ip::access(p)).
and access(p) is the inline method of struct hdr_ip.

I think this is all,
Hope this helps.

Bye.


On 26 Jan 2006 17:53:40 -0000, ramya r <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> I tried to implement the Ping protocol specified in the Greis's tutorials 
> under the ~ns/tcl/ns-tutorial folder..
>
> As per the specifications for the necessary changes to be made in order to 
> implement this protocol,
>
> its mentioned that..-
> -----------------------
>
> You also have to add an entry for the new ping packets in the file 
> 'tcl/lib/ns-packet.tcl' in the list at the beginning of the file. It would 
> look like the following piece of code.
>
>        { SRMEXT off_srm_ext_}
>        { Ping off_ping_ }} {
> set cl PacketHeader/[lindex $pair 0]
> -------------------------
>
> the problem i have is that i do not find any such list in ns-paclet.tcl
>
> there is one list but its found commented ie., its an old code..
>
>
> What do i do?
>
>
>
>
>
>

Reply via email to