s3:dcerpc Add prs_parse_dcerpc_bind
authorSimo Sorce <idra@samba.org>
Thu, 8 Jul 2010 05:13:57 +0000 (01:13 -0400)
committerSimo Sorce <idra@samba.org>
Thu, 8 Jul 2010 05:41:24 +0000 (01:41 -0400)
librpc/idl/dcerpc.idl
source3/include/proto.h
source3/rpc_parse/parse_rpc.c

index 49a4aae03e01c7669a344502709924fd301370c1..68def36c5fc0252a1347f90b906cafaa05036108 100644 (file)
@@ -19,7 +19,7 @@ interface dcerpc
                ndr_syntax_id transfer_syntaxes[num_transfer_syntaxes];
        } dcerpc_ctx_list;
 
-       typedef struct {
+       typedef [public] struct {
                uint16 max_xmit_frag;
                uint16 max_recv_frag;
                uint32 assoc_group_id;
index ec61dd1b9d262635fd2db7a1ff7c53f6748f9098..90afdd1fa67d8ceb5dc8eb1ee4ed78701e02f045 100644 (file)
@@ -5080,6 +5080,9 @@ void init_rpc_hdr(RPC_HDR *hdr, enum dcerpc_pkt_type pkt_type, uint8 flags,
 bool smb_io_rpc_hdr(const char *desc,  RPC_HDR *rpc, prs_struct *ps, int depth);
 bool smb_io_rpc_context(const char *desc, struct dcerpc_ctx_list *rpc_ctx, prs_struct *ps, int depth);
 bool smb_io_rpc_hdr_rb(const char *desc, RPC_HDR_RB *rpc, prs_struct *ps, int depth);
+NTSTATUS dcerpc_pull_dcerpc_bind(TALLOC_CTX *mem_ctx,
+                                const DATA_BLOB *blob,
+                                struct dcerpc_bind *r);
 void init_rpc_hdr_ba(RPC_HDR_BA *rpc, 
                                uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
                                const char *pipe_addr,
index 74246c5b4effaeebbab1fac65eba6727a913ed41..90e939715e39bea416a9fe37d353506da2272fe5 100644 (file)
@@ -5,6 +5,7 @@
  *  Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
  *  Copyright (C) Paul Ashton                       1997.
  *  Copyright (C) Jeremy Allison                    1999.
+ *  Copyright (C) Simo Sorce                        2010
  *  
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -21,6 +22,7 @@
  */
 
 #include "includes.h"
+#include "librpc/gen_ndr/ndr_dcerpc.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_RPC_PARSE
@@ -228,6 +230,21 @@ bool smb_io_rpc_context(const char *desc, struct dcerpc_ctx_list *rpc_ctx, prs_s
        return True;
 } 
 
+NTSTATUS dcerpc_pull_dcerpc_bind(TALLOC_CTX *mem_ctx,
+                                const DATA_BLOB *blob,
+                                struct dcerpc_bind *r)
+{
+       enum ndr_err_code ndr_err;
+
+       ndr_err = ndr_pull_struct_blob(blob, mem_ctx, r,
+               (ndr_pull_flags_fn_t)ndr_pull_dcerpc_bind);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               return ndr_map_error2ntstatus(ndr_err);
+       }
+
+       return NT_STATUS_OK;
+}
+
 /*******************************************************************
  Reads or writes an RPC_HDR_RB structure.
 ********************************************************************/