s3:rpc user idl define dcerpc_ctx_list instead of custom RPC_CONTEXT
authorSimo Sorce <idra@samba.org>
Wed, 7 Jul 2010 21:14:27 +0000 (17:14 -0400)
committerSimo Sorce <idra@samba.org>
Thu, 8 Jul 2010 05:08:05 +0000 (01:08 -0400)
source3/include/proto.h
source3/include/rpc_dce.h
source3/rpc_parse/parse_rpc.c
source3/rpc_server/srv_pipe.c

index 99afcf3e053ee12b4a3d1c66b9e4774d1cbee6e0..ec61dd1b9d262635fd2db7a1ff7c53f6748f9098 100644 (file)
@@ -5078,7 +5078,7 @@ const char *get_pipe_name_from_syntax(TALLOC_CTX *mem_ctx,
 void init_rpc_hdr(RPC_HDR *hdr, enum dcerpc_pkt_type pkt_type, uint8 flags,
                                uint32 call_id, int data_len, int auth_len);
 bool smb_io_rpc_hdr(const char *desc,  RPC_HDR *rpc, prs_struct *ps, int depth);
-bool smb_io_rpc_context(const char *desc, RPC_CONTEXT *rpc_ctx, 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);
 void init_rpc_hdr_ba(RPC_HDR_BA *rpc, 
                                uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
index 37015ebb96d83d17802005b63bbdbcf690ab05e4..03d1e32cca24083f12a44c22727ce45c3e643299 100644 (file)
@@ -107,18 +107,11 @@ typedef struct rpc_hdr_auth_info {
 
 #define RPC_HDR_AUTH_LEN 8
 
-typedef struct rpc_context {
-       uint16 context_id;              /* presentation context identifier. */
-       uint8 num_transfer_syntaxes;    /* the number of syntaxes */
-       struct ndr_syntax_id abstract;  /* num and vers. of interface client is using */
-       struct ndr_syntax_id *transfer; /* Array of transfer interfaces. */
-} RPC_CONTEXT;
-
 /* RPC_BIND_REQ - ms req bind */
 typedef struct rpc_bind_req_info {
        RPC_HDR_BBA bba;
        uint8 num_contexts;    /* the number of contexts */
-       RPC_CONTEXT *rpc_context;
+       struct dcerpc_ctx_list *rpc_context;
 } RPC_HDR_RB;
 
 /* 
index eb52c4154430d73b09bc3016128bcdbeefc937b3..74246c5b4effaeebbab1fac65eba6727a913ed41 100644 (file)
@@ -188,10 +188,10 @@ static bool smb_io_rpc_hdr_bba(const char *desc,  RPC_HDR_BBA *rpc, prs_struct *
 }
 
 /*******************************************************************
- Reads or writes an RPC_CONTEXT structure.
+ Reads or writes a struct dcerpc_ctx_list structure.
 ********************************************************************/
 
-bool smb_io_rpc_context(const char *desc, RPC_CONTEXT *rpc_ctx, prs_struct *ps, int depth)
+bool smb_io_rpc_context(const char *desc, struct dcerpc_ctx_list *rpc_ctx, prs_struct *ps, int depth)
 {
        int i;
 
@@ -209,17 +209,20 @@ bool smb_io_rpc_context(const char *desc, RPC_CONTEXT *rpc_ctx, prs_struct *ps,
        if (rpc_ctx->num_transfer_syntaxes == 0)
                return False;
 
-       if(!smb_io_rpc_iface("", &rpc_ctx->abstract, ps, depth))
+       if(!smb_io_rpc_iface("", &rpc_ctx->abstract_syntax, ps, depth))
                return False;
 
        if (UNMARSHALLING(ps)) {
-               if (!(rpc_ctx->transfer = PRS_ALLOC_MEM(ps, struct ndr_syntax_id, rpc_ctx->num_transfer_syntaxes))) {
+               rpc_ctx->transfer_syntaxes =
+                       PRS_ALLOC_MEM(ps, struct ndr_syntax_id,
+                                       rpc_ctx->num_transfer_syntaxes);
+               if (!rpc_ctx->transfer_syntaxes) {
                        return False;
                }
        }
 
        for (i = 0; i < rpc_ctx->num_transfer_syntaxes; i++ ) {
-               if (!smb_io_rpc_iface("", &rpc_ctx->transfer[i], ps, depth))
+               if (!smb_io_rpc_iface("", &rpc_ctx->transfer_syntaxes[i], ps, depth))
                        return False;
        }
        return True;
@@ -252,7 +255,7 @@ bool smb_io_rpc_hdr_rb(const char *desc, RPC_HDR_RB *rpc, prs_struct *ps, int de
                return False;
 
        if (UNMARSHALLING(ps)) {
-               if (!(rpc->rpc_context = PRS_ALLOC_MEM(ps, RPC_CONTEXT, rpc->num_contexts))) {
+               if (!(rpc->rpc_context = PRS_ALLOC_MEM(ps, struct dcerpc_ctx_list, rpc->num_contexts))) {
                        return False;
                }
        }
index 6a40f32e23cae4599eabdd782e29868abf64a3ee..e8a69a669f82bd92be5b95a54da45369684c2a2a 100644 (file)
@@ -1605,7 +1605,7 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p)
         * Try and find the correct pipe name to ensure
         * that this is a pipe name we support.
         */
-       id = hdr_rb.rpc_context[0].abstract;
+       id = hdr_rb.rpc_context[0].abstract_syntax;
        if (rpc_srv_pipe_exists_by_id(&id)) {
                DEBUG(3, ("api_pipe_bind_req: \\PIPE\\%s -> \\PIPE\\%s\n",
                        rpc_srv_get_pipe_cli_name(&id),
@@ -1614,13 +1614,13 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p)
                status = smb_probe_module(
                        "rpc", get_pipe_name_from_syntax(
                                talloc_tos(),
-                               &hdr_rb.rpc_context[0].abstract));
+                               &hdr_rb.rpc_context[0].abstract_syntax));
 
                if (NT_STATUS_IS_ERR(status)) {
                        DEBUG(3,("api_pipe_bind_req: Unknown pipe name %s in bind request.\n",
                                 get_pipe_name_from_syntax(
                                        talloc_tos(),
-                                       &hdr_rb.rpc_context[0].abstract)));
+                                       &hdr_rb.rpc_context[0].abstract_syntax)));
                        prs_mem_free(&p->out_data.frag);
                        prs_mem_free(&out_hdr_ba);
                        prs_mem_free(&out_auth);
@@ -1664,15 +1664,17 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p)
                unknown to NT4)
                Needed when adding entries to a DACL from NT5 - SK */
 
-       if(check_bind_req(p, &hdr_rb.rpc_context[0].abstract, &hdr_rb.rpc_context[0].transfer[0],
-                               hdr_rb.rpc_context[0].context_id )) {
+       if (check_bind_req(p,
+                       &hdr_rb.rpc_context[0].abstract_syntax,
+                       &hdr_rb.rpc_context[0].transfer_syntaxes[0],
+                       hdr_rb.rpc_context[0].context_id)) {
                init_rpc_hdr_ba(&hdr_ba,
                        RPC_MAX_PDU_FRAG_LEN,
                        RPC_MAX_PDU_FRAG_LEN,
                        assoc_gid,
                        ack_pipe_name,
                        0x1, 0x0, 0x0,
-                       &hdr_rb.rpc_context[0].transfer[0]);
+                       &hdr_rb.rpc_context[0].transfer_syntaxes[0]);
        } else {
                /* Rejection reason: abstract syntax not supported */
                init_rpc_hdr_ba(&hdr_ba, RPC_MAX_PDU_FRAG_LEN,
@@ -1941,15 +1943,17 @@ bool api_pipe_alter_context(pipes_struct *p, prs_struct *rpc_in_p)
                unknown to NT4)
                Needed when adding entries to a DACL from NT5 - SK */
 
-       if(check_bind_req(p, &hdr_rb.rpc_context[0].abstract, &hdr_rb.rpc_context[0].transfer[0],
-                               hdr_rb.rpc_context[0].context_id )) {
+       if (check_bind_req(p,
+                       &hdr_rb.rpc_context[0].abstract_syntax,
+                       &hdr_rb.rpc_context[0].transfer_syntaxes[0],
+                       hdr_rb.rpc_context[0].context_id)) {
                init_rpc_hdr_ba(&hdr_ba,
                        RPC_MAX_PDU_FRAG_LEN,
                        RPC_MAX_PDU_FRAG_LEN,
                        assoc_gid,
                        ack_pipe_name,
                        0x1, 0x0, 0x0,
-                       &hdr_rb.rpc_context[0].transfer[0]);
+                       &hdr_rb.rpc_context[0].transfer_syntaxes[0]);
        } else {
                /* Rejection reason: abstract syntax not supported */
                init_rpc_hdr_ba(&hdr_ba, RPC_MAX_PDU_FRAG_LEN,