[PATCH] LIBNDR_FLAG_NOALIGN support in wireshark and PIDL

Julien Kerihuel j.kerihuel at openchange.org
Mon Jan 18 07:25:35 MST 2010

Hi Lists,

Prior submitting the wireshark's part of this patch onto the wireshark
bugzilla, I thought it might be worthwhile to have feedback from
developers first.

MAPI content is non-NDR compatible. It can be dissected using the
existing NDR layer functions in epan/dissectors/packet-dcerpc-ndr.c but
it requires offsets to be left intact prior effective dissection, which
means there shouldn't be any offset adjustment when LIBNDR_FLAG_NOALIGN
flag is used in PIDL.

The following patches implement such behavior:
1. It adds a no_align gboolean variable to dcerpc_info structure
(default set to FALSE)
2. when pidl generates the code and LIBNDR_FLAG_NOALIGN flag is used, it
sets the no_align gboolean to TRUE which turns offste adjustment off in

I couldn't come up with a nicer solution so far, but these tiny patches
truly improves the overall development effort for the MAPI dissector. It
basically prevents from writing hand-written code for most of the MAPI
calls. This also means this may help keeping the conformance files - in
particular request.cnf.c and response.cnf.c - readable and prevent them
from exponentially growing up.

Another advantage is that it becomes conceivable to generate code for
structures or others some non-dceprc dissectors using pidl. You would
only have to describe the structures, specify LIBNDR_FLAG_NOALIGN flag
and you would have automatic dissection code generated which you can
refer to (or cut and paste).



Julien Kerihuel
j.kerihuel at openchange.org
OpenChange Project Manager

GPG Fingerprint: 0B55 783D A781 6329 108A  B609 7EF6 FE11 A35F 1F79

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 002_wireshark_noalign_support.diff
Type: text/x-patch
Size: 3457 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100118/0befd73a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pidl_noalign_patch.diff
Type: text/x-patch
Size: 1979 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100118/0befd73a/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100118/0befd73a/attachment.pgp>

More information about the samba-technical mailing list