给函数赋值?这是肿不回事?
void LowpanUdpAgent::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 Lowpan UDP should not be -1\n"); return; } // If they are sending data, then it must fit within a single packet. if (data && nbytes > size_) { printf("Error: data greater than maximum lowpan 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); rh->flags() = 0; rh->seqno() = ++seqno_; hdr_cmn::access(p)->timestamp() = (u_int32_t)(SAMPLERATE*local_time); // add "beginning of talkspurt" labels (tcl/ex/test-rcvr.tcl) if (flags && (0 ==strcmp(flags, "NEW_BURST"))) rh->flags() |= RTP_M; p->setdata(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); rh->flags() = 0; //这里 rh->seqno() = ++seqno_; hdr_cmn::access(p)->timestamp() = (u_int32_t)(SAMPLERATE*local_time); // add "beginning of talkspurt" labels (tcl/ex/test-rcvr.tcl) if (flags && (0 == strcmp(flags, "NEW_BURST"))) rh->flags() |= RTP_M; p->setdata(data); target_->recv(p); } idle();}