session_server_ch.h
Go to the documentation of this file.
#ifndef NC_SESSION_SERVER_CH_H_
#define NC_SESSION_SERVER_CH_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <libyang/libyang.h>
#include <stdint.h>
#include "netconf.h"
#include "session.h"
#if defined (NC_ENABLED_SSH) || defined (NC_ENABLED_TLS)
int nc_server_ch_add_client(const char *name);
int nc_server_ch_del_client(const char *name);
int nc_server_ch_is_client(const char *name);
int nc_server_ch_client_add_endpt(const char *client_name, const char *endpt_name, NC_TRANSPORT_IMPL ti);
int nc_server_ch_client_del_endpt(const char *client_name, const char *endpt_name, NC_TRANSPORT_IMPL ti);
int nc_server_ch_client_is_endpt(const char *client_name, const char *endpt_name);
int nc_server_ch_client_endpt_set_address(const char *client_name, const char *endpt_name, const char *address);
int nc_server_ch_client_endpt_set_port(const char *client_name, const char *endpt_name, uint16_t port);
int nc_server_ch_client_endpt_enable_keepalives(const char *client_name, const char *endpt_name, int enable);
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);
int nc_server_ch_client_set_conn_type(const char *client_name, NC_CH_CONN_TYPE conn_type);
int nc_server_ch_client_periodic_set_period(const char *client_name, uint16_t period);
int nc_server_ch_client_periodic_set_anchor_time(const char *client_name, time_t anchor_time);
int nc_server_ch_client_periodic_set_idle_timeout(const char *client_name, uint16_t idle_timeout);
int nc_server_ch_client_set_start_with(const char *client_name, NC_CH_START_WITH start_with);
int nc_server_ch_client_set_max_attempts(const char *client_name, uint8_t max_attempts);
int nc_connect_ch_client_dispatch(const char *client_name,
int (*session_clb)(const char *client_name, struct nc_session *new_session));
#endif /* NC_ENABLED_SSH || NC_ENABLED_TLS */
#ifdef NC_ENABLED_SSH
int nc_server_ssh_ch_client_endpt_add_hostkey(const char *client_name, const char *endpt_name, const char *name, int16_t idx);
int nc_server_ssh_ch_client_endpt_del_hostkey(const char *client_name, const char *endpt_name, const char *name, int16_t idx);
int nc_server_ssh_ch_client_endpt_mov_hostkey(const char *client_name, const char *endpt_name, const char *key_mov,
const char *key_after);
int nc_server_ssh_ch_client_endpt_set_auth_methods(const char *client_name, const char *endpt_name, int auth_methods);
int nc_server_ssh_ch_client_endpt_get_auth_methods(const char *client_name, const char *endpt_name);
int nc_server_ssh_ch_client_endpt_set_auth_attempts(const char *client_name, const char *endpt_name, uint16_t auth_attempts);
int nc_server_ssh_ch_client_endpt_set_auth_timeout(const char *client_name, const char *endpt_name, uint16_t auth_timeout);
#endif /* NC_ENABLED_SSH */
#ifdef NC_ENABLED_TLS
int nc_server_tls_ch_client_endpt_set_server_cert(const char *client_name, const char *endpt_name, const char *name);
int nc_server_tls_ch_client_endpt_add_trusted_cert_list(const char *client_name, const char *endpt_name, const char *name);
int nc_server_tls_ch_client_endpt_del_trusted_cert_list(const char *client_name, const char *endpt_name, const char *name);
int nc_server_tls_ch_client_endpt_set_trusted_ca_paths(const char *client_name, const char *endpt_name, const char *ca_file,
const char *ca_dir);
int nc_server_tls_ch_client_endpt_set_crl_paths(const char *client_name, const char *endpt_name, const char *crl_file,
const char *crl_dir);
void nc_server_tls_ch_client_endpt_clear_crls(const char *client_name, const char *endpt_name);
int nc_server_tls_ch_client_endpt_add_ctn(const char *client_name, const char *endpt_name, uint32_t id,
const char *fingerprint, NC_TLS_CTN_MAPTYPE map_type, const char *name);
int nc_server_tls_ch_client_endpt_del_ctn(const char *client_name, const char *endpt_name, int64_t id,
const char *fingerprint, NC_TLS_CTN_MAPTYPE map_type, const char *name);
int nc_server_tls_ch_client_endpt_get_ctn(const char *client_name, const char *endpt_name, uint32_t *id, char **fingerprint,
NC_TLS_CTN_MAPTYPE *map_type, char **name);
#endif /* NC_ENABLED_TLS */
#ifdef __cplusplus
}
#endif
#endif /* NC_SESSION_SERVER_CH_H_ */
nc_server_ssh_ch_client_endpt_set_auth_methods
int nc_server_ssh_ch_client_endpt_set_auth_methods(const char *client_name, const char *endpt_name, int auth_methods)
Set accepted Call Home SSH authentication methods. All (publickey, password, interactive) are support...
nc_server_ssh_ch_client_endpt_set_auth_timeout
int nc_server_ssh_ch_client_endpt_set_auth_timeout(const char *client_name, const char *endpt_name, uint16_t auth_timeout)
Set Call Home SSH authentication timeout. 30 seconds by default.
nc_server_ssh_ch_client_endpt_set_auth_attempts
int nc_server_ssh_ch_client_endpt_set_auth_attempts(const char *client_name, const char *endpt_name, uint16_t auth_attempts)
Set Call Home SSH authentication attempts of every client. 3 by default.
nc_server_ssh_ch_client_endpt_del_hostkey
int nc_server_ssh_ch_client_endpt_del_hostkey(const char *client_name, const char *endpt_name, const char *name, int16_t idx)
Delete Call Home SSH host keys. Their order is preserved.
nc_server_ssh_ch_client_endpt_mov_hostkey
int nc_server_ssh_ch_client_endpt_mov_hostkey(const char *client_name, const char *endpt_name, const char *key_mov, const char *key_after)
Move Call Home SSH host key.
nc_server_ssh_ch_client_endpt_get_auth_methods
int nc_server_ssh_ch_client_endpt_get_auth_methods(const char *client_name, const char *endpt_name)
Get accepted Call Home SSH authentication methods.
nc_server_ssh_ch_client_endpt_add_hostkey
int nc_server_ssh_ch_client_endpt_add_hostkey(const char *client_name, const char *endpt_name, const char *name, int16_t idx)
Add Call Home SSH host keys the server will identify itself with. Only the name is set,...
nc_server_tls_ch_client_endpt_set_crl_paths
int nc_server_tls_ch_client_endpt_set_crl_paths(const char *client_name, const char *endpt_name, const char *crl_file, const char *crl_dir)
Set Call Home Certificate Revocation List locations. There can only be one file and one directory,...
nc_server_tls_ch_client_endpt_set_server_cert
int nc_server_tls_ch_client_endpt_set_server_cert(const char *client_name, const char *endpt_name, const char *name)
Set the server Call Home TLS certificate. Only the name is set, the certificate itself wil be retriev...
nc_server_tls_ch_client_endpt_set_trusted_ca_paths
int nc_server_tls_ch_client_endpt_set_trusted_ca_paths(const char *client_name, const char *endpt_name, const char *ca_file, const char *ca_dir)
Set trusted Call Home Certificate Authority certificate locations. There can only be one file and one...
nc_server_tls_ch_client_endpt_add_ctn
int nc_server_tls_ch_client_endpt_add_ctn(const char *client_name, const char *endpt_name, uint32_t id, const char *fingerprint, NC_TLS_CTN_MAPTYPE map_type, const char *name)
Add a cert-to-name entry.
nc_server_tls_ch_client_endpt_del_trusted_cert_list
int nc_server_tls_ch_client_endpt_del_trusted_cert_list(const char *client_name, const char *endpt_name, const char *name)
Remove a set Call Home trusted certificate list. CRLs and CTN entries are not affected.
nc_server_tls_ch_client_endpt_del_ctn
int nc_server_tls_ch_client_endpt_del_ctn(const char *client_name, const char *endpt_name, int64_t id, const char *fingerprint, NC_TLS_CTN_MAPTYPE map_type, const char *name)
Remove a Call Home cert-to-name entry.
nc_server_tls_ch_client_endpt_add_trusted_cert_list
int nc_server_tls_ch_client_endpt_add_trusted_cert_list(const char *client_name, const char *endpt_name, const char *name)
Add a Call Home trusted certificate list. Can be both a CA or a client one.
nc_server_tls_ch_client_endpt_get_ctn
int nc_server_tls_ch_client_endpt_get_ctn(const char *client_name, const char *endpt_name, uint32_t *id, char **fingerprint, NC_TLS_CTN_MAPTYPE *map_type, char **name)
Get a Call Home cert-to-name entry.
nc_server_tls_ch_client_endpt_clear_crls
void nc_server_tls_ch_client_endpt_clear_crls(const char *client_name, const char *endpt_name)
Destroy and clean Call Home CRLs. Call Home certificates, private keys, and CTN entries are not affec...
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.
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.
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.
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.
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.
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.
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.
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.
nc_connect_ch_client_dispatch
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.
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.
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.
nc_server_ch_del_client
int nc_server_ch_del_client(const char *name)
Drop any connections, stop connecting and remove a client.
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.
nc_server_ch_add_client
int nc_server_ch_add_client(const char *name)
Add a new Call Home client.
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.
nc_server_ch_is_client
int nc_server_ch_is_client(const char *name)
Check if a Call Home client exists.
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.
netconf.h
libnetconf2's general public functions and structures definitions.
session.h
libnetconf2 session manipulation
NC_TLS_CTN_MAPTYPE
NC_TLS_CTN_MAPTYPE
Enumeration of cert-to-name mapping types.
Definition: session.h:42
NC_CH_START_WITH
NC_CH_START_WITH
Enumeration of Call Home client priority policy.
Definition: session.h:93
NC_CH_CONN_TYPE
NC_CH_CONN_TYPE
Enumeration of Call Home connection types.
Definition: session.h:84
NC_TRANSPORT_IMPL
NC_TRANSPORT_IMPL
Enumeration of transport implementations (ways how libnetconf implements NETCONF transport protocol)
Definition: session.h:68