Server-side Call Home functions.
More...
|
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. More...
|
|
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. More...
|
|
int | nc_server_ch_is_client (const char *name) |
| Check if a Call Home client exists. More...
|
|
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. More...
|
|
Server-side Call Home functions.
typedef struct ly_ctx*(* nc_server_ch_session_acquire_ctx_cb)(void *cb_data) |
Callback for getting a locked context for new Call Home sessions.
- Parameters
-
[in] | cb_data | Arbitrary ctx callback data. |
- Returns
- Context for the session to use during its lifetime;
-
NULL on error and session fails to be created.
Definition at line 74 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.
- Parameters
-
[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.
- Parameters
-
[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. |
- Returns
- 0 on success;
-
non-zero on error and
new_session
is freed.
Definition at line 92 of file session_server_ch.h.
int nc_server_ch_is_client |
( |
const char * |
name | ) |
|
Check if a Call Home client exists.
- Parameters
-
- Returns
- 0 if does not exists, non-zero otherwise.
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.
- Parameters
-
[in] | client_name | Client name. |
[in] | endpt_name | Endpoint name. |
- Returns
- 0 if does not exists, non-zero otherwise.
Dispatch a thread connecting to a listening NETCONF client and creating Call Home sessions.
- Parameters
-
[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 . |
- Returns
- 0 if the thread was successfully created, -1 on error.
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.
- Parameters
-
[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 . |