summaryrefslogtreecommitdiff
path: root/pidl/lib/Parse/Pidl/Wireshark
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2011-08-02 11:56:32 +0400
committerMatthieu Patou <mat@matws.net>2011-08-06 01:33:06 +0400
commit5ff63e2dcffe0c1db3e0111f4eb710e2bff4f9c8 (patch)
tree794d9f9564322d28d431cf32cd3e9df8fcb7ee0f /pidl/lib/Parse/Pidl/Wireshark
parent7170cfaaf3b8663ac20be0231baa8ba90e80e5af (diff)
downloadsamba-5ff63e2dcffe0c1db3e0111f4eb710e2bff4f9c8.tar.gz
samba-5ff63e2dcffe0c1db3e0111f4eb710e2bff4f9c8.tar.bz2
samba-5ff63e2dcffe0c1db3e0111f4eb710e2bff4f9c8.zip
pidl: generate code for dissecting null terminated strings
Diffstat (limited to 'pidl/lib/Parse/Pidl/Wireshark')
-rw-r--r--pidl/lib/Parse/Pidl/Wireshark/NDR.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
index 83fc3cd3bf..7586eb3a62 100644
--- a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
+++ b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
@@ -323,6 +323,12 @@ sub ElementLevel($$$$$$$)
$self->pidl_code("proto_item_append_text(tree, \": %s\", data);");
} elsif (property_matches($e, "flag", ".*LIBNDR_FLAG_STR_SIZE4.*")) {
$self->pidl_code("offset = dissect_ndr_vstring(tvb, offset, pinfo, tree, drep, $bs, $hf, FALSE, NULL);");
+ } elsif (property_matches($e, "flag", ".*STR_NULLTERM.*")) {
+ if ($bs == 2) {
+ $self->pidl_code("offset = dissect_null_term_wstring(tvb, offset, pinfo, tree, drep, $hf , 0);")
+ } else {
+ $self->pidl_code("offset = dissect_null_term_string(tvb, offset, pinfo, tree, drep, $hf , 0);")
+ }
} else {
warn("Unable to handle string with flags $e->{PROPERTIES}->{flag}");
}