From 93f262ee6d162bf007b79d2daf9de6c49c6163d1 Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Fri, 18 Oct 2013 00:04:28 -0700 Subject: [PATCH] pidl-wireshark: generate ALIGN_TO_x_BYTES instructions if the element has the align_x flag Signed-off-by: Matthieu Patou Reviewed-by: Stefan Metzmacher --- pidl/lib/Parse/Pidl/Wireshark/NDR.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm index 6bc03ccd9b96..7a81f5ca5a9b 100644 --- a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm +++ b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm @@ -462,6 +462,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; -- 2.34.1