Server-side Call Home
Server

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

Collaboration diagram for Server-side Call Home:

## 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_connect_ch_client_dispatch (const char *client_name, int(*session_clb)(const char *client_name, struct nc_session *new_session))
| Establish a Call Home connection with a listening NETCONF client. More...
int | nc_server_ch_add_client (const char *name)
| Add a new Call Home client. 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_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_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_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_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_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_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_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_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_set_max_attempts (const char *client_name, uint8_t max_attempts)
| Set Call Home client overall max attempts. 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_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...

## Detailed Description

Call Home functionality for server-side applications.

## Function Documentation

## nc_connect_ch_client_dispatch()

int nc_connect_ch_client_dispatch | ( | const char * | client_name,
|  | int(*)(const char *client_name, struct nc_session *new_session) | session_clb
| ) |  |

Establish a Call Home connection with a listening NETCONF client.

Parameters

  [in] | client_name | Existing client name.
  [out] | session_clb | Function that is called for every established session on the client. `new_session` pointer is internally discarded afterwards. If the callback returns non-zero, the `new_session` is freed.

Returns
  0 if the thread was successfully created, -1 on error.

## nc_server_ch_add_client()

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

Add a new Call Home client.

Parameters

  [in] | name | Arbitrary unique client name.

Returns
  0 on success, -1 on error.

## nc_server_ch_client_add_endpt()

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_name | Existing client name.
  [in] | endpt_name | Arbitrary unique (within the client) endpoint name.
  [in] | ti | Transport protocol to use.

Returns
  0 on success, -1 on error.

## nc_server_ch_client_del_endpt()

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_name | Existing client name.
  [in] | endpt_name | Existing endpoint of `client_name`. NULL matches all endpoints.
  [in] | ti | Client 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.

## nc_server_ch_client_endpt_enable_keepalives()

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_name | Existing Call Home client name.
  [in] | endpt_name | Existing endpoint name of `client_name`.
  [in] | enable | Whether to enable or disable keepalives.

Returns
  0 on success, -1 on error.

## nc_server_ch_client_endpt_set_address()

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_name | Existing Call Home client name.
  [in] | endpt_name | Existing endpoint name of `client_name`.
  [in] | address | New listening address.

Returns
  0 on success, -1 on error.

## nc_server_ch_client_endpt_set_keepalives()

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_name | Existing Call Home client name.
  [in] | endpt_name | Existing endpoint name of `client_name`.
  [in] | idle_time | Keepalive idle time in seconds, 1 by default, -1 to keep previous value.
  [in] | max_probes | Keepalive max probes sent, 10 by default, -1 to keep previous value.
  [in] | probe_interval | Keepalive probe interval in seconds, 5 by default, -1 to keep previous value.

Returns
  0 on success, -1 on error.

## nc_server_ch_client_endpt_set_port()

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_name | Existing Call Home client name.
  [in] | endpt_name | Existing endpoint name of `client_name`.
  [in] | port | New listening port.

Returns
  0 on success, -1 on error.

## 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_server_ch_client_periodic_set_anchor_time()

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_name | Existing Call Home client name.
  [in] | anchor_time | Call Home periodic connection anchor time for the period.

Returns
  0 on success, -1 on error.

## nc_server_ch_client_periodic_set_idle_timeout()

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_name | Existing Call Home client name.
  [in] | idle_timeout | Call Home periodic idle timeout.

Returns
  0 on success, -1 on error.

## nc_server_ch_client_periodic_set_period()

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_name | Existing Call Home client name.
  [in] | period | Call Home periodic connection period in minutes.

Returns
  0 on success, -1 on error.

## nc_server_ch_client_set_conn_type()

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_name | Existing Call Home client name.
  [in] | conn_type | Call Home connection type.

Returns
  0 on success, -1 on error.

## nc_server_ch_client_set_max_attempts()

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_name | Existing Call Home client name.
  [in] | max_attempts | Call Home overall max reconnect attempts.

Returns
  0 on success, -1 on error.

## nc_server_ch_client_set_start_with()

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_name | Existing Call Home client name.
  [in] | start_with | Call Home client start-with.

Returns
  0 on success, -1 on error.

## nc_server_ch_del_client()

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

Drop any connections, stop connecting and remove a client.

Parameters

  [in] | name | Client name. NULL matches all the clients.

Returns
  0 on success, -1 on not finding any match.

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