freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

networksimulationandanalysis---usingns2-資料下載頁(yè)

2024-10-12 15:20本頁(yè)面

【導(dǎo)讀】Analytical. Emulation. Simulation. Highstart-upcost. Tools. throughput?HowCBRworks?HowUDPworks?HowDCFworks?Multicast. Unicast. PropagationModel. wirelesserrormodel. DCFvs.EDCF. simulation?mobilenodes?mobilenode?REAL. (RealisticandLarge)?NS-1?NS-2. Wired. Wireless. Tracing,visualization,variousutilities. Ns,thesimulatoritself. Nam,theworkanimator. Pre-processing:. Post-processing:. implementthes

  

【正文】 include include include //rtp timestamp needs the samplerate define SAMPLERATE 8000 define RTP_M 0x0080 // marker for significant events class UdpAgent : public Agent { public: UdpAgent()。 UdpAgent(packet_t)。 virtual void sendmsg(int nbytes, const char *flags = 0) { sendmsg(nbytes, NULL, flags)。 } virtual void sendmsg(int nbytes, AppData* data, const char *flags = 0)。 virtual void recv(Packet* pkt, Handler*)。 virtual int mand(int argc, const char*const* argv)。 protected: int seqno_。 }。 endif include include include include include static class UdpAgentClass : public TclClass { public: UdpAgentClass() : TclClass(Agent/UDP) {} TclObject* create(int, const char*const*) { return (new UdpAgent())。 } } class_udp_agent。 UdpAgent::UdpAgent() : Agent(PT_UDP), seqno_(1) { bind(packetSize_, amp。size_)。 } UdpAgent::UdpAgent(packet_t type) : Agent(type) { bind(packetSize_, amp。size_)。 } // put in timestamp and sequence number, even though UDP doesn39。t usually have one. void UdpAgent::sendmsg(int nbytes, AppData* data, const char* flags) { Packet *p。 int n。 assert (size_ 0)。 n = nbytes / size_。 if (nbytes == 1) { printf(Error: sendmsg() for UDP should not be 1\n)。 return。 } // If they are sending data, then it must fit within a single packet. if (data amp。amp。 nbytes size_) { printf(Error: data greater than maximum UDP packet size\n)。 return。 } double local_time = Scheduler::instance().clock()。 while (n 0) { p = allocpkt()。 hdr_cmn::access(p)size() = size_。 hdr_rtp* rh = hdr_rtp::access(p)。 rhflags() = 0。 rhseqno() = ++seqno_。 hdr_cmn::access(p)timestamp() = (u_int32_t)(SAMPLERATE*local_time)。 // add beginning of talkspurt labels (tcl/ex/) if (flags amp。amp。 (0 ==strcmp(flags, NEW_BURST))) rhflags() |= RTP_M。 psetdata(data)。 target_recv(p)。 } n = nbytes % size_。 if (n 0) { p = allocpkt()。 hdr_cmn::access(p)size() = n。 hdr_rtp* rh = hdr_rtp::access(p)。 rhflags() = 0。 rhseqno() = ++seqno_。 hdr_cmn::access(p)timestamp() = (u_int32_t)(SAMPLERATE*local_time)。 // add beginning of talkspurt labels (tcl/ex/) if (flags amp。amp。 (0 == strcmp(flags, NEW_BURST))) rhflags() |= RTP_M。 psetdata(data)。 target_recv(p)。 } idle()。 } void UdpAgent::recv(Packet* pkt, Handler*) { if (app_ ) { // If an application is attached, pass the data to the app hdr_cmn* h = hdr_cmn::access(pkt)。 app_process_data(hsize(), pktuserdata())。 } else if (pktuserdata() amp。amp。 pktuserdata()type() == PACKET_DATA) { // otherwise if it39。s just PacketData, pass it to Tcl // // Note that a Tcl procedure Agent/Udp recv {from data} // needs to be defined. For example, // // Agent/Udp instproc recv {from data} {puts data} PacketData* data = (PacketData*)pktuserdata()。 hdr_ip* iph = hdr_ip::access(pkt)。 Tclamp。 tcl = Tcl::instance()。 (%s process_data %d {%s}, name(), iph Address::instance().NodeShift_[1], datadata())。 } Packet::free(pkt)。 } int UdpAgent::mand(int argc, const char*const* argv) { if (argc == 4) { if (strcmp(argv[1], send) == 0) { PacketData* data = new PacketData(1 + strlen(argv[3]))。 strcpy((char*)datadata(), argv[3])。 sendmsg(atoi(argv[2]), data)。 return (TCL_OK)。 } } else if (argc == 5) { if (strcmp(argv[1], sendmsg) == 0) { PacketData* data = new PacketData(1 + strlen(argv[3]))。 strcpy((char*)datadata(), argv[3])。 sendmsg(atoi(argv[2]), data, argv[4])。 return (TCL_OK)。 } } return (Agent::mand(argc, argv))。 } ifndef ns_mudp_h define ns_mudp_h include class mUdpAgent : public UdpAgent { public: mUdpAgent()。 virtual void sendmsg(int nbytes, AppData* data, const char *flags = 0)。 virtual int mand(int argc, const char*const* argv)。 protected: int id_。 char BWfile[100]。 FILE *BWFile。 int openfile。 }。 endif include include include include include static class mUdpAgentClass : public TclClass { public: mUdpAgentClass() : TclClass(Agent/mUDP) {} TclObject* create(int, const char*const*) { return (new mUdpAgent())。 } } class_mudp_agent。 mUdpAgent::mUdpAgent() : id_(0), openfile(0) { bind(packetSize_, amp。size_)。 UdpAgent::UdpAgent()。 } void mUdpAgent::sendmsg(int nbytes, AppData* data, const char* flags) { Packet *p。 int n。 char buf[100]。 //added by smallko if (size_) n = nbytes / size_。 else printf(Error: myUDP size = 0\n)。 if (nbytes == 1) { printf(Error: sendmsg() for UDP should not be 1\n)。 return。 } double local_time = Scheduler::instance().clock()。 while (n 0) { ……………………………………………………………………………….. hdr_cmn::access(p)sendtime_ = local_time。 // (smallko) if(openfile!=0){ hdr_cmn::access(p)frame_pkt_id_ = id_++。 sprintf(buf, %16f id %16d udp %16d\n, local_time, hdr_cmn::access(p)frame_pkt_id_, hdr_cmn::access(p)size()28)。 fwrite(buf, strlen(buf), 1, BWFile)。 } …………………………………………………………………. psetdata(data)。 target_recv(p)。 } n = nbytes % size_。 if (n 0) { …………………………………………………………………………….. hdr_cmn::access(p)sendtime_ = local_time。 // (smallko) if(openfile!=0){ hdr_cmn::access(p)frame_pkt_id_ = id_++。 sprintf(buf, %16f id %16d udp %16d\n, local_time, hdr_cmn::access(p)frame_pkt_id_, hdr_cmn::access(p)size()28)。 fwrite(buf, s
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1