libnetconf2
3.5.4
NETCONF server and client library in C.
|
NETCONF client functionality. More...
Modules | |
Client Messages | |
Functions to create NETCONF RPCs (or actions) and process replies received from the server. | |
Client SSH | |
Client-side settings for SSH connections. | |
Client Session | |
Client-side NETCONF session manipulation. | |
Client TLS | |
Client-side settings for TLS connections. | |
Client-side Call Home | |
Call Home functionality for client-side applications. | |
Functions | |
void | nc_client_destroy (void) |
Destroy all libssh and/or libssl/libcrypto dynamic memory and the client options, for both SSH and TLS, and for Call Home too. More... | |
ly_module_imp_clb | nc_client_get_schema_callback (void **user_data) |
Get callback function used to get missing schemas. More... | |
const char * | nc_client_get_schema_searchpath (void) |
Get schema searchpath that was set by nc_client_set_schema_searchpath(). More... | |
void * | nc_client_get_thread_context (void) |
Get thread-specific client context for sharing with some other thread using nc_client_set_thread_context(). More... | |
int | nc_client_init (void) |
Initialize client for establishing connections. More... | |
void | nc_client_set_new_session_context_autofill (int enabled) |
Enable/disable loading of all the YANG modules supported by the server when a new session is created. If disabled, it is expected that users update the context themselves and load the YANG modules that are planned to be used. Otherwise even basic RPCs may fail to be sent! More... | |
int | nc_client_set_new_session_context_schema_mount (struct nc_session *session) |
Set client session context to support schema-mount, if possible. More... | |
int | nc_client_set_schema_callback (ly_module_imp_clb clb, void *user_data) |
Set callback function to get missing schemas. More... | |
int | nc_client_set_schema_searchpath (const char *path) |
Set location where libnetconf tries to search for YANG/YIN schemas. More... | |
void | nc_client_set_thread_context (void *context) |
Use the provided thread-specific client's context in the current thread. More... | |
NETCONF client functionality.
int nc_client_set_schema_searchpath | ( | const char * | path | ) |
Set location where libnetconf tries to search for YANG/YIN schemas.
The location is searched when connecting to a NETCONF server and building YANG context for further processing of the NETCONF messages and data.
The searchpath is also used to store schemas retreived via <get-schema> operation - if the schema is not found in searchpath neither via schema callback provided via nc_client_set_schema_callback() and server supports the NETCONF <get-schema> operation, the schema is retrieved this way and stored into the searchpath (if specified).
[in] | path | Directory where to search for YANG/YIN schemas. |
const char* nc_client_get_schema_searchpath | ( | void | ) |
Get schema searchpath that was set by nc_client_set_schema_searchpath().
int nc_client_set_schema_callback | ( | ly_module_imp_clb | clb, |
void * | user_data | ||
) |
Set callback function to get missing schemas.
[in] | clb | Callback responsible for returning the missing model. |
[in] | user_data | Arbitrary data that will always be passed to the callback clb . |
ly_module_imp_clb nc_client_get_schema_callback | ( | void ** | user_data | ) |
Get callback function used to get missing schemas.
[out] | user_data | Optionally return the private data set with the callback. Note that the caller is responsible for freeing the private data, so before changing the callback, private data used for the previous callback should be freed. |
void nc_client_set_new_session_context_autofill | ( | int | enabled | ) |
Enable/disable loading of all the YANG modules supported by the server when a new session is created. If disabled, it is expected that users update the context themselves and load the YANG modules that are planned to be used. Otherwise even basic RPCs may fail to be sent!
[in] | enabled | Whether context autofill is enabled or disabled. |
int nc_client_set_new_session_context_schema_mount | ( | struct nc_session * | session | ) |
Set client session context to support schema-mount, if possible.
Performed automatically unless nc_client_set_new_session_context_autofill() was disabled.
[in] | session | NETCONF session to update. |
void nc_client_set_thread_context | ( | void * | context | ) |
Use the provided thread-specific client's context in the current thread.
Note that from this point the context is shared with the thread from which the context was taken and any nc_client_*set* functions and functions creating connection in these threads should be protected from the concurrent execution.
Context contains schema searchpath/callback, call home binds, TLS and SSH authentication data (username, keys, various certificates and callbacks).
[in] | context | Client's thread-specific context provided by nc_client_get_thread_context(). |
void* nc_client_get_thread_context | ( | void | ) |
Get thread-specific client context for sharing with some other thread using nc_client_set_thread_context().
int nc_client_init | ( | void | ) |
Initialize client for establishing connections.
void nc_client_destroy | ( | void | ) |
Destroy all libssh and/or libssl/libcrypto dynamic memory and the client options, for both SSH and TLS, and for Call Home too.