From afe3e8172ddaa5e4aa811faceecda4f943d6e2ef Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 2 Apr 2008 04:53:27 +0200 Subject: Install public header files again and include required prototypes. (This used to be commit 47ffbbf67435904754469544390b67d34c958343) --- source4/rpc_server/common/common.h | 15 +++++++++++++-- source4/rpc_server/common/server_info.c | 30 +++++++++++++++--------------- 2 files changed, 28 insertions(+), 17 deletions(-) (limited to 'source4/rpc_server/common') diff --git a/source4/rpc_server/common/common.h b/source4/rpc_server/common/common.h index 5ddfca43b5..110ef6062d 100644 --- a/source4/rpc_server/common/common.h +++ b/source4/rpc_server/common/common.h @@ -57,7 +57,18 @@ #define DCESRV_PULL_HANDLE(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, NT_STATUS_INVALID_HANDLE) #define DCESRV_PULL_HANDLE_WERR(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, WERR_BADFID) +struct share_config; struct dcesrv_context; +enum srvsvc_ShareType dcesrv_common_get_share_type(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, struct share_config *scfg); +enum srvsvc_PlatformId dcesrv_common_get_platform_id(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx); +const char *dcesrv_common_get_domain_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx); +const char *dcesrv_common_get_lan_root(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx); +const char *dcesrv_common_get_server_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, const char *server_unc); +uint32_t dcesrv_common_get_version_major(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx); +uint32_t dcesrv_common_get_version_minor(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx); +uint32_t dcesrv_common_get_version_build(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx); +uint32_t dcesrv_common_get_share_permissions(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, struct share_config *scfg); +uint32_t dcesrv_common_get_share_current_users(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, struct share_config *scfg); +const char *dcesrv_common_get_share_path(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, struct share_config *scfg); -#include "param/share.h" -#include "rpc_server/common/proto.h" +struct dcesrv_context; diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index 0a44493df5..646879ad0d 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -32,7 +32,7 @@ */ /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ enum srvsvc_PlatformId dcesrv_common_get_platform_id(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +enum srvsvc_PlatformId dcesrv_common_get_platform_id(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { enum srvsvc_PlatformId id; @@ -41,7 +41,7 @@ _PUBLIC_ enum srvsvc_PlatformId dcesrv_common_get_platform_id(TALLOC_CTX *mem_ct return id; } -_PUBLIC_ const char *dcesrv_common_get_server_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, const char *server_unc) +const char *dcesrv_common_get_server_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, const char *server_unc) { const char *p = server_unc; @@ -64,25 +64,25 @@ const char *dcesrv_common_get_domain_name(TALLOC_CTX *mem_ctx, struct dcesrv_con } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_version_major(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) +uint32_t dcesrv_common_get_version_major(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) { return lp_parm_int(lp_ctx, NULL, "server_info", "version_major", 5); } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_version_minor(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) +uint32_t dcesrv_common_get_version_minor(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) { return lp_parm_int(lp_ctx, NULL, "server_info", "version_minor", 2); } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_version_build(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) +uint32_t dcesrv_common_get_version_build(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) { return lp_parm_int(lp_ctx, NULL, "server_info", "version_build", 3790); } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { int default_server_announce = 0; default_server_announce |= SV_TYPE_WORKSTATION; @@ -158,56 +158,56 @@ _PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dces } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ const char *dcesrv_common_get_lan_root(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +const char *dcesrv_common_get_lan_root(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return talloc_strdup(mem_ctx, ""); } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_users(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +uint32_t dcesrv_common_get_users(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return -1; } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_disc(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +uint32_t dcesrv_common_get_disc(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return 15; } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_hidden(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +uint32_t dcesrv_common_get_hidden(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return 0; } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_announce(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +uint32_t dcesrv_common_get_announce(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return 240; } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_anndelta(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +uint32_t dcesrv_common_get_anndelta(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return 3000; } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_licenses(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +uint32_t dcesrv_common_get_licenses(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return 0; } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ const char *dcesrv_common_get_userpath(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +const char *dcesrv_common_get_userpath(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return talloc_strdup(mem_ctx, "c:\\"); } #define INVALID_SHARE_NAME_CHARS " \"*+,./:;<=>?[\\]|" -_PUBLIC_ bool dcesrv_common_validate_share_name(TALLOC_CTX *mem_ctx, const char *share_name) +bool dcesrv_common_validate_share_name(TALLOC_CTX *mem_ctx, const char *share_name) { if (strpbrk(share_name, INVALID_SHARE_NAME_CHARS)) { return false; -- cgit From 1cf8130e110c63a3bfc04ef8e21ca4343a4ab35c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 2 Apr 2008 14:18:31 +0200 Subject: Move handle utility functions to public header, remove more public headers. (This used to be commit 92e71c19f4e1d3ca123a083942ec578d21f7012c) --- source4/rpc_server/common/common.h | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'source4/rpc_server/common') diff --git a/source4/rpc_server/common/common.h b/source4/rpc_server/common/common.h index 110ef6062d..af2d96cb3e 100644 --- a/source4/rpc_server/common/common.h +++ b/source4/rpc_server/common/common.h @@ -20,43 +20,6 @@ along with this program. If not, see . */ -/* a useful macro for generating a RPC fault in the backend code */ -#define DCESRV_FAULT(code) do { \ - dce_call->fault_code = code; \ - return r->out.result; \ -} while(0) - -/* a useful macro for generating a RPC fault in the backend code */ -#define DCESRV_FAULT_VOID(code) do { \ - dce_call->fault_code = code; \ - return; \ -} while(0) - -/* a useful macro for checking the validity of a dcerpc policy handle - and giving the right fault code if invalid */ -#define DCESRV_CHECK_HANDLE(h) do {if (!(h)) DCESRV_FAULT(DCERPC_FAULT_CONTEXT_MISMATCH); } while (0) - -/* this checks for a valid policy handle, and gives a fault if an - invalid handle or retval if the handle is of the - wrong type */ -#define DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, retval) do { \ - (h) = dcesrv_handle_fetch(dce_call->context, (inhandle), DCESRV_HANDLE_ANY); \ - DCESRV_CHECK_HANDLE(h); \ - if ((t) != DCESRV_HANDLE_ANY && (h)->wire_handle.handle_type != (t)) { \ - return retval; \ - } \ -} while (0) - -/* this checks for a valid policy handle and gives a dcerpc fault - if its the wrong type of handle */ -#define DCESRV_PULL_HANDLE_FAULT(h, inhandle, t) do { \ - (h) = dcesrv_handle_fetch(dce_call->context, (inhandle), t); \ - DCESRV_CHECK_HANDLE(h); \ -} while (0) - -#define DCESRV_PULL_HANDLE(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, NT_STATUS_INVALID_HANDLE) -#define DCESRV_PULL_HANDLE_WERR(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, WERR_BADFID) - struct share_config; struct dcesrv_context; enum srvsvc_ShareType dcesrv_common_get_share_type(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, struct share_config *scfg); -- cgit