pidl: handle hyper attribute for wireshark
[samba.git] / pidl / lib / Parse / Pidl / Wireshark / NDR.pm
index 83fc3cd3bf7b73a38421b1992dd7c36c5ed93faf..4ff5f41e11e70c895d4b843b820e66368ce54390 100644 (file)
@@ -323,9 +323,19 @@ 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}");
                        }
+               } elsif ($l->{DATA_TYPE} eq "DATA_BLOB") {
+                       my $remain = 0;
+                       $remain = 1 if (property_matches($e->{ORIGINAL}, "flag", ".*LIBNDR_FLAG_REMAINING.*"));
+                       $self->pidl_code("offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, $hf, $remain);");
                } else {
                        my $call;
 
@@ -813,7 +823,7 @@ sub ProcessInterface($$)
        
            my $maj = $x->{VERSION};
            $maj =~ s/\.(.*)$//g;
-           $self->pidl_def("static guint16 ver_dcerpc_$x->{NAME} = $maj;");
+           $self->pidl_def("static guint32 ver_dcerpc_$x->{NAME} = $maj;");
            $self->pidl_def("");
        }
 
@@ -879,6 +889,7 @@ sub Initialize($$)
                $self->register_type("int$bits", "offset = PIDL_dissect_uint$bits(tvb, offset, pinfo, tree, drep, \@HF\@, \@PARAM\@);", "FT_INT$bits", "BASE_DEC", 0, "NULL", $bytes);
        }
                
+       $self->register_type("hyper", "offset = dissect_ndr_uint64(tvb, offset, pinfo, tree, drep, \@HF\@, NULL);", "FT_UINT64", "BASE_DEC", 0, "NULL", 8);
        $self->register_type("udlong", "offset = dissect_ndr_duint32(tvb, offset, pinfo, tree, drep, \@HF\@, NULL);", "FT_UINT64", "BASE_DEC", 0, "NULL", 4);
        $self->register_type("bool8", "offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, \@HF\@, \@PARAM\@);","FT_INT8", "BASE_DEC", 0, "NULL", 1);
        $self->register_type("char", "offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, \@HF\@, \@PARAM\@);","FT_INT8", "BASE_DEC", 0, "NULL", 1);