|
libnetconf2 4.6.1
NETCONF server and client library in C.
|
Functions | |
| int | nc_server_destroy (void) |
| Destroy any dynamically allocated libssh and/or libssl/libcrypto and server resources. | |
| uint32_t | nc_server_endpt_count (void) |
| Get the number of currently configured listening endpoints. | |
| void | nc_server_get_capab_withdefaults (NC_WD_MODE *basic_mode, int *also_supported) |
| Get with-defaults capability extra parameters. | |
| char ** | nc_server_get_cpblts (const struct ly_ctx *ctx) |
| Get all the server capabilities including all the schemas. | |
| char ** | nc_server_get_cpblts_version (const struct ly_ctx *ctx, LYS_VERSION version) |
| Get the server capabilities including the schemas with the specified YANG version. | |
| int | nc_server_init (void) |
| Initialize libssh and/or libssl/libcrypto and the server. | |
| int | nc_server_init_ctx (struct ly_ctx **ctx) |
| Initialize a context which can serve as a default server context. | |
| int | nc_server_set_capab_withdefaults (NC_WD_MODE basic_mode, int also_supported) |
| Set the with-defaults capability extra parameters. | |
| int | nc_server_set_capability (const char *value) |
| Set capability of the server. | |
| void | nc_server_set_content_id_clb (char *(*content_id_clb)(void *user_data), void *user_data, void(*free_user_data)(void *user_data)) |
| Set the callback for getting yang-library capability identifier. If none is set, libyang context change count is used. | |
| int nc_server_init | ( | void | ) |
Initialize libssh and/or libssl/libcrypto and the server.
Must be called before other nc_server* functions.
| int nc_server_destroy | ( | void | ) |
Destroy any dynamically allocated libssh and/or libssl/libcrypto and server resources.
No other server API call may run concurrently with this function and there must be no session being accepted or authenticated. Established sessions are not affected, but the data of the user callbacks set through the API (nc_server_ssh_set_interactive_auth_clb(), nc_server_ch_set_dispatch_data(), ...) is released here, so an authentication still running in one of them would use freed data. Call Home client threads are stopped, but only the ones dispatched before this call.
| int nc_server_init_ctx | ( | struct ly_ctx ** | ctx | ) |
Initialize a context which can serve as a default server context.
Loads the default modules ietf-netconf and ietf-netconf-monitoring and their enabled features - ietf-netconf enabled features are : writable-running, candidate, rollback-on-error, validate, startup, url, xpath, confirmed-commit and ietf-netconf-monitoring has no features.
If ctx is :
| [in,out] | ctx | Optional context in which the modules will be loaded. Created if ctx is null. |
| int nc_server_set_capab_withdefaults | ( | NC_WD_MODE | basic_mode, |
| int | also_supported ) |
Set the with-defaults capability extra parameters.
For the capability to be actually advertised, the server context must also include the ietf-netconf-with-defaults model.
Changing this option has the same ill effects as changing capabilities while sessions are already established.
| [in] | basic_mode | basic-mode with-defaults parameter. |
| [in] | also_supported | NC_WD_MODE bit array, also-supported with-defaults parameter. |
| void nc_server_get_capab_withdefaults | ( | NC_WD_MODE * | basic_mode, |
| int * | also_supported ) |
Get with-defaults capability extra parameters.
At least one argument must be non-NULL.
| [out] | basic_mode | basic-mode parameter. |
| [out] | also_supported | also-supported parameter. |
| int nc_server_set_capability | ( | const char * | value | ) |
Set capability of the server.
Capability can be used when some behavior or extension of the server is not defined as a YANG module. The provided value will be advertised in the server's <hello> messages. Note, that libnetconf only checks that the provided value is non-empty string.
| [in] | value | Capability string to be advertised in server's <hello> messages. |
| void nc_server_set_content_id_clb | ( | char *(* | content_id_clb )(void *user_data), |
| void * | user_data, | ||
| void(* | free_user_data )(void *user_data) ) |
Set the callback for getting yang-library capability identifier. If none is set, libyang context change count is used.
| [in] | content_id_clb | Callback that should return the yang-library content identifier. |
| [in] | user_data | Optional arbitrary user data that will be passed to content_id_clb. |
| [in] | free_user_data | Optional callback that will be called during cleanup to free any user_data. |
| char ** nc_server_get_cpblts | ( | const struct ly_ctx * | ctx | ) |
Get all the server capabilities including all the schemas.
A few capabilities (with-defaults, interleave) depend on the current server options.
| [in] | ctx | Context to read most capabilities from. |
| char ** nc_server_get_cpblts_version | ( | const struct ly_ctx * | ctx, |
| LYS_VERSION | version ) |
Get the server capabilities including the schemas with the specified YANG version.
A few capabilities (with-defaults, interleave) depend on the current server options.
| [in] | ctx | Context to read most capabilities from. |
| [in] | version | YANG version of the schemas to be included in result, with LYS_VERSION_UNDEF the result is the same as from nc_server_get_cpblts(). |
| uint32_t nc_server_endpt_count | ( | void | ) |
Get the number of currently configured listening endpoints.