[AFS3-std] Re: Encoding IPvN addresses (was Re: first draft: ubik update proposal)

Derrick Brashear shadow@gmail.com
Tue, 8 Feb 2011 10:20:16 -0500


>> (Assuming
>> you meant an opaque vector like the built-in XDR opaque vector, with the
>> included encoded length).
>
> If we're defining a new builtin type, along the lines of UUID, it does no=
t
> need to be something that can be composed from the existing types. =A0The
> encoding for this on the wire ought to consist of an integer encoding the
> family, an integer encoding the size of the address data, and some number=
 of
> octets encoding the address. =A0For IPv4 and IPv6, the address data consi=
sts
> of a single address, transmitted in exactly the same way as in IP headers=
.

struct {
   int addrtype;
   int addrlen;
   int addr<>
} rx_addr;

#define RX_ADDRTYPE_IPV4 1
#define RX_ADDRTYPE_IPV6 2



--=20
Derrick