diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/proto.h | 2 | ||||
-rw-r--r-- | source3/param/loadparm.c | 13 | ||||
-rw-r--r-- | source3/param/loadparm_ctx.c | 4 |
3 files changed, 19 insertions, 0 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 5d15e4e77a..c3e680d8b6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1577,6 +1577,8 @@ const char *lp_ldap_idmap_suffix(void); struct parm_struct; /* Return a pointer to a service by name. */ struct loadparm_service *lp_service(const char *pszServiceName); +struct loadparm_service *lp_servicebynum(int snum); +struct loadparm_service *lp_default_loadparm_service(void); void *lp_parm_ptr(struct loadparm_service *service, struct parm_struct *parm); void *lp_local_ptr_by_snum(int snum, struct parm_struct *parm); bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue); diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 79f1b236ca..1258709856 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6419,6 +6419,19 @@ struct loadparm_service *lp_service(const char *pszServiceName) return ServicePtrs[iService]; } +struct loadparm_service *lp_servicebynum(int snum) +{ + if (snum = -1 || !LP_SNUM_OK(snum)) { + return NULL; + } + return ServicePtrs[snum]; +} + +struct loadparm_service *lp_default_loadparm_service() +{ + return &sDefault; +} + /*************************************************************************** Copy a service structure to another. diff --git a/source3/param/loadparm_ctx.c b/source3/param/loadparm_ctx.c index 7362279f9b..7c59ca709a 100644 --- a/source3/param/loadparm_ctx.c +++ b/source3/param/loadparm_ctx.c @@ -30,6 +30,10 @@ static const struct loadparm_s3_context s3_fns = .get_parm_struct = lp_get_parameter, .get_parm_ptr = lp_parm_ptr, .get_service = lp_service, + .get_servicebynum = lp_servicebynum, + .get_default_loadparm_service = lp_default_loadparm_service, + .get_numservices = lp_numservices, + .set_cmdline = lp_set_cmdline, .server_role = lp_server_role, |