mirror of
https://github.com/samba-team/samba.git
synced 2025-11-27 08:23:49 +03:00
r22055: Port the endpoint mapper (and functions it requires) to Samba 3.
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
9b34cd8d89
commit
ad98126187
@@ -225,7 +225,8 @@ LIBNDR_GEN_OBJ = librpc/gen_ndr/ndr_unixinfo.o librpc/gen_ndr/ndr_lsa.o \
|
|||||||
librpc/gen_ndr/ndr_winreg.o librpc/gen_ndr/ndr_initshutdown.o \
|
librpc/gen_ndr/ndr_winreg.o librpc/gen_ndr/ndr_initshutdown.o \
|
||||||
librpc/gen_ndr/ndr_srvsvc.o librpc/gen_ndr/ndr_svcctl.o \
|
librpc/gen_ndr/ndr_srvsvc.o librpc/gen_ndr/ndr_svcctl.o \
|
||||||
librpc/gen_ndr/ndr_eventlog.o librpc/gen_ndr/ndr_wkssvc.o \
|
librpc/gen_ndr/ndr_eventlog.o librpc/gen_ndr/ndr_wkssvc.o \
|
||||||
librpc/gen_ndr/ndr_notify.o
|
librpc/gen_ndr/ndr_notify.o \
|
||||||
|
librpc/gen_ndr/ndr_epmapper.o
|
||||||
|
|
||||||
RPC_PARSE_OBJ0 = rpc_parse/parse_prs.o rpc_parse/parse_misc.o
|
RPC_PARSE_OBJ0 = rpc_parse/parse_prs.o rpc_parse/parse_misc.o
|
||||||
|
|
||||||
@@ -328,7 +329,7 @@ LIBMSRPC_GEN_OBJ = librpc/gen_ndr/cli_unixinfo.o librpc/gen_ndr/cli_lsa.o \
|
|||||||
librpc/gen_ndr/cli_dfs.o librpc/gen_ndr/cli_echo.o \
|
librpc/gen_ndr/cli_dfs.o librpc/gen_ndr/cli_echo.o \
|
||||||
librpc/gen_ndr/cli_srvsvc.o \
|
librpc/gen_ndr/cli_srvsvc.o \
|
||||||
librpc/gen_ndr/cli_winreg.o librpc/gen_ndr/cli_initshutdown.o \
|
librpc/gen_ndr/cli_winreg.o librpc/gen_ndr/cli_initshutdown.o \
|
||||||
librpc/gen_ndr/cli_eventlog.o \
|
librpc/gen_ndr/cli_eventlog.o librpc/gen_ndr/cli_epmapper.o \
|
||||||
$(LIBNDR_GEN_OBJ) $(LIBNDR_OBJ) $(RPCCLIENT_NDR_OBJ)
|
$(LIBNDR_GEN_OBJ) $(LIBNDR_OBJ) $(RPCCLIENT_NDR_OBJ)
|
||||||
|
|
||||||
REGOBJS_OBJ = registry/reg_objects.o
|
REGOBJS_OBJ = registry/reg_objects.o
|
||||||
@@ -348,6 +349,8 @@ RPC_SAMR_OBJ = rpc_server/srv_samr.o rpc_server/srv_samr_nt.o \
|
|||||||
RPC_UNIXINFO_OBJ = librpc/gen_ndr/srv_unixinfo.o rpc_server/srv_unixinfo_nt.o
|
RPC_UNIXINFO_OBJ = librpc/gen_ndr/srv_unixinfo.o rpc_server/srv_unixinfo_nt.o
|
||||||
REGFIO_OBJ = registry/regfio.o
|
REGFIO_OBJ = registry/regfio.o
|
||||||
|
|
||||||
|
RPC_EPMAPPER_OBJ = librpc/gen_ndr/srv_epmapper.o rpc_server/srv_epmapper_nt.o
|
||||||
|
|
||||||
RPC_REG_OBJ = librpc/gen_ndr/srv_winreg.o rpc_server/srv_winreg_nt.o $(REGFIO_OBJ)
|
RPC_REG_OBJ = librpc/gen_ndr/srv_winreg.o rpc_server/srv_winreg_nt.o $(REGFIO_OBJ)
|
||||||
RPC_INITSHUTDOWN_OBJ = librpc/gen_ndr/srv_initshutdown.o rpc_server/srv_initshutdown_nt.o
|
RPC_INITSHUTDOWN_OBJ = librpc/gen_ndr/srv_initshutdown.o rpc_server/srv_initshutdown_nt.o
|
||||||
|
|
||||||
@@ -756,8 +759,8 @@ PROTO_OBJ = $(SMBD_OBJ_MAIN) $(LIBNDR_OBJ) $(RPCCLIENT_NDR_OBJ) \
|
|||||||
$(RPC_SVC_OBJ) $(RPC_WKS_OBJ) $(RPC_DFS_OBJ) $(RPC_SPOOLSS_OBJ) \
|
$(RPC_SVC_OBJ) $(RPC_WKS_OBJ) $(RPC_DFS_OBJ) $(RPC_SPOOLSS_OBJ) \
|
||||||
$(RPC_ECHO_OBJ) $(RPC_SVCCTL_OBJ) $(RPC_EVENTLOG_OBJ) $(SMBLDAP_OBJ) \
|
$(RPC_ECHO_OBJ) $(RPC_SVCCTL_OBJ) $(RPC_EVENTLOG_OBJ) $(SMBLDAP_OBJ) \
|
||||||
$(IDMAP_OBJ) libsmb/spnego.o $(PASSCHANGE_OBJ) $(RPC_UNIXINFO_OBJ) \
|
$(IDMAP_OBJ) libsmb/spnego.o $(PASSCHANGE_OBJ) $(RPC_UNIXINFO_OBJ) \
|
||||||
$(RPC_NTSVCS_OBJ) $(RPC_INITSHUTDOWN_OBJ) utils/passwd_util.o \
|
$(RPC_EPMAPPER_OBJ) $(RPC_NTSVCS_OBJ) $(RPC_INITSHUTDOWN_OBJ) \
|
||||||
$(LIBGPO_OBJ) $(NSS_INFO_OBJ)
|
utils/passwd_util.o $(LIBGPO_OBJ) $(NSS_INFO_OBJ)
|
||||||
|
|
||||||
WINBIND_WINS_NSS_OBJ = nsswitch/wins.o $(PARAM_OBJ) \
|
WINBIND_WINS_NSS_OBJ = nsswitch/wins.o $(PARAM_OBJ) \
|
||||||
$(LIBSMB_OBJ) $(LIB_NONSMBD_OBJ) $(NSSWINS_OBJ) $(KRBCLIENT_OBJ) $(SECRETS_OBJ)
|
$(LIBSMB_OBJ) $(LIB_NONSMBD_OBJ) $(NSSWINS_OBJ) $(KRBCLIENT_OBJ) $(SECRETS_OBJ)
|
||||||
@@ -936,7 +939,8 @@ cac: SHOWFLAGS $(LIBMSRPC)
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
## Perl IDL Compiler
|
## Perl IDL Compiler
|
||||||
IDL_FILES = unixinfo.idl lsa.idl dfs.idl echo.idl winreg.idl initshutdown.idl \
|
IDL_FILES = unixinfo.idl lsa.idl dfs.idl echo.idl winreg.idl initshutdown.idl \
|
||||||
srvsvc.idl svcctl.idl eventlog.idl wkssvc.idl netlogon.idl notify.idl
|
srvsvc.idl svcctl.idl eventlog.idl wkssvc.idl netlogon.idl notify.idl \
|
||||||
|
epmapper.idl
|
||||||
|
|
||||||
idl:
|
idl:
|
||||||
@IDL_FILES="$(IDL_FILES)" CPP="$(CPP)" PERL="$(PERL)" \
|
@IDL_FILES="$(IDL_FILES)" CPP="$(CPP)" PERL="$(PERL)" \
|
||||||
@@ -1303,6 +1307,11 @@ bin/librpc_unixinfo.@SHLIBEXT@: proto_exists $(RPC_UNIXINFO_OBJ)
|
|||||||
@$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_UNIXINFO_OBJ) -lc \
|
@$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_UNIXINFO_OBJ) -lc \
|
||||||
@SONAMEFLAG@`basename $@`
|
@SONAMEFLAG@`basename $@`
|
||||||
|
|
||||||
|
bin/librpc_epmapper.@SHLIBEXT@: proto_exists $(RPC_EPMAPPER_OBJ)
|
||||||
|
@echo "Linking $@"
|
||||||
|
@$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_EPMAPPER_OBJ) -lc \
|
||||||
|
@SONAMEFLAG@`basename $@`
|
||||||
|
|
||||||
bin/librpc_srvsvc.@SHLIBEXT@: proto_exists $(RPC_SVC_OBJ)
|
bin/librpc_srvsvc.@SHLIBEXT@: proto_exists $(RPC_SVC_OBJ)
|
||||||
@echo "Linking $@"
|
@echo "Linking $@"
|
||||||
@$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_SVC_OBJ) -lc \
|
@$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_SVC_OBJ) -lc \
|
||||||
|
|||||||
@@ -592,7 +592,7 @@ AC_SUBST(DYNEXP)
|
|||||||
|
|
||||||
dnl Add modules that have to be built by default here
|
dnl Add modules that have to be built by default here
|
||||||
dnl These have to be built static:
|
dnl These have to be built static:
|
||||||
default_static_modules="pdb_smbpasswd pdb_tdbsam rpc_lsa rpc_samr rpc_winreg rpc_initshutdown rpc_lsa_ds rpc_wkssvc rpc_svcctl rpc_ntsvcs rpc_net rpc_netdfs rpc_srvsvc rpc_spoolss rpc_eventlog rpc_unixinfo auth_sam auth_unix auth_winbind auth_server auth_domain auth_builtin vfs_default nss_info_template"
|
default_static_modules="pdb_smbpasswd pdb_tdbsam rpc_lsa rpc_samr rpc_winreg rpc_initshutdown rpc_lsa_ds rpc_wkssvc rpc_svcctl rpc_ntsvcs rpc_net rpc_netdfs rpc_srvsvc rpc_spoolss rpc_eventlog rpc_unixinfo rpc_epmapper auth_sam auth_unix auth_winbind auth_server auth_domain auth_builtin vfs_default nss_info_template"
|
||||||
|
|
||||||
dnl These are preferably build shared, and static if dlopen() is not available
|
dnl These are preferably build shared, and static if dlopen() is not available
|
||||||
default_shared_modules="vfs_recycle vfs_audit vfs_extd_audit vfs_full_audit vfs_netatalk vfs_fake_perms vfs_default_quota vfs_readonly vfs_cap vfs_expand_msdfs vfs_shadow_copy charset_CP850 charset_CP437 auth_script"
|
default_shared_modules="vfs_recycle vfs_audit vfs_extd_audit vfs_full_audit vfs_netatalk vfs_fake_perms vfs_default_quota vfs_readonly vfs_cap vfs_expand_msdfs vfs_shadow_copy charset_CP850 charset_CP437 auth_script"
|
||||||
@@ -5992,6 +5992,7 @@ SMB_MODULE(rpc_eventlog, \$(RPC_EVENTLOG_OBJ), "bin/librpc_eventlog.$SHLIBEXT",
|
|||||||
SMB_MODULE(rpc_samr, \$(RPC_SAMR_OBJ), "bin/librpc_samr.$SHLIBEXT", RPC)
|
SMB_MODULE(rpc_samr, \$(RPC_SAMR_OBJ), "bin/librpc_samr.$SHLIBEXT", RPC)
|
||||||
SMB_MODULE(rpc_rpcecho, \$(RPC_ECHO_OBJ), "bin/librpc_echo.$SHLIBEXT", RPC)
|
SMB_MODULE(rpc_rpcecho, \$(RPC_ECHO_OBJ), "bin/librpc_echo.$SHLIBEXT", RPC)
|
||||||
SMB_MODULE(rpc_unixinfo, \$(RPC_UNIXINFO_OBJ), "bin/librpc_unixinfo.$SHLIBEXT", RPC)
|
SMB_MODULE(rpc_unixinfo, \$(RPC_UNIXINFO_OBJ), "bin/librpc_unixinfo.$SHLIBEXT", RPC)
|
||||||
|
SMB_MODULE(rpc_epmapper, \$(RPC_EPMAPPER_OBJ), "bin/librpc_epmapper.$SHLIBEXT", RPC)
|
||||||
SMB_SUBSYSTEM(RPC,smbd/server.o)
|
SMB_SUBSYSTEM(RPC,smbd/server.o)
|
||||||
|
|
||||||
SMB_MODULE(idmap_ldap, nsswitch/idmap_ldap.o, "bin/ldap.$SHLIBEXT", IDMAP)
|
SMB_MODULE(idmap_ldap, nsswitch/idmap_ldap.o, "bin/ldap.$SHLIBEXT", IDMAP)
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include "librpc/gen_ndr/cli_echo.h"
|
#include "librpc/gen_ndr/cli_echo.h"
|
||||||
#include "librpc/gen_ndr/cli_unixinfo.h"
|
#include "librpc/gen_ndr/cli_unixinfo.h"
|
||||||
|
#include "librpc/gen_ndr/cli_epmapper.h"
|
||||||
#include "librpc/gen_ndr/cli_dfs.h"
|
#include "librpc/gen_ndr/cli_dfs.h"
|
||||||
#include "librpc/gen_ndr/cli_lsa.h"
|
#include "librpc/gen_ndr/cli_lsa.h"
|
||||||
#include "librpc/gen_ndr/cli_srvsvc.h"
|
#include "librpc/gen_ndr/cli_srvsvc.h"
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ typedef uint32 codepoint_t;
|
|||||||
#define PIPE_NETDFS "\\PIPE\\netdfs"
|
#define PIPE_NETDFS "\\PIPE\\netdfs"
|
||||||
#define PIPE_ECHO "\\PIPE\\rpcecho"
|
#define PIPE_ECHO "\\PIPE\\rpcecho"
|
||||||
#define PIPE_SHUTDOWN "\\PIPE\\initshutdown"
|
#define PIPE_SHUTDOWN "\\PIPE\\initshutdown"
|
||||||
#define PIPE_EPM "\\PIPE\\epmapper"
|
#define PIPE_EPMAPPER "\\PIPE\\epmapper"
|
||||||
#define PIPE_SVCCTL "\\PIPE\\svcctl"
|
#define PIPE_SVCCTL "\\PIPE\\svcctl"
|
||||||
#define PIPE_EVENTLOG "\\PIPE\\eventlog"
|
#define PIPE_EVENTLOG "\\PIPE\\eventlog"
|
||||||
#define PIPE_UNIXINFO "\\PIPE\\unixinfo"
|
#define PIPE_UNIXINFO "\\PIPE\\unixinfo"
|
||||||
@@ -209,7 +209,8 @@ typedef uint32 codepoint_t;
|
|||||||
#define PI_EVENTLOG 12
|
#define PI_EVENTLOG 12
|
||||||
#define PI_UNIXINFO 13
|
#define PI_UNIXINFO 13
|
||||||
#define PI_NTSVCS 14
|
#define PI_NTSVCS 14
|
||||||
#define PI_MAX_PIPES 15
|
#define PI_EPMAPPER 15
|
||||||
|
#define PI_MAX_PIPES 16
|
||||||
|
|
||||||
/* 64 bit time (100usec) since ????? - cifs6.txt, section 3.5, page 30 */
|
/* 64 bit time (100usec) since ????? - cifs6.txt, section 3.5, page 30 */
|
||||||
typedef uint64_t NTTIME;
|
typedef uint64_t NTTIME;
|
||||||
@@ -1898,4 +1899,6 @@ enum usershare_err {
|
|||||||
/* Different reasons for closing a file. */
|
/* Different reasons for closing a file. */
|
||||||
enum file_close_type {NORMAL_CLOSE=0,SHUTDOWN_CLOSE,ERROR_CLOSE};
|
enum file_close_type {NORMAL_CLOSE=0,SHUTDOWN_CLOSE,ERROR_CLOSE};
|
||||||
|
|
||||||
|
#include "librpc/gen_ndr/epmapper.h"
|
||||||
|
|
||||||
#endif /* _SMB_H */
|
#endif /* _SMB_H */
|
||||||
|
|||||||
267
source/librpc/gen_ndr/cli_epmapper.c
Normal file
267
source/librpc/gen_ndr/cli_epmapper.c
Normal file
@@ -0,0 +1,267 @@
|
|||||||
|
/*
|
||||||
|
* Unix SMB/CIFS implementation.
|
||||||
|
* client auto-generated by pidl. DO NOT MODIFY!
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "includes.h"
|
||||||
|
#include "librpc/gen_ndr/cli_epmapper.h"
|
||||||
|
|
||||||
|
NTSTATUS rpccli_epm_Insert(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t num_ents, struct epm_entry_t *entries, uint32_t replace)
|
||||||
|
{
|
||||||
|
struct epm_Insert r;
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
|
/* In parameters */
|
||||||
|
r.in.num_ents = num_ents;
|
||||||
|
r.in.entries = entries;
|
||||||
|
r.in.replace = replace;
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_IN_DEBUG(epm_Insert, &r);
|
||||||
|
|
||||||
|
status = cli_do_rpc_ndr(cli, mem_ctx, PI_EPMAPPER, DCERPC_EPM_INSERT, &r, (ndr_pull_flags_fn_t)ndr_pull_epm_Insert, (ndr_push_flags_fn_t)ndr_push_epm_Insert);
|
||||||
|
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_OUT_DEBUG(epm_Insert, &r);
|
||||||
|
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Return variables */
|
||||||
|
|
||||||
|
/* Return result */
|
||||||
|
return NT_STATUS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS rpccli_epm_Delete(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t num_ents, struct epm_entry_t *entries)
|
||||||
|
{
|
||||||
|
struct epm_Delete r;
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
|
/* In parameters */
|
||||||
|
r.in.num_ents = num_ents;
|
||||||
|
r.in.entries = entries;
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_IN_DEBUG(epm_Delete, &r);
|
||||||
|
|
||||||
|
status = cli_do_rpc_ndr(cli, mem_ctx, PI_EPMAPPER, DCERPC_EPM_DELETE, &r, (ndr_pull_flags_fn_t)ndr_pull_epm_Delete, (ndr_push_flags_fn_t)ndr_push_epm_Delete);
|
||||||
|
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_OUT_DEBUG(epm_Delete, &r);
|
||||||
|
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Return variables */
|
||||||
|
|
||||||
|
/* Return result */
|
||||||
|
return NT_STATUS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS rpccli_epm_Lookup(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t inquiry_type, struct GUID *object, struct rpc_if_id_t *interface_id, uint32_t vers_option, struct policy_handle *entry_handle, uint32_t max_ents, uint32_t *num_ents, struct epm_entry_t *entries)
|
||||||
|
{
|
||||||
|
struct epm_Lookup r;
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
|
/* In parameters */
|
||||||
|
r.in.inquiry_type = inquiry_type;
|
||||||
|
r.in.object = object;
|
||||||
|
r.in.interface_id = interface_id;
|
||||||
|
r.in.vers_option = vers_option;
|
||||||
|
r.in.entry_handle = entry_handle;
|
||||||
|
r.in.max_ents = max_ents;
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_IN_DEBUG(epm_Lookup, &r);
|
||||||
|
|
||||||
|
status = cli_do_rpc_ndr(cli, mem_ctx, PI_EPMAPPER, DCERPC_EPM_LOOKUP, &r, (ndr_pull_flags_fn_t)ndr_pull_epm_Lookup, (ndr_push_flags_fn_t)ndr_push_epm_Lookup);
|
||||||
|
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_OUT_DEBUG(epm_Lookup, &r);
|
||||||
|
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Return variables */
|
||||||
|
*entry_handle = *r.out.entry_handle;
|
||||||
|
*num_ents = *r.out.num_ents;
|
||||||
|
memcpy(entries, r.out.entries, r.in.max_ents);
|
||||||
|
|
||||||
|
/* Return result */
|
||||||
|
return NT_STATUS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS rpccli_epm_Map(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct GUID *object, struct epm_twr_t *map_tower, struct policy_handle *entry_handle, uint32_t max_towers, uint32_t *num_towers, struct epm_twr_p_t *towers)
|
||||||
|
{
|
||||||
|
struct epm_Map r;
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
|
/* In parameters */
|
||||||
|
r.in.object = object;
|
||||||
|
r.in.map_tower = map_tower;
|
||||||
|
r.in.entry_handle = entry_handle;
|
||||||
|
r.in.max_towers = max_towers;
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_IN_DEBUG(epm_Map, &r);
|
||||||
|
|
||||||
|
status = cli_do_rpc_ndr(cli, mem_ctx, PI_EPMAPPER, DCERPC_EPM_MAP, &r, (ndr_pull_flags_fn_t)ndr_pull_epm_Map, (ndr_push_flags_fn_t)ndr_push_epm_Map);
|
||||||
|
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_OUT_DEBUG(epm_Map, &r);
|
||||||
|
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Return variables */
|
||||||
|
*entry_handle = *r.out.entry_handle;
|
||||||
|
*num_towers = *r.out.num_towers;
|
||||||
|
memcpy(towers, r.out.towers, r.in.max_towers);
|
||||||
|
|
||||||
|
/* Return result */
|
||||||
|
return NT_STATUS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS rpccli_epm_LookupHandleFree(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *entry_handle)
|
||||||
|
{
|
||||||
|
struct epm_LookupHandleFree r;
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
|
/* In parameters */
|
||||||
|
r.in.entry_handle = entry_handle;
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_IN_DEBUG(epm_LookupHandleFree, &r);
|
||||||
|
|
||||||
|
status = cli_do_rpc_ndr(cli, mem_ctx, PI_EPMAPPER, DCERPC_EPM_LOOKUPHANDLEFREE, &r, (ndr_pull_flags_fn_t)ndr_pull_epm_LookupHandleFree, (ndr_push_flags_fn_t)ndr_push_epm_LookupHandleFree);
|
||||||
|
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_OUT_DEBUG(epm_LookupHandleFree, &r);
|
||||||
|
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Return variables */
|
||||||
|
*entry_handle = *r.out.entry_handle;
|
||||||
|
|
||||||
|
/* Return result */
|
||||||
|
return NT_STATUS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS rpccli_epm_InqObject(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct GUID *epm_object)
|
||||||
|
{
|
||||||
|
struct epm_InqObject r;
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
|
/* In parameters */
|
||||||
|
r.in.epm_object = epm_object;
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_IN_DEBUG(epm_InqObject, &r);
|
||||||
|
|
||||||
|
status = cli_do_rpc_ndr(cli, mem_ctx, PI_EPMAPPER, DCERPC_EPM_INQOBJECT, &r, (ndr_pull_flags_fn_t)ndr_pull_epm_InqObject, (ndr_push_flags_fn_t)ndr_push_epm_InqObject);
|
||||||
|
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_OUT_DEBUG(epm_InqObject, &r);
|
||||||
|
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Return variables */
|
||||||
|
|
||||||
|
/* Return result */
|
||||||
|
return NT_STATUS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS rpccli_epm_MgmtDelete(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t object_speced, struct GUID *object, struct epm_twr_t *tower)
|
||||||
|
{
|
||||||
|
struct epm_MgmtDelete r;
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
|
/* In parameters */
|
||||||
|
r.in.object_speced = object_speced;
|
||||||
|
r.in.object = object;
|
||||||
|
r.in.tower = tower;
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_IN_DEBUG(epm_MgmtDelete, &r);
|
||||||
|
|
||||||
|
status = cli_do_rpc_ndr(cli, mem_ctx, PI_EPMAPPER, DCERPC_EPM_MGMTDELETE, &r, (ndr_pull_flags_fn_t)ndr_pull_epm_MgmtDelete, (ndr_push_flags_fn_t)ndr_push_epm_MgmtDelete);
|
||||||
|
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_OUT_DEBUG(epm_MgmtDelete, &r);
|
||||||
|
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Return variables */
|
||||||
|
|
||||||
|
/* Return result */
|
||||||
|
return NT_STATUS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS rpccli_epm_MapAuth(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
|
||||||
|
{
|
||||||
|
struct epm_MapAuth r;
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
|
/* In parameters */
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_IN_DEBUG(epm_MapAuth, &r);
|
||||||
|
|
||||||
|
status = cli_do_rpc_ndr(cli, mem_ctx, PI_EPMAPPER, DCERPC_EPM_MAPAUTH, &r, (ndr_pull_flags_fn_t)ndr_pull_epm_MapAuth, (ndr_push_flags_fn_t)ndr_push_epm_MapAuth);
|
||||||
|
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_OUT_DEBUG(epm_MapAuth, &r);
|
||||||
|
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Return variables */
|
||||||
|
|
||||||
|
/* Return result */
|
||||||
|
return NT_STATUS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
12
source/librpc/gen_ndr/cli_epmapper.h
Normal file
12
source/librpc/gen_ndr/cli_epmapper.h
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#include "librpc/gen_ndr/ndr_epmapper.h"
|
||||||
|
#ifndef __CLI_EPMAPPER__
|
||||||
|
#define __CLI_EPMAPPER__
|
||||||
|
NTSTATUS rpccli_epm_Insert(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t num_ents, struct epm_entry_t *entries, uint32_t replace);
|
||||||
|
NTSTATUS rpccli_epm_Delete(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t num_ents, struct epm_entry_t *entries);
|
||||||
|
NTSTATUS rpccli_epm_Lookup(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t inquiry_type, struct GUID *object, struct rpc_if_id_t *interface_id, uint32_t vers_option, struct policy_handle *entry_handle, uint32_t max_ents, uint32_t *num_ents, struct epm_entry_t *entries);
|
||||||
|
NTSTATUS rpccli_epm_Map(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct GUID *object, struct epm_twr_t *map_tower, struct policy_handle *entry_handle, uint32_t max_towers, uint32_t *num_towers, struct epm_twr_p_t *towers);
|
||||||
|
NTSTATUS rpccli_epm_LookupHandleFree(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *entry_handle);
|
||||||
|
NTSTATUS rpccli_epm_InqObject(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct GUID *epm_object);
|
||||||
|
NTSTATUS rpccli_epm_MgmtDelete(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t object_speced, struct GUID *object, struct epm_twr_t *tower);
|
||||||
|
NTSTATUS rpccli_epm_MapAuth(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx);
|
||||||
|
#endif /* __CLI_EPMAPPER__ */
|
||||||
353
source/librpc/gen_ndr/epmapper.h
Normal file
353
source/librpc/gen_ndr/epmapper.h
Normal file
@@ -0,0 +1,353 @@
|
|||||||
|
/* header auto-generated by pidl */
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifndef _HEADER_epmapper
|
||||||
|
#define _HEADER_epmapper
|
||||||
|
|
||||||
|
#define EPMAPPER_STATUS_NO_MORE_ENTRIES ( 0x16c9a0d6 )
|
||||||
|
#define EPMAPPER_STATUS_NO_MEMORY ( 0x16C9A012 )
|
||||||
|
#define EPMAPPER_STATUS_OK ( 0 )
|
||||||
|
#ifndef USE_UINT_ENUMS
|
||||||
|
enum epm_protocol {
|
||||||
|
EPM_PROTOCOL_DNET_NSP=0x04,
|
||||||
|
EPM_PROTOCOL_OSI_TP4=0x05,
|
||||||
|
EPM_PROTOCOL_OSI_CLNS=0x06,
|
||||||
|
EPM_PROTOCOL_TCP=0x07,
|
||||||
|
EPM_PROTOCOL_UDP=0x08,
|
||||||
|
EPM_PROTOCOL_IP=0x09,
|
||||||
|
EPM_PROTOCOL_NCADG=0x0a,
|
||||||
|
EPM_PROTOCOL_NCACN=0x0b,
|
||||||
|
EPM_PROTOCOL_NCALRPC=0x0c,
|
||||||
|
EPM_PROTOCOL_UUID=0x0d,
|
||||||
|
EPM_PROTOCOL_IPX=0x0e,
|
||||||
|
EPM_PROTOCOL_SMB=0x0f,
|
||||||
|
EPM_PROTOCOL_PIPE=0x10,
|
||||||
|
EPM_PROTOCOL_NETBIOS=0x11,
|
||||||
|
EPM_PROTOCOL_NETBEUI=0x12,
|
||||||
|
EPM_PROTOCOL_SPX=0x13,
|
||||||
|
EPM_PROTOCOL_NB_IPX=0x14,
|
||||||
|
EPM_PROTOCOL_DSP=0x16,
|
||||||
|
EPM_PROTOCOL_DDP=0x17,
|
||||||
|
EPM_PROTOCOL_APPLETALK=0x18,
|
||||||
|
EPM_PROTOCOL_VINES_SPP=0x1a,
|
||||||
|
EPM_PROTOCOL_VINES_IPC=0x1b,
|
||||||
|
EPM_PROTOCOL_STREETTALK=0x1c,
|
||||||
|
EPM_PROTOCOL_HTTP=0x1f,
|
||||||
|
EPM_PROTOCOL_UNIX_DS=0x20,
|
||||||
|
EPM_PROTOCOL_NULL=0x21
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
enum epm_protocol { __donnot_use_enum_epm_protocol=0x7FFFFFFF}
|
||||||
|
#define EPM_PROTOCOL_DNET_NSP ( 0x04 )
|
||||||
|
#define EPM_PROTOCOL_OSI_TP4 ( 0x05 )
|
||||||
|
#define EPM_PROTOCOL_OSI_CLNS ( 0x06 )
|
||||||
|
#define EPM_PROTOCOL_TCP ( 0x07 )
|
||||||
|
#define EPM_PROTOCOL_UDP ( 0x08 )
|
||||||
|
#define EPM_PROTOCOL_IP ( 0x09 )
|
||||||
|
#define EPM_PROTOCOL_NCADG ( 0x0a )
|
||||||
|
#define EPM_PROTOCOL_NCACN ( 0x0b )
|
||||||
|
#define EPM_PROTOCOL_NCALRPC ( 0x0c )
|
||||||
|
#define EPM_PROTOCOL_UUID ( 0x0d )
|
||||||
|
#define EPM_PROTOCOL_IPX ( 0x0e )
|
||||||
|
#define EPM_PROTOCOL_SMB ( 0x0f )
|
||||||
|
#define EPM_PROTOCOL_PIPE ( 0x10 )
|
||||||
|
#define EPM_PROTOCOL_NETBIOS ( 0x11 )
|
||||||
|
#define EPM_PROTOCOL_NETBEUI ( 0x12 )
|
||||||
|
#define EPM_PROTOCOL_SPX ( 0x13 )
|
||||||
|
#define EPM_PROTOCOL_NB_IPX ( 0x14 )
|
||||||
|
#define EPM_PROTOCOL_DSP ( 0x16 )
|
||||||
|
#define EPM_PROTOCOL_DDP ( 0x17 )
|
||||||
|
#define EPM_PROTOCOL_APPLETALK ( 0x18 )
|
||||||
|
#define EPM_PROTOCOL_VINES_SPP ( 0x1a )
|
||||||
|
#define EPM_PROTOCOL_VINES_IPC ( 0x1b )
|
||||||
|
#define EPM_PROTOCOL_STREETTALK ( 0x1c )
|
||||||
|
#define EPM_PROTOCOL_HTTP ( 0x1f )
|
||||||
|
#define EPM_PROTOCOL_UNIX_DS ( 0x20 )
|
||||||
|
#define EPM_PROTOCOL_NULL ( 0x21 )
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
|
||||||
|
struct epm_rhs_dnet_nsp {
|
||||||
|
char _empty_;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_osi_tp4 {
|
||||||
|
char _empty_;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_osi_clns {
|
||||||
|
char _empty_;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_udp {
|
||||||
|
uint16_t port;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_tcp {
|
||||||
|
uint16_t port;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_ip {
|
||||||
|
const char * ipaddr;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_ncadg {
|
||||||
|
uint16_t minor_version;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_ncacn {
|
||||||
|
uint16_t minor_version;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_uuid {
|
||||||
|
DATA_BLOB unknown;/* [flag(LIBNDR_FLAG_REMAINING)] */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_ipx {
|
||||||
|
char _empty_;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_smb {
|
||||||
|
const char * unc;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_pipe {
|
||||||
|
const char * path;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_netbios {
|
||||||
|
const char * name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_netbeui {
|
||||||
|
char _empty_;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_spx {
|
||||||
|
char _empty_;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_nb_ipx {
|
||||||
|
char _empty_;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_http {
|
||||||
|
uint16_t port;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_unix_ds {
|
||||||
|
const char * path;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_null {
|
||||||
|
char _empty_;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_ncalrpc {
|
||||||
|
uint16_t minor_version;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_appletalk {
|
||||||
|
char _empty_;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_atalk_stream {
|
||||||
|
char _empty_;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_atalk_datagram {
|
||||||
|
char _empty_;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_vines_spp {
|
||||||
|
uint16_t port;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_vines_ipc {
|
||||||
|
uint16_t port;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_rhs_streettalk {
|
||||||
|
const char * streettalk;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */
|
||||||
|
};
|
||||||
|
|
||||||
|
union epm_rhs {
|
||||||
|
struct epm_rhs_dnet_nsp dnet_nsp;/* [case(EPM_PROTOCOL_DNET_NSP)] */
|
||||||
|
struct epm_rhs_osi_tp4 osi_tp4;/* [case(EPM_PROTOCOL_OSI_TP4)] */
|
||||||
|
struct epm_rhs_osi_clns osi_clns;/* [case(EPM_PROTOCOL_OSI_CLNS)] */
|
||||||
|
struct epm_rhs_tcp tcp;/* [case(EPM_PROTOCOL_TCP)] */
|
||||||
|
struct epm_rhs_udp udp;/* [case(EPM_PROTOCOL_UDP)] */
|
||||||
|
struct epm_rhs_ip ip;/* [case(EPM_PROTOCOL_IP)] */
|
||||||
|
struct epm_rhs_ncadg ncadg;/* [case(EPM_PROTOCOL_NCADG)] */
|
||||||
|
struct epm_rhs_ncacn ncacn;/* [case(EPM_PROTOCOL_NCACN)] */
|
||||||
|
struct epm_rhs_ncalrpc ncalrpc;/* [case(EPM_PROTOCOL_NCALRPC)] */
|
||||||
|
struct epm_rhs_uuid uuid;/* [case(EPM_PROTOCOL_UUID)] */
|
||||||
|
struct epm_rhs_ipx ipx;/* [case(EPM_PROTOCOL_IPX)] */
|
||||||
|
struct epm_rhs_smb smb;/* [case(EPM_PROTOCOL_SMB)] */
|
||||||
|
struct epm_rhs_pipe pipe;/* [case(EPM_PROTOCOL_PIPE)] */
|
||||||
|
struct epm_rhs_netbios netbios;/* [case(EPM_PROTOCOL_NETBIOS)] */
|
||||||
|
struct epm_rhs_netbeui netbeui;/* [case(EPM_PROTOCOL_NETBEUI)] */
|
||||||
|
struct epm_rhs_spx spx;/* [case(EPM_PROTOCOL_SPX)] */
|
||||||
|
struct epm_rhs_nb_ipx nb_ipx;/* [case(EPM_PROTOCOL_NB_IPX)] */
|
||||||
|
struct epm_rhs_atalk_stream atalk_stream;/* [case(EPM_PROTOCOL_DSP)] */
|
||||||
|
struct epm_rhs_atalk_datagram atalk_datagram;/* [case(EPM_PROTOCOL_DDP)] */
|
||||||
|
struct epm_rhs_appletalk appletalk;/* [case(EPM_PROTOCOL_APPLETALK)] */
|
||||||
|
struct epm_rhs_vines_spp vines_spp;/* [case(EPM_PROTOCOL_VINES_SPP)] */
|
||||||
|
struct epm_rhs_vines_ipc vines_ipc;/* [case(EPM_PROTOCOL_VINES_IPC)] */
|
||||||
|
struct epm_rhs_streettalk streettalk;/* [case(EPM_PROTOCOL_STREETTALK)] */
|
||||||
|
struct epm_rhs_http http;/* [case(EPM_PROTOCOL_HTTP)] */
|
||||||
|
struct epm_rhs_unix_ds unix_ds;/* [case(EPM_PROTOCOL_UNIX_DS)] */
|
||||||
|
struct epm_rhs_null null;/* [case(EPM_PROTOCOL_NULL)] */
|
||||||
|
DATA_BLOB unknown;/* [default,flag(LIBNDR_FLAG_REMAINING)] */
|
||||||
|
}/* [nodiscriminant,flag(LIBNDR_FLAG_BIGENDIAN)] */;
|
||||||
|
|
||||||
|
struct epm_lhs {
|
||||||
|
enum epm_protocol protocol;
|
||||||
|
DATA_BLOB lhs_data;/* [flag(LIBNDR_FLAG_REMAINING)] */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_floor {
|
||||||
|
struct epm_lhs lhs;/* [subcontext(2)] */
|
||||||
|
union epm_rhs rhs;/* [subcontext(2),switch_is(lhs.protocol)] */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_tower {
|
||||||
|
uint16_t num_floors;
|
||||||
|
struct epm_floor *floors;
|
||||||
|
}/* [gensize,flag(LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN)] */;
|
||||||
|
|
||||||
|
struct epm_twr_t {
|
||||||
|
uint32_t tower_length;/* [value(ndr_size_epm_tower(&tower,ndr->flags))] */
|
||||||
|
struct epm_tower tower;/* [subcontext(4)] */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_entry_t {
|
||||||
|
struct GUID object;
|
||||||
|
struct epm_twr_t *tower;/* [ptr] */
|
||||||
|
const char * annotation;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_LEN4)] */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct rpc_if_id_t {
|
||||||
|
struct GUID uuid;
|
||||||
|
uint16_t vers_major;
|
||||||
|
uint16_t vers_minor;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct epm_twr_p_t {
|
||||||
|
struct epm_twr_t *twr;/* [ptr] */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct epm_Insert {
|
||||||
|
struct {
|
||||||
|
uint32_t num_ents;
|
||||||
|
struct epm_entry_t *entries;/* [size_is(num_ents)] */
|
||||||
|
uint32_t replace;
|
||||||
|
} in;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
uint32_t result;
|
||||||
|
} out;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct epm_Delete {
|
||||||
|
struct {
|
||||||
|
uint32_t num_ents;
|
||||||
|
struct epm_entry_t *entries;/* [size_is(num_ents)] */
|
||||||
|
} in;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
uint32_t result;
|
||||||
|
} out;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct epm_Lookup {
|
||||||
|
struct {
|
||||||
|
uint32_t inquiry_type;
|
||||||
|
struct GUID *object;/* [ptr] */
|
||||||
|
struct rpc_if_id_t *interface_id;/* [ptr] */
|
||||||
|
uint32_t vers_option;
|
||||||
|
uint32_t max_ents;
|
||||||
|
struct policy_handle *entry_handle;/* [ref] */
|
||||||
|
} in;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
uint32_t *num_ents;/* [ref] */
|
||||||
|
struct epm_entry_t *entries;/* [length_is(*num_ents),size_is(max_ents)] */
|
||||||
|
struct policy_handle *entry_handle;/* [ref] */
|
||||||
|
uint32_t result;
|
||||||
|
} out;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct epm_Map {
|
||||||
|
struct {
|
||||||
|
struct GUID *object;/* [ptr] */
|
||||||
|
struct epm_twr_t *map_tower;/* [ptr] */
|
||||||
|
uint32_t max_towers;
|
||||||
|
struct policy_handle *entry_handle;/* [ref] */
|
||||||
|
} in;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
uint32_t *num_towers;/* [ref] */
|
||||||
|
struct epm_twr_p_t *towers;/* [length_is(*num_towers),size_is(max_towers)] */
|
||||||
|
struct policy_handle *entry_handle;/* [ref] */
|
||||||
|
uint32_t result;
|
||||||
|
} out;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct epm_LookupHandleFree {
|
||||||
|
struct {
|
||||||
|
struct policy_handle *entry_handle;/* [ref] */
|
||||||
|
} in;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
struct policy_handle *entry_handle;/* [ref] */
|
||||||
|
uint32_t result;
|
||||||
|
} out;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct epm_InqObject {
|
||||||
|
struct {
|
||||||
|
struct GUID *epm_object;/* [ref] */
|
||||||
|
} in;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
uint32_t result;
|
||||||
|
} out;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct epm_MgmtDelete {
|
||||||
|
struct {
|
||||||
|
uint32_t object_speced;
|
||||||
|
struct GUID *object;/* [ptr] */
|
||||||
|
struct epm_twr_t *tower;/* [ptr] */
|
||||||
|
} in;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
uint32_t result;
|
||||||
|
} out;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct epm_MapAuth {
|
||||||
|
struct {
|
||||||
|
uint32_t result;
|
||||||
|
} out;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* _HEADER_epmapper */
|
||||||
2686
source/librpc/gen_ndr/ndr_epmapper.c
Normal file
2686
source/librpc/gen_ndr/ndr_epmapper.c
Normal file
File diff suppressed because it is too large
Load Diff
77
source/librpc/gen_ndr/ndr_epmapper.h
Normal file
77
source/librpc/gen_ndr/ndr_epmapper.h
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
/* header auto-generated by pidl */
|
||||||
|
|
||||||
|
#include "librpc/gen_ndr/epmapper.h"
|
||||||
|
|
||||||
|
#ifndef _HEADER_NDR_epmapper
|
||||||
|
#define _HEADER_NDR_epmapper
|
||||||
|
|
||||||
|
#include "librpc/ndr/libndr.h"
|
||||||
|
#define DCERPC_EPMAPPER_UUID "e1af8308-5d1f-11c9-91a4-08002b14a0fa"
|
||||||
|
#define DCERPC_EPMAPPER_VERSION 3.0
|
||||||
|
#define DCERPC_EPMAPPER_NAME "epmapper"
|
||||||
|
#define DCERPC_EPMAPPER_HELPSTRING "EndPoint Mapper"
|
||||||
|
extern const struct dcerpc_interface_table dcerpc_table_epmapper;
|
||||||
|
NTSTATUS dcerpc_server_epmapper_init(void);
|
||||||
|
#define DCERPC_EPM_INSERT (0x00)
|
||||||
|
|
||||||
|
#define DCERPC_EPM_DELETE (0x01)
|
||||||
|
|
||||||
|
#define DCERPC_EPM_LOOKUP (0x02)
|
||||||
|
|
||||||
|
#define DCERPC_EPM_MAP (0x03)
|
||||||
|
|
||||||
|
#define DCERPC_EPM_LOOKUPHANDLEFREE (0x04)
|
||||||
|
|
||||||
|
#define DCERPC_EPM_INQOBJECT (0x05)
|
||||||
|
|
||||||
|
#define DCERPC_EPM_MGMTDELETE (0x06)
|
||||||
|
|
||||||
|
#define DCERPC_EPM_MAPAUTH (0x07)
|
||||||
|
|
||||||
|
#define DCERPC_EPMAPPER_CALL_COUNT (8)
|
||||||
|
void ndr_print_epm_protocol(struct ndr_print *ndr, const char *name, enum epm_protocol r);
|
||||||
|
void ndr_print_epm_rhs_dnet_nsp(struct ndr_print *ndr, const char *name, const struct epm_rhs_dnet_nsp *r);
|
||||||
|
void ndr_print_epm_rhs_osi_tp4(struct ndr_print *ndr, const char *name, const struct epm_rhs_osi_tp4 *r);
|
||||||
|
void ndr_print_epm_rhs_osi_clns(struct ndr_print *ndr, const char *name, const struct epm_rhs_osi_clns *r);
|
||||||
|
void ndr_print_epm_rhs_udp(struct ndr_print *ndr, const char *name, const struct epm_rhs_udp *r);
|
||||||
|
void ndr_print_epm_rhs_tcp(struct ndr_print *ndr, const char *name, const struct epm_rhs_tcp *r);
|
||||||
|
void ndr_print_epm_rhs_ip(struct ndr_print *ndr, const char *name, const struct epm_rhs_ip *r);
|
||||||
|
void ndr_print_epm_rhs_ncadg(struct ndr_print *ndr, const char *name, const struct epm_rhs_ncadg *r);
|
||||||
|
void ndr_print_epm_rhs_ncacn(struct ndr_print *ndr, const char *name, const struct epm_rhs_ncacn *r);
|
||||||
|
void ndr_print_epm_rhs_uuid(struct ndr_print *ndr, const char *name, const struct epm_rhs_uuid *r);
|
||||||
|
void ndr_print_epm_rhs_ipx(struct ndr_print *ndr, const char *name, const struct epm_rhs_ipx *r);
|
||||||
|
void ndr_print_epm_rhs_smb(struct ndr_print *ndr, const char *name, const struct epm_rhs_smb *r);
|
||||||
|
void ndr_print_epm_rhs_pipe(struct ndr_print *ndr, const char *name, const struct epm_rhs_pipe *r);
|
||||||
|
void ndr_print_epm_rhs_netbios(struct ndr_print *ndr, const char *name, const struct epm_rhs_netbios *r);
|
||||||
|
void ndr_print_epm_rhs_netbeui(struct ndr_print *ndr, const char *name, const struct epm_rhs_netbeui *r);
|
||||||
|
void ndr_print_epm_rhs_spx(struct ndr_print *ndr, const char *name, const struct epm_rhs_spx *r);
|
||||||
|
void ndr_print_epm_rhs_nb_ipx(struct ndr_print *ndr, const char *name, const struct epm_rhs_nb_ipx *r);
|
||||||
|
void ndr_print_epm_rhs_http(struct ndr_print *ndr, const char *name, const struct epm_rhs_http *r);
|
||||||
|
void ndr_print_epm_rhs_unix_ds(struct ndr_print *ndr, const char *name, const struct epm_rhs_unix_ds *r);
|
||||||
|
void ndr_print_epm_rhs_null(struct ndr_print *ndr, const char *name, const struct epm_rhs_null *r);
|
||||||
|
void ndr_print_epm_rhs_ncalrpc(struct ndr_print *ndr, const char *name, const struct epm_rhs_ncalrpc *r);
|
||||||
|
void ndr_print_epm_rhs_appletalk(struct ndr_print *ndr, const char *name, const struct epm_rhs_appletalk *r);
|
||||||
|
void ndr_print_epm_rhs_atalk_stream(struct ndr_print *ndr, const char *name, const struct epm_rhs_atalk_stream *r);
|
||||||
|
void ndr_print_epm_rhs_atalk_datagram(struct ndr_print *ndr, const char *name, const struct epm_rhs_atalk_datagram *r);
|
||||||
|
void ndr_print_epm_rhs_vines_spp(struct ndr_print *ndr, const char *name, const struct epm_rhs_vines_spp *r);
|
||||||
|
void ndr_print_epm_rhs_vines_ipc(struct ndr_print *ndr, const char *name, const struct epm_rhs_vines_ipc *r);
|
||||||
|
void ndr_print_epm_rhs_streettalk(struct ndr_print *ndr, const char *name, const struct epm_rhs_streettalk *r);
|
||||||
|
void ndr_print_epm_rhs(struct ndr_print *ndr, const char *name, const union epm_rhs *r);
|
||||||
|
void ndr_print_epm_lhs(struct ndr_print *ndr, const char *name, const struct epm_lhs *r);
|
||||||
|
void ndr_print_epm_floor(struct ndr_print *ndr, const char *name, const struct epm_floor *r);
|
||||||
|
void ndr_print_epm_tower(struct ndr_print *ndr, const char *name, const struct epm_tower *r);
|
||||||
|
void ndr_print_epm_twr_t(struct ndr_print *ndr, const char *name, const struct epm_twr_t *r);
|
||||||
|
void ndr_print_epm_entry_t(struct ndr_print *ndr, const char *name, const struct epm_entry_t *r);
|
||||||
|
void ndr_print_rpc_if_id_t(struct ndr_print *ndr, const char *name, const struct rpc_if_id_t *r);
|
||||||
|
void ndr_print_epm_twr_p_t(struct ndr_print *ndr, const char *name, const struct epm_twr_p_t *r);
|
||||||
|
void ndr_print_epm_Insert(struct ndr_print *ndr, const char *name, int flags, const struct epm_Insert *r);
|
||||||
|
void ndr_print_epm_Delete(struct ndr_print *ndr, const char *name, int flags, const struct epm_Delete *r);
|
||||||
|
void ndr_print_epm_Lookup(struct ndr_print *ndr, const char *name, int flags, const struct epm_Lookup *r);
|
||||||
|
NTSTATUS ndr_push_epm_Map(struct ndr_push *ndr, int flags, const struct epm_Map *r);
|
||||||
|
NTSTATUS ndr_pull_epm_Map(struct ndr_pull *ndr, int flags, struct epm_Map *r);
|
||||||
|
void ndr_print_epm_Map(struct ndr_print *ndr, const char *name, int flags, const struct epm_Map *r);
|
||||||
|
void ndr_print_epm_LookupHandleFree(struct ndr_print *ndr, const char *name, int flags, const struct epm_LookupHandleFree *r);
|
||||||
|
void ndr_print_epm_InqObject(struct ndr_print *ndr, const char *name, int flags, const struct epm_InqObject *r);
|
||||||
|
void ndr_print_epm_MgmtDelete(struct ndr_print *ndr, const char *name, int flags, const struct epm_MgmtDelete *r);
|
||||||
|
void ndr_print_epm_MapAuth(struct ndr_print *ndr, const char *name, int flags, const struct epm_MapAuth *r);
|
||||||
|
#endif /* _HEADER_NDR_epmapper */
|
||||||
574
source/librpc/gen_ndr/srv_epmapper.c
Normal file
574
source/librpc/gen_ndr/srv_epmapper.c
Normal file
@@ -0,0 +1,574 @@
|
|||||||
|
/*
|
||||||
|
* Unix SMB/CIFS implementation.
|
||||||
|
* server auto-generated by pidl. DO NOT MODIFY!
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "includes.h"
|
||||||
|
#include "librpc/gen_ndr/srv_epmapper.h"
|
||||||
|
|
||||||
|
static BOOL api_epm_Insert(pipes_struct *p)
|
||||||
|
{
|
||||||
|
struct ndr_pull *pull;
|
||||||
|
struct ndr_push *push;
|
||||||
|
NTSTATUS status;
|
||||||
|
DATA_BLOB blob;
|
||||||
|
struct epm_Insert r;
|
||||||
|
TALLOC_CTX *mem_ctx = talloc_init("api_epm_Insert");
|
||||||
|
|
||||||
|
if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
pull = ndr_pull_init_blob(&blob, mem_ctx);
|
||||||
|
if (pull == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
||||||
|
status = ndr_pull_epm_Insert(pull, NDR_IN, &r);
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_IN_DEBUG(epm_Insert, &r);
|
||||||
|
|
||||||
|
r.out.result = _epm_Insert(p, &r);
|
||||||
|
|
||||||
|
if (p->rng_fault_state) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
/* Return True here, srv_pipe_hnd.c will take care */
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_OUT_DEBUG(epm_Insert, &r);
|
||||||
|
|
||||||
|
push = ndr_push_init_ctx(mem_ctx);
|
||||||
|
if (push == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
status = ndr_push_epm_Insert(push, NDR_OUT, &r);
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
blob = ndr_push_blob(push);
|
||||||
|
if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL api_epm_Delete(pipes_struct *p)
|
||||||
|
{
|
||||||
|
struct ndr_pull *pull;
|
||||||
|
struct ndr_push *push;
|
||||||
|
NTSTATUS status;
|
||||||
|
DATA_BLOB blob;
|
||||||
|
struct epm_Delete r;
|
||||||
|
TALLOC_CTX *mem_ctx = talloc_init("api_epm_Delete");
|
||||||
|
|
||||||
|
if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
pull = ndr_pull_init_blob(&blob, mem_ctx);
|
||||||
|
if (pull == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
||||||
|
status = ndr_pull_epm_Delete(pull, NDR_IN, &r);
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_IN_DEBUG(epm_Delete, &r);
|
||||||
|
|
||||||
|
r.out.result = _epm_Delete(p, &r);
|
||||||
|
|
||||||
|
if (p->rng_fault_state) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
/* Return True here, srv_pipe_hnd.c will take care */
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_OUT_DEBUG(epm_Delete, &r);
|
||||||
|
|
||||||
|
push = ndr_push_init_ctx(mem_ctx);
|
||||||
|
if (push == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
status = ndr_push_epm_Delete(push, NDR_OUT, &r);
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
blob = ndr_push_blob(push);
|
||||||
|
if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL api_epm_Lookup(pipes_struct *p)
|
||||||
|
{
|
||||||
|
struct ndr_pull *pull;
|
||||||
|
struct ndr_push *push;
|
||||||
|
NTSTATUS status;
|
||||||
|
DATA_BLOB blob;
|
||||||
|
struct epm_Lookup r;
|
||||||
|
TALLOC_CTX *mem_ctx = talloc_init("api_epm_Lookup");
|
||||||
|
|
||||||
|
if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
pull = ndr_pull_init_blob(&blob, mem_ctx);
|
||||||
|
if (pull == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
||||||
|
status = ndr_pull_epm_Lookup(pull, NDR_IN, &r);
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_IN_DEBUG(epm_Lookup, &r);
|
||||||
|
|
||||||
|
ZERO_STRUCT(r.out);
|
||||||
|
r.out.entry_handle = r.in.entry_handle;
|
||||||
|
r.out.num_ents = talloc_zero(mem_ctx, uint32_t);
|
||||||
|
if (r.out.num_ents == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
r.out.entries = talloc_zero_array(mem_ctx, struct epm_entry_t, r.in.max_ents);
|
||||||
|
if (r.out.entries == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
r.out.result = _epm_Lookup(p, &r);
|
||||||
|
|
||||||
|
if (p->rng_fault_state) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
/* Return True here, srv_pipe_hnd.c will take care */
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_OUT_DEBUG(epm_Lookup, &r);
|
||||||
|
|
||||||
|
push = ndr_push_init_ctx(mem_ctx);
|
||||||
|
if (push == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
status = ndr_push_epm_Lookup(push, NDR_OUT, &r);
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
blob = ndr_push_blob(push);
|
||||||
|
if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL api_epm_Map(pipes_struct *p)
|
||||||
|
{
|
||||||
|
struct ndr_pull *pull;
|
||||||
|
struct ndr_push *push;
|
||||||
|
NTSTATUS status;
|
||||||
|
DATA_BLOB blob;
|
||||||
|
struct epm_Map r;
|
||||||
|
TALLOC_CTX *mem_ctx = talloc_init("api_epm_Map");
|
||||||
|
|
||||||
|
if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
pull = ndr_pull_init_blob(&blob, mem_ctx);
|
||||||
|
if (pull == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
||||||
|
status = ndr_pull_epm_Map(pull, NDR_IN, &r);
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_IN_DEBUG(epm_Map, &r);
|
||||||
|
|
||||||
|
ZERO_STRUCT(r.out);
|
||||||
|
r.out.entry_handle = r.in.entry_handle;
|
||||||
|
r.out.num_towers = talloc_zero(mem_ctx, uint32_t);
|
||||||
|
if (r.out.num_towers == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
r.out.towers = talloc_zero_array(mem_ctx, struct epm_twr_p_t, r.in.max_towers);
|
||||||
|
if (r.out.towers == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
r.out.result = _epm_Map(p, &r);
|
||||||
|
|
||||||
|
if (p->rng_fault_state) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
/* Return True here, srv_pipe_hnd.c will take care */
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_OUT_DEBUG(epm_Map, &r);
|
||||||
|
|
||||||
|
push = ndr_push_init_ctx(mem_ctx);
|
||||||
|
if (push == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
status = ndr_push_epm_Map(push, NDR_OUT, &r);
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
blob = ndr_push_blob(push);
|
||||||
|
if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL api_epm_LookupHandleFree(pipes_struct *p)
|
||||||
|
{
|
||||||
|
struct ndr_pull *pull;
|
||||||
|
struct ndr_push *push;
|
||||||
|
NTSTATUS status;
|
||||||
|
DATA_BLOB blob;
|
||||||
|
struct epm_LookupHandleFree r;
|
||||||
|
TALLOC_CTX *mem_ctx = talloc_init("api_epm_LookupHandleFree");
|
||||||
|
|
||||||
|
if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
pull = ndr_pull_init_blob(&blob, mem_ctx);
|
||||||
|
if (pull == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
||||||
|
status = ndr_pull_epm_LookupHandleFree(pull, NDR_IN, &r);
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_IN_DEBUG(epm_LookupHandleFree, &r);
|
||||||
|
|
||||||
|
ZERO_STRUCT(r.out);
|
||||||
|
r.out.entry_handle = r.in.entry_handle;
|
||||||
|
r.out.result = _epm_LookupHandleFree(p, &r);
|
||||||
|
|
||||||
|
if (p->rng_fault_state) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
/* Return True here, srv_pipe_hnd.c will take care */
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_OUT_DEBUG(epm_LookupHandleFree, &r);
|
||||||
|
|
||||||
|
push = ndr_push_init_ctx(mem_ctx);
|
||||||
|
if (push == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
status = ndr_push_epm_LookupHandleFree(push, NDR_OUT, &r);
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
blob = ndr_push_blob(push);
|
||||||
|
if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL api_epm_InqObject(pipes_struct *p)
|
||||||
|
{
|
||||||
|
struct ndr_pull *pull;
|
||||||
|
struct ndr_push *push;
|
||||||
|
NTSTATUS status;
|
||||||
|
DATA_BLOB blob;
|
||||||
|
struct epm_InqObject r;
|
||||||
|
TALLOC_CTX *mem_ctx = talloc_init("api_epm_InqObject");
|
||||||
|
|
||||||
|
if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
pull = ndr_pull_init_blob(&blob, mem_ctx);
|
||||||
|
if (pull == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
||||||
|
status = ndr_pull_epm_InqObject(pull, NDR_IN, &r);
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_IN_DEBUG(epm_InqObject, &r);
|
||||||
|
|
||||||
|
r.out.result = _epm_InqObject(p, &r);
|
||||||
|
|
||||||
|
if (p->rng_fault_state) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
/* Return True here, srv_pipe_hnd.c will take care */
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_OUT_DEBUG(epm_InqObject, &r);
|
||||||
|
|
||||||
|
push = ndr_push_init_ctx(mem_ctx);
|
||||||
|
if (push == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
status = ndr_push_epm_InqObject(push, NDR_OUT, &r);
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
blob = ndr_push_blob(push);
|
||||||
|
if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL api_epm_MgmtDelete(pipes_struct *p)
|
||||||
|
{
|
||||||
|
struct ndr_pull *pull;
|
||||||
|
struct ndr_push *push;
|
||||||
|
NTSTATUS status;
|
||||||
|
DATA_BLOB blob;
|
||||||
|
struct epm_MgmtDelete r;
|
||||||
|
TALLOC_CTX *mem_ctx = talloc_init("api_epm_MgmtDelete");
|
||||||
|
|
||||||
|
if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
pull = ndr_pull_init_blob(&blob, mem_ctx);
|
||||||
|
if (pull == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
||||||
|
status = ndr_pull_epm_MgmtDelete(pull, NDR_IN, &r);
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_IN_DEBUG(epm_MgmtDelete, &r);
|
||||||
|
|
||||||
|
r.out.result = _epm_MgmtDelete(p, &r);
|
||||||
|
|
||||||
|
if (p->rng_fault_state) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
/* Return True here, srv_pipe_hnd.c will take care */
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_OUT_DEBUG(epm_MgmtDelete, &r);
|
||||||
|
|
||||||
|
push = ndr_push_init_ctx(mem_ctx);
|
||||||
|
if (push == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
status = ndr_push_epm_MgmtDelete(push, NDR_OUT, &r);
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
blob = ndr_push_blob(push);
|
||||||
|
if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL api_epm_MapAuth(pipes_struct *p)
|
||||||
|
{
|
||||||
|
struct ndr_pull *pull;
|
||||||
|
struct ndr_push *push;
|
||||||
|
NTSTATUS status;
|
||||||
|
DATA_BLOB blob;
|
||||||
|
struct epm_MapAuth r;
|
||||||
|
TALLOC_CTX *mem_ctx = talloc_init("api_epm_MapAuth");
|
||||||
|
|
||||||
|
if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
pull = ndr_pull_init_blob(&blob, mem_ctx);
|
||||||
|
if (pull == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
||||||
|
status = ndr_pull_epm_MapAuth(pull, NDR_IN, &r);
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_IN_DEBUG(epm_MapAuth, &r);
|
||||||
|
|
||||||
|
r.out.result = _epm_MapAuth(p, &r);
|
||||||
|
|
||||||
|
if (p->rng_fault_state) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
/* Return True here, srv_pipe_hnd.c will take care */
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DEBUGLEVEL >= 10)
|
||||||
|
NDR_PRINT_OUT_DEBUG(epm_MapAuth, &r);
|
||||||
|
|
||||||
|
push = ndr_push_init_ctx(mem_ctx);
|
||||||
|
if (push == NULL) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
status = ndr_push_epm_MapAuth(push, NDR_OUT, &r);
|
||||||
|
if (NT_STATUS_IS_ERR(status)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
blob = ndr_push_blob(push);
|
||||||
|
if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
talloc_free(mem_ctx);
|
||||||
|
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Tables */
|
||||||
|
static struct api_struct api_epmapper_cmds[] =
|
||||||
|
{
|
||||||
|
{"EPM_INSERT", DCERPC_EPM_INSERT, api_epm_Insert},
|
||||||
|
{"EPM_DELETE", DCERPC_EPM_DELETE, api_epm_Delete},
|
||||||
|
{"EPM_LOOKUP", DCERPC_EPM_LOOKUP, api_epm_Lookup},
|
||||||
|
{"EPM_MAP", DCERPC_EPM_MAP, api_epm_Map},
|
||||||
|
{"EPM_LOOKUPHANDLEFREE", DCERPC_EPM_LOOKUPHANDLEFREE, api_epm_LookupHandleFree},
|
||||||
|
{"EPM_INQOBJECT", DCERPC_EPM_INQOBJECT, api_epm_InqObject},
|
||||||
|
{"EPM_MGMTDELETE", DCERPC_EPM_MGMTDELETE, api_epm_MgmtDelete},
|
||||||
|
{"EPM_MAPAUTH", DCERPC_EPM_MAPAUTH, api_epm_MapAuth},
|
||||||
|
};
|
||||||
|
|
||||||
|
void epmapper_get_pipe_fns(struct api_struct **fns, int *n_fns)
|
||||||
|
{
|
||||||
|
*fns = api_epmapper_cmds;
|
||||||
|
*n_fns = sizeof(api_epmapper_cmds) / sizeof(struct api_struct);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS rpc_epmapper_init(void)
|
||||||
|
{
|
||||||
|
return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "epmapper", "epmapper", api_epmapper_cmds, sizeof(api_epmapper_cmds) / sizeof(struct api_struct));
|
||||||
|
}
|
||||||
14
source/librpc/gen_ndr/srv_epmapper.h
Normal file
14
source/librpc/gen_ndr/srv_epmapper.h
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#include "librpc/gen_ndr/ndr_epmapper.h"
|
||||||
|
#ifndef __SRV_EPMAPPER__
|
||||||
|
#define __SRV_EPMAPPER__
|
||||||
|
uint32 _epm_Insert(pipes_struct *p, struct epm_Insert *r);
|
||||||
|
uint32 _epm_Delete(pipes_struct *p, struct epm_Delete *r);
|
||||||
|
uint32 _epm_Lookup(pipes_struct *p, struct epm_Lookup *r);
|
||||||
|
uint32 _epm_Map(pipes_struct *p, struct epm_Map *r);
|
||||||
|
uint32 _epm_LookupHandleFree(pipes_struct *p, struct epm_LookupHandleFree *r);
|
||||||
|
uint32 _epm_InqObject(pipes_struct *p, struct epm_InqObject *r);
|
||||||
|
uint32 _epm_MgmtDelete(pipes_struct *p, struct epm_MgmtDelete *r);
|
||||||
|
uint32 _epm_MapAuth(pipes_struct *p, struct epm_MapAuth *r);
|
||||||
|
void epmapper_get_pipe_fns(struct api_struct **fns, int *n_fns);
|
||||||
|
NTSTATUS rpc_epmapper_init(void);
|
||||||
|
#endif /* __SRV_EPMAPPER__ */
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "librpc/rpc/dcerpc_table.h"
|
#include "librpc/rpc/dcerpc_table.h"
|
||||||
#include "librpc/gen_ndr/ndr_dfs.h"
|
#include "librpc/gen_ndr/ndr_dfs.h"
|
||||||
#include "librpc/gen_ndr/ndr_echo.h"
|
#include "librpc/gen_ndr/ndr_echo.h"
|
||||||
|
#include "librpc/gen_ndr/ndr_epmapper.h"
|
||||||
#include "librpc/gen_ndr/ndr_eventlog.h"
|
#include "librpc/gen_ndr/ndr_eventlog.h"
|
||||||
#include "librpc/gen_ndr/ndr_initshutdown.h"
|
#include "librpc/gen_ndr/ndr_initshutdown.h"
|
||||||
#include "librpc/gen_ndr/ndr_lsa.h"
|
#include "librpc/gen_ndr/ndr_lsa.h"
|
||||||
@@ -26,6 +27,9 @@ NTSTATUS dcerpc_register_builtin_interfaces(void)
|
|||||||
status = librpc_register_interface(&dcerpc_table_rpcecho);
|
status = librpc_register_interface(&dcerpc_table_rpcecho);
|
||||||
if (NT_STATUS_IS_ERR(status)) return status;
|
if (NT_STATUS_IS_ERR(status)) return status;
|
||||||
|
|
||||||
|
status = librpc_register_interface(&dcerpc_table_epmapper);
|
||||||
|
if (NT_STATUS_IS_ERR(status)) return status;
|
||||||
|
|
||||||
status = librpc_register_interface(&dcerpc_table_eventlog);
|
status = librpc_register_interface(&dcerpc_table_eventlog);
|
||||||
if (NT_STATUS_IS_ERR(status)) return status;
|
if (NT_STATUS_IS_ERR(status)) return status;
|
||||||
|
|
||||||
|
|||||||
302
source/librpc/idl/epmapper.idl
Normal file
302
source/librpc/idl/epmapper.idl
Normal file
@@ -0,0 +1,302 @@
|
|||||||
|
#include "idl_types.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
endpoint mapper interface
|
||||||
|
Related links:
|
||||||
|
http://www.opengroup.org/onlinepubs/9629399/apdxl.htm : Details on towers
|
||||||
|
http://www.opengroup.org/onlinepubs/9629399/chap6.htm#tagcjh_11_02_03_01: binding strings
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
[
|
||||||
|
uuid("e1af8308-5d1f-11c9-91a4-08002b14a0fa"),
|
||||||
|
version(3.0),
|
||||||
|
endpoint("ncacn_np:[\\pipe\\epmapper]", "ncacn_ip_tcp:[135]",
|
||||||
|
"ncalrpc:[EPMAPPER]"),
|
||||||
|
helpstring("EndPoint Mapper"),
|
||||||
|
pointer_default(ptr)
|
||||||
|
]
|
||||||
|
interface epmapper
|
||||||
|
{
|
||||||
|
|
||||||
|
/*
|
||||||
|
note that the following IDL won't work in MIDL, and in fact
|
||||||
|
that the full towers/floors representation of epm cannot be
|
||||||
|
represented in MIDL at all. I decided to represent it using
|
||||||
|
the extended IDL syntax in pidl to make it easier to work
|
||||||
|
with.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const int EPMAPPER_STATUS_NO_MORE_ENTRIES = 0x16c9a0d6;
|
||||||
|
const int EPMAPPER_STATUS_NO_MEMORY = 0x16C9A012;
|
||||||
|
const int EPMAPPER_STATUS_OK = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
typedef [enum8bit] enum {
|
||||||
|
|
||||||
|
/* Level 4 and higher */
|
||||||
|
EPM_PROTOCOL_DNET_NSP = 0x04,
|
||||||
|
EPM_PROTOCOL_OSI_TP4 = 0x05,
|
||||||
|
EPM_PROTOCOL_OSI_CLNS = 0x06,
|
||||||
|
EPM_PROTOCOL_TCP = 0x07,
|
||||||
|
EPM_PROTOCOL_UDP = 0x08,
|
||||||
|
EPM_PROTOCOL_IP = 0x09,
|
||||||
|
/* These 4 are protocol identifiers, always at level 3 or lower */
|
||||||
|
EPM_PROTOCOL_NCADG = 0x0a, /* Connectionless RPC */
|
||||||
|
EPM_PROTOCOL_NCACN = 0x0b,
|
||||||
|
EPM_PROTOCOL_NCALRPC = 0x0c, /* Local RPC */
|
||||||
|
EPM_PROTOCOL_UUID = 0x0d,
|
||||||
|
EPM_PROTOCOL_IPX = 0x0e,
|
||||||
|
EPM_PROTOCOL_SMB = 0x0f,
|
||||||
|
EPM_PROTOCOL_PIPE = 0x10,
|
||||||
|
EPM_PROTOCOL_NETBIOS = 0x11,
|
||||||
|
EPM_PROTOCOL_NETBEUI = 0x12,
|
||||||
|
EPM_PROTOCOL_SPX = 0x13,
|
||||||
|
EPM_PROTOCOL_NB_IPX = 0x14, /* NetBIOS over IPX */
|
||||||
|
EPM_PROTOCOL_DSP = 0x16, /* AppleTalk Data Stream Protocol */
|
||||||
|
EPM_PROTOCOL_DDP = 0x17, /* AppleTalk Data Datagram Protocol */
|
||||||
|
EPM_PROTOCOL_APPLETALK = 0x18, /* AppleTalk */
|
||||||
|
EPM_PROTOCOL_VINES_SPP = 0x1a,
|
||||||
|
EPM_PROTOCOL_VINES_IPC = 0x1b, /* Inter Process Communication */
|
||||||
|
EPM_PROTOCOL_STREETTALK = 0x1c, /* Vines Streettalk */
|
||||||
|
EPM_PROTOCOL_HTTP = 0x1f,
|
||||||
|
EPM_PROTOCOL_UNIX_DS = 0x20, /* Unix domain socket */
|
||||||
|
EPM_PROTOCOL_NULL = 0x21
|
||||||
|
} epm_protocol;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
/*FIXME */
|
||||||
|
} epm_rhs_dnet_nsp;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
/*FIXME*/
|
||||||
|
} epm_rhs_osi_tp4;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
/*FIXME*/
|
||||||
|
} epm_rhs_osi_clns;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint16 port;
|
||||||
|
} epm_rhs_udp;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint16 port;
|
||||||
|
} epm_rhs_tcp;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
ipv4address ipaddr;
|
||||||
|
} epm_rhs_ip;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint16 minor_version;
|
||||||
|
} epm_rhs_ncadg;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint16 minor_version;
|
||||||
|
} epm_rhs_ncacn;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
[flag(NDR_REMAINING)] DATA_BLOB unknown;
|
||||||
|
} epm_rhs_uuid;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
/*FIXME */
|
||||||
|
} epm_rhs_ipx;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
astring unc;
|
||||||
|
} epm_rhs_smb;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
astring path;
|
||||||
|
} epm_rhs_pipe;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
astring name;
|
||||||
|
} epm_rhs_netbios;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
} epm_rhs_netbeui;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
} epm_rhs_spx;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
} epm_rhs_nb_ipx;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint16 port;
|
||||||
|
} epm_rhs_http;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
astring path;
|
||||||
|
} epm_rhs_unix_ds;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
} epm_rhs_null;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint16 minor_version;
|
||||||
|
} epm_rhs_ncalrpc;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
} epm_rhs_appletalk;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
} epm_rhs_atalk_stream;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
} epm_rhs_atalk_datagram;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint16 port;
|
||||||
|
} epm_rhs_vines_spp;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint16 port;
|
||||||
|
} epm_rhs_vines_ipc;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
astring streettalk;
|
||||||
|
} epm_rhs_streettalk;
|
||||||
|
|
||||||
|
typedef [flag(NDR_BIG_ENDIAN),nodiscriminant] union {
|
||||||
|
[case(EPM_PROTOCOL_DNET_NSP)] epm_rhs_dnet_nsp dnet_nsp;
|
||||||
|
[case(EPM_PROTOCOL_OSI_TP4)] epm_rhs_osi_tp4 osi_tp4;
|
||||||
|
[case(EPM_PROTOCOL_OSI_CLNS)] epm_rhs_osi_clns osi_clns;
|
||||||
|
[case(EPM_PROTOCOL_TCP)] epm_rhs_tcp tcp;
|
||||||
|
[case(EPM_PROTOCOL_UDP)] epm_rhs_udp udp;
|
||||||
|
[case(EPM_PROTOCOL_IP)] epm_rhs_ip ip;
|
||||||
|
[case(EPM_PROTOCOL_NCADG)] epm_rhs_ncadg ncadg;
|
||||||
|
[case(EPM_PROTOCOL_NCACN)] epm_rhs_ncacn ncacn;
|
||||||
|
[case(EPM_PROTOCOL_NCALRPC)] epm_rhs_ncalrpc ncalrpc;
|
||||||
|
[case(EPM_PROTOCOL_UUID)] epm_rhs_uuid uuid;
|
||||||
|
[case(EPM_PROTOCOL_IPX)] epm_rhs_ipx ipx;
|
||||||
|
[case(EPM_PROTOCOL_SMB)] epm_rhs_smb smb;
|
||||||
|
[case(EPM_PROTOCOL_PIPE)] epm_rhs_pipe pipe;
|
||||||
|
[case(EPM_PROTOCOL_NETBIOS)] epm_rhs_netbios netbios;
|
||||||
|
[case(EPM_PROTOCOL_NETBEUI)] epm_rhs_netbeui netbeui;
|
||||||
|
[case(EPM_PROTOCOL_SPX)] epm_rhs_spx spx;
|
||||||
|
[case(EPM_PROTOCOL_NB_IPX)] epm_rhs_nb_ipx nb_ipx;
|
||||||
|
[case(EPM_PROTOCOL_DSP)] epm_rhs_atalk_stream atalk_stream;
|
||||||
|
[case(EPM_PROTOCOL_DDP)] epm_rhs_atalk_datagram atalk_datagram;
|
||||||
|
[case(EPM_PROTOCOL_APPLETALK)] epm_rhs_appletalk appletalk;
|
||||||
|
[case(EPM_PROTOCOL_VINES_SPP)] epm_rhs_vines_spp vines_spp;
|
||||||
|
[case(EPM_PROTOCOL_VINES_IPC)] epm_rhs_vines_ipc vines_ipc;
|
||||||
|
[case(EPM_PROTOCOL_STREETTALK)] epm_rhs_streettalk streettalk;
|
||||||
|
[case(EPM_PROTOCOL_HTTP)] epm_rhs_http http;
|
||||||
|
[case(EPM_PROTOCOL_UNIX_DS)] epm_rhs_unix_ds unix_ds;
|
||||||
|
[case(EPM_PROTOCOL_NULL)] epm_rhs_null null;
|
||||||
|
[default] [flag(NDR_REMAINING)] DATA_BLOB unknown;
|
||||||
|
} epm_rhs;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
epm_protocol protocol;
|
||||||
|
[flag(NDR_REMAINING)] DATA_BLOB lhs_data;
|
||||||
|
} epm_lhs;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
[subcontext(2)] epm_lhs lhs;
|
||||||
|
[subcontext(2),switch_is(lhs.protocol)] epm_rhs rhs;
|
||||||
|
} epm_floor;
|
||||||
|
|
||||||
|
/* note that the NDR_NOALIGN flag is inherited by all nested
|
||||||
|
structures. All of the towers/floors stuff is
|
||||||
|
non-aligned. I wonder what sort of wicked substance these
|
||||||
|
guys were smoking?
|
||||||
|
*/
|
||||||
|
typedef [gensize,flag(NDR_NOALIGN|NDR_LITTLE_ENDIAN)] struct {
|
||||||
|
uint16 num_floors;
|
||||||
|
epm_floor floors[num_floors];
|
||||||
|
} epm_tower;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
[value(ndr_size_epm_tower(&tower, ndr->flags))] uint32 tower_length;
|
||||||
|
[subcontext(4)] epm_tower tower;
|
||||||
|
} epm_twr_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
GUID object;
|
||||||
|
epm_twr_t *tower;
|
||||||
|
ascstr2 annotation;
|
||||||
|
} epm_entry_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
GUID uuid;
|
||||||
|
uint16 vers_major;
|
||||||
|
uint16 vers_minor;
|
||||||
|
} rpc_if_id_t;
|
||||||
|
|
||||||
|
/**********************/
|
||||||
|
/* Function 0x0 */
|
||||||
|
error_status_t epm_Insert(
|
||||||
|
[in] uint32 num_ents,
|
||||||
|
[in,size_is(num_ents)] epm_entry_t entries[],
|
||||||
|
[in] uint32 replace
|
||||||
|
);
|
||||||
|
|
||||||
|
/**********************/
|
||||||
|
/* Function 0x1 */
|
||||||
|
error_status_t epm_Delete(
|
||||||
|
[in] uint32 num_ents,
|
||||||
|
[in, size_is(num_ents)] epm_entry_t entries[]
|
||||||
|
);
|
||||||
|
|
||||||
|
/**********************/
|
||||||
|
/* Function 0x02 */
|
||||||
|
error_status_t epm_Lookup(
|
||||||
|
[in] uint32 inquiry_type,
|
||||||
|
[in,ptr] GUID *object,
|
||||||
|
[in,ptr] rpc_if_id_t *interface_id,
|
||||||
|
[in] uint32 vers_option,
|
||||||
|
[in,out] policy_handle *entry_handle,
|
||||||
|
[in] uint32 max_ents,
|
||||||
|
[out] uint32 *num_ents,
|
||||||
|
[out, length_is(*num_ents), size_is(max_ents)] epm_entry_t entries[]
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/**********************/
|
||||||
|
/* Function 0x03 */
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
epm_twr_t *twr;
|
||||||
|
} epm_twr_p_t;
|
||||||
|
|
||||||
|
[public] error_status_t epm_Map(
|
||||||
|
[in,ptr] GUID *object,
|
||||||
|
[in,ptr] epm_twr_t *map_tower,
|
||||||
|
[in,out] policy_handle *entry_handle,
|
||||||
|
[in] uint32 max_towers,
|
||||||
|
[out] uint32 *num_towers,
|
||||||
|
[out, length_is(*num_towers), size_is(max_towers)] epm_twr_p_t towers[]
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/**********************/
|
||||||
|
/* Function 0x04 */
|
||||||
|
error_status_t epm_LookupHandleFree(
|
||||||
|
[in,out] policy_handle *entry_handle
|
||||||
|
);
|
||||||
|
|
||||||
|
/**********************/
|
||||||
|
/* Function 0x05 */
|
||||||
|
error_status_t epm_InqObject(
|
||||||
|
[in] GUID *epm_object
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/**********************/
|
||||||
|
/* Function 0x06 */
|
||||||
|
error_status_t epm_MgmtDelete(
|
||||||
|
[in] uint32 object_speced,
|
||||||
|
[in,ptr] GUID *object,
|
||||||
|
[in,ptr] epm_twr_t *tower
|
||||||
|
);
|
||||||
|
|
||||||
|
/**********************/
|
||||||
|
/* Function 0x07 */
|
||||||
|
error_status_t epm_MapAuth();
|
||||||
|
}
|
||||||
@@ -479,12 +479,17 @@ NTSTATUS ndr_push_unique_ptr(struct ndr_push *ndr, const void *p)
|
|||||||
/*
|
/*
|
||||||
push a 'simple' full non-zero value if a pointer is non-NULL, otherwise 0
|
push a 'simple' full non-zero value if a pointer is non-NULL, otherwise 0
|
||||||
*/
|
*/
|
||||||
NTSTATUS ndr_push_sptr_ptr(struct ndr_push *ndr, const void *p)
|
NTSTATUS ndr_push_full_ptr(struct ndr_push *ndr, const void *p)
|
||||||
{
|
{
|
||||||
uint32_t ptr = 0;
|
uint32_t ptr = 0;
|
||||||
if (p) {
|
if (p) {
|
||||||
ndr->ptr_count++;
|
/* Check if the pointer already exists and has an id */
|
||||||
ptr = ndr->ptr_count;
|
ptr = ndr_token_peek(&ndr->full_ptr_list, p);
|
||||||
|
if (ptr == 0) {
|
||||||
|
ndr->ptr_count++;
|
||||||
|
ptr = ndr->ptr_count;
|
||||||
|
ndr_token_store(ndr, &ndr->full_ptr_list, p, ptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ndr_push_uint32(ndr, NDR_SCALARS, ptr);
|
return ndr_push_uint32(ndr, NDR_SCALARS, ptr);
|
||||||
}
|
}
|
||||||
@@ -572,6 +577,43 @@ NTSTATUS ndr_pull_time_t(struct ndr_pull *ndr, int ndr_flags, time_t *t)
|
|||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
pull a ipv4address
|
||||||
|
*/
|
||||||
|
NTSTATUS ndr_pull_ipv4address(struct ndr_pull *ndr, int ndr_flags, const char **address)
|
||||||
|
{
|
||||||
|
struct in_addr in;
|
||||||
|
NDR_CHECK(ndr_pull_uint32(ndr, ndr_flags, &in.s_addr));
|
||||||
|
in.s_addr = htonl(in.s_addr);
|
||||||
|
*address = talloc_strdup(ndr->current_mem_ctx, inet_ntoa(in));
|
||||||
|
NT_STATUS_HAVE_NO_MEMORY(*address);
|
||||||
|
return NT_STATUS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
push a ipv4address
|
||||||
|
*/
|
||||||
|
NTSTATUS ndr_push_ipv4address(struct ndr_push *ndr, int ndr_flags, const char *address)
|
||||||
|
{
|
||||||
|
uint32_t addr;
|
||||||
|
if (!is_ipaddress(address)) {
|
||||||
|
return ndr_push_error(ndr, NDR_ERR_IPV4ADDRESS,
|
||||||
|
"Invalid IPv4 address: '%s'",
|
||||||
|
address);
|
||||||
|
}
|
||||||
|
addr = inet_addr(address);
|
||||||
|
NDR_CHECK(ndr_push_uint32(ndr, ndr_flags, htonl(addr)));
|
||||||
|
return NT_STATUS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
print a ipv4address
|
||||||
|
*/
|
||||||
|
void ndr_print_ipv4address(struct ndr_print *ndr, const char *name,
|
||||||
|
const char *address)
|
||||||
|
{
|
||||||
|
ndr->print(ndr, "%-25s: %s", name, address);
|
||||||
|
}
|
||||||
|
|
||||||
void ndr_print_struct(struct ndr_print *ndr, const char *name, const char *type)
|
void ndr_print_struct(struct ndr_print *ndr, const char *name, const char *type)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -211,6 +211,16 @@ interface/version dce/rpc pipe identification
|
|||||||
}, 0x01 \
|
}, 0x01 \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define SYNT_EPMAPPER_V3 \
|
||||||
|
{ \
|
||||||
|
{ \
|
||||||
|
0xe1af8308, 0x5d1f,0x11c9, \
|
||||||
|
{ 0x91,0xa4}, \
|
||||||
|
{0x08,0x00, \
|
||||||
|
0x2b,0x14,0xa0,0xfa} \
|
||||||
|
}, 0x03 \
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* IMPORTANT!! If you update this structure, make sure to
|
* IMPORTANT!! If you update this structure, make sure to
|
||||||
* update the index #defines in smb.h.
|
* update the index #defines in smb.h.
|
||||||
@@ -234,6 +244,7 @@ const struct pipe_id_info pipe_names [] =
|
|||||||
{ PIPE_EVENTLOG, SYNT_EVENTLOG_V0 , PIPE_EVENTLOG , TRANS_SYNT_V2 },
|
{ PIPE_EVENTLOG, SYNT_EVENTLOG_V0 , PIPE_EVENTLOG , TRANS_SYNT_V2 },
|
||||||
{ PIPE_UNIXINFO, SYNT_UNIXINFO_V0 , PIPE_UNIXINFO , TRANS_SYNT_V2 },
|
{ PIPE_UNIXINFO, SYNT_UNIXINFO_V0 , PIPE_UNIXINFO , TRANS_SYNT_V2 },
|
||||||
{ PIPE_NTSVCS , SYNT_NTSVCS_V1 , PIPE_NTSVCS , TRANS_SYNT_V2 },
|
{ PIPE_NTSVCS , SYNT_NTSVCS_V1 , PIPE_NTSVCS , TRANS_SYNT_V2 },
|
||||||
|
{ PIPE_EPMAPPER, SYNT_EPMAPPER_V3 , PIPE_EPMAPPER , TRANS_SYNT_V2 },
|
||||||
{ NULL , SYNT_NONE_V0 , NULL , SYNT_NONE_V0 }
|
{ NULL , SYNT_NONE_V0 , NULL , SYNT_NONE_V0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
71
source/rpc_server/srv_epmapper_nt.c
Normal file
71
source/rpc_server/srv_epmapper_nt.c
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
* Unix SMB/CIFS implementation.
|
||||||
|
* RPC Pipe client / server routines for the endpoint mapper
|
||||||
|
* Copyright (C) Jelmer Vernooij 2007.
|
||||||
|
*
|
||||||
|
* 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 2 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, write to the Free Software
|
||||||
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* This is the implementation of the dfs pipe. */
|
||||||
|
|
||||||
|
#include "includes.h"
|
||||||
|
|
||||||
|
uint32 _epm_MapAuth(pipes_struct *p, struct epm_MapAuth *r)
|
||||||
|
{
|
||||||
|
/* FIXME */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 _epm_MgmtDelete(pipes_struct *p, struct epm_MgmtDelete *r)
|
||||||
|
{
|
||||||
|
/* FIXME */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 _epm_InqObject(pipes_struct *p, struct epm_InqObject *r)
|
||||||
|
{
|
||||||
|
/* FIXME */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 _epm_LookupHandleFree(pipes_struct *p, struct epm_LookupHandleFree *r)
|
||||||
|
{
|
||||||
|
/* FIXME */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 _epm_Map(pipes_struct *p, struct epm_Map *r)
|
||||||
|
{
|
||||||
|
/* FIXME */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 _epm_Lookup(pipes_struct *p, struct epm_Lookup *r)
|
||||||
|
{
|
||||||
|
/* FIXME */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 _epm_Delete(pipes_struct *p, struct epm_Delete *r)
|
||||||
|
{
|
||||||
|
/* FIXME */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 _epm_Insert(pipes_struct *p, struct epm_Insert *r)
|
||||||
|
{
|
||||||
|
/* FIXME */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -2382,7 +2382,7 @@ void get_pipe_fns( int idx, struct api_struct **fns, int *n_fns )
|
|||||||
case PI_SVCCTL:
|
case PI_SVCCTL:
|
||||||
svcctl_get_pipe_fns( &cmds, &n_cmds );
|
svcctl_get_pipe_fns( &cmds, &n_cmds );
|
||||||
break;
|
break;
|
||||||
case PI_EVENTLOG:
|
case PI_EVENTLOG:
|
||||||
eventlog_get_pipe_fns( &cmds, &n_cmds );
|
eventlog_get_pipe_fns( &cmds, &n_cmds );
|
||||||
break;
|
break;
|
||||||
case PI_UNIXINFO:
|
case PI_UNIXINFO:
|
||||||
@@ -2396,6 +2396,9 @@ void get_pipe_fns( int idx, struct api_struct **fns, int *n_fns )
|
|||||||
rpcecho_get_pipe_fns( &cmds, &n_cmds );
|
rpcecho_get_pipe_fns( &cmds, &n_cmds );
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
case PI_EPMAPPER:
|
||||||
|
epmapper_get_pipe_fns( &cmds, &n_cmds );
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
DEBUG(0,("get_pipe_fns: Unknown pipe index! [%d]\n", idx));
|
DEBUG(0,("get_pipe_fns: Unknown pipe index! [%d]\n", idx));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user