Dear all, In NS2, the packet header must be accessed through its offset. But I can not find where the offset_ is initialized. Please look and see if my understanding of this issue is right or not:
In the RTPAgent, it is directly use hdr_cmn::access(p) to access the header part. When the RTPAgent is configured in TCL, a binding is made to connect the RTP header's offset to the "offset_" of struct "hdr_cmn". Therefore, through the forced type conversion "return (hdr_rtp*) p->access(offset_);" (in ns/apps/rtp.cc, and p is a pointer to a new Packet instance), the "offset_" in hdr_rtp (which is a child of hdr_cmn) is initialized to the value configured through TCL. Thank you.