diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-11-03 12:05:47 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-11-03 20:06:15 +0000 |
commit | 1119eb692bc53b06c3e3fec0d6a05a0f4108c73b (patch) | |
tree | b8a78754d1f8e3fe82fd0e0bda74581f8a1dae06 /tools/pidl/lib | |
parent | 283b5cd708b701db0af3125c930325cf52c192e2 (diff) |
generate ALIGN_TO_x_BYTES instructions if the element has the align_x flag
Pick up change from Samba:
commit 93f262ee6d162bf007b79d2daf9de6c49c6163d1
Author: Matthieu Patou <mat@matws.net>
Date: Fri Oct 18 00:04:28 2013 -0700
pidl-wireshark: generate ALIGN_TO_x_BYTES instructions if the element has the align_x flag
Change-Id: I865eae69ea7a8200630d3ad69bda9ac7b1c12255
Reviewed-on: https://code.wireshark.org/review/5099
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tools/pidl/lib')
-rw-r--r-- | tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm index c2d20245f6..4aa19a69e6 100644 --- a/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm +++ b/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm @@ -479,6 +479,12 @@ sub Element($$$$$$) BASE_TYPE => "BASE_NONE" }; } + if (property_matches($e, "flag", ".*LIBNDR_FLAG_ALIGN.*")) { + my $align_flag = $e->{PROPERTIES}->{flag}; + if ($align_flag =~ m/LIBNDR_FLAG_ALIGN(\d+)/) { + $call_code = "ALIGN_TO_$1_BYTES; ".$call_code; + } + } my $hf = $self->register_hf_field("hf_$ifname\_$pn\_$e->{NAME}", field2name($e->{NAME}), "$ifname.$pn.$e->{NAME}", $type->{FT_TYPE}, $type->{BASE_TYPE}, $type->{VALSSTRING}, $type->{MASK}, ""); $self->{hf_used}->{$hf} = 1; |