libnetconf2  1.1.48
NETCONF library for clients and servers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
session_server_ch.h
Go to the documentation of this file.
1 
15 #ifndef NC_SESSION_SERVER_CH_H_
16 #define NC_SESSION_SERVER_CH_H_
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 #include <stdint.h>
23 #include <libyang/libyang.h>
24 
25 #include "session.h"
26 #include "netconf.h"
27 
28 #if defined(NC_ENABLED_SSH) || defined(NC_ENABLED_TLS)
29 
44 int nc_server_ch_add_client(const char *name);
45 
52 int nc_server_ch_del_client(const char *name);
53 
60 int nc_server_ch_is_client(const char *name);
61 
70 int nc_server_ch_client_add_endpt(const char *client_name, const char *endpt_name, NC_TRANSPORT_IMPL ti);
71 
82 int nc_server_ch_client_del_endpt(const char *client_name, const char *endpt_name, NC_TRANSPORT_IMPL ti);
83 
91 int nc_server_ch_client_is_endpt(const char *client_name, const char *endpt_name);
92 
103 int nc_server_ch_client_endpt_set_address(const char *client_name, const char *endpt_name, const char *address);
104 
115 int nc_server_ch_client_endpt_set_port(const char *client_name, const char *endpt_name, uint16_t port);
116 
125 int nc_server_ch_client_endpt_enable_keepalives(const char *client_name, const char *endpt_name, int enable);
126 
137 int nc_server_ch_client_endpt_set_keepalives(const char *client_name, const char *endpt_name, int idle_time,
138  int max_probes, int probe_interval);
139 
147 int nc_server_ch_client_set_conn_type(const char *client_name, NC_CH_CONN_TYPE conn_type);
148 
156 int nc_server_ch_client_periodic_set_period(const char *client_name, uint16_t period);
157 
165 int nc_server_ch_client_periodic_set_anchor_time(const char *client_name, time_t anchor_time);
166 
174 int nc_server_ch_client_periodic_set_idle_timeout(const char *client_name, uint16_t idle_timeout);
175 
183 int nc_server_ch_client_set_start_with(const char *client_name, NC_CH_START_WITH start_with);
184 
192 int nc_server_ch_client_set_max_attempts(const char *client_name, uint8_t max_attempts);
193 
202 int nc_connect_ch_client_dispatch(const char *client_name,
203  void (*session_clb)(const char *client_name, struct nc_session *new_session));
204 
207 #endif /* NC_ENABLED_SSH || NC_ENABLED_TLS */
208 
209 #ifdef NC_ENABLED_SSH
210 
229 int nc_server_ssh_ch_client_endpt_add_hostkey(const char *client_name, const char *endpt_name, const char *name, int16_t idx);
230 
240 int nc_server_ssh_ch_client_endpt_del_hostkey(const char *client_name, const char *endpt_name, const char *name, int16_t idx);
241 
251 int nc_server_ssh_ch_client_endpt_mov_hostkey(const char *client_name, const char *endpt_name, const char *key_mov,
252  const char *key_after);
253 
263 int nc_server_ssh_ch_client_endpt_set_auth_methods(const char *client_name, const char *endpt_name, int auth_methods);
264 
272 int nc_server_ssh_ch_client_endpt_get_auth_methods(const char *client_name, const char *endpt_name);
273 
282 int nc_server_ssh_ch_client_endpt_set_auth_attempts(const char *client_name, const char *endpt_name, uint16_t auth_attempts);
283 
292 int nc_server_ssh_ch_client_endpt_set_auth_timeout(const char *client_name, const char *endpt_name, uint16_t auth_timeout);
293 
296 #endif /* NC_ENABLED_SSH */
297 
298 #ifdef NC_ENABLED_TLS
299 
317 int nc_server_tls_ch_client_endpt_set_server_cert(const char *client_name, const char *endpt_name, const char *name);
318 
327 int nc_server_tls_ch_client_endpt_add_trusted_cert_list(const char *client_name, const char *endpt_name, const char *name);
328 
337 int nc_server_tls_ch_client_endpt_del_trusted_cert_list(const char *client_name, const char *endpt_name, const char *name);
338 
352 int nc_server_tls_ch_client_endpt_set_trusted_ca_paths(const char *client_name, const char *endpt_name, const char *ca_file,
353  const char *ca_dir);
354 
366 int nc_server_tls_ch_client_endpt_set_crl_paths(const char *client_name, const char *endpt_name, const char *crl_file,
367  const char *crl_dir);
368 
376 void nc_server_tls_ch_client_endpt_clear_crls(const char *client_name, const char *endpt_name);
377 
393 int nc_server_tls_ch_client_endpt_add_ctn(const char *client_name, const char *endpt_name, uint32_t id,
394  const char *fingerprint, NC_TLS_CTN_MAPTYPE map_type, const char *name);
395 
407 int nc_server_tls_ch_client_endpt_del_ctn(const char *client_name, const char *endpt_name, int64_t id,
408  const char *fingerprint, NC_TLS_CTN_MAPTYPE map_type, const char *name);
409 
425 int nc_server_tls_ch_client_endpt_get_ctn(const char *client_name, const char *endpt_name, uint32_t *id, char **fingerprint,
426  NC_TLS_CTN_MAPTYPE *map_type, char **name);
427 
430 #endif /* NC_ENABLED_TLS */
431 
432 #ifdef __cplusplus
433 }
434 #endif
435 
436 #endif /* NC_SESSION_SERVER_CH_H_ */
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.
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.
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.
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.
int nc_server_ch_add_client(const char *name)
Add a new Call Home client.
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...
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.
libnetconf2 session manipulation
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.
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_TRANSPORT_IMPL
Enumeration of transport implementations (ways how libnetconf implements NETCONF transport protocol) ...
Definition: session.h:68
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.
int nc_server_ch_del_client(const char *name)
Drop any connections, stop connecting and remove a client.
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...
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.
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.
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.
int nc_server_ch_client_periodic_set_period(const char *client_name, uint16_t period)
Set Call Home client periodic connection period for reconnecting.
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_CH_CONN_TYPE
Enumeration of Call Home connection types.
Definition: session.h:84
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.
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.
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...
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.
int nc_server_ch_client_set_conn_type(const char *client_name, NC_CH_CONN_TYPE conn_type)
Set Call Home client connection type.
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...
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_client_add_endpt(const char *client_name, const char *endpt_name, NC_TRANSPORT_IMPL ti)
Add a new Call Home client endpoint.
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.
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.
int nc_server_ch_client_set_max_attempts(const char *client_name, uint8_t max_attempts)
Set Call Home client overall max attempts.
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_TLS_CTN_MAPTYPE
Enumeration of cert-to-name mapping types.
Definition: session.h:42
NC_CH_START_WITH
Enumeration of Call Home client priority policy.
Definition: session.h:93
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.
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...
libnetconf2&#39;s general public functions and structures definitions.
int nc_server_ch_is_client(const char *name)
Check if a Call Home client exists.
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.