c> Here's an interesting question; why do you need htonl and
c> ntohl for a single program? In RSPFd, we have all sorts of
c> stuff coming in in net byte order and we also send out a lot
c> of stuff in net byte order.
c> Is it worth my while "doing the right thing" and having lots
c> of ntohl()'s in my receive functions and lots of htonl()'s
c> in my outgoing ones or should I just not worry about it and
c> use net byte order internally.
If you are just passing buffers around, sending what came in, then the byte
order is not important. Where the code would work on a machine of either
endianess without htonl()/ntohl(), then there is no point to the conversions.
On the other hand, it can be quite dangerous if you write some code assuming
that the data will never actually be parsed or interpreted and then have to
change it later such that this assumption is invalidated.
-- Mike