summaryrefslogtreecommitdiff
path: root/pidl
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2009-07-28 18:24:27 +1000
committerStefan Metzmacher <metze@samba.org>2009-07-28 12:30:16 +0200
commitc6d7f3bdb541eaa2734723d644edae9fae89e1da (patch)
tree2976cbcc2122b2de2efa70424149ddc87d31862c /pidl
parent7204ea422bcffa0a7d26eb34c7adf9fc3a7e714c (diff)
downloadsamba-c6d7f3bdb541eaa2734723d644edae9fae89e1da.tar.gz
samba-c6d7f3bdb541eaa2734723d644edae9fae89e1da.tar.bz2
samba-c6d7f3bdb541eaa2734723d644edae9fae89e1da.zip
pidl: import a patch to pidl made in the wireshark reporitory.
Original commit message in wireshark SVN (rev 28961): ==== From Kovarththanan Rajaratnam: More "Cleanup header_field_info definitions" ==== Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'pidl')
-rw-r--r--pidl/lib/Parse/Pidl/Wireshark/NDR.pm24
1 files changed, 19 insertions, 5 deletions
diff --git a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
index 8846b740ab..a9ad555cca 100644
--- a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
+++ b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
@@ -380,7 +380,7 @@ sub Element($$$)
MASK => 0,
VALSSTRING => "NULL",
FT_TYPE => "FT_NONE",
- BASE_TYPE => "BASE_HEX"
+ BASE_TYPE => "BASE_NONE"
};
}
@@ -389,7 +389,7 @@ sub Element($$$)
MASK => 0,
VALSSTRING => "NULL",
FT_TYPE => "FT_STRING",
- BASE_TYPE => "BASE_DEC"
+ BASE_TYPE => "BASE_NONE"
};
}
@@ -874,7 +874,7 @@ sub Initialize($$)
$self->register_type("policy_handle", "offset = PIDL_dissect_policy_hnd(tvb, offset, pinfo, tree, drep, \@HF\@, \@PARAM\@);","FT_BYTES", "BASE_NONE", 0, "NULL", 4);
$self->register_type("NTTIME", "offset = dissect_ndr_nt_NTTIME(tvb, offset, pinfo, tree, drep, \@HF\@);","FT_ABSOLUTE_TIME", "BASE_NONE", 0, "NULL", 4);
$self->register_type("NTTIME_hyper", "offset = dissect_ndr_nt_NTTIME(tvb, offset, pinfo, tree, drep, \@HF\@);","FT_ABSOLUTE_TIME", "BASE_NONE", 0, "NULL", 4);
- $self->register_type("time_t", "offset = dissect_ndr_time_t(tvb, offset, pinfo,tree, drep, \@HF\@, NULL);","FT_ABSOLUTE_TIME", "BASE_DEC", 0, "NULL", 4);
+ $self->register_type("time_t", "offset = dissect_ndr_time_t(tvb, offset, pinfo,tree, drep, \@HF\@, NULL);","FT_ABSOLUTE_TIME", "BASE_NONE", 0, "NULL", 4);
$self->register_type("NTTIME_1sec", "offset = dissect_ndr_nt_NTTIME(tvb, offset, pinfo, tree, drep, \@HF\@);", "FT_ABSOLUTE_TIME", "BASE_NONE", 0, "NULL", 4);
$self->register_type("SID", "
dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
@@ -882,7 +882,7 @@ sub Initialize($$)
di->hf_index = \@HF\@;
offset = dissect_ndr_nt_SID_with_options(tvb, offset, pinfo, tree, drep, param);
- ","FT_STRING", "BASE_DEC", 0, "NULL", 4);
+ ","FT_STRING", "BASE_NONE", 0, "NULL", 4);
$self->register_type("WERROR",
"offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, \@HF\@, \@PARAM\@);","FT_UINT32", "BASE_DEC", 0, "VALS(WERR_errors)", 4);
$self->register_type("NTSTATUS",
@@ -1055,6 +1055,20 @@ sub DumpHfDeclaration($)
return "$res\n";
}
+sub make_str_or_null($)
+{
+ my $str = shift;
+ if (substr($str, 0, 1) eq "\"") {
+ $str = substr($str, 1, length($str)-2);
+ }
+ $str =~ s/^\s*//;
+ $str =~ s/\s*$//;
+ if ($str eq "") {
+ return "NULL";
+ }
+ return make_str($str);
+}
+
sub DumpHfList($)
{
my ($self) = @_;
@@ -1063,7 +1077,7 @@ sub DumpHfList($)
foreach (values %{$self->{conformance}->{header_fields}})
{
$res .= "\t{ &$_->{INDEX},
- { ".make_str($_->{NAME}).", ".make_str($_->{FILTER}).", $_->{FT_TYPE}, $_->{BASE_TYPE}, $_->{VALSSTRING}, $_->{MASK}, ".make_str($_->{BLURB}).", HFILL }},
+ { ".make_str($_->{NAME}).", ".make_str($_->{FILTER}).", $_->{FT_TYPE}, $_->{BASE_TYPE}, $_->{VALSSTRING}, $_->{MASK}, ".make_str_or_null($_->{BLURB}).", HFILL }},
";
}