summaryrefslogtreecommitdiff
path: root/source4/build/pidl
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-05-15 11:22:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:53:46 -0500
commit0fae321bc0bd7c03aaad59155946cc30bdf2350c (patch)
tree20e18f26fa93db9921cb909d44969448e521c3eb /source4/build/pidl
parent064e7447bebd715c8351d9a0ee31f648990f2336 (diff)
downloadsamba-0fae321bc0bd7c03aaad59155946cc30bdf2350c.tar.gz
samba-0fae321bc0bd7c03aaad59155946cc30bdf2350c.tar.bz2
samba-0fae321bc0bd7c03aaad59155946cc30bdf2350c.zip
r744: A bunch of minor fixes. The ethereal pidl parser now dissects simple
samr calls - only the ones that take policy handles and uint32s. (This used to be commit d6e30faeec097822c9cdcc9e4270d0adc139cea8)
Diffstat (limited to 'source4/build/pidl')
-rw-r--r--source4/build/pidl/eparser.pm34
1 files changed, 22 insertions, 12 deletions
diff --git a/source4/build/pidl/eparser.pm b/source4/build/pidl/eparser.pm
index 1fe1fff332..102e05e29d 100644
--- a/source4/build/pidl/eparser.pm
+++ b/source4/build/pidl/eparser.pm
@@ -19,7 +19,7 @@ sub ParamSimpleNdrType($)
my($p) = shift;
my($res);
- $res .= "\toffset = dissect_ndr_$p->{TYPE}(tvb, offset, pinfo, tree, drep, hf_$p->{NAME}, NULL);\n";
+ $res .= "\toffset = dissect_ndr_$p->{TYPE}(tvb, offset, pinfo, tree, drep, hf_$p->{NAME}_$p->{TYPE}, NULL);\n";
return $res;
}
@@ -29,7 +29,7 @@ sub ParamPolicyHandle($)
my($p) = shift;
my($res);
- $res .= "\toffset = dissect_nt_policy_hnd(tvb, offset, pinfo, tree, drep, hf_policy_hnd, NULL, NULL, FALSE, FALSE);\n";
+ $res .= "\toffset = dissect_nt_policy_hnd(tvb, offset, pinfo, tree, drep, hf_policy_handle, NULL, NULL, FALSE, FALSE);\n";
return $res;
}
@@ -39,7 +39,7 @@ sub ParamString($)
my($p) = shift;
my($res);
- $res .= "\toffset = dissect_ndr_pointer_cb(tvb, offset, pinfo, tree, drep, dissect_ndr_wchar_cvstring, NDR_POINTER_UNIQUE, \"$p->{NAME}\", hf_$p->{NAME}, cb_wstr_postprocess, GINT_TO_POINTER(1));\n";
+ $res .= "\toffset = dissect_ndr_pointer_cb(tvb, offset, pinfo, tree, drep, dissect_ndr_wchar_cvstring, NDR_POINTER_UNIQUE, \"$p->{NAME}\", hf_$p->{NAME}_string, cb_wstr_postprocess, GINT_TO_POINTER(1));\n";
return $res;
}
@@ -104,7 +104,7 @@ sub ParseFunction($)
$res .= ParseParameter($d), if defined($d->{PROPERTIES}{out});
}
- $res .= "\n\toffset = dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_samr_rc, NULL);\n\n";
+ $res .= "\n\toffset = dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf_rc, NULL);\n\n";
$res .= "\treturn offset;\n";
$res .= "}\n\n";
@@ -145,6 +145,8 @@ sub Pass1ModuleHeader($)
#include "packet-dcerpc.h"
#include "packet-dcerpc-nt.h"
+extern const value_string NT_errors[];
+
EOF
# UUID
@@ -203,9 +205,9 @@ sub Pass1Interface($)
$res .= << "EOF";
static int proto_dcerpc_$name = -1;
-static int hf_${name}_opnum = -1;
-static int hf_${name}_rc = -1;
-static int hf_policy_hnd = -1;
+static int hf_opnum = -1;
+static int hf_rc = -1;
+static int hf_policy_handle = -1;
static gint ett_dcerpc_$name = -1;
@@ -216,12 +218,13 @@ EOF
foreach my $args ($fn->{DATA}) {
foreach my $params (@{$args}) {
- next, if defined $hf_info{$params->{NAME}};
+ my $hf_name = "$params->{NAME}_$params->{TYPE}";
+ next, if defined $hf_info{$hf_name};
# Make a note about new field
- $res .= "static int hf_$params->{NAME} = -1;\n";
- $hf_info{$params->{NAME}} = {
+ $res .= "static int hf_$hf_name = -1;\n";
+ $hf_info{$hf_name} = {
'ft' => type2ft($params->{TYPE}),
'base' => type2base($params->{TYPE})
};
@@ -298,7 +301,14 @@ sub Parse($)
$res .= Pass3Interface($d), if $d->{TYPE} eq "INTERFACE";
}
- my $hf_register_info = "";
+ my $hf_register_info = << "EOF";
+\t{ &hf_opnum,
+\t { \"Operation\", \"$name.opnum\", FT_UINT16, BASE_DEC, NULL, 0x0, \"Operation\", HFILL }},
+\t{ &hf_policy_handle,
+\t { \"Policy handle\", \"$name.policy\", FT_BYTES, BASE_NONE, NULL, 0x0, \"Policy handle\", HFILL }},
+\t{ &hf_rc,
+\t { \"Return code\", \"$name.rc\", FT_UINT32, BASE_HEX, VALS(NT_errors), 0x0, \"Return status code\", HFILL }},
+EOF
foreach my $hf (keys(%hf_info)) {
$hf_register_info .= "\t{ &hf_$hf,\n";
@@ -333,7 +343,7 @@ proto_reg_handoff_dcerpc_$name(void)
{
dcerpc_init_uuid(proto_dcerpc_$name, ett_dcerpc_$name,
&uuid_dcerpc_$name, ver_dcerpc_$name,
- dcerpc_${name}_dissectors, hf_${name}_opnum);
+ dcerpc_${name}_dissectors, hf_opnum);
}
EOF