[OpenAFS-devel] AF_INET byte order

Douglas E. Engert deengert@anl.gov
Wed, 07 Mar 2007 13:11:35 -0600


Jim Rees wrote:
> The code as written is wrong.  I guess I'll change it to
> 
> #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
> 
> but I wonder if it shouldn't really be
> 
> #if !defined(AFS_LINUX_ENV)
> 
> Comments?  Which order do Solaris and AIX want?

Well on Solaris 10 (Sparc), AF_INET is defines as 2 and in some of
the header files where they use  ...->sin_family = AF_INET;

But in /usr/include/portocols/routed.h they do:
#define RIP_AF_INET htons(AF_INET)
to use in a RIPv2  struct netinfo { ...
from RFC 2453.

    "Unless otherwise specified, fields contain binary integers,
    in network byte order, with the most-significant octet
    first (big-endian)"

So on Solaris at least it looks like you store it in the
local format. If you want to send it over the netwotk, then
in network byte order.


> _______________________________________________
> OpenAFS-devel mailing list
> OpenAFS-devel@openafs.org
> https://lists.openafs.org/mailman/listinfo/openafs-devel
> 
> 

-- 

  Douglas E. Engert  <DEEngert@anl.gov>
  Argonne National Laboratory
  9700 South Cass Avenue
  Argonne, Illinois  60439
  (630) 252-5444