enum packet_t { PT_TCP, PT_UDP, PT_CBR, PT_AUDIO, . . . .

// LMS packets PT_LMS, PT_LMS_SETUP, // insert new packet types here PT_NTYPE // This MUST be the LAST one }; constructor code: static void initName() { if(nPkt_ >= PT_NTYPE+1) return; char **nameNew = new char*[PT_NTYPE+1]; for(unsigned int i = (unsigned int)PT_SMAC+1; i < nPkt_; i++) { nameNew[i] = name_[i]; } if(!nPkt_) delete [] name_; name_ = nameNew; nPkt_ = PT_NTYPE+1; name_[PT_TCP]= "tcp"; name_[PT_UDP]= "udp"; name_[PT_CBR]= "cbr"; name_[PT_AUDIO]= "audio"; . . . . name_[PT_DCCP_DATAACK]="DCCP_DataAck"; name_[PT_DCCP_CLOSE]="DCCP_Close"; name_[PT_DCCP_CLOSEREQ]="DCCP_CloseReq"; name_[PT_DCCP_RESET]="DCCP_Reset"; name_[PT_NTYPE]= "undefined"; }

ns-packet. # Other: Encap # common/encap. src_rtg/hdr_src. . . .cc # Routers: . .tcl code set protolist { # Common: Common Flags IP # IP # Routing Protocols: NV # NixVector classifier for stateless routing rtProtoDV # distance vector routing protocol rtProtoLS # link state routing protocol SR # source routing. dsr/hdr_sr.cc IPinIP # IP encapsulation HDLC # High Level Data Link Control } . . .cc Src_rt # source routing. # Application-Layer Protocols: Message # a protocol to carry text messages Ping # Ping .

Sign up to vote on this title
UsefulNot useful