| Solaris |
|
|
| Authors: | Tomas Heran <tomas.heran@sun.com> |
|---|---|
| Version: | DRAFT 1.0 |
| Date: | 2008-03-10 |
Contents
We propose to implement a library to handle configuration repository access for all client-side name service components. We call this library libnsconf. The interface of this library is Consolidation Private.
libnsconf abstracts the configuration repository and provides interfaces to work with Name Service Switch Profiles (NSSP) and Name Service Back-End Configurations (BEC). For description of NSSP and NSBEC, please see "Duckwater: Simplified Name Services Management - Profiles" [profiles].
The idea is that we will have a simple (repository independent) interface to access local configuration data that all name service components can use.
Our goal is to use the SMF repository to store our configuration data, but we expect that accessing the SMF configuration repository through libscf(3LIB) will require a lot of duplicated programming. We want to have this code only in one place (libnsconf) and not duplicate it in other name service components.
Please note, that this interface is supposed to be the lower-level part of name service configuration API. The upper-level, which will be used directly by applications like nscfg(1M), nsadm(1M) etc. will reside in back-end specific name service switch modules - i.e. /usr/lib/nss_*.so. For more information, please refer to "Duckwater: Configuration APIs for Name Service Switch Modules" design document [nssconfig].
Users of libnsconf have to call nsconf_init before using any of the APIs. To ensure, that the connection to the svc.configd is properly closed, that users have to call nsconf_fini.
int nsconf_init(); void nsconf_fini(); int nsconf_is_initialized();
Group of functions to create/modify/delete/find and iterate through configurations (NSSPs and NSBECs) stored in repository.
nsconf_config_t *nsconf_config_create(nsconf_type_t type,
const char *name);
void nsconf_config_destroy(nsconf_config_t *config);
int nsconf_config_clone(nsconf_config_t **to,
nsconf_config_t *from, const char *new_name);
int nsconf_config_get(nsconf_type_t type,
const char *name, nsconf_config_t **config);
int nsconf_config_put(const nsconf_config_t *config);
int nsconf_config_remove(nsconf_type_t type, const char *name);
nsconf_iter_t *nsconf_iter_create(nsconf_type_t type);
int nsconf_iter_next_config(nsconf_iter_t *iter,
nsconf_config_t **config);
void nsconf_iter_destroy(nsconf_iter_t *iter);
int nsconf_config_get_prop(nsconf_config_t *config,
const char *name, nsconf_property_t **prop);
int nsconf_prop_set_val(nsconf_config_t *config,
const char *name, const char *value);
int nsconf_prop_get_val(nsconf_config_t *config,
const char *name, const char **value);
int nsconf_prop_unset_val(nsconf_config_t *config,
const char *name);
int nsconf_prop_add_val(nsconf_config_t *config,
const char *name,
const char *value);
nsconf_property_t * nsconf_config_next_prop(
nsconf_config_t *config,
nsconf_property_t *ref_prop);
nsconf_value_t * nsconf_prop_next_val(
nsconf_property_t *prop,
nsconf_value_t *ref_val);
Marking configurations is enabled or disabled. The actual work needed to activate a configuration will be done partially in nsadm(1M) and partially in particular NSS modules.
int nsconf_config_activate(
nsconf_type_t type,
const char *name);
int nsconf_config_deactivate(
nsconf_type_t type);
int nscfg_discover_backends(
int *n_becs,
nsconf_config_t ***becs,
int timeout_sec);
Will be redesigned.
These functions give access to libnsconf error codes and their string representations:
int nsconf_error(void); const char *nsconf_strerror(int err);
This functions give access to error codes and their string representations of lower-level repository access library - i.e. libscf(3C):
int nsconf_repo_error(void); const char *nsconf_repo_strerror(int err);
Most of the functions in libnsconf library return 0 on success and -1 on error. Exceptions to this rule are these functions:
* nsconf_config_create returns pointer to newly created nsconf_config_t structure (or NULL on error).
To get error code after last nsconf_* function invocation, use nsconf_error() function. To get string representation of the error, use nsconf_strerror(int). nsconf_erorr() return value is valid only immediately after the previous call to a libnsconf function failed.
1. libsldap.so.1
|=NSSP:|Name Service Switch Profile - high level configuration entity, describing the whole set of name service configurations.
| NSBEC: | Name Service Back-End Configuration - Configuration of each particular back-end (LDAP, NIS, NIS+, DNS) |
|---|
| [nssconfig] | http://opensolaris.org/os/project/duckwater/Documentation/nssconfig/ |
| [profiles] | http://opensolaris.org/os/project/duckwater/Documentation/profiles_new/ |
Terms of Use
|
Privacy
|
Trademarks
|
Copyright Policy
|
Site Guidelines
|
Site Map
|
Help
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Use.
© 2012, Oracle Corporation and/or its affiliates.