Hello, I'm working on a project where i need to add a new field to the existing IP header and bind it so that i can pass some value from tcl script.Can any one give me a detailed procedure on how to do it as I'm relatively new to NS2. I am currently using ns-2.33 . I tried to do the same with TCP and it worked.But that doesnt happen with IP header. It says cannot over load the default constructor (because i put the bind statement in the constructor). Please reply to this problem as soon as possible.
#ifndef lint static const char rcsid[] = "@(#) $Header: /cvsroot/nsnam/ns-2/common/ip.cc,v 1.8 1998/08/12 23:41:05 gnguyen Exp $"; #endif #include "packet.h" #include "ip.h" int hdr_ip::offset_; static class IPHeaderClass : public PacketHeaderClass { public: IPHeaderClass() : PacketHeaderClass("PacketHeader/IP", sizeof(hdr_ip)) { bind_offset(&hdr_ip::offset_); * bind("gsq_", &gsq_);* } //IPHeaderClass()::IPHeaderClass(){ //IPHeaderClass() : PacketHeaderClass(const char*, int) { *//bind("gsq", &gsq_);* //}; void export_offsets() { field_offset("src_", OFFSET(hdr_ip, src_)); field_offset("dst_", OFFSET(hdr_ip, dst_)); field_offset("ttl_", OFFSET(hdr_ip, ttl_)); * field_offset("gsq_", OFFSET(hdr_ip, gsq_));* field_offset("fid_", OFFSET(hdr_ip, fid_)); field_offset("prio_", OFFSET(hdr_ip, prio_)); } } class_iphdr; With, Thanks & Regards -Saikrishna