mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
librpc/rpc: add dcerpc_binding_[g|s]et_transport()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
This commit is contained in:
parent
f066bd7b33
commit
6ce8d761dc
@ -457,6 +457,39 @@ _PUBLIC_ NTSTATUS dcerpc_binding_set_object(struct dcerpc_binding *b,
|
|||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_PUBLIC_ enum dcerpc_transport_t dcerpc_binding_get_transport(const struct dcerpc_binding *b)
|
||||||
|
{
|
||||||
|
return b->transport;
|
||||||
|
}
|
||||||
|
|
||||||
|
_PUBLIC_ NTSTATUS dcerpc_binding_set_transport(struct dcerpc_binding *b,
|
||||||
|
enum dcerpc_transport_t transport)
|
||||||
|
{
|
||||||
|
char *tmp = discard_const_p(char, b->endpoint);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TODO: we may want to check the transport value is
|
||||||
|
* wellknown.
|
||||||
|
*/
|
||||||
|
if (b->transport == transport) {
|
||||||
|
return NT_STATUS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
b->transport = transport;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This implicitly resets the endpoint
|
||||||
|
* as the endpoint is transport specific.
|
||||||
|
*
|
||||||
|
* TODO: in future we may reset more options
|
||||||
|
* here.
|
||||||
|
*/
|
||||||
|
talloc_free(tmp);
|
||||||
|
b->endpoint = NULL;
|
||||||
|
|
||||||
|
return NT_STATUS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
_PUBLIC_ void dcerpc_binding_get_auth_info(const struct dcerpc_binding *b,
|
_PUBLIC_ void dcerpc_binding_get_auth_info(const struct dcerpc_binding *b,
|
||||||
enum dcerpc_AuthType *_auth_type,
|
enum dcerpc_AuthType *_auth_type,
|
||||||
enum dcerpc_AuthLevel *_auth_level)
|
enum dcerpc_AuthLevel *_auth_level)
|
||||||
@ -621,8 +654,7 @@ _PUBLIC_ NTSTATUS dcerpc_binding_set_string_option(struct dcerpc_binding *b,
|
|||||||
return NT_STATUS_INVALID_PARAMETER_MIX;
|
return NT_STATUS_INVALID_PARAMETER_MIX;
|
||||||
}
|
}
|
||||||
|
|
||||||
b->transport = t;
|
return dcerpc_binding_set_transport(b, t);
|
||||||
return NT_STATUS_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = strcmp(name, "object");
|
ret = strcmp(name, "object");
|
||||||
|
@ -136,6 +136,9 @@ char *dcerpc_binding_string(TALLOC_CTX *mem_ctx, const struct dcerpc_binding *b)
|
|||||||
struct GUID dcerpc_binding_get_object(const struct dcerpc_binding *b);
|
struct GUID dcerpc_binding_get_object(const struct dcerpc_binding *b);
|
||||||
NTSTATUS dcerpc_binding_set_object(struct dcerpc_binding *b,
|
NTSTATUS dcerpc_binding_set_object(struct dcerpc_binding *b,
|
||||||
struct GUID object);
|
struct GUID object);
|
||||||
|
enum dcerpc_transport_t dcerpc_binding_get_transport(const struct dcerpc_binding *b);
|
||||||
|
NTSTATUS dcerpc_binding_set_transport(struct dcerpc_binding *b,
|
||||||
|
enum dcerpc_transport_t transport);
|
||||||
void dcerpc_binding_get_auth_info(const struct dcerpc_binding *b,
|
void dcerpc_binding_get_auth_info(const struct dcerpc_binding *b,
|
||||||
enum dcerpc_AuthType *_auth_type,
|
enum dcerpc_AuthType *_auth_type,
|
||||||
enum dcerpc_AuthLevel *_auth_level);
|
enum dcerpc_AuthLevel *_auth_level);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user