[AFS3-std] Re: Encoding IPvN addresses

Andrew Deason adeason@sinenomine.net
Mon, 7 Feb 2011 16:12:14 -0600


On Mon, 7 Feb 2011 16:07:10 -0600
Andrew Deason <adeason@sinenomine.net> wrote:

> On Mon, 07 Feb 2011 16:44:10 -0500
> Jeffrey Hutzelman <jhutz@cmu.edu> wrote:
> 
> > And, we can't just use xdr_union, because that makes the type
> > non-extensible -- xdr_union will fail if it receives an unknown
> > discriminator value.  To be extensible, we need to actually encode the
> > length on the wire, and have an unknown discriminator handler that
> > reads off the length and the other bits and either throws them away or
> > hands them to the application somehow.
>
[...]
> 
> But I believe that was proposed because allowing unknown union
> discriminators to be parseable was impossible (at least, while staying
> within the XDR spec). There's a way to allow the decoder to read the
> length of the payload of an unknown discriminator from another field in
> the structure? How do you do this?

Er, sorry, I read that wrong; you said you were talking about something
besides an xdr_union. But still, what I describe above is at least one
way to do this: you put all future type payloads in an opaque blob, and
run the xdr decoder on that to decode them.

-- 
Andrew Deason
adeason@sinenomine.net