[Ns-bugs] [Bug 1102] IPv4 header doesn't handle correctly the fragment offset field
code at nsnam.ece.gatech.edu
Mon Jun 13 06:43:54 PDT 2011
--- Comment #7 from Tom Henderson <tomh at tomh.org> 2011-06-13 09:43:54 EDT ---
(In reply to comment #6)
> Hi Tomasso,Tom,
> A few things to think about:
> which layer will need to use "GetFragmentOffset" and "SetFragmentOffset"?
> In my opinion, this is typically used by the logic found in "Fragmentation &
> Reassembly" module, which is a layer 3 module.
I don't think we can make assumptions about who is using this API and what are
their intentions; it is a public header and I can easily imagine users outside
of the stack handling this. Since the methods explicitly use the name of this
header field, I would expect the units to match, unless documented otherwise.
> 535 iph->frag_off = htons(offset>>3);
I guess we look at it in different ways. I equate
Ipv4Header::SetFragmentOffset() to the above assignment, which takes the
normalized value. Whether or not the IP stack maintains this offset in bytes
or in blocks is outside the scope of this header class.
> This is just my opinion, either way is fine if properly documented.
Configure bugmail: https://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Ns-bugs