when do I need to call htons on the 3rd argument to socket()?
it appears that 0 is the most common argument,
but I often see examples like
socket(,,htons(ETH_P_ALL));
and
socket(,,IPPROTO_TCP);
so, what is the rule?
what CPP #define's can be passed to socket() as the protocol?
which ones need htons()?
the next question is, of course,
how portable the answer to the previous question is?
(i.e., what are the proper protocol argument to socket() on *BSD &c)
thanks!
--
Sam Steingold (
http://www.podval.org/~sds) running w2k
<http://www.jihadwatch.org/> <http://www.dhimmi.com/>
<http://www.openvotingconsortium.org/> <http://ffii.org/>
Every day above ground is a good day.