[PATCH 1/1] PIDL fix for using external types with wireshark backend

ronnie sahlberg ronniesahlberg at gmail.com
Tue Oct 6 03:59:41 MDT 2009

On Tue, Oct 6, 2009 at 8:26 PM, Stefan (metze) Metzmacher
<metze at samba.org> wrote:
> Hi Ronnie,
>> I am referring to this code :
>>       unless (hasType($e)) {
>>           # it must be an external type - all we can do is guess
>>               # warning($e, "assuming alignment of unknown type '$e' is 4");
>>           return 4;
>>       }
>> I dont if you rely on this and that unknown types default to 4bytes,
>> so I cant estimate if or how much it would break if this would become
>> a die("...")
> Yes, it's a bug, but it's not trivial to fix for the samba case.
> We need to implement the 'import' statement more correct
> and need to make the global %typelist dynamic for each file we
> process. Currently pidl is able to compile more than one idl file
> at a time (and samba uses this to speed up the compilation),
> but the problem is that types are not removed between the compilations
> of different files.

This does sound similar to the issue wireshark has with cross-idl
spanning types.
For some reasons, I do not want wireshark to have to use the import
statement at all,
or rather that it does compile every file in isolation, independent of
any other files.
One such reason is tha thter eare IDL files where I want to remain
using a handmarshalled version instead of an IDL version
and i want to introduce the idl files one at a time.

Of course, this makes cross-idl types difficult. Which is why the TYPE
directive in the conformance file is used
to explicitely say thing like :

TYPE lsa_String "offset=dissect_ndr_lsa_String(tvb, offset, pinfo,
tree, drep, @PARAM@, @HF@);" FT_STRING BASE_NONE 0 NULL 5

Basically, there is an external type called lsa_String, some wireshark
specific metadata,  and that its alignment is 5

So wireshark has a similar problem with import, in this case not that
it is not not fully optmimally correctly implemented, but that i dont
at this stage want to use it when generating wireshark dissectors.

Perhaps we can add some general purpose way to add decorations to the
idl files that would provide explicit descriptions for these external
types instead of using "import" ?

More information about the samba-technical mailing list