[Ns-bugs] [Bug 320] getsockname returns a port number in network byte order
bugzilla-daemon@nsnam-www.ece.gatech.edu
bugzilla-daemon at nsnam-www.ece.gatech.edu
Sun Oct 26 21:03:21 PDT 2008
http://www.nsnam.org/bugzilla/show_bug.cgi?id=320
------- Comment #3 from tomh at tomh.org 2008-10-27 00:03 -------
(In reply to comment #2)
> the API as-is SUCKS:
> - its unexpected to get an integer filled in in network byte order.
> - can't just convert the integer internally, since the address is also
> in network byte order, so we'd have to convert the address inside
> nsc, too
> - this API just doesn't work when you want to provide other information
> that could be stored in some sockaddr (e.g. flow label...)
>
> Rationale:
> Both getpeername and getsockname provided by NSC should be re-done.
> I've posted a RFC patch that makes both use a struct sockaddr (its not that
> simple due to network stack <-> host os conversion issues) to the ML:
> http://mailman.isi.edu/pipermail/ns-developers/2008-October/004878.html
>
> This of course means that the port (and address) will still be in
> network byte order, but at least it will be more obvious then. The advantage
> is also that it makes things simpler wrt. to other address families that might
> be supported by future NSC releases.
>
This seems like a reasonable solution to me (to just adopt sockaddr in a
standard manner at the API)
--
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the Ns-bugs
mailing list