diff options
author | Jörg Mayer <jmayer@loplof.de> | 2005-11-03 15:23:09 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2005-11-03 15:23:09 +0000 |
commit | 65528c765a332bb8a7265b1a31a198e882c2b322 (patch) | |
tree | cdb747b1cc87181089f3a5c3d174b1234f94357e /tools/pidl | |
parent | 2447b390d2ef9e8d6f69447b96ab8395145c2d7f (diff) |
Update to samba svn 11484
svn path=/trunk/; revision=16388
Diffstat (limited to 'tools/pidl')
-rw-r--r-- | tools/pidl/TODO | 2 | ||||
-rw-r--r-- | tools/pidl/lib/Parse/Pidl/Ethereal/NDR.pm | 14 | ||||
-rw-r--r-- | tools/pidl/lib/Parse/Pidl/NDR.pm | 5 | ||||
-rw-r--r-- | tools/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm | 5 |
4 files changed, 21 insertions, 5 deletions
diff --git a/tools/pidl/TODO b/tools/pidl/TODO index ca5047c0d7..e7ff518e36 100644 --- a/tools/pidl/TODO +++ b/tools/pidl/TODO @@ -10,7 +10,7 @@ - auto-alloc [ref] pointers for Samba4 during pull if they were NULL -- better replacement for subcontext() +- replace subcontext() with represent_as() - --explain-ndr option that dumps out parse tree diff --git a/tools/pidl/lib/Parse/Pidl/Ethereal/NDR.pm b/tools/pidl/lib/Parse/Pidl/Ethereal/NDR.pm index be2e48a686..24423d9292 100644 --- a/tools/pidl/lib/Parse/Pidl/Ethereal/NDR.pm +++ b/tools/pidl/lib/Parse/Pidl/Ethereal/NDR.pm @@ -292,6 +292,10 @@ sub ElementLevel($$$$$) if ($conformance->{imports}->{$l->{DATA_TYPE}}) { $call = $conformance->{imports}->{$l->{DATA_TYPE}}->{DATA}; $conformance->{imports}->{$l->{DATA_TYPE}}->{USED} = 1; + } elsif (defined($conformance->{imports}->{"$pn.$e->{NAME}"})) { + $call = $conformance->{imports}->{"$pn.$e->{NAME}"}->{DATA}; + $conformance->{imports}->{"$pn.$e->{NAME}"}->{USED} = 1; + } elsif (defined($conformance->{types}->{$l->{DATA_TYPE}})) { $call= $conformance->{types}->{$l->{DATA_TYPE}}->{DISSECTOR_NAME}; $conformance->{types}->{$l->{DATA_TYPE}}->{USED} = 1; @@ -401,6 +405,7 @@ sub Function($$$) pidl_code "$ifname\_dissect\_${fn_name}_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)"; pidl_code "{"; indent; + pidl_code "guint32 status;\n"; foreach (@{$fn->{ELEMENTS}}) { if (grep(/out/,@{$_->{DIRECTION}})) { pidl_code "$dissectornames{$_->{NAME}}"; @@ -411,10 +416,15 @@ sub Function($$$) if (not defined($fn->{RETURN_TYPE})) { } elsif ($fn->{RETURN_TYPE} eq "NTSTATUS") { - pidl_code "offset = dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf\_$ifname\_status, NULL);"; + pidl_code "offset = dissect_ntstatus(tvb, offset, pinfo, tree, drep, hf\_$ifname\_status, &status);\n"; + pidl_code "if (status != 0 && check_col(pinfo->cinfo, COL_INFO))"; + pidl_code "\tcol_append_fstr(pinfo->cinfo, COL_INFO, \", Error: %s\", val_to_str(status, NT_errors, \"Unknown NT status 0x%08x\"));\n"; $hf_used{"hf\_$ifname\_status"} = 1; } elsif ($fn->{RETURN_TYPE} eq "WERROR") { - pidl_code "offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf\_$ifname\_werror, NULL);"; + pidl_code "offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf\_$ifname\_werror, &status);\n"; + pidl_code "if (status != 0 && check_col(pinfo->cinfo, COL_INFO))"; + pidl_code "\tcol_append_fstr(pinfo->cinfo, COL_INFO, \", Error: %s\", val_to_str(status, DOS_errors, \"Unknown DOS error 0x%08x\"));\n"; + $hf_used{"hf\_$ifname\_werror"} = 1; } else { print "$fn->{FILE}:$fn->{LINE}: error: return type `$fn->{RETURN_TYPE}' not yet supported\n"; diff --git a/tools/pidl/lib/Parse/Pidl/NDR.pm b/tools/pidl/lib/Parse/Pidl/NDR.pm index d0b6708bf6..8405873589 100644 --- a/tools/pidl/lib/Parse/Pidl/NDR.pm +++ b/tools/pidl/lib/Parse/Pidl/NDR.pm @@ -529,10 +529,14 @@ sub ParseFunction($$$) $rettype = $d->{RETURN_TYPE}; } + my $async = 0; + if (has_property($d, "async")) { $async = 1; } + return { NAME => $d->{NAME}, TYPE => "FUNCTION", OPNUM => $thisopnum, + ASYNC => $async, RETURN_TYPE => $rettype, PROPERTIES => $d->{PROPERTIES}, ELEMENTS => \@elements, @@ -744,6 +748,7 @@ my %property_list = ( "noopnum" => ["FUNCTION"], "in" => ["ELEMENT"], "out" => ["ELEMENT"], + "async" => ["FUNCTION"], # pointer "ref" => ["ELEMENT"], diff --git a/tools/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm b/tools/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm index 0454f90c9a..05946b44f5 100644 --- a/tools/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm +++ b/tools/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm @@ -2160,11 +2160,12 @@ sub FunctionTable($) pidl "\t\tsizeof(struct $d->{NAME}),"; pidl "\t\t(ndr_push_flags_fn_t) ndr_push_$d->{NAME},"; pidl "\t\t(ndr_pull_flags_fn_t) ndr_pull_$d->{NAME},"; - pidl "\t\t(ndr_print_function_t) ndr_print_$d->{NAME}"; + pidl "\t\t(ndr_print_function_t) ndr_print_$d->{NAME},"; + pidl "\t\t".($d->{ASYNC}?"True":"False").","; pidl "\t},"; $count++; } - pidl "\t{ NULL, 0, NULL, NULL, NULL }"; + pidl "\t{ NULL, 0, NULL, NULL, NULL, False }"; pidl "};"; pidl ""; |