libnetconf2  1.1.48
NETCONF library for clients and servers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Server-side Call Home

Call Home functionality for server-side applications. More...

Modules

 Server-side Call Home on SSH
 SSH settings for the Call Home functionality.
 
 Server-side Call Home on TLS
 TLS settings for the Call Home functionality.
 

Functions

int nc_server_ch_add_client (const char *name)
 Add a new Call Home client. More...
 
int nc_server_ch_del_client (const char *name)
 Drop any connections, stop connecting and remove a client. More...
 
int nc_server_ch_is_client (const char *name)
 Check if a Call Home client exists. More...
 
int nc_server_ch_client_add_endpt (const char *client_name, const char *endpt_name, NC_TRANSPORT_IMPL ti)
 Add a new Call Home client endpoint. More...
 
int nc_server_ch_client_del_endpt (const char *client_name, const char *endpt_name, NC_TRANSPORT_IMPL ti)
 Remove a Call Home client endpoint. 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_client_endpt_set_address (const char *client_name, const char *endpt_name, const char *address)
 Change Call Home client endpoint listening address. More...
 
int nc_server_ch_client_endpt_set_port (const char *client_name, const char *endpt_name, uint16_t port)
 Change Call Home client endpoint listening port. More...
 
int nc_server_ch_client_endpt_enable_keepalives (const char *client_name, const char *endpt_name, int enable)
 Change Call Home client endpoint keepalives state. Affects only new connections. More...
 
int nc_server_ch_client_endpt_set_keepalives (const char *client_name, const char *endpt_name, int idle_time, int max_probes, int probe_interval)
 Change Call Home client endpoint keepalives parameters. Affects only new connections. More...
 
int nc_server_ch_client_set_conn_type (const char *client_name, NC_CH_CONN_TYPE conn_type)
 Set Call Home client connection type. More...
 
int nc_server_ch_client_periodic_set_period (const char *client_name, uint16_t period)
 Set Call Home client periodic connection period for reconnecting. More...
 
int nc_server_ch_client_periodic_set_anchor_time (const char *client_name, time_t anchor_time)
 Set Call Home client periodic connection period anchor time. More...
 
int nc_server_ch_client_periodic_set_idle_timeout (const char *client_name, uint16_t idle_timeout)
 Set Call Home client periodic connection idle timeout. More...
 
int nc_server_ch_client_set_start_with (const char *client_name, NC_CH_START_WITH start_with)
 Set Call Home client start-with policy. More...
 
int nc_server_ch_client_set_max_attempts (const char *client_name, uint8_t max_attempts)
 Set Call Home client overall max attempts. More...
 
int nc_connect_ch_client_dispatch (const char *client_name, void(*session_clb)(const char *client_name, struct nc_session *new_session))
 Establish a Call Home connection with a listening NETCONF client. More...
 

Detailed Description

Call Home functionality for server-side applications.

Function Documentation

int nc_server_ch_add_client ( const char *  name)

Add a new Call Home client.

Parameters
[in]nameArbitrary unique client name.
Returns
0 on success, -1 on error.
int nc_server_ch_del_client ( const char *  name)

Drop any connections, stop connecting and remove a client.

Parameters
[in]nameClient name. NULL matches all the clients.
Returns
0 on success, -1 on not finding any match.
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_add_endpt ( const char *  client_name,
const char *  endpt_name,
NC_TRANSPORT_IMPL  ti 
)

Add a new Call Home client endpoint.

Parameters
[in]client_nameExisting client name.
[in]endpt_nameArbitrary unique (within the client) endpoint name.
[in]tiTransport protocol to use.
Returns
0 on success, -1 on error.
int nc_server_ch_client_del_endpt ( const char *  client_name,
const char *  endpt_name,
NC_TRANSPORT_IMPL  ti 
)

Remove a Call Home client endpoint.

Parameters
[in]client_nameExisting client name.
[in]endpt_nameExisting endpoint of client_name. NULL matches all endpoints.
[in]tiClient transport protocol. NULL matches any protocol. Redundant to set if endpt_name is set, client names are unique disregarding their protocol.
Returns
0 on success, -1 on error.
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_server_ch_client_endpt_set_address ( const char *  client_name,
const char *  endpt_name,
const char *  address 
)

Change Call Home client endpoint listening address.

On error the previous listening socket (if any) is left untouched.

Parameters
[in]client_nameExisting Call Home client name.
[in]endpt_nameExisting endpoint name of client_name.
[in]addressNew listening address.
Returns
0 on success, -1 on error.
int nc_server_ch_client_endpt_set_port ( const char *  client_name,
const char *  endpt_name,
uint16_t  port 
)

Change Call Home client endpoint listening port.

On error the previous listening socket (if any) is left untouched.

Parameters
[in]client_nameExisting Call Home client name.
[in]endpt_nameExisting endpoint name of client_name.
[in]portNew listening port.
Returns
0 on success, -1 on error.
int nc_server_ch_client_endpt_enable_keepalives ( const char *  client_name,
const char *  endpt_name,
int  enable 
)

Change Call Home client endpoint keepalives state. Affects only new connections.

Parameters
[in]client_nameExisting Call Home client name.
[in]endpt_nameExisting endpoint name of client_name.
[in]enableWhether to enable or disable keepalives.
Returns
0 on success, -1 on error.
int nc_server_ch_client_endpt_set_keepalives ( const char *  client_name,
const char *  endpt_name,
int  idle_time,
int  max_probes,
int  probe_interval 
)

Change Call Home client endpoint keepalives parameters. Affects only new connections.

Parameters
[in]client_nameExisting Call Home client name.
[in]endpt_nameExisting endpoint name of client_name.
[in]idle_timeKeepalive idle time in seconds, 1 by default, -1 to keep previous value.
[in]max_probesKeepalive max probes sent, 10 by default, -1 to keep previous value.
[in]probe_intervalKeepalive probe interval in seconds, 5 by default, -1 to keep previous value.
Returns
0 on success, -1 on error.
int nc_server_ch_client_set_conn_type ( const char *  client_name,
NC_CH_CONN_TYPE  conn_type 
)

Set Call Home client connection type.

Parameters
[in]client_nameExisting Call Home client name.
[in]conn_typeCall Home connection type.
Returns
0 on success, -1 on error.
int nc_server_ch_client_periodic_set_period ( const char *  client_name,
uint16_t  period 
)

Set Call Home client periodic connection period for reconnecting.

Parameters
[in]client_nameExisting Call Home client name.
[in]periodCall Home periodic connection period in minutes.
Returns
0 on success, -1 on error.
int nc_server_ch_client_periodic_set_anchor_time ( const char *  client_name,
time_t  anchor_time 
)

Set Call Home client periodic connection period anchor time.

Parameters
[in]client_nameExisting Call Home client name.
[in]anchor_timeCall Home periodic connection anchor time for the period.
Returns
0 on success, -1 on error.
int nc_server_ch_client_periodic_set_idle_timeout ( const char *  client_name,
uint16_t  idle_timeout 
)

Set Call Home client periodic connection idle timeout.

Parameters
[in]client_nameExisting Call Home client name.
[in]idle_timeoutCall Home periodic idle timeout.
Returns
0 on success, -1 on error.
int nc_server_ch_client_set_start_with ( const char *  client_name,
NC_CH_START_WITH  start_with 
)

Set Call Home client start-with policy.

Parameters
[in]client_nameExisting Call Home client name.
[in]start_withCall Home client start-with.
Returns
0 on success, -1 on error.
int nc_server_ch_client_set_max_attempts ( const char *  client_name,
uint8_t  max_attempts 
)

Set Call Home client overall max attempts.

Parameters
[in]client_nameExisting Call Home client name.
[in]max_attemptsCall Home overall max reconnect attempts.
Returns
0 on success, -1 on error.
int nc_connect_ch_client_dispatch ( const char *  client_name,
void(*)(const char *client_name, struct nc_session *new_session)  session_clb 
)

Establish a Call Home connection with a listening NETCONF client.

Parameters
[in]client_nameExisting client name.
[out]session_clbFunction that is called for every established session on the client. new_session pointer is internally discarded afterwards.
Returns
0 if the thread was successfully created, -1 on error.