mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
libndr: Rename ndr64_transfer_syntax and null_ndr_syntax_id so they have a ndr_ prefix.
This makes the NDR namespace a bit clearer, in preparation of ABI checking.
This commit is contained in:
parent
6058977f90
commit
95ca5fbadd
@ -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;
|
||||
|
@ -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/>.
|
||||
*/
|
||||
@ -33,17 +34,17 @@
|
||||
#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
|
||||
};
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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(
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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 = "";
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user