[AFS3-std] AFS-3 XDR discriminated union primitive type I-D
Tom Keiser
tkeiser@sinenomine.net
Mon, 7 Mar 2011 22:43:36 -0500
On Mon, Mar 7, 2011 at 6:47 PM, Simon Wilkinson <simon@sxw.org.uk> wrote:
>
> On 7 Mar 2011, at 20:46, Tom Keiser wrote:
>
>> Hi all,
>>
>> I've published a new I-D, based upon the on-list consensus from the othe=
r week, defining a new discriminated union primitive type. =A0Feedback and =
comments are hereby invited...
>
> I'm puzzled as to why length isn't just the length of the arm. If you mod=
ify the encoding so that length is just the length of the encoded arm, then=
you can actually decode these "new" unions using an existing rpcgen, by en=
coding them as
>
Hi Simon,
It was an arbitrary decision. Actually, now that I think about it,
this brings up an interesting question: will we ever want to use XDR
to encode large streams of data (e.g., a next-generation dump format)?
If so, we would likely want the length field to be a hyper. On the
other hand, that would result in a significant increase in common-case
overhead. Should we defer that until we need it, perhaps with an
afs-union64?
> struct {
> =A0 int type;
> =A0 opaque arm;
> }
>
> ... which I suspect might come in useful somewhere down the line.
>
Indeed it would. I'll change the language for -01.
Cheers,
-Tom