|
libnetconf2 4.6.4
NETCONF server and client library in C.
|
Server-side Call Home functions. More...
Typedefs | |
| typedef int(* | nc_server_ch_new_session_cb) (const char *client_name, struct nc_session *new_session, void *user_data) |
| Callback for new Call Home sessions. | |
| typedef void(* | nc_server_ch_new_session_fail_cb) (const char *client_name, const char *endpt_name, uint8_t max_attempts, uint8_t cur_attempt, void *user_data) |
| Callback for failures when creating new Call Home sessions. | |
| typedef const struct ly_ctx *(* | nc_server_ch_session_acquire_ctx_cb) (void *cb_data) |
| Callback for getting a locked context for new Call Home sessions. | |
| typedef void(* | nc_server_ch_session_release_ctx_cb) (void *cb_data) |
| Callback for releasing a locked context for Call Home sessions. | |
Functions | |
| int | nc_connect_ch_client_dispatch (const char *client_name, nc_server_ch_session_acquire_ctx_cb acquire_ctx_cb, nc_server_ch_session_release_ctx_cb release_ctx_cb, void *ctx_cb_data, nc_server_ch_new_session_cb new_session_cb, void *new_session_cb_data) |
| Dispatch a thread connecting to a listening NETCONF client and creating Call Home sessions. | |
| int | nc_server_ch_client_is_endpt (const char *client_name, const char *endpt_name) |
| Check if an endpoint of a Call Home client exists. | |
| int | nc_server_ch_is_client (const char *name) |
| Check if a Call Home client exists. | |
| void | nc_server_ch_set_dispatch_data (nc_server_ch_session_acquire_ctx_cb acquire_ctx_cb, nc_server_ch_session_release_ctx_cb release_ctx_cb, void *ctx_cb_data, nc_server_ch_new_session_cb new_session_cb, void *new_session_cb_data) |
| Set callbacks and their data for Call Home threads. | |
| void | nc_server_ch_set_new_session_fail_cb (nc_server_ch_new_session_fail_cb new_session_fail_cb, void *new_session_fail_cb_data) |
| Set callback for failure of a new CH session creation. | |
Server-side Call Home functions.
| typedef const struct ly_ctx *(* nc_server_ch_session_acquire_ctx_cb) (void *cb_data) |
Callback for getting a locked context for new Call Home sessions.
| [in] | cb_data | Arbitrary ctx callback data. |
Definition at line 65 of file session_server_ch.h.
| typedef void(* nc_server_ch_session_release_ctx_cb) (void *cb_data) |
Callback for releasing a locked context for Call Home sessions.
| [in] | cb_data | Arbitrary ctx callback data. |
Definition at line 81 of file session_server_ch.h.
| typedef int(* nc_server_ch_new_session_cb) (const char *client_name, struct nc_session *new_session, void *user_data) |
Callback for new Call Home sessions.
| [in] | client_name | Name of the CH client which established the session. |
| [in] | new_session | New established CH session, the pointer is internally discarded afterwards. |
| [in] | user_data | Arbitrary new session callback data. |
new_session is freed. Definition at line 92 of file session_server_ch.h.
| typedef void(* nc_server_ch_new_session_fail_cb) (const char *client_name, const char *endpt_name, uint8_t max_attempts, uint8_t cur_attempt, void *user_data) |
Callback for failures when creating new Call Home sessions.
| [in] | client_name | Name of the CH client that failed to create the session. |
| [in] | endpt_name | Name of the CH client endpoint that failed to create the session. |
| [in] | max_attempts | Maximum connection attempts for the endpoints. |
| [in] | cur_attempt | Current failed connection attempt. |
| [in] | user_data | Arbitrary new session callback data. |
Definition at line 103 of file session_server_ch.h.
| int nc_server_ch_is_client | ( | const char * | name | ) |
Check if a Call Home client exists.
| [in] | name | Client name. |
| int nc_server_ch_client_is_endpt | ( | const char * | client_name, |
| const char * | endpt_name ) |
Check if an endpoint of a Call Home client exists.
| [in] | client_name | Client name. |
| [in] | endpt_name | Endpoint name. |
| int nc_connect_ch_client_dispatch | ( | const char * | client_name, |
| nc_server_ch_session_acquire_ctx_cb | acquire_ctx_cb, | ||
| nc_server_ch_session_release_ctx_cb | release_ctx_cb, | ||
| void * | ctx_cb_data, | ||
| nc_server_ch_new_session_cb | new_session_cb, | ||
| void * | new_session_cb_data ) |
Dispatch a thread connecting to a listening NETCONF client and creating Call Home sessions.
There is at most one thread per Call Home client, so dispatching a client that already has a running thread (either from a previous call or automatically, when its configuration was applied) does nothing and is reported as an error.
| [in] | client_name | Existing client name. |
| [in] | acquire_ctx_cb | Callback for acquiring new session context. |
| [in] | release_ctx_cb | Callback for releasing session context. |
| [in] | ctx_cb_data | Arbitrary user data passed to acquire_ctx_cb and release_ctx_cb. |
| [in] | new_session_cb | Callback called for every established session on the client. |
| [in] | new_session_cb_data | Arbitrary user data passed to new_session_cb. |
| void nc_server_ch_set_dispatch_data | ( | nc_server_ch_session_acquire_ctx_cb | acquire_ctx_cb, |
| nc_server_ch_session_release_ctx_cb | release_ctx_cb, | ||
| void * | ctx_cb_data, | ||
| nc_server_ch_new_session_cb | new_session_cb, | ||
| void * | new_session_cb_data ) |
Set callbacks and their data for Call Home threads.
If set, Call Home threads will be dispatched automatically upon creation of new Call Home clients.
| [in] | acquire_ctx_cb | Callback for acquiring new session context. |
| [in] | release_ctx_cb | Callback for releasing session context. |
| [in] | ctx_cb_data | Arbitrary user data passed to acquire_ctx_cb and release_ctx_cb. |
| [in] | new_session_cb | Callback called for every established Call Home session. |
| [in] | new_session_cb_data | Arbitrary user data passed to new_session_cb. |
| void nc_server_ch_set_new_session_fail_cb | ( | nc_server_ch_new_session_fail_cb | new_session_fail_cb, |
| void * | new_session_fail_cb_data ) |
Set callback for failure of a new CH session creation.
| [in] | new_session_fail_cb | Callback to call for every failed session creation. |
| [in] | new_session_fail_cb_data | Arbitrary user data passed to new_session_fail_cb. |