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

Simon Wilkinson simon@sxw.org.uk
Tue, 8 Feb 2011 15:23:41 +0000


On 8 Feb 2011, at 15:20, Derrick Brashear wrote:

> struct {
>   int addrtype;
>   int addrlen;
>   int addr<>
> } rx_addr;
>
> #define RX_ADDRTYPE_IPV4 1
> #define RX_ADDRTYPE_IPV6 2

Why not just use an opaque? That way you don't get into any of the  
ordering issues that ints bring with them.

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

Cheers,

Simon.