Loading...
Searching...
No Matches
Server-side Call Home Functions
Server » Server-side Call Home

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

## Detailed Description

Server-side Call Home functions.

## Typedef Documentation

## nc_server_ch_session_acquire_ctx_cb

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.

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 65 of file session_server_ch.h.

## nc_server_ch_session_release_ctx_cb

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.

## nc_server_ch_new_session_cb

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.

## Function Documentation

## nc_server_ch_is_client()

int nc_server_ch_is_client | ( | const char * | name | ) |

Check if a Call Home client exists.

Parameters

  [in] | name | Client name.

Returns
  0 if does not exists, non-zero otherwise.

## nc_server_ch_client_is_endpt()

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.

## nc_connect_ch_client_dispatch()

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

## nc_server_ch_set_dispatch_data()

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