summaryrefslogtreecommitdiff
path: root/pidl/lib/Parse/Pidl/Wireshark
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2009-10-04 16:57:57 +1100
committerAndrew Tridgell <tridge@samba.org>2009-10-06 19:14:11 +1100
commite9f126421d21a66cc695039f798d252e9f98fef9 (patch)
treef1f2734aae4ca25d2acff284070131e91119c989 /pidl/lib/Parse/Pidl/Wireshark
parentd26016c19854142c1e5fbb5a3bfc40e7e4b1c616 (diff)
downloadsamba-e9f126421d21a66cc695039f798d252e9f98fef9.tar.gz
samba-e9f126421d21a66cc695039f798d252e9f98fef9.tar.bz2
samba-e9f126421d21a66cc695039f798d252e9f98fef9.zip
add trailer alignment to structures
Diffstat (limited to 'pidl/lib/Parse/Pidl/Wireshark')
-rw-r--r--pidl/lib/Parse/Pidl/Wireshark/NDR.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
index e13e14465c..b8adf2dc4e 100644
--- a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
+++ b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
@@ -545,6 +545,9 @@ sub Struct($$$$)
$self->indent;
$self->pidl_code("proto_item *item = NULL;");
$self->pidl_code("proto_tree *tree = NULL;");
+ if ($e->{ALIGN} > 1) {
+ $self->pidl_code("dcerpc_info *di = pinfo->private_data;");
+ }
$self->pidl_code("int old_offset;");
$self->pidl_code("");
@@ -565,6 +568,15 @@ sub Struct($$$$)
$self->pidl_code("\n$res");
$self->pidl_code("proto_item_set_len(item, offset-old_offset);\n");
+ if ($e->{ALIGN} > 1) {
+ $self->pidl_code("");
+ $self->pidl_code("if (di->call_data->flags & DCERPC_IS_NDR64) {");
+ $self->indent;
+ $self->pidl_code("ALIGN_TO_$e->{ALIGN}_BYTES;");
+ $self->deindent;
+ $self->pidl_code("}");
+ }
+ $self->pidl_code("");
$self->pidl_code("return offset;");
$self->deindent;
$self->pidl_code("}\n");
@@ -634,6 +646,8 @@ sub Union($$$$)
$self->pidl_code("switch(level) {$res\t}");
$self->pidl_code("proto_item_set_len(item, offset-old_offset);\n");
+ $self->pidl_code("");
+
$self->pidl_code("return offset;");
$self->deindent;
$self->pidl_code("}");