diff options
-rw-r--r-- | source3/rpc_server/rpc_service_setup.c | 21 | ||||
-rw-r--r-- | source3/rpc_server/rpc_service_setup.h | 14 |
2 files changed, 35 insertions, 0 deletions
diff --git a/source3/rpc_server/rpc_service_setup.c b/source3/rpc_server/rpc_service_setup.c index a9633fb355..6cf4905af7 100644 --- a/source3/rpc_server/rpc_service_setup.c +++ b/source3/rpc_server/rpc_service_setup.c @@ -52,6 +52,27 @@ #include "rpc_server/rpc_server.h" #include "rpc_server/epmapper/srv_epmapper.h" +enum rpc_service_mode_e rpc_epmapper_mode(void) +{ + const char *rpcsrv_type; + enum rpc_service_mode_e state; + + rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM, + "rpc_server", + "epmapper", + "disabled"); + + if (strcasecmp_m(rpcsrv_type, "external") == 0) { + state = RPC_SERVICE_MODE_EXTERNAL; + } else if (strcasecmp_m(rpcsrv_type, "daemon") == 0) { + state = RPC_SERVICE_MODE_DAEMON; + } else { + state = RPC_SERVICE_MODE_DISABLED; + } + + return state; +} + static bool rpc_setup_epmapper(struct tevent_context *ev_ctx, struct messaging_context *msg_ctx) { diff --git a/source3/rpc_server/rpc_service_setup.h b/source3/rpc_server/rpc_service_setup.h index 2e27995261..e568b1fc06 100644 --- a/source3/rpc_server/rpc_service_setup.h +++ b/source3/rpc_server/rpc_service_setup.h @@ -24,6 +24,20 @@ struct ndr_interface_table; +enum rpc_service_mode_e { + RPC_SERVICE_MODE_DISABLED = 0, + RPC_SERVICE_MODE_EMBEDDED, + RPC_SERVICE_MODE_EXTERNAL, + RPC_SERVICE_MODE_DAEMON +}; + +/** + * @brief Get the mode in which epmapper is started. + * + * @return The mode. + */ +enum rpc_service_mode_e rpc_epmapper_mode(void); + /** * @brief Register an endpoint at the endpoint mapper. * |