libndr: Rename ndr64_transfer_syntax and null_ndr_syntax_id so they have a ndr_ prefix.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 18 Mar 2012 15:46:57 +0000 (16:46 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 20 Mar 2012 12:54:07 +0000 (13:54 +0100)
This makes the NDR namespace a bit clearer, in preparation of ABI checking.

12 files changed:
librpc/ndr/libndr.h
librpc/ndr/ndr.c
librpc/rpc/binding.c
source3/rpc_client/cli_pipe.c
source3/rpc_server/epmapper/srv_epmapper.c
source3/rpc_server/rpc_ncacn_np.c
source3/rpc_server/srv_pipe.c
source4/librpc/rpc/dcerpc_auth.c
source4/librpc/rpc/pyrpc.c
source4/rpc_server/dcerpc_server.c
source4/rpc_server/epmapper/rpc_epmapper.c
source4/torture/rpc/epmapper.c

index 36adae91c0ad09b23dfbc91ffe2ffc67b95dfc96..dafce6451aab9cb7655bc5d5220dff256da9b8fe 100644 (file)
@@ -353,9 +353,9 @@ typedef void (*ndr_print_function_t)(struct ndr_print *, const char *, int, cons
 #include "../libcli/util/error.h"
 #include "librpc/gen_ndr/misc.h"
 
-extern const struct ndr_syntax_id ndr_transfer_syntax;
-extern const struct ndr_syntax_id ndr64_transfer_syntax;
-extern const struct ndr_syntax_id null_ndr_syntax_id;
+extern const struct ndr_syntax_id ndr_transfer_syntax_ndr;
+extern const struct ndr_syntax_id ndr_transfer_syntax_ndr64;
+extern const struct ndr_syntax_id ndr_syntax_id_null;
 
 struct ndr_interface_call_pipe {
        const char *name;
index 7cb6e214ba3aa0fc5c15e45088aebb49305061ef..2279d1c1c3c9345a714ab3bc64001fcd9f87f1f2 100644 (file)
@@ -1,20 +1,21 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
 
    libndr interface
 
    Copyright (C) Andrew Tridgell 2003
-   
+   Copyright (C) Jelmer Vernooij 2005-2008
+
    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
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 #define NDR_BASE_MARSHALL_SIZE 1024
 
 /* this guid indicates NDR encoding in a protocol tower */
-const struct ndr_syntax_id ndr_transfer_syntax = {
+const struct ndr_syntax_id ndr_transfer_syntax_ndr = {
   { 0x8a885d04, 0x1ceb, 0x11c9, {0x9f, 0xe8}, {0x08,0x00,0x2b,0x10,0x48,0x60} },
   2
 };
 
-const struct ndr_syntax_id ndr64_transfer_syntax = {
+const struct ndr_syntax_id ndr_transfer_syntax_ndr64 = {
   { 0x71710533, 0xbeba, 0x4937, {0x83, 0x19}, {0xb5,0xdb,0xef,0x9c,0xcc,0x36} },
   1
 };
 
-const struct ndr_syntax_id null_ndr_syntax_id = {
+const struct ndr_syntax_id ndr_syntax_id_null = {
   { 0, 0, 0, { 0, 0 }, { 0, 0, 0, 0, 0, 0 } },
   0
 };
index 381e3aedb54f9d89ffd41baee715eb2601243457..f7fbbbc548bf47cf60c5d7bd3add38f12bae5231 100644 (file)
@@ -105,11 +105,11 @@ const char *epm_floor_string(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor)
                                /* lhs is used: UUID */
                                char *uuidstr;
 
-                               if (GUID_equal(&syntax.uuid, &ndr_transfer_syntax.uuid)) {
+                               if (GUID_equal(&syntax.uuid, &ndr_transfer_syntax_ndr.uuid)) {
                                        return "NDR";
                                } 
 
-                               if (GUID_equal(&syntax.uuid, &ndr64_transfer_syntax.uuid)) {
+                               if (GUID_equal(&syntax.uuid, &ndr_transfer_syntax_ndr64.uuid)) {
                                        return "NDR64";
                                } 
 
@@ -838,7 +838,7 @@ _PUBLIC_ NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx,
        tower->floors[1].lhs.protocol = EPM_PROTOCOL_UUID;
 
        tower->floors[1].lhs.lhs_data = dcerpc_floor_pack_lhs_data(tower->floors, 
-                                                               &ndr_transfer_syntax);
+                                                               &ndr_transfer_syntax_ndr);
 
        tower->floors[1].rhs.uuid.unknown = data_blob_talloc_zero(tower->floors, 2);
 
index 12f911b9fd8c1cfc01c11aaae0e4e8910c1b84ad..db89b3165bf4876c5b75f67355e45bd05a11e8fa 100644 (file)
@@ -2280,7 +2280,7 @@ static NTSTATUS rpc_pipe_open_tcp_port(TALLOC_CTX *mem_ctx, const char *host,
        }
 
        result->abstract_syntax = *abstract_syntax;
-       result->transfer_syntax = ndr_transfer_syntax;
+       result->transfer_syntax = ndr_transfer_syntax_ndr;
 
        result->desthost = talloc_strdup(result, host);
        result->srv_name_slash = talloc_asprintf_strupper_m(
@@ -2509,7 +2509,7 @@ NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
        }
 
        result->abstract_syntax = *abstract_syntax;
-       result->transfer_syntax = ndr_transfer_syntax;
+       result->transfer_syntax = ndr_transfer_syntax_ndr;
 
        result->desthost = get_myname(result);
        result->srv_name_slash = talloc_asprintf_strupper_m(
@@ -2605,7 +2605,7 @@ static NTSTATUS rpc_pipe_open_np(struct cli_state *cli,
        }
 
        result->abstract_syntax = *abstract_syntax;
-       result->transfer_syntax = ndr_transfer_syntax;
+       result->transfer_syntax = ndr_transfer_syntax_ndr;
        result->desthost = talloc_strdup(result, cli_state_remote_name(cli));
        result->srv_name_slash = talloc_asprintf_strupper_m(
                result, "\\\\%s", result->desthost);
index 58f222026430a15ad6181b71f392134c9169bf5d..cb99bde528bb51b70da792f2810e9e389ab3a230 100644 (file)
@@ -904,8 +904,8 @@ error_status_t _epm_Map(struct pipes_struct *p,
        dcerpc_floor_get_lhs_data(&floors[1], &ifid);
 
        if (floors[1].lhs.protocol != EPM_PROTOCOL_UUID ||
-           !GUID_equal(&ifid.uuid, &ndr_transfer_syntax.uuid) ||
-           ifid.if_version != ndr_transfer_syntax.if_version) {
+           !GUID_equal(&ifid.uuid, &ndr_transfer_syntax_ndr.uuid) ||
+           ifid.if_version != ndr_transfer_syntax_ndr.if_version) {
                rc = EPMAPPER_STATUS_NO_MORE_ENTRIES;
                goto done;
        }
index 37c30791b2311cd073b8bddb25f49cdae6b38100..f1b7b43b46929769533cd7c62d8dff969a2bd391 100644 (file)
@@ -477,7 +477,7 @@ NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx,
        }
 
        result->abstract_syntax = *abstract_syntax;
-       result->transfer_syntax = ndr_transfer_syntax;
+       result->transfer_syntax = ndr_transfer_syntax_ndr;
 
        if (remote_address == NULL) {
                struct tsocket_address *local;
@@ -675,7 +675,7 @@ static NTSTATUS rpc_pipe_open_external(TALLOC_CTX *mem_ctx,
        }
 
        result->abstract_syntax = *abstract_syntax;
-       result->transfer_syntax = ndr_transfer_syntax;
+       result->transfer_syntax = ndr_transfer_syntax_ndr;
 
        result->desthost = get_myname(result);
        result->srv_name_slash = talloc_asprintf_strupper_m(
index 4330a7ddc31145d073715d94fcd0c9e830c5d2d5..0bc48b1a06809009128e45be4c1202c25306d7ce 100644 (file)
@@ -341,7 +341,7 @@ static bool check_bind_req(struct pipes_struct *p,
 
        /* we have to check all now since win2k introduced a new UUID on the lsaprpc pipe */
        if (rpc_srv_pipe_exists_by_id(abstract) &&
-          ndr_syntax_id_equal(transfer, &ndr_transfer_syntax)) {
+          ndr_syntax_id_equal(transfer, &ndr_transfer_syntax_ndr)) {
                DEBUG(3, ("check_bind_req: %s -> %s rpc service\n",
                          rpc_srv_get_pipe_cli_name(abstract),
                          rpc_srv_get_pipe_srv_name(abstract)));
@@ -759,7 +759,7 @@ static bool api_pipe_bind_req(struct pipes_struct *p,
                /* Rejection reason: abstract syntax not supported */
                bind_ack_ctx.result = DCERPC_BIND_PROVIDER_REJECT;
                bind_ack_ctx.reason = DCERPC_BIND_REASON_ASYNTAX;
-               bind_ack_ctx.syntax = null_ndr_syntax_id;
+               bind_ack_ctx.syntax = ndr_syntax_id_null;
        }
 
        /*
@@ -1107,7 +1107,7 @@ static bool api_pipe_alter_context(struct pipes_struct *p,
                /* Rejection reason: abstract syntax not supported */
                bind_ack_ctx.result = DCERPC_BIND_PROVIDER_REJECT;
                bind_ack_ctx.reason = DCERPC_BIND_REASON_ASYNTAX;
-               bind_ack_ctx.syntax = null_ndr_syntax_id;
+               bind_ack_ctx.syntax = ndr_syntax_id_null;
        }
 
        /*
index f119b426d9fe4b6e269377741202713dbb39b861..cedcdd1bece08705e3b601757aab09c6d54612bc 100644 (file)
@@ -41,9 +41,9 @@ static NTSTATUS dcerpc_init_syntaxes(const struct ndr_interface_table *table,
        syntax->if_version = table->syntax_id.if_version;
 
        if (pipe_flags & DCERPC_NDR64) {
-               *transfer_syntax = ndr64_transfer_syntax;
+               *transfer_syntax = ndr_transfer_syntax_ndr64;
        } else {
-               *transfer_syntax = ndr_transfer_syntax;
+               *transfer_syntax = ndr_transfer_syntax_ndr;
        }
 
        return NT_STATUS_OK;
index 23961e7a079e49629ea5362ce44c4b1a2f0d2731..67462f18f3a8a5100435f3f07bc8c0f995e2fc3a 100644 (file)
@@ -262,10 +262,9 @@ static PyObject *py_iface_alter_context(PyObject *self, PyObject *args, PyObject
                return NULL;
 
        if (py_transfer_syntax == Py_None) {
-               transfer_syntax = ndr_transfer_syntax;
+               transfer_syntax = ndr_transfer_syntax_ndr;
        } else {
-               if (!ndr_syntax_from_py_object(py_transfer_syntax, 
-                                              &transfer_syntax))
+               if (!ndr_syntax_from_py_object(py_transfer_syntax, &transfer_syntax))
                        return NULL;
        }
 
index a16e6ac9d5f2e4894239ac44043f4d748d4f5d63..389cbe36660b5afd76e5fcdb21d0535c30acaaa4 100644 (file)
@@ -544,8 +544,8 @@ static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call)
 
        transfer_syntax_version = call->pkt.u.bind.ctx_list[0].transfer_syntaxes[0].if_version;
        transfer_syntax_uuid = &call->pkt.u.bind.ctx_list[0].transfer_syntaxes[0].uuid;
-       if (!GUID_equal(&ndr_transfer_syntax.uuid, transfer_syntax_uuid) != 0 ||
-           ndr_transfer_syntax.if_version != transfer_syntax_version) {
+       if (!GUID_equal(&ndr_transfer_syntax_ndr.uuid, transfer_syntax_uuid) != 0 ||
+           ndr_transfer_syntax_ndr.if_version != transfer_syntax_version) {
                char *uuid_str = GUID_string(call, transfer_syntax_uuid);
                /* we only do NDR encoded dcerpc */
                DEBUG(0,("Non NDR transfer syntax requested - %s\n", uuid_str));
@@ -657,7 +657,7 @@ static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call)
        }
        pkt.u.bind_ack.ctx_list[0].result = result;
        pkt.u.bind_ack.ctx_list[0].reason = reason;
-       pkt.u.bind_ack.ctx_list[0].syntax = ndr_transfer_syntax;
+       pkt.u.bind_ack.ctx_list[0].syntax = ndr_transfer_syntax_ndr;
        pkt.u.bind_ack.auth_info = data_blob(NULL, 0);
 
        status = dcesrv_auth_bind_ack(call, &pkt);
@@ -731,8 +731,8 @@ static NTSTATUS dcesrv_alter_new_context(struct dcesrv_call_state *call, uint32_
 
        transfer_syntax_version = call->pkt.u.alter.ctx_list[0].transfer_syntaxes[0].if_version;
        transfer_syntax_uuid = &call->pkt.u.alter.ctx_list[0].transfer_syntaxes[0].uuid;
-       if (!GUID_equal(transfer_syntax_uuid, &ndr_transfer_syntax.uuid) ||
-           ndr_transfer_syntax.if_version != transfer_syntax_version) {
+       if (!GUID_equal(transfer_syntax_uuid, &ndr_transfer_syntax_ndr.uuid) ||
+           ndr_transfer_syntax_ndr.if_version != transfer_syntax_version) {
                /* we only do NDR encoded dcerpc */
                return NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED;
        }
@@ -846,7 +846,7 @@ static NTSTATUS dcesrv_alter(struct dcesrv_call_state *call)
        }
        pkt.u.alter_resp.ctx_list[0].result = result;
        pkt.u.alter_resp.ctx_list[0].reason = reason;
-       pkt.u.alter_resp.ctx_list[0].syntax = ndr_transfer_syntax;
+       pkt.u.alter_resp.ctx_list[0].syntax = ndr_transfer_syntax_ndr;
        pkt.u.alter_resp.auth_info = data_blob(NULL, 0);
        pkt.u.alter_resp.secondary_address = "";
 
index 87bfee6dc34751c575a03974f1087804f764c880..371a3b5dd5313a6293875597a85f68e3d60a7ad4 100644 (file)
@@ -201,8 +201,8 @@ static error_status_t dcesrv_epm_Map(struct dcesrv_call_state *dce_call, TALLOC_
        dcerpc_floor_get_lhs_data(&r->in.map_tower->tower.floors[1], &ndr_syntax);
 
        if (floors[1].lhs.protocol != EPM_PROTOCOL_UUID ||
-               !GUID_equal(&ndr_syntax.uuid, &ndr_transfer_syntax.uuid) ||
-           ndr_syntax.if_version != ndr_transfer_syntax.if_version) {
+               !GUID_equal(&ndr_syntax.uuid, &ndr_transfer_syntax_ndr.uuid) ||
+           ndr_syntax.if_version != ndr_transfer_syntax_ndr.if_version) {
                goto failed;
        }
 
index fad6abecf717bc8e65073eb8b4e8f2ce410233e2..c0d8c44e0282f66c5099d44485eafa59ae017b19 100644 (file)
@@ -204,7 +204,7 @@ static bool test_Map_tcpip(struct torture_context *tctx,
                        ndr_interface_name(&syntax.uuid, syntax.if_version));
 
        dcerpc_floor_get_lhs_data(&t.floors[1], &syntax);
-       torture_assert(tctx, ndr_syntax_id_equal(&syntax, &ndr_transfer_syntax),
+       torture_assert(tctx, ndr_syntax_id_equal(&syntax, &ndr_transfer_syntax_ndr),
                       "epm_Map_tcpip failed: floor 2 is not NDR encoded");
 
        torture_assert(tctx, t.floors[2].lhs.protocol == EPM_PROTOCOL_NCACN,