summaryrefslogtreecommitdiff
path: root/source4/build/pidl
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-05-21 12:15:04 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:53:51 -0500
commitac5393fa25484d0b5495f4f61456c419aa1982a5 (patch)
tree716fad4a6915b497b917ab6f7d367d9842c643c0 /source4/build/pidl
parent544abe075990a4bb3d868fff831ecfedf9d6caa7 (diff)
downloadsamba-ac5393fa25484d0b5495f4f61456c419aa1982a5.tar.gz
samba-ac5393fa25484d0b5495f4f61456c419aa1982a5.tar.bz2
samba-ac5393fa25484d0b5495f4f61456c419aa1982a5.zip
r806: Checkin of workarea - tridge gave me some good ideas today for a better
way to do this. (This used to be commit c63cb50ca56cb69f7ef39f9828afa61f324f2832)
Diffstat (limited to 'source4/build/pidl')
-rw-r--r--source4/build/pidl/eparser.pm82
1 files changed, 82 insertions, 0 deletions
diff --git a/source4/build/pidl/eparser.pm b/source4/build/pidl/eparser.pm
index d3caef6b3c..4650778096 100644
--- a/source4/build/pidl/eparser.pm
+++ b/source4/build/pidl/eparser.pm
@@ -165,6 +165,16 @@ sub ParamStruct($)
return $res;
}
+sub ParamDomSID($)
+{
+ my($p) = shift;
+ my($res);
+
+ $res .= "\toffset = dissect_ndr_nt_SID(tvb, offset, pinfo, tree, drep);\n";
+
+ return $res;
+}
+
# Index of NDR types and functions to generate code to dissect that type
my %param_handlers = (
@@ -173,8 +183,69 @@ my %param_handlers = (
'uint32' => \&ParamSimpleNdrType,
'policy_handle' => \&ParamPolicyHandle,
'string' => \&ParamString,
+ 'dom_sid2' => \&ParamDomSID,
);
+sub PtrString($)
+{
+ my($p) = shift;
+ my($res) = "";
+
+ $res .= "/* pointer to string not supported */\n";
+
+ return $res;
+}
+
+sub PtrSimpleNdrType($)
+{
+ my($p) = shift;
+ my($res) = "";
+
+ $res .= "/* pointer to $p->{TYPE} not supported */\n";
+
+ return $res;
+}
+
+sub PtrDomSID($)
+{
+ my($p) = shift;
+ my($res) = "";
+
+ $res .= "/* pointer to dom_sid not supported */\n";
+
+ return $res;
+}
+
+sub PtrSecurityDescriptor($)
+{
+ my($p) = shift;
+ my($res) = "";
+
+ $res .= "/* pointer to security descriptor not supported */\n";
+
+ return $res;
+}
+
+sub PtrNotImplemented($)
+{
+ my($p) = shift;
+ my($res) = "";
+
+ $res .= "/* pointer to $p->{TYPE} not supported */\n";
+
+ return $res;
+}
+
+my %ptr_handlers = (
+ 'uint8' => \&PtrSimpleNdrType,
+ 'uint16' => \&PtrSimpleNdrType,
+ 'uint32' => \&PtrSimpleNdrType,
+ 'string' => \&PtrString,
+ 'dom_sid2' => \&PtrDomSID,
+ 'security_descriptor' => \&PtrSecurityDescriptor,
+ 'lsa_SidArray' => \&PtrNotImplemented,
+ );
+
# Generate a parser for a NDR parameter
sub ParseParameter($)
@@ -184,6 +255,17 @@ sub ParseParameter($)
# Call function registered for this type
+ if ($p->{POINTERS} == 1 && $p->{TYPE} ne "policy_handle") {
+
+ if (defined($ptr_handlers{$p->{TYPE}})) {
+ $res .= &{$ptr_handlers{$p->{TYPE}}}($p);
+ } else {
+ $res .= "\toffset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep, dissect_$p->{TYPE}, NDR_POINTER_UNIQUE, \"$p->{TYPE} pointer\", -1);\n";
+ }
+
+ return $res;
+ }
+
if (defined($param_handlers{$p->{TYPE}})) {
$res .= &{$param_handlers{$p->{TYPE}}}($p);
return $res;