libnetconf2  4.7.5
NETCONF server and client library in C.
server_config.h
Go to the documentation of this file.
1 
17 #ifndef NC_CONFIG_SERVER_H_
18 #define NC_CONFIG_SERVER_H_
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 #include <stdarg.h>
25 #include <stdint.h>
26 
27 #include <libyang/libyang.h>
28 
29 #include "session.h"
30 
71 int nc_server_config_load_modules(struct ly_ctx **ctx);
72 
85 int nc_server_config_setup_diff(const struct lyd_node *diff);
86 
101 int nc_server_config_setup_data(const struct lyd_node *data);
102 
114 int nc_server_config_setup_path(const struct ly_ctx *ctx, const char *path);
115 
116 #if defined (NC_SSH) || defined (NC_TLS)
117 
131 int nc_server_config_add_address_port(const struct ly_ctx *ctx, const char *endpt_name, NC_TRANSPORT_IMPL transport,
132  const char *address, uint16_t port, struct lyd_node **config);
133 
148 int nc_server_config_add_keystore_asym_key(const struct ly_ctx *ctx, NC_TRANSPORT_IMPL ti, const char *asym_key_name,
149  const char *privkey_path, const char *pubkey_path, struct lyd_node **config);
150 
159 int nc_server_config_del_keystore_asym_key(const char *asym_key_name, struct lyd_node **config);
160 
177 int nc_server_config_add_keystore_cert(const struct ly_ctx *ctx, const char *asym_key_name, const char *cert_name,
178  const char *cert_path, struct lyd_node **config);
179 
190 int nc_server_config_del_keystore_cert(const char *asym_key_name, const char *cert_name, struct lyd_node **config);
191 
206 int nc_server_config_add_truststore_pubkey(const struct ly_ctx *ctx, const char *pub_bag_name, const char *pubkey_name,
207  const char *pubkey_path, struct lyd_node **config);
208 
218 int nc_server_config_del_truststore_pubkey(const char *pub_bag_name, const char *pubkey_name, struct lyd_node **config);
219 
234 int nc_server_config_add_truststore_cert(const struct ly_ctx *ctx, const char *cert_bag_name, const char *cert_name,
235  const char *cert_path, struct lyd_node **config);
236 
246 int nc_server_config_del_truststore_cert(const char *cert_bag_name, const char *cert_name, struct lyd_node **config);
247 
248 #endif /* NC_SSH or NC_TLS */
249 
261 int nc_server_config_del_endpt(const char *endpt_name, struct lyd_node **config);
262 
282 int nc_server_config_add_unix_socket(const struct ly_ctx *ctx, const char *endpt_name, const char *path,
283  const char *mode, const char *owner, const char *group, struct lyd_node **config);
284 
313 int nc_server_config_add_unix_user_mapping(const struct ly_ctx *ctx, const char *endpt_name,
314  const char *system_user, const char *netconf_user, struct lyd_node **config);
315 
325 int nc_server_config_del_unix_user_mapping(const char *endpt_name, const char *system_user,
326  struct lyd_node **config);
327 
328 #ifdef NC_SSH
329 
340 int nc_server_config_oper_get_supported_ssh_algs(const struct ly_ctx *ctx, struct lyd_node **supported_algs);
341 
351 int nc_server_config_oper_get_user_password_last_modified(const char *ch_client, const char *endpoint,
352  const char *username, time_t *last_modified);
353 
366 int nc_server_config_hash_password(const char *crypt_hash, char **hashed_password);
367 
368 #endif /* NC_SSH */
369 
370 #ifdef NC_TLS
371 
381 int nc_server_config_oper_get_supported_tls_algs(const struct ly_ctx *ctx, struct lyd_node **supported_algs);
382 
383 #endif /* NC_TLS */
384 
389 #if defined (NC_SSH) || defined (NC_TLS)
390 
426 int nc_server_config_add_ch_address_port(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
427  NC_TRANSPORT_IMPL transport, const char *address, const char *port, struct lyd_node **config);
428 
440 int nc_server_config_del_ch_client(const char *client_name, struct lyd_node **config);
441 
454 int nc_server_config_del_ch_endpt(const char *client_name, const char *endpt_name, struct lyd_node **config);
455 
468 int nc_server_config_add_ch_persistent(const struct ly_ctx *ctx, const char *client_name, struct lyd_node **config);
469 
483 int nc_server_config_add_ch_period(const struct ly_ctx *ctx, const char *client_name, uint16_t period,
484  struct lyd_node **config);
485 
495 int nc_server_config_del_ch_period(const char *client_name, struct lyd_node **config);
496 
510 int nc_server_config_add_ch_anchor_time(const struct ly_ctx *ctx, const char *client_name,
511  const char *anchor_time, struct lyd_node **config);
512 
520 int nc_server_config_del_ch_anchor_time(const char *client_name, struct lyd_node **config);
521 
535 int nc_server_config_add_ch_idle_timeout(const struct ly_ctx *ctx, const char *client_name,
536  uint16_t idle_timeout, struct lyd_node **config);
537 
547 int nc_server_config_del_ch_idle_timeout(const char *client_name, struct lyd_node **config);
548 
562 int nc_server_config_add_ch_reconnect_strategy(const struct ly_ctx *ctx, const char *client_name,
563  NC_CH_START_WITH start_with, uint16_t max_wait, uint8_t max_attempts, struct lyd_node **config);
564 
574 int nc_server_config_del_ch_reconnect_strategy(const char *client_name, struct lyd_node **config);
575 
580 #endif /* NC_SSH or NC_TLS */
581 
582 #ifdef __cplusplus
583 }
584 #endif
585 
586 #endif /* NC_CONFIG_SERVER_H_ */
int nc_server_config_add_ch_address_port(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name, NC_TRANSPORT_IMPL transport, const char *address, const char *port, struct lyd_node **config)
Creates new YANG configuration data nodes for a Call Home client's address and port.
int nc_server_config_add_ch_persistent(const struct ly_ctx *ctx, const char *client_name, struct lyd_node **config)
Creates new YANG configuration data nodes for the Call Home persistent connection type.
int nc_server_config_add_ch_anchor_time(const struct ly_ctx *ctx, const char *client_name, const char *anchor_time, struct lyd_node **config)
Creates new YANG configuration data nodes for the anchor time parameter of the Call Home periodic con...
int nc_server_config_add_ch_period(const struct ly_ctx *ctx, const char *client_name, uint16_t period, struct lyd_node **config)
Creates new YANG configuration data nodes for the period parameter of the Call Home periodic connecti...
int nc_server_config_del_ch_idle_timeout(const char *client_name, struct lyd_node **config)
Deletes the Call Home idle timeout parameter of the periodic connection type from the YANG data.
int nc_server_config_del_ch_anchor_time(const char *client_name, struct lyd_node **config)
Deletes the Call Home anchor time parameter of the periodic connection type from the YANG data.
int nc_server_config_del_ch_endpt(const char *client_name, const char *endpt_name, struct lyd_node **config)
Deletes a Call Home endpoint from the YANG data.
int nc_server_config_del_ch_client(const char *client_name, struct lyd_node **config)
Deletes a Call Home client from the YANG data.
int nc_server_config_del_ch_reconnect_strategy(const char *client_name, struct lyd_node **config)
Resets the values of the Call Home reconnect strategy nodes to their defaults.
int nc_server_config_add_ch_reconnect_strategy(const struct ly_ctx *ctx, const char *client_name, NC_CH_START_WITH start_with, uint16_t max_wait, uint8_t max_attempts, struct lyd_node **config)
Creates new YANG configuration data nodes for the Call Home reconnect strategy.
int nc_server_config_del_ch_period(const char *client_name, struct lyd_node **config)
Deletes the Call Home period parameter of the periodic connection type from the YANG data.
int nc_server_config_add_ch_idle_timeout(const struct ly_ctx *ctx, const char *client_name, uint16_t idle_timeout, struct lyd_node **config)
Creates new YANG configuration data nodes for the idle timeout parameter of the Call Home periodic co...
int nc_server_config_oper_get_supported_tls_algs(const struct ly_ctx *ctx, struct lyd_node **supported_algs)
Gets all the TLS transport cipher suites supported by the server.
int nc_server_config_del_unix_user_mapping(const char *endpt_name, const char *system_user, struct lyd_node **config)
Deletes a UNIX username mapping from the YANG data.
int nc_server_config_add_address_port(const struct ly_ctx *ctx, const char *endpt_name, NC_TRANSPORT_IMPL transport, const char *address, uint16_t port, struct lyd_node **config)
Creates new YANG configuration data nodes for address and port.
int nc_server_config_del_truststore_pubkey(const char *pub_bag_name, const char *pubkey_name, struct lyd_node **config)
Deletes a truststore's public key from the YANG data.
int nc_server_config_del_keystore_asym_key(const char *asym_key_name, struct lyd_node **config)
Deletes a keystore's asymmetric key from the YANG data.
int nc_server_config_load_modules(struct ly_ctx **ctx)
Implements all the required modules and their features in the context. Needs to be called before any ...
int nc_server_config_add_unix_user_mapping(const struct ly_ctx *ctx, const char *endpt_name, const char *system_user, const char *netconf_user, struct lyd_node **config)
Creates new YANG data nodes for a UNIX username mapping.
int nc_server_config_del_endpt(const char *endpt_name, struct lyd_node **config)
Deletes an endpoint from the YANG data.
int nc_server_config_del_keystore_cert(const char *asym_key_name, const char *cert_name, struct lyd_node **config)
Deletes a keystore's certificate from the YANG data.
int nc_server_config_add_unix_socket(const struct ly_ctx *ctx, const char *endpt_name, const char *path, const char *mode, const char *owner, const char *group, struct lyd_node **config)
Creates new YANG data nodes for a UNIX socket endpoint.
int nc_server_config_oper_get_supported_ssh_algs(const struct ly_ctx *ctx, struct lyd_node **supported_algs)
Gets all the SSH transport algorithms supported by the server.
int nc_server_config_setup_diff(const struct lyd_node *diff)
Configure server based on the given diff.
int nc_server_config_hash_password(const char *crypt_hash, char **hashed_password)
Hashes a clear-text 'iana-crypt-hash' password the way the server stores it in its configuration.
int nc_server_config_add_truststore_cert(const struct ly_ctx *ctx, const char *cert_bag_name, const char *cert_name, const char *cert_path, struct lyd_node **config)
Creates new YANG data nodes for a certificate in the truststore.
int nc_server_config_del_truststore_cert(const char *cert_bag_name, const char *cert_name, struct lyd_node **config)
Deletes a truststore's certificate from the YANG data.
int nc_server_config_add_keystore_cert(const struct ly_ctx *ctx, const char *asym_key_name, const char *cert_name, const char *cert_path, struct lyd_node **config)
Creates new YANG data nodes for a certificate in the keystore.
int nc_server_config_oper_get_user_password_last_modified(const char *ch_client, const char *endpoint, const char *username, time_t *last_modified)
Gets the last modified time of an SSH user's password.
int nc_server_config_setup_data(const struct lyd_node *data)
Configure server based on the given data.
int nc_server_config_add_keystore_asym_key(const struct ly_ctx *ctx, NC_TRANSPORT_IMPL ti, const char *asym_key_name, const char *privkey_path, const char *pubkey_path, struct lyd_node **config)
Creates new YANG data nodes for an asymmetric key in the keystore.
int nc_server_config_setup_path(const struct ly_ctx *ctx, const char *path)
Configure server based on the given data stored in a file.
int nc_server_config_add_truststore_pubkey(const struct ly_ctx *ctx, const char *pub_bag_name, const char *pubkey_name, const char *pubkey_path, struct lyd_node **config)
Creates new YANG data nodes for a public key in the truststore.
libnetconf2 session manipulation
NC_CH_START_WITH
Enumeration of Call Home client priority policy.
Definition: session.h:109
NC_TRANSPORT_IMPL
Enumeration of transport implementations (ways how libnetconf implements NETCONF transport protocol)
Definition: session.h:83