libnetconf2  3.0.17
NETCONF server and client library in C.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Server-side Call Home Functions

Server-side Call Home functions. More...

Collaboration diagram for Server-side Call Home Functions:

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. More...
 
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. More...
 
typedef void(* nc_server_ch_session_release_ctx_cb )(void *cb_data)
 Callback for releasing a locked context for Call Home sessions. More...
 

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. 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...
 

Detailed Description

Server-side Call Home functions.

Typedef Documentation

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_dataArbitrary 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_dataArbitrary 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_nameName of the CH client which established the session.
[in]new_sessionNew established CH session, the pointer is internally discarded afterwards.
[in]user_dataArbitrary 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.

Function Documentation

int nc_server_ch_is_client ( const char *  name)

Check if a Call Home client exists.

Parameters
[in]nameClient name.
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_nameClient name.
[in]endpt_nameEndpoint name.
Returns
0 if does not exists, non-zero otherwise.
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.

Parameters
[in]client_nameExisting client name.
[in]acquire_ctx_cbCallback for acquiring new session context.
[in]release_ctx_cbCallback for releasing session context.
[in]ctx_cb_dataArbitrary user data passed to acquire_ctx_cb and release_ctx_cb.
[in]new_session_cbCallback called for every established session on the client.
[in]new_session_cb_dataArbitrary user data passed to new_session_cb.
Returns
0 if the thread was successfully created, -1 on error.
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.

Parameters
[in]acquire_ctx_cbCallback for acquiring new session context.
[in]release_ctx_cbCallback for releasing session context.
[in]ctx_cb_dataArbitrary user data passed to acquire_ctx_cb and release_ctx_cb.
[in]new_session_cbCallback called for every established Call Home session.
[in]new_session_cb_dataArbitrary user data passed to new_session_cb.