pidl:NDR/Client.pm: generate explicit _recv functions
authorStefan Metzmacher <metze@samba.org>
Sat, 27 Feb 2010 09:34:04 +0000 (10:34 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 1 Mar 2010 15:11:51 +0000 (16:11 +0100)
metze

pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm

index 9d3ccaf8c8302fb8691542fc75e83a2300cc14a4..958f215a2e7808346b33578c49897f87551b4893 100644 (file)
@@ -43,6 +43,37 @@ sub ParseFunctionSend($$$)
        $res .= "}\n\n";
 }
 
+sub ParseFunctionRecv($$$)
+{
+       my ($interface, $fn, $name) = @_;
+       my $uname = uc $name;
+
+       my $proto = "NTSTATUS dcerpc_$name\_recv(struct rpc_request *rreq)";
+
+       $res_hdr .= "\n$proto;\n";
+
+       $res .= "$proto\n{\n";
+
+       if (has_property($fn, "todo")) {
+               $res .= "\treturn NT_STATUS_NOT_IMPLEMENTED;\n";
+       } else {
+               $res .= "NTSTATUS status;
+       struct dcerpc_pipe *p = rreq->p;
+       struct $name *r = (struct $name *)rreq->ndr.struct_ptr;
+
+       status = dcerpc_ndr_request_recv(rreq);
+
+       if (NT_STATUS_IS_OK(status) && (p->conn->flags & DCERPC_DEBUG_PRINT_OUT)) {
+               NDR_PRINT_OUT_DEBUG($name, r);
+       }
+
+       return status;
+";
+       }
+
+       $res .= "}\n\n";
+}
+
 sub ParseFunctionSync($$$)
 {
        my ($interface, $fn, $name) = @_;
@@ -90,6 +121,7 @@ sub ParseFunction($$)
        my ($interface, $fn) = @_;
 
        ParseFunctionSend($interface, $fn, $fn->{NAME});
+       ParseFunctionRecv($interface, $fn, $fn->{NAME});
        ParseFunctionSync($interface, $fn, $fn->{NAME});
 }