Duplicate data in RPC packets

Amin Azez azez at ufomechanic.net
Wed Jan 16 10:03:13 GMT 2008


* Amin Azez wrote, On 16/01/08 09:11:
> * Luke Howard wrote, On 15/01/08 22:41:
>   
>> Amin Azez wrote:
>>     
>>> I notice RPC packets seem to duplicate the switch_is and size_is data.
>>>   
>>>       
>> That's because the field containing the discriminant or size could
>> occur after the union or array itself.
>>     
> Sure, but my question was: in that case why do we need to pack the
> discriminant or size field at all?
> (If it always also occurs just before the union or array).
>
> I have considered that the only requirement to do so might be if the
> size is used for an array in a union member excluded by a discriminant
> (if that is even permitted) but the question still remains when the
> field is in the same level as the array or union.
>
> The packer merely doesn't bother to pack if it will be packing an union
> or array that uses it, and the unpacker just takes it from the first
> union or array that uses it.
>   
The PIDL specific "nodiscriminant" property as explained on:
  http://search.cpan.org/~ctrlsoft/Parse-Pidl-0.01/pidl

fixed this for me. Hurrah!

Sam


More information about the samba-technical mailing list