roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 1 | /** |
roman | e028ef9 | 2023-02-24 16:33:08 +0100 | [diff] [blame] | 2 | * @file server_config.h |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 3 | * @author Roman Janota <janota@cesnet.cz> |
| 4 | * @brief libnetconf2 server configuration |
| 5 | * |
| 6 | * @copyright |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 7 | * Copyright (c) 2023 CESNET, z.s.p.o. |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 8 | * |
| 9 | * This source code is licensed under BSD 3-Clause License (the "License"). |
| 10 | * You may not use this file except in compliance with the License. |
| 11 | * You may obtain a copy of the License at |
| 12 | * |
| 13 | * https://opensource.org/licenses/BSD-3-Clause |
| 14 | */ |
| 15 | |
| 16 | #ifndef NC_CONFIG_SERVER_H_ |
| 17 | #define NC_CONFIG_SERVER_H_ |
| 18 | |
| 19 | #ifdef __cplusplus |
| 20 | extern "C" { |
| 21 | #endif |
| 22 | |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 23 | #include <stdarg.h> |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 24 | #include <stdint.h> |
| 25 | |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 26 | #include <libyang/libyang.h> |
| 27 | |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 28 | #include "session.h" |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 29 | |
| 30 | /** |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 31 | * @defgroup server_config Server Configuration |
| 32 | * @ingroup server |
| 33 | * |
| 34 | * @brief Server-side configuration creation and application |
| 35 | * @{ |
| 36 | */ |
| 37 | |
| 38 | /** |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 39 | * @} Server Configuration |
| 40 | */ |
| 41 | |
| 42 | /** |
| 43 | * @defgroup server_config_functions Server Configuration Functions |
| 44 | * @ingroup server_config |
| 45 | * |
| 46 | * @brief Server-side configuration functions |
| 47 | * @{ |
| 48 | */ |
| 49 | |
| 50 | /** |
| 51 | * @brief Implements all the required modules and their features in the context. |
| 52 | * Needs to be called before any other configuration functions. |
| 53 | * |
| 54 | * If ctx is : |
| 55 | * - NULL: a new context will be created and if the call is successful you have to free it, |
| 56 | * - non NULL: modules will simply be implemented. |
| 57 | * |
| 58 | * Implemented modules: ietf-netconf-server, ietf-x509-cert-to-name, ietf-crypto-types, |
| 59 | * ietf-tcp-common, ietf-ssh-common, iana-ssh-encryption-algs, iana-ssh-key-exchange-algs, |
| 60 | * iana-ssh-mac-algs, iana-ssh-public-key-algs, ietf-keystore, ietf-ssh-server, ietf-truststore, |
| 61 | * ietf-tls-server and libnetconf2-netconf-server. |
| 62 | * |
roman | 6430c15 | 2023-10-12 11:28:47 +0200 | [diff] [blame] | 63 | * @param[in, out] ctx Optional context in which the modules will be implemented. Created if *ctx is null. |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 64 | * @return 0 on success, 1 on error. |
| 65 | */ |
| 66 | int nc_server_config_load_modules(struct ly_ctx **ctx); |
| 67 | |
| 68 | /** |
roman | 6430c15 | 2023-10-12 11:28:47 +0200 | [diff] [blame] | 69 | * @brief Configure server based on the given diff. |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 70 | * |
roman | 6430c15 | 2023-10-12 11:28:47 +0200 | [diff] [blame] | 71 | * Context must already have implemented the required modules, see ::nc_server_config_load_modules(). |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 72 | * |
roman | 6430c15 | 2023-10-12 11:28:47 +0200 | [diff] [blame] | 73 | * @param[in] diff YANG diff belonging to either ietf-netconf-server, ietf-keystore or ietf-truststore modules. |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 74 | * The top level node HAS to have an operation (create, replace, delete or none). |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 75 | * @return 0 on success, 1 on error. |
| 76 | */ |
roman | f6f37a5 | 2023-05-25 14:27:51 +0200 | [diff] [blame] | 77 | int nc_server_config_setup_diff(const struct lyd_node *diff); |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 78 | |
| 79 | /** |
roman | f02273a | 2023-05-25 09:44:11 +0200 | [diff] [blame] | 80 | * @brief Configure server based on the given data. |
| 81 | * |
roman | f02273a | 2023-05-25 09:44:11 +0200 | [diff] [blame] | 82 | * Behaves as if all the nodes in data had the replace operation. That means that the current configuration will be deleted |
roman | 6430c15 | 2023-10-12 11:28:47 +0200 | [diff] [blame] | 83 | * and just the given data will be applied. |
roman | 0f5fa42 | 2023-08-07 09:03:24 +0200 | [diff] [blame] | 84 | * Context must already have implemented the required modules, see ::nc_server_config_load_modules(). |
roman | f02273a | 2023-05-25 09:44:11 +0200 | [diff] [blame] | 85 | * |
roman | 6430c15 | 2023-10-12 11:28:47 +0200 | [diff] [blame] | 86 | * @param[in] data YANG data belonging to either ietf-netconf-server, ietf-keystore or ietf-truststore modules. |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 87 | * This data __must be valid__. No node can have an operation attribute. |
roman | f02273a | 2023-05-25 09:44:11 +0200 | [diff] [blame] | 88 | * @return 0 on success, 1 on error. |
| 89 | */ |
roman | f6f37a5 | 2023-05-25 14:27:51 +0200 | [diff] [blame] | 90 | int nc_server_config_setup_data(const struct lyd_node *data); |
roman | f02273a | 2023-05-25 09:44:11 +0200 | [diff] [blame] | 91 | |
| 92 | /** |
roman | 6430c15 | 2023-10-12 11:28:47 +0200 | [diff] [blame] | 93 | * @brief Configure server based on the given data stored in a file. |
| 94 | * |
roman | 0f5fa42 | 2023-08-07 09:03:24 +0200 | [diff] [blame] | 95 | * Wrapper around ::nc_server_config_setup_data() hiding work with parsing the data. |
roman | 6430c15 | 2023-10-12 11:28:47 +0200 | [diff] [blame] | 96 | * Context must already have implemented the required modules, see ::nc_server_config_load_modules(). |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 97 | * |
| 98 | * @param[in] ctx libyang context. |
roman | 6430c15 | 2023-10-12 11:28:47 +0200 | [diff] [blame] | 99 | * @param[in] path Path to a file with ietf-netconf-server, ietf-keystore or ietf-truststore YANG data. |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 100 | * This data __must be valid__. No node can have an operation attribute. |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 101 | * @return 0 on success, 1 on error. |
| 102 | */ |
| 103 | int nc_server_config_setup_path(const struct ly_ctx *ctx, const char *path); |
| 104 | |
roman | 2eab474 | 2023-06-06 10:00:26 +0200 | [diff] [blame] | 105 | #ifdef NC_ENABLED_SSH_TLS |
| 106 | |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 107 | /** |
roman | 6430c15 | 2023-10-12 11:28:47 +0200 | [diff] [blame] | 108 | * @brief Creates new YANG configuration data nodes for address and port. |
roman | 9b1379c | 2023-03-31 10:11:10 +0200 | [diff] [blame] | 109 | * |
roman | 9b1379c | 2023-03-31 10:11:10 +0200 | [diff] [blame] | 110 | * @param[in] ctx libyang context. |
| 111 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 112 | * If an endpoint with this identifier already exists, its contents might be changed. |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 113 | * @param[in] transport Either SSH or TLS transport for the given endpoint. |
| 114 | * @param[in] address New listening address. |
| 115 | * @param[in] port New listening port. |
roman | 9b1379c | 2023-03-31 10:11:10 +0200 | [diff] [blame] | 116 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 117 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 118 | * @return 0 on success, non-zero otherwise. |
roman | 45cec4e | 2023-02-17 10:21:39 +0100 | [diff] [blame] | 119 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 120 | int nc_server_config_add_address_port(const struct ly_ctx *ctx, const char *endpt_name, NC_TRANSPORT_IMPL transport, |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 121 | const char *address, uint16_t port, struct lyd_node **config); |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 122 | |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 123 | #endif /* NC_ENABLED_SSH_TLS */ |
| 124 | |
| 125 | /** |
| 126 | * @brief Deletes an endpoint from the YANG data. |
| 127 | * |
| 128 | * @param[in] endpt_name Optional identifier of an endpoint to be deleted. |
| 129 | * If NULL, all of the endpoints will be deleted. |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 130 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 131 | * @return 0 on success, non-zero otherwise. |
| 132 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 133 | int nc_server_config_del_endpt(const char *endpt_name, struct lyd_node **config); |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 134 | |
| 135 | #ifdef NC_ENABLED_SSH_TLS |
| 136 | |
| 137 | /** |
| 138 | * @brief Creates new YANG data nodes for an asymmetric key in the keystore. |
| 139 | * |
| 140 | * @param[in] ctx libyang context. |
roman | 1314591 | 2023-08-17 15:36:54 +0200 | [diff] [blame] | 141 | * @param[in] ti Transport in which the key pair will be used. Either SSH or TLS. |
roman | 12c3d52 | 2023-07-26 13:39:30 +0200 | [diff] [blame] | 142 | * @param[in] asym_key_name Identifier of the asymmetric key pair. |
| 143 | * This identifier is used to reference the key pair. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 144 | * @param[in] privkey_path Path to a private key file. |
| 145 | * @param[in] pubkey_path Optional path a public key file. |
| 146 | * If not supplied, it will be generated from the private key. |
| 147 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 148 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 149 | * @return 0 on success, non-zero otherwise. |
| 150 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 151 | int nc_server_config_add_keystore_asym_key(const struct ly_ctx *ctx, NC_TRANSPORT_IMPL ti, const char *asym_key_name, |
roman | 1314591 | 2023-08-17 15:36:54 +0200 | [diff] [blame] | 152 | const char *privkey_path, const char *pubkey_path, struct lyd_node **config); |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 153 | |
| 154 | /** |
| 155 | * @brief Deletes a keystore's asymmetric key from the YANG data. |
| 156 | * |
roman | 12c3d52 | 2023-07-26 13:39:30 +0200 | [diff] [blame] | 157 | * @param[in] asym_key_name Optional identifier of the asymmetric key to be deleted. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 158 | * If NULL, all of the asymmetric keys in the keystore will be deleted. |
| 159 | * @param[in,out] config Configuration YANG data tree. |
| 160 | * @return 0 on success, non-zero otherwise. |
| 161 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 162 | int nc_server_config_del_keystore_asym_key(const char *asym_key_name, struct lyd_node **config); |
roman | 12c3d52 | 2023-07-26 13:39:30 +0200 | [diff] [blame] | 163 | |
| 164 | /** |
| 165 | * @brief Creates new YANG data nodes for a certificate in the keystore. |
| 166 | * |
roman | 6430c15 | 2023-10-12 11:28:47 +0200 | [diff] [blame] | 167 | * A certificate can not exist without its asymmetric key, so you must create an asymmetric key |
| 168 | * with the same identifier you pass to this function. |
roman | 12c3d52 | 2023-07-26 13:39:30 +0200 | [diff] [blame] | 169 | * |
| 170 | * @param[in] ctx libyang context. |
| 171 | * @param[in] asym_key_name Arbitrary identifier of the asymmetric key. |
| 172 | * If an asymmetric key pair with this name already exists, its contents will be changed. |
| 173 | * @param[in] cert_name Arbitrary identifier of the key pair's certificate. |
| 174 | * If a certificate with this name already exists, its contents will be changed. |
| 175 | * @param[in] cert_path Path to the PEM encoded certificate file. |
| 176 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 177 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 178 | * @return 0 on success, non-zero otherwise. |
| 179 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 180 | int nc_server_config_add_keystore_cert(const struct ly_ctx *ctx, const char *asym_key_name, const char *cert_name, |
roman | 12c3d52 | 2023-07-26 13:39:30 +0200 | [diff] [blame] | 181 | const char *cert_path, struct lyd_node **config); |
| 182 | |
| 183 | /** |
| 184 | * @brief Deletes a keystore's certificate from the YANG data. |
| 185 | * |
| 186 | * @param[in] asym_key_name Identifier of an existing asymmetric key pair. |
| 187 | * @param[in] cert_name Optional identifier of a certificate to be deleted. |
| 188 | * If NULL, all of the certificates belonging to the asymmetric key pair will be deleted. |
| 189 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 190 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 191 | * @return 0 on success, non-zero otherwise. |
| 192 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 193 | int nc_server_config_del_keystore_cert(const char *asym_key_name, const char *cert_name, struct lyd_node **config); |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 194 | |
| 195 | /** |
| 196 | * @brief Creates new YANG data nodes for a public key in the truststore. |
| 197 | * |
| 198 | * @param[in] ctx libyang context. |
roman | 12c3d52 | 2023-07-26 13:39:30 +0200 | [diff] [blame] | 199 | * @param[in] pub_bag_name Arbitrary identifier of the public key bag. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 200 | * This name is used to reference the public keys in the bag. |
| 201 | * If a public key bag with this name already exists, its contents will be changed. |
| 202 | * @param[in] pubkey_name Arbitrary identifier of the public key. |
roman | 12c3d52 | 2023-07-26 13:39:30 +0200 | [diff] [blame] | 203 | * If a public key with this name already exists in the given bag, its contents will be changed. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 204 | * @param[in] pubkey_path Path to a file containing a public key. |
| 205 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 206 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 207 | * @return 0 on success, non-zero otherwise. |
| 208 | */ |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 209 | int nc_server_config_add_truststore_pubkey(const struct ly_ctx *ctx, const char *pub_bag_name, const char *pubkey_name, |
| 210 | const char *pubkey_path, struct lyd_node **config); |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 211 | |
| 212 | /** |
| 213 | * @brief Deletes a truststore's public key from the YANG data. |
| 214 | * |
roman | 12c3d52 | 2023-07-26 13:39:30 +0200 | [diff] [blame] | 215 | * @param[in] pub_bag_name Identifier of an existing public key bag. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 216 | * @param[in] pubkey_name Optional identifier of a public key to be deleted. |
| 217 | * If NULL, all of the public keys in the given bag will be deleted. |
| 218 | * @param[in,out] config Configuration YANG data tree. |
| 219 | * @return 0 on success, non-zero otherwise. |
| 220 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 221 | int nc_server_config_del_truststore_pubkey(const char *pub_bag_name, const char *pubkey_name, struct lyd_node **config); |
roman | 12c3d52 | 2023-07-26 13:39:30 +0200 | [diff] [blame] | 222 | |
| 223 | /** |
| 224 | * @brief Creates new YANG data nodes for a certificate in the truststore. |
| 225 | * |
| 226 | * @param[in] ctx libyang context. |
| 227 | * @param[in] cert_bag_name Arbitrary identifier of the certificate bag. |
| 228 | * This name is used to reference the certificates in the bag. |
| 229 | * If a certificate bag with this name already exists, its contents will be changed. |
| 230 | * @param[in] cert_name Arbitrary identifier of the certificate. |
| 231 | * If a certificate with this name already exists in the given bag, its contents will be changed. |
| 232 | * @param[in] cert_path Path to a file containing a PEM encoded certificate. |
| 233 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 234 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 235 | * @return 0 on success, non-zero otherwise. |
| 236 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 237 | int nc_server_config_add_truststore_cert(const struct ly_ctx *ctx, const char *cert_bag_name, const char *cert_name, |
roman | 12c3d52 | 2023-07-26 13:39:30 +0200 | [diff] [blame] | 238 | const char *cert_path, struct lyd_node **config); |
| 239 | |
| 240 | /** |
| 241 | * @brief Deletes a truststore's certificate from the YANG data. |
| 242 | * |
| 243 | * @param[in] cert_bag_name Identifier of an existing certificate bag. |
| 244 | * @param[in] cert_name Optional identifier of a certificate to be deleted. |
| 245 | * If NULL, all of the certificates in the given bag will be deleted. |
| 246 | * @param[in,out] config Configuration YANG data tree. |
| 247 | * @return 0 on success, non-zero otherwise. |
| 248 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 249 | int nc_server_config_del_truststore_cert(const char *cert_bag_name, |
roman | 12c3d52 | 2023-07-26 13:39:30 +0200 | [diff] [blame] | 250 | const char *cert_name, struct lyd_node **config); |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 251 | |
| 252 | /** |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 253 | * @} Server Configuration Functions |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 254 | */ |
| 255 | |
| 256 | /** |
| 257 | * @defgroup server_config_ssh SSH Server Configuration |
| 258 | * @ingroup server_config |
| 259 | * |
| 260 | * @brief SSH server configuration creation and deletion |
| 261 | * @{ |
| 262 | */ |
| 263 | |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 264 | /** |
| 265 | * @brief Creates new YANG configuration data nodes for a hostkey. |
| 266 | * |
| 267 | * @param[in] ctx libyang context. |
| 268 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 269 | * If an endpoint with this identifier already exists, its hostkey might be changed. |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 270 | * @param[in] hostkey_name Arbitrary identifier of the hostkey. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 271 | * If a hostkey with this identifier already exists, its contents will be changed. |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 272 | * @param[in] privkey_path Path to a file containing a private key. |
| 273 | * The private key has to be in a PEM format. Only RSA and ECDSA keys are supported. |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 274 | * @param[in] pubkey_path Optional path to a file containing a public key. If NULL, public key will be |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 275 | * generated from the private key. |
| 276 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 277 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 278 | * @return 0 on success, non-zero otherwise. |
| 279 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 280 | int nc_server_config_add_ssh_hostkey(const struct ly_ctx *ctx, const char *endpt_name, const char *hostkey_name, |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 281 | const char *privkey_path, const char *pubkey_path, struct lyd_node **config); |
| 282 | |
| 283 | /** |
| 284 | * @brief Deletes a hostkey from the YANG data. |
| 285 | * |
| 286 | * @param[in] ctx libyang context. |
| 287 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 288 | * @param[in] hostkey_name Optional identifier of the hostkey to be deleted. |
| 289 | * If NULL, all of the hostkeys on this endpoint will be deleted. |
| 290 | * @param[in,out] config Configuration YANG data tree. |
| 291 | * @return 0 on success, non-zero otherwise. |
| 292 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 293 | int nc_server_config_del_ssh_hostkey(const struct ly_ctx *ctx, const char *endpt_name, |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 294 | const char *hostkey_name, struct lyd_node **config); |
| 295 | |
| 296 | /** |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 297 | * @brief Creates new YANG data nodes for a reference to an asymmetric key located in the keystore. |
| 298 | * |
| 299 | * This asymmetric key pair will be used as the SSH hostkey. |
| 300 | * |
| 301 | * @param[in] ctx libyang context. |
| 302 | * @param[in] endpt_name Arbitrary identifier of an endpoint. |
| 303 | * If an endpoint with this identifier already exists, its contents will be changed. |
| 304 | * @param[in] hostkey_name Arbitrary identifier of the endpoint's hostkey. |
| 305 | * If an endpoint's hostkey with this identifier already exists, its contents will be changed. |
| 306 | * @param[in] keystore_reference Name of the asymmetric key pair to be referenced and used as a hostkey. |
| 307 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 308 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 309 | * @return 0 on success, non-zero otherwise. |
| 310 | */ |
| 311 | int nc_server_config_add_ssh_keystore_ref(const struct ly_ctx *ctx, const char *endpt_name, const char *hostkey_name, |
| 312 | const char *keystore_reference, struct lyd_node **config); |
| 313 | |
| 314 | /** |
| 315 | * @brief Deletes a keystore reference from the YANG data. |
| 316 | * |
| 317 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 318 | * @param[in] hostkey_name Identifier of an existing hostkey on the given endpoint. |
| 319 | * @param[in,out] config Configuration YANG data tree. |
| 320 | * @return 0 on success, non-zero otherwise. |
| 321 | */ |
| 322 | int nc_server_config_del_ssh_keystore_ref(const char *endpt_name, const char *hostkey_name, |
| 323 | struct lyd_node **config); |
| 324 | |
| 325 | /** |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 326 | * @brief Creates new YANG configuration data nodes for an SSH user's public key authentication method. |
| 327 | * |
| 328 | * @param[in] ctx libyang context. |
| 329 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
| 330 | * If an endpoint with this identifier already exists, its user might be changed. |
| 331 | * @param[in] user_name Arbitrary identifier of the user. |
| 332 | * If an user with this identifier already exists, its contents will be changed. |
| 333 | * @param[in] pubkey_name Arbitrary identifier of the user's public key. |
| 334 | * If a public key with this identifier already exists for this user, its contents will be changed. |
| 335 | * @param[in] pubkey_path Path to a file containing the user's public key. |
| 336 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 337 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 338 | * @return 0 on success, non-zero otherwise. |
| 339 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 340 | int nc_server_config_add_ssh_user_pubkey(const struct ly_ctx *ctx, const char *endpt_name, |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 341 | const char *user_name, const char *pubkey_name, const char *pubkey_path, struct lyd_node **config); |
| 342 | |
| 343 | /** |
| 344 | * @brief Deletes an SSH user's public key from the YANG data. |
| 345 | * |
| 346 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 347 | * @param[in] user_name Identifier of an existing user on the given endpoint. |
| 348 | * @param[in] pubkey_name Optional identifier of a public key to be deleted. |
| 349 | * If NULL, all of the users public keys will be deleted. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 350 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 351 | * @return 0 on success, non-zero otherwise. |
| 352 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 353 | int nc_server_config_del_ssh_user_pubkey(const char *endpt_name, const char *user_name, |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 354 | const char *pubkey_name, struct lyd_node **config); |
| 355 | |
| 356 | /** |
| 357 | * @brief Creates new YANG configuration data nodes for an SSH user's password authentication method. |
| 358 | * |
| 359 | * @param[in] ctx libyang context. |
| 360 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
| 361 | * If an endpoint with this identifier already exists, its user might be changed. |
| 362 | * @param[in] user_name Arbitrary identifier of the user. |
| 363 | * If an user with this identifier already exists, its contents will be changed. |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 364 | * @param[in] password Clear-text password to be set for the user. It will be hashed. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 365 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 366 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 367 | * @return 0 on success, non-zero otherwise. |
| 368 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 369 | int nc_server_config_add_ssh_user_password(const struct ly_ctx *ctx, const char *endpt_name, |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 370 | const char *user_name, const char *password, struct lyd_node **config); |
| 371 | |
| 372 | /** |
| 373 | * @brief Deletes an SSH user's password from the YANG data. |
| 374 | * |
| 375 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 376 | * @param[in] user_name Identifier of an existing user on the given endpoint. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 377 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 378 | * @return 0 on success, non-zero otherwise. |
| 379 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 380 | int nc_server_config_del_ssh_user_password(const char *endpt_name, const char *user_name, |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 381 | struct lyd_node **config); |
| 382 | |
| 383 | /** |
| 384 | * @brief Creates new YANG configuration data nodes for an SSH user's keyboard interactive authentication method. |
| 385 | * |
| 386 | * @param[in] ctx libyang context. |
| 387 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
| 388 | * If an endpoint with this identifier already exists, its user might be changed. |
| 389 | * @param[in] user_name Arbitrary identifier of the user. |
| 390 | * If an user with this identifier already exists, its contents will be changed. |
| 391 | * @param[in] pam_config_name Name of the PAM configuration file. |
roman | 0f5fa42 | 2023-08-07 09:03:24 +0200 | [diff] [blame] | 392 | * @param[in] pam_config_dir Optional. The absolute path to the directory in which the configuration file |
| 393 | * with the name pam_config_name is located. A newer version (>= 1.4) of PAM library is required to be able to specify |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 394 | * the path. If NULL is passed, then the PAM's system directories will be searched (usually /etc/pam.d/). |
| 395 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 396 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 397 | * @return 0 on success, non-zero otherwise. |
| 398 | */ |
roman | 808f3f6 | 2023-11-23 16:01:04 +0100 | [diff] [blame] | 399 | |
| 400 | /** |
| 401 | * @brief Creates new YANG configuration data nodes for an SSH user's keyboard interactive authentication method. |
| 402 | * |
| 403 | * To set the PAM configuration filename, see ::nc_server_ssh_set_pam_conf_filename(). |
| 404 | * |
| 405 | * @param[in] ctx libyang context. |
| 406 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
| 407 | * If an endpoint with this identifier already exists, its user might be changed. |
| 408 | * @param[in] user_name Arbitrary identifier of the user. |
| 409 | * If an user with this identifier already exists, its contents will be changed. |
| 410 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 411 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 412 | * @return 0 on success, non-zero otherwise. |
| 413 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 414 | int nc_server_config_add_ssh_user_interactive(const struct ly_ctx *ctx, const char *endpt_name, |
roman | 808f3f6 | 2023-11-23 16:01:04 +0100 | [diff] [blame] | 415 | const char *user_name, struct lyd_node **config); |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 416 | |
| 417 | /** |
| 418 | * @brief Deletes an SSH user's keyboard interactive authentication from the YANG data. |
| 419 | * |
| 420 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 421 | * @param[in] user_name Identifier of an existing user on the given endpoint. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 422 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 423 | * @return 0 on success, non-zero otherwise. |
| 424 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 425 | int nc_server_config_del_ssh_user_interactive(const char *endpt_name, const char *user_name, |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 426 | struct lyd_node **config); |
| 427 | |
| 428 | /** |
| 429 | * @brief Deletes an SSH user from the YANG data. |
| 430 | * |
| 431 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 432 | * @param[in] user_name Optional identifier of an user to be deleted. |
| 433 | * If NULL, all of the users on this endpoint will be deleted. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 434 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 435 | * @return 0 on success, non-zero otherwise. |
| 436 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 437 | int nc_server_config_del_ssh_user(const char *endpt_name, |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 438 | const char *user_name, struct lyd_node **config); |
| 439 | |
| 440 | /** |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 441 | * @brief Creates new YANG data nodes for a reference to a public key bag located in the truststore. |
| 442 | * |
| 443 | * The public key's located in the bag will be used for client authentication. |
| 444 | * |
| 445 | * @param[in] ctx libyang context. |
| 446 | * @param[in] endpt_name Arbitrary identifier of an endpoint. |
| 447 | * If an endpoint with this identifier already exists, its contents will be changed. |
| 448 | * @param[in] user_name Arbitrary identifier of the endpoint's user. |
| 449 | * If an endpoint's user with this identifier already exists, its contents will be changed. |
| 450 | * @param[in] truststore_reference Name of the public key bag to be referenced and used for authentication. |
| 451 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 452 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 453 | * @return 0 on success, non-zero otherwise. |
| 454 | */ |
| 455 | int nc_server_config_add_ssh_truststore_ref(const struct ly_ctx *ctx, const char *endpt_name, const char *user_name, |
| 456 | const char *truststore_reference, struct lyd_node **config); |
| 457 | |
| 458 | /** |
| 459 | * @brief Deletes a truststore reference from the YANG data. |
| 460 | * |
| 461 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 462 | * @param[in] user_name Identifier of an user on the given endpoint whose truststore reference will be deleted. |
| 463 | * @param[in,out] config Modified configuration YANG data tree. |
| 464 | * @return 0 on success, non-zero otherwise. |
| 465 | */ |
| 466 | int nc_server_config_del_ssh_truststore_ref(const char *endpt_name, const char *user_name, |
| 467 | struct lyd_node **config); |
| 468 | |
| 469 | /** |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 470 | * @brief Creates new YANG configuration data nodes, which will be a reference to another SSH endpoint's users. |
| 471 | * |
| 472 | * Whenever a client tries to connect to the referencing endpoint, all of its users will be tried first. If no match is |
| 473 | * found, the referenced endpoint's configured users will be tried. |
| 474 | * |
| 475 | * @param[in] ctx libyang context |
| 476 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
| 477 | * If an endpoint with this identifier already exists, its contents will be changed. |
| 478 | * @param[in] referenced_endpt Identifier of an endpoint, which has to exist whenever this data |
| 479 | * is applied. The referenced endpoint can reference another one and so on, but there mustn't be a cycle. |
| 480 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 481 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 482 | * @return 0 on success, non-zero otherwise. |
| 483 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 484 | int nc_server_config_add_ssh_endpoint_client_ref(const struct ly_ctx *ctx, const char *endpt_name, |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 485 | const char *referenced_endpt, struct lyd_node **config); |
| 486 | |
| 487 | /** |
| 488 | * @brief Deletes reference to another SSH endpoint's users from the YANG data. |
| 489 | * |
| 490 | * @param[in] endpt_name Identifier of an existing endpoint. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 491 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 492 | * @return 0 on success, non-zero otherwise. |
| 493 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 494 | int nc_server_config_del_ssh_endpoint_client_ref(const char *endpt_name, struct lyd_node **config); |
roman | 9b1379c | 2023-03-31 10:11:10 +0200 | [diff] [blame] | 495 | |
| 496 | /** |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 497 | * @} SSH Server Configuration |
roman | 9b1379c | 2023-03-31 10:11:10 +0200 | [diff] [blame] | 498 | */ |
roman | 9b1379c | 2023-03-31 10:11:10 +0200 | [diff] [blame] | 499 | |
| 500 | /** |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 501 | * @defgroup server_config_tls TLS Server Configuration |
| 502 | * @ingroup server_config |
roman | 9b1379c | 2023-03-31 10:11:10 +0200 | [diff] [blame] | 503 | * |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 504 | * @brief TLS server configuration creation and deletion |
| 505 | * @{ |
roman | 9b1379c | 2023-03-31 10:11:10 +0200 | [diff] [blame] | 506 | */ |
roman | 2e797ef | 2023-06-19 10:47:49 +0200 | [diff] [blame] | 507 | |
| 508 | /** |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 509 | * @brief Creates new YANG configuration data nodes for a server's certificate. |
| 510 | * |
| 511 | * @param[in] ctx libyang context. |
| 512 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 513 | * If an endpoint with this identifier already exists, its server certificate will be changed. |
roman | 6c4efcd | 2023-08-08 10:18:44 +0200 | [diff] [blame] | 514 | * @param[in] privkey_path Path to the server's PEM encoded private key file. |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 515 | * @param[in] pubkey_path Optional path to the server's public key file. If not provided, |
| 516 | * it will be generated from the private key. |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 517 | * @param[in] cert_path Path to the server's certificate file. |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 518 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 519 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 520 | * @return 0 on success, non-zero otherwise. |
| 521 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 522 | int nc_server_config_add_tls_server_cert(const struct ly_ctx *ctx, const char *endpt_name, const char *privkey_path, |
| 523 | const char *pubkey_path, const char *cert_path, struct lyd_node **config); |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 524 | |
| 525 | /** |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 526 | * @brief Deletes the server's certificate from the YANG data. |
| 527 | * |
| 528 | * @param[in] endpt_name Identifier of an existing endpoint. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 529 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 530 | * @return 0 on success, non-zero otherwise. |
| 531 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 532 | int nc_server_config_del_tls_server_cert(const char *endpt_name, struct lyd_node **config); |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 533 | |
| 534 | /** |
| 535 | * @brief Creates new YANG configuration data nodes for a keystore reference to the TLS server's certificate. |
| 536 | * |
| 537 | * @param[in] ctx libyang context. |
| 538 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
| 539 | * If an endpoint with this identifier already exists, its contents will be changed. |
| 540 | * @param[in] asym_key_ref Name of the asymmetric key pair in the keystore to be referenced. |
| 541 | * @param[in] cert_ref Name of the certificate, which must belong to the given asymmetric key pair, to be referenced. |
| 542 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 543 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 544 | * @return 0 on success, non-zero otherwise. |
| 545 | */ |
| 546 | int nc_server_config_add_tls_keystore_ref(const struct ly_ctx *ctx, const char *endpt_name, const char *asym_key_ref, |
| 547 | const char *cert_ref, struct lyd_node **config); |
| 548 | |
| 549 | /** |
| 550 | * @brief Deletes a TLS server certificate keystore reference from the YANG data. |
| 551 | * |
| 552 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 553 | * @param[in,out] config Modified configuration YANG data tree. |
| 554 | * @return 0 on success, non-zero otherwise. |
| 555 | */ |
| 556 | int nc_server_config_del_tls_keystore_ref(const char *endpt_name, struct lyd_node **config); |
roman | 12c3d52 | 2023-07-26 13:39:30 +0200 | [diff] [blame] | 557 | |
| 558 | /** |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 559 | * @brief Creates new YANG configuration data nodes for a client's (end-entity) certificate. |
| 560 | * |
| 561 | * @param[in] ctx libyang context. |
| 562 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 563 | * If an endpoint with this identifier already exists, its contents will be changed. |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 564 | * @param[in] cert_name Arbitrary identifier of the client's certificate. |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 565 | * If a client certificate with this identifier already exists, it will be changed. |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 566 | * @param[in] cert_path Path to the client's certificate file. |
| 567 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 568 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 569 | * @return 0 on success, non-zero otherwise. |
| 570 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 571 | int nc_server_config_add_tls_client_cert(const struct ly_ctx *ctx, const char *endpt_name, const char *cert_name, |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 572 | const char *cert_path, struct lyd_node **config); |
| 573 | |
| 574 | /** |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 575 | * @brief Deletes a client (end-entity) certificate from the YANG data. |
| 576 | * |
| 577 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 578 | * @param[in] cert_name Optional name of a certificate to be deleted. |
| 579 | * If NULL, all of the end-entity certificates on the given endpoint will be deleted. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 580 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 581 | * @return 0 on success, non-zero otherwise. |
| 582 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 583 | int nc_server_config_del_tls_client_cert(const char *endpt_name, const char *cert_name, struct lyd_node **config); |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 584 | |
| 585 | /** |
| 586 | * @brief Creates new YANG configuration data nodes for a truststore reference to a set of client (end-entity) certificates. |
| 587 | * |
| 588 | * @param[in] ctx libyang context. |
| 589 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
| 590 | * If an endpoint with this identifier already exists, its contents will be changed. |
| 591 | * @param[in] cert_bag_ref Identifier of the certificate bag in the truststore to be referenced. |
| 592 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 593 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 594 | * @return 0 on success, non-zero otherwise. |
| 595 | */ |
| 596 | int nc_server_config_add_tls_client_cert_truststore_ref(const struct ly_ctx *ctx, const char *endpt_name, |
| 597 | const char *cert_bag_ref, struct lyd_node **config); |
| 598 | |
| 599 | /** |
| 600 | * @brief Deletes a client (end-entity) certificates truststore reference from the YANG data. |
| 601 | * |
| 602 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 603 | * @param[in,out] config Modified configuration YANG data tree. |
| 604 | * @return 0 on success, non-zero otherwise. |
| 605 | */ |
| 606 | int nc_server_config_del_tls_client_cert_truststore_ref(const char *endpt_name, struct lyd_node **config); |
roman | 12c3d52 | 2023-07-26 13:39:30 +0200 | [diff] [blame] | 607 | |
| 608 | /** |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 609 | * @brief Creates new YANG configuration data nodes for a client certificate authority (trust-anchor) certificate. |
| 610 | * |
| 611 | * @param[in] ctx libyang context. |
| 612 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 613 | * If an endpoint with this identifier already exists, its contents will be changed. |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 614 | * @param[in] cert_name Arbitrary identifier of the certificate authority certificate. |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 615 | * If a CA with this identifier already exists, it will be changed. |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 616 | * @param[in] cert_path Path to the CA certificate file. |
| 617 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 618 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 619 | * @return 0 on success, non-zero otherwise. |
| 620 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 621 | int nc_server_config_add_tls_ca_cert(const struct ly_ctx *ctx, const char *endpt_name, const char *cert_name, |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 622 | const char *cert_path, struct lyd_node **config); |
| 623 | |
| 624 | /** |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 625 | * @brief Deletes a client certificate authority (trust-anchor) certificate from the YANG data. |
| 626 | * |
| 627 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 628 | * @param[in] cert_name Optional name of a certificate to be deleted. |
| 629 | * If NULL, all of the CA certificates on the given endpoint will be deleted. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 630 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 631 | * @return 0 on success, non-zero otherwise. |
| 632 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 633 | int nc_server_config_del_tls_ca_cert(const char *endpt_name, const char *cert_name, struct lyd_node **config); |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 634 | |
| 635 | /** |
| 636 | * @brief Creates new YANG configuration data nodes for a truststore reference to a set of client certificate authority (trust-anchor) certificates. |
| 637 | * |
| 638 | * @param[in] ctx libyang context. |
| 639 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
| 640 | * If an endpoint with this identifier already exists, its contents will be changed. |
| 641 | * @param[in] cert_bag_ref Identifier of the certificate bag in the truststore to be referenced. |
| 642 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 643 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 644 | * @return 0 on success, non-zero otherwise. |
| 645 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 646 | int nc_server_config_add_tls_ca_cert_truststore_ref(const struct ly_ctx *ctx, const char *endpt_name, |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 647 | const char *cert_bag_ref, struct lyd_node **config); |
| 648 | |
| 649 | /** |
| 650 | * @brief Deletes a client certificate authority (trust-anchor) certificates truststore reference from the YANG data. |
| 651 | * |
| 652 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 653 | * @param[in,out] config Modified configuration YANG data tree. |
| 654 | * @return 0 on success, non-zero otherwise. |
| 655 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 656 | int nc_server_config_del_tls_ca_cert_truststore_ref(const char *endpt_name, struct lyd_node **config); |
roman | 12c3d52 | 2023-07-26 13:39:30 +0200 | [diff] [blame] | 657 | |
| 658 | /** |
Roytak | 7695891 | 2023-09-29 15:25:14 +0200 | [diff] [blame] | 659 | * @brief Creates new YANG configuration data nodes, which will be a reference to another TLS endpoint's certificates. |
| 660 | * |
| 661 | * Whenever an user tries to connect to the referencing endpoint, all of its certificates will be tried first. If no match is |
| 662 | * found, the referenced endpoint's configured certificates will be tried. The same applies to cert-to-name entries. |
| 663 | * |
| 664 | * @param[in] ctx libyang context |
| 665 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
| 666 | * If an endpoint with this identifier already exists, its contents will be changed. |
| 667 | * @param[in] referenced_endpt Identifier of an endpoint, which has to exist whenever this data |
| 668 | * is applied. The referenced endpoint can reference another one and so on, but there mustn't be a cycle. |
| 669 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 670 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 671 | * @return 0 on success, non-zero otherwise. |
| 672 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 673 | int nc_server_config_add_tls_endpoint_client_ref(const struct ly_ctx *ctx, const char *endpt_name, |
Roytak | 7695891 | 2023-09-29 15:25:14 +0200 | [diff] [blame] | 674 | const char *referenced_endpt, struct lyd_node **config); |
| 675 | |
| 676 | /** |
| 677 | * @brief Deletes reference to another TLS endpoint's users from the YANG data. |
| 678 | * |
| 679 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 680 | * @param[in,out] config Modified configuration YANG data tree. |
| 681 | * @return 0 on success, non-zero otherwise. |
| 682 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 683 | int nc_server_config_del_tls_endpoint_client_ref(const char *endpt_name, struct lyd_node **config); |
Roytak | 7695891 | 2023-09-29 15:25:14 +0200 | [diff] [blame] | 684 | |
| 685 | /** |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 686 | * @brief Creates new YANG configuration data nodes for a cert-to-name entry. |
| 687 | * |
| 688 | * @param[in] ctx libyang context. |
| 689 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 690 | * If an endpoint with this identifier already exists, its contents will be changed. |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 691 | * @param[in] id ID of the entry. The lower the ID, the higher the priority of the entry (it will be checked earlier). |
| 692 | * @param[in] fingerprint Optional fingerprint of the entry. The fingerprint should always be set, however if it is |
| 693 | * not set, it will match any certificate. Entry with no fingerprint should therefore be placed only as the last entry. |
| 694 | * @param[in] map_type Mapping username to the certificate option. |
| 695 | * @param[in] name Username for this cert-to-name entry. |
| 696 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 697 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 698 | * @return 0 on success, non-zero otherwise. |
| 699 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 700 | int nc_server_config_add_tls_ctn(const struct ly_ctx *ctx, const char *endpt_name, uint32_t id, const char *fingerprint, |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 701 | NC_TLS_CTN_MAPTYPE map_type, const char *name, struct lyd_node **config); |
| 702 | |
roman | 12644fe | 2023-06-08 11:06:42 +0200 | [diff] [blame] | 703 | /** |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 704 | * @brief Deletes a cert-to-name entry from the YANG data. |
| 705 | * |
| 706 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 707 | * @param[in] id Optional ID of the CTN entry. |
| 708 | * If 0, all of the cert-to-name entries on the given endpoint will be deleted. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 709 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 710 | * @return 0 on success, non-zero otherwise. |
| 711 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 712 | int nc_server_config_del_tls_ctn(const char *endpt_name, uint32_t id, struct lyd_node **config); |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 713 | |
| 714 | /** |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 715 | * @} TLS Server Configuration |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 716 | */ |
| 717 | |
| 718 | /** |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 719 | * @defgroup server_config_ch Call Home Server Configuration |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 720 | * @ingroup server_config |
| 721 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 722 | * @brief Call Home server configuration creation and deletion |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 723 | * @{ |
| 724 | */ |
| 725 | |
| 726 | /** |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 727 | * @} Call Home Server Configuration |
| 728 | */ |
| 729 | |
| 730 | /** |
| 731 | * @defgroup server_config_ch_functions Call Home Server Configuration Functions |
| 732 | * @ingroup server_config_ch |
| 733 | * |
| 734 | * @brief Call Home server configuration functions |
| 735 | * @{ |
| 736 | */ |
| 737 | |
| 738 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 739 | * @brief Creates new YANG configuration data nodes for a Call Home client's address and port. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 740 | * |
| 741 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 742 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 743 | * If a Call Home client with this identifier already exists, its contents will be changed. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 744 | * @param[in] endpt_name Arbitrary identifier of the client's endpoint. |
| 745 | * If the client's endpoint with this identifier already exists, its contents will be changed. |
| 746 | * @param[in] transport Transport protocol to be used on this endpoint - either SSH or TLS. |
| 747 | * @param[in] address Address to connect to. |
| 748 | * @param[in] port Port to connect to. |
| 749 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 750 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 751 | * @return 0 on success, non-zero otherwise. |
| 752 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 753 | int nc_server_config_add_ch_address_port(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name, |
roman | 5cbb653 | 2023-06-22 12:53:17 +0200 | [diff] [blame] | 754 | NC_TRANSPORT_IMPL transport, const char *address, const char *port, struct lyd_node **config); |
| 755 | |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 756 | #endif /* NC_ENABLED_SSH_TLS */ |
| 757 | |
| 758 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 759 | * @brief Deletes a Call Home client from the YANG data. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 760 | * |
| 761 | * @param[in] client_name Optional identifier of a client to be deleted. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 762 | * If NULL, all of the Call Home clients will be deleted. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 763 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 764 | * @return 0 on success, non-zero otherwise. |
| 765 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 766 | int nc_server_config_del_ch_client(const char *client_name, struct lyd_node **config); |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 767 | |
| 768 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 769 | * @brief Deletes a Call Home endpoint from the YANG data. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 770 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 771 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 772 | * @param[in] endpt_name Optional identifier of a CH endpoint to be deleted. |
| 773 | * If NULL, all of the CH endpoints which belong to the given client will be deleted. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 774 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 775 | * @return 0 on success, non-zero otherwise. |
| 776 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 777 | int nc_server_config_del_ch_endpt(const char *client_name, const char *endpt_name, struct lyd_node **config); |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 778 | |
| 779 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 780 | * @brief Creates new YANG configuration data nodes for the Call Home persistent connection type. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 781 | * |
| 782 | * This is the default connection type. If periodic connection type was set before, it will be unset. |
| 783 | * |
| 784 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 785 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 786 | * If a Call Home client with this identifier already exists, its contents will be changed. |
Roytak | 9b32c0f | 2023-08-02 15:07:29 +0200 | [diff] [blame] | 787 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 788 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 789 | * @return 0 on success, non-zero otherwise. |
| 790 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 791 | int nc_server_config_add_ch_persistent(const struct ly_ctx *ctx, const char *client_name, struct lyd_node **config); |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 792 | |
| 793 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 794 | * @brief Creates new YANG configuration data nodes for the period parameter of the Call Home periodic connection type. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 795 | * |
| 796 | * If called, the persistent connection type will be replaced by periodic. |
| 797 | * |
| 798 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 799 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 800 | * If a Call Home client with this identifier already exists, its contents will be changed. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 801 | * @param[in] period Duration between periodic connections in minutes. |
Roytak | 9b32c0f | 2023-08-02 15:07:29 +0200 | [diff] [blame] | 802 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 803 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 804 | * @return 0 on success, non-zero otherwise. |
| 805 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 806 | int nc_server_config_add_ch_period(const struct ly_ctx *ctx, const char *client_name, uint16_t period, |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 807 | struct lyd_node **config); |
| 808 | |
| 809 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 810 | * @brief Deletes the Call Home period parameter of the periodic connection type from the YANG data. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 811 | * |
| 812 | * This behaves the same as setting the period to 60 minutes, which is the default value of this node. |
| 813 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 814 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 815 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 816 | * @return 0 on success, non-zero otherwise. |
| 817 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 818 | int nc_server_config_del_ch_period(const char *client_name, struct lyd_node **config); |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 819 | |
| 820 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 821 | * @brief Creates new YANG configuration data nodes for the anchor time parameter of the Call Home periodic connection type. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 822 | * |
| 823 | * If called, the persistent connection type will be replaced by periodic. |
| 824 | * |
| 825 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 826 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 827 | * If a Call Home client with this identifier already exists, its contents will be changed. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 828 | * @param[in] anchor_time Timestamp before or after which a series of periodic connections are determined. |
Roytak | 9b32c0f | 2023-08-02 15:07:29 +0200 | [diff] [blame] | 829 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 830 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 831 | * @return 0 on success, non-zero otherwise. |
| 832 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 833 | int nc_server_config_add_ch_anchor_time(const struct ly_ctx *ctx, const char *client_name, |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 834 | const char *anchor_time, struct lyd_node **config); |
| 835 | |
| 836 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 837 | * @brief Deletes the Call Home anchor time parameter of the periodic connection type from the YANG data. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 838 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 839 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 840 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 841 | * @return 0 on success, non-zero otherwise. |
| 842 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 843 | int nc_server_config_del_ch_anchor_time(const char *client_name, struct lyd_node **config); |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 844 | |
| 845 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 846 | * @brief Creates new YANG configuration data nodes for the idle timeout parameter of the Call Home periodic connection type. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 847 | * |
| 848 | * If called, the persistent connection type will be replaced by periodic. |
| 849 | * |
| 850 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 851 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 852 | * If a Call Home client with this identifier already exists, its contents will be changed. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 853 | * @param[in] idle_timeout Specifies the maximum number of seconds that a session may remain idle. |
Roytak | 9b32c0f | 2023-08-02 15:07:29 +0200 | [diff] [blame] | 854 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 855 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 856 | * @return 0 on success, non-zero otherwise. |
| 857 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 858 | int nc_server_config_add_ch_idle_timeout(const struct ly_ctx *ctx, const char *client_name, |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 859 | uint16_t idle_timeout, struct lyd_node **config); |
| 860 | |
| 861 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 862 | * @brief Deletes the Call Home idle timeout parameter of the periodic connection type from the YANG data. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 863 | * |
| 864 | * This behaves the same as setting the timeout to 180 seconds, which is the default value of this node. |
| 865 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 866 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 867 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 868 | * @return 0 on success, non-zero otherwise. |
| 869 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 870 | int nc_server_config_del_ch_idle_timeout(const char *client_name, struct lyd_node **config); |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 871 | |
| 872 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 873 | * @brief Creates new YANG configuration data nodes for the Call Home reconnect strategy. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 874 | * |
| 875 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 876 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 877 | * If a Call Home client with this identifier already exists, its contents will be changed. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 878 | * @param[in] start_with Specifies which endpoint to try if a connection is unsuccessful. Default value is NC_CH_FIRST_LISTED. |
| 879 | * @param[in] max_wait The number of seconds after which a connection to an endpoint is deemed unsuccessful. Default value if 5. |
| 880 | * @param[in] max_attempts The number of unsuccessful connection attempts before moving to the next endpoint. Default value is 3. |
Roytak | 9b32c0f | 2023-08-02 15:07:29 +0200 | [diff] [blame] | 881 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 882 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 883 | * @return 0 on success, non-zero otherwise. |
| 884 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 885 | int nc_server_config_add_ch_reconnect_strategy(const struct ly_ctx *ctx, const char *client_name, |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 886 | NC_CH_START_WITH start_with, uint16_t max_wait, uint8_t max_attempts, struct lyd_node **config); |
| 887 | |
| 888 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 889 | * @brief Resets the values of the Call Home reconnect strategy nodes to their defaults. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 890 | * |
| 891 | * The default values are: start-with = NC_CH_FIRST_LISTED, max-wait = 5 and max-attempts = 3. |
| 892 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 893 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 894 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 895 | * @return 0 on success, non-zero otherwise. |
| 896 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 897 | int nc_server_config_del_ch_reconnect_strategy(const char *client_name, struct lyd_node **config); |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 898 | |
| 899 | /** |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 900 | * @} Call Home Server Configuration Functions |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 901 | */ |
| 902 | |
| 903 | #ifdef NC_ENABLED_SSH_TLS |
| 904 | |
| 905 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 906 | * @defgroup server_config_ch_ssh SSH Call Home Server Configuration |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 907 | * @ingroup server_config_ch |
| 908 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 909 | * @brief SSH Call Home server configuration creation and deletion |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 910 | * @{ |
| 911 | */ |
| 912 | |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 913 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 914 | * @brief Creates new YANG data nodes for a Call Home SSH hostkey. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 915 | * |
| 916 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 917 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 918 | * If a Call Home client with this identifier already exists, its contents will be changed. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 919 | * @param[in] endpt_name Arbitrary identifier of the client's endpoint. |
| 920 | * If the client's endpoint with this identifier already exists, its contents will be changed. |
| 921 | * @param[in] hostkey_name Arbitrary identifier of the endpoint's hostkey. |
| 922 | * If the endpoint's hostkey with this identifier already exists, its contents will be changed. |
| 923 | * @param[in] privkey_path Path to a file containing a private key. |
| 924 | * The private key has to be in a PEM format. Only RSA and ECDSA keys are supported. |
| 925 | * @param[in] pubkey_path Path to a file containing a public key. If NULL, public key will be |
| 926 | * generated from the private key. |
| 927 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 928 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 929 | * @return 0 on success, non-zero otherwise. |
| 930 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 931 | int nc_server_config_add_ch_ssh_hostkey(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name, |
roman | 5cbb653 | 2023-06-22 12:53:17 +0200 | [diff] [blame] | 932 | const char *hostkey_name, const char *privkey_path, const char *pubkey_path, struct lyd_node **config); |
| 933 | |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 934 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 935 | * @brief Deletes a Call Home hostkey from the YANG data. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 936 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 937 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 938 | * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 939 | * @param[in] hostkey_name Optional identifier of a hostkey to be deleted. |
| 940 | * If NULL, all of the hostkeys on the given endpoint will be deleted. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 941 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 942 | * @return 0 on success, non-zero otherwise. |
| 943 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 944 | int nc_server_config_del_ch_ssh_hostkey(const char *client_name, const char *endpt_name, |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 945 | const char *hostkey_name, struct lyd_node **config); |
| 946 | |
| 947 | /** |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 948 | * @brief Creates new YANG data nodes for a reference to an asymmetric key located in the keystore. |
| 949 | * |
| 950 | * This asymmetric key pair will be used as the Call Home SSH hostkey. |
| 951 | * |
| 952 | * @param[in] ctx libyang context. |
| 953 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 954 | * If a Call Home client with this identifier already exists, its contents will be changed. |
| 955 | * @param[in] endpt_name Arbitrary identifier of the client's endpoint. |
| 956 | * If the client's endpoint with this identifier already exists, its contents will be changed. |
| 957 | * @param[in] hostkey_name Arbitrary identifier of the endpoint's hostkey. |
| 958 | * If the endpoint's hostkey with this identifier already exists, its contents will be changed. |
| 959 | * @param[in] keystore_reference Name of the asymmetric key pair to be referenced and used as a hostkey. |
| 960 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 961 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 962 | * @return 0 on success, non-zero otherwise. |
| 963 | */ |
| 964 | int nc_server_config_add_ch_ssh_keystore_ref(const struct ly_ctx *ctx, const char *client_name, |
| 965 | const char *endpt_name, const char *hostkey_name, const char *keystore_reference, struct lyd_node **config); |
| 966 | |
| 967 | /** |
| 968 | * @brief Deletes a Call Home keystore reference from the YANG data. |
| 969 | * |
| 970 | * @param[in] client_name Identifier of an existing Call Home client. |
| 971 | * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client. |
| 972 | * @param[in] hostkey_name Identifier of an existing hostkey that belongs to the given CH endpoint. |
| 973 | * @param[in,out] config Modified configuration YANG data tree. |
| 974 | * @return 0 on success, non-zero otherwise. |
| 975 | */ |
| 976 | int nc_server_config_del_ch_ssh_keystore_ref(const char *client_name, const char *endpt_name, |
| 977 | const char *hostkey_name, struct lyd_node **config); |
| 978 | |
| 979 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 980 | * @brief Creates new YANG data nodes for a Call Home SSH user's public key authentication method. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 981 | * |
| 982 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 983 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 984 | * If a Call Home client with this identifier already exists, its contents will be changed. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 985 | * @param[in] endpt_name Arbitrary identifier of the client's endpoint. |
| 986 | * If the client's endpoint with this identifier already exists, its contents will be changed. |
| 987 | * @param[in] user_name Arbitrary identifier of the endpoint's user. |
| 988 | * If the endpoint's user with this identifier already exists, its contents will be changed. |
| 989 | * @param[in] pubkey_name Arbitrary identifier of the user's public key. |
| 990 | * If the user's public key with this identifier already exists, its contents will be changed. |
| 991 | * @param[in] pubkey_path Path to a file containing a public key. |
| 992 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 993 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 994 | * @return 0 on success, non-zero otherwise. |
| 995 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 996 | int nc_server_config_add_ch_ssh_user_pubkey(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name, |
roman | 5cbb653 | 2023-06-22 12:53:17 +0200 | [diff] [blame] | 997 | const char *user_name, const char *pubkey_name, const char *pubkey_path, struct lyd_node **config); |
| 998 | |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 999 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1000 | * @brief Deletes a Call Home SSH user's public key from the YANG data. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 1001 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1002 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1003 | * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client. |
| 1004 | * @param[in] user_name Identifier of an existing SSH user that belongs to the given CH endpoint. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1005 | * @param[in] pubkey_name Optional identifier of a public key to be deleted. |
| 1006 | * If NULL, all of the public keys which belong to the given SSH user will be deleted. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1007 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 1008 | * @return 0 on success, non-zero otherwise. |
| 1009 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 1010 | int nc_server_config_del_ch_ssh_user_pubkey(const char *client_name, const char *endpt_name, |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1011 | const char *user_name, const char *pubkey_name, struct lyd_node **config); |
roman | 5cbb653 | 2023-06-22 12:53:17 +0200 | [diff] [blame] | 1012 | |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 1013 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1014 | * @brief Creates new YANG data nodes for a Call Home SSH user's password authentication method. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1015 | * |
| 1016 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1017 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1018 | * If a Call Home client with this identifier already exists, its contents will be changed. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1019 | * @param[in] endpt_name Arbitrary identifier of the client's endpoint. |
| 1020 | * If the client's endpoint with this identifier already exists, its contents will be changed. |
| 1021 | * @param[in] user_name Arbitrary identifier of the endpoint's user. |
| 1022 | * If the endpoint's user with this identifier already exists, its contents will be changed. |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 1023 | * @param[in] password Clear-text password to be set for the user. It will be hashed. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1024 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 1025 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1026 | * @return 0 on success, non-zero otherwise. |
| 1027 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 1028 | int nc_server_config_add_ch_ssh_user_password(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name, |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1029 | const char *user_name, const char *password, struct lyd_node **config); |
| 1030 | |
| 1031 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1032 | * @brief Deletes a Call Home SSH user's password from the YANG data. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1033 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1034 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1035 | * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client. |
| 1036 | * @param[in] user_name Identifier of an existing SSH user that belongs to the given CH endpoint. |
| 1037 | * @param[in,out] config Modified configuration YANG data tree. |
| 1038 | * @return 0 on success, non-zero otherwise. |
| 1039 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 1040 | int nc_server_config_del_ch_ssh_user_password(const char *client_name, const char *endpt_name, |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1041 | const char *user_name, struct lyd_node **config); |
| 1042 | |
| 1043 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1044 | * @brief Creates new YANG configuration data nodes for a Call Home SSH user's keyboard interactive authentication method. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1045 | * |
roman | 808f3f6 | 2023-11-23 16:01:04 +0100 | [diff] [blame] | 1046 | * To set the PAM configuration filename, see ::nc_server_ssh_set_pam_conf_filename(). |
| 1047 | * |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1048 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1049 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1050 | * If a Call Home client with this identifier already exists, its contents will be changed. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1051 | * @param[in] endpt_name Arbitrary identifier of the client's endpoint. |
| 1052 | * If the client's endpoint with this identifier already exists, its contents will be changed. |
| 1053 | * @param[in] user_name Arbitrary identifier of the endpoint's user. |
| 1054 | * If the endpoint's user with this identifier already exists, its contents will be changed. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1055 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 1056 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1057 | * @return 0 on success, non-zero otherwise. |
| 1058 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 1059 | int nc_server_config_add_ch_ssh_user_interactive(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name, |
roman | 808f3f6 | 2023-11-23 16:01:04 +0100 | [diff] [blame] | 1060 | const char *user_name, struct lyd_node **config); |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1061 | |
| 1062 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1063 | * @brief Deletes a Call Home SSH user's keyboard interactive authentication from the YANG data. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1064 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1065 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1066 | * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client. |
| 1067 | * @param[in] user_name Identifier of an existing SSH user that belongs to the given CH endpoint. |
| 1068 | * @param[in,out] config Modified configuration YANG data tree. |
| 1069 | * @return 0 on success, non-zero otherwise. |
| 1070 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 1071 | int nc_server_config_del_ch_ssh_user_interactive(const char *client_name, const char *endpt_name, |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1072 | const char *user_name, struct lyd_node **config); |
| 1073 | |
| 1074 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1075 | * @brief Deletes a Call Home SSH user from the YANG data. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1076 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1077 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1078 | * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client. |
| 1079 | * @param[in] user_name Identifier of an existing SSH user that belongs to the given CH endpoint. |
| 1080 | * @param[in,out] config Modified configuration YANG data tree. |
| 1081 | * @return 0 on success, non-zero otherwise. |
| 1082 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 1083 | int nc_server_config_del_ch_ssh_user(const char *client_name, const char *endpt_name, |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1084 | const char *user_name, struct lyd_node **config); |
| 1085 | |
| 1086 | /** |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 1087 | * @brief Creates new YANG data nodes for a reference to a public key bag located in the truststore. |
| 1088 | * |
| 1089 | * The public key's located in the bag will be used for Call Home SSH client authentication. |
| 1090 | * |
| 1091 | * @param[in] ctx libyang context. |
| 1092 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1093 | * If a Call Home client with this identifier already exists, its contents will be changed. |
| 1094 | * @param[in] endpt_name Arbitrary identifier of the client's endpoint. |
| 1095 | * If the client's endpoint with this identifier already exists, its contents will be changed. |
| 1096 | * @param[in] user_name Arbitrary identifier of the endpoint's user. |
| 1097 | * If the endpoint's user with this identifier already exists, its contents will be changed. |
| 1098 | * @param[in] truststore_reference Name of the public key bag to be referenced and used for authentication. |
| 1099 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 1100 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1101 | * @return 0 on success, non-zero otherwise. |
| 1102 | */ |
| 1103 | int nc_server_config_add_ch_ssh_truststore_ref(const struct ly_ctx *ctx, const char *client_name, |
| 1104 | const char *endpt_name, const char *user_name, const char *truststore_reference, struct lyd_node **config); |
| 1105 | |
| 1106 | /** |
| 1107 | * @brief Deletes a Call Home SSH truststore reference from the YANG data. |
| 1108 | * |
| 1109 | * @param[in] client_name Identifier of an existing Call Home client. |
| 1110 | * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client. |
| 1111 | * @param[in] user_name Identifier of an existing SSH user that belongs to the given CH endpoint. |
| 1112 | * @param[in,out] config Modified configuration YANG data tree. |
| 1113 | * @return 0 on success, non-zero otherwise. |
| 1114 | */ |
| 1115 | int nc_server_config_del_ch_ssh_truststore_ref(const char *client_name, const char *endpt_name, |
| 1116 | const char *user_name, struct lyd_node **config); |
| 1117 | |
| 1118 | /** |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 1119 | * @} SSH Call Home Server Configuration |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 1120 | */ |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 1121 | |
| 1122 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1123 | * @defgroup server_config_ch_tls TLS Call Home Server Configuration |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1124 | * @ingroup server_config_ch |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 1125 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1126 | * @brief TLS Call Home server configuration creation and deletion |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1127 | * @{ |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 1128 | */ |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 1129 | |
roman | b6f4403 | 2023-06-30 15:07:56 +0200 | [diff] [blame] | 1130 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1131 | * @brief Creates new YANG configuration data nodes for a Call Home server's certificate. |
roman | b6f4403 | 2023-06-30 15:07:56 +0200 | [diff] [blame] | 1132 | * |
| 1133 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1134 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1135 | * If a Call Home client with this identifier already exists, its contents will be changed. |
| 1136 | * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint. |
| 1137 | * If a Call Home client's endpoint with this identifier already exists, its contents will be changed. |
roman | 6c4efcd | 2023-08-08 10:18:44 +0200 | [diff] [blame] | 1138 | * @param[in] privkey_path Path to the server's PEM encoded private key file. |
roman | b6f4403 | 2023-06-30 15:07:56 +0200 | [diff] [blame] | 1139 | * @param[in] pubkey_path Optional path to the server's public key file. If not provided, |
| 1140 | * it will be generated from the private key. |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 1141 | * @param[in] cert_path Path to the server's certificate file. |
Roytak | 934edc3 | 2023-07-27 12:04:18 +0200 | [diff] [blame] | 1142 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
roman | b6f4403 | 2023-06-30 15:07:56 +0200 | [diff] [blame] | 1143 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1144 | * @return 0 on success, non-zero otherwise. |
| 1145 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 1146 | int nc_server_config_add_ch_tls_server_cert(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name, |
| 1147 | const char *privkey_path, const char *pubkey_path, const char *cert_path, struct lyd_node **config); |
roman | b6f4403 | 2023-06-30 15:07:56 +0200 | [diff] [blame] | 1148 | |
| 1149 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1150 | * @brief Deletes a Call Home server certificate from the YANG data. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1151 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1152 | * @param[in] client_name Identifier of an existing Call Home client. |
| 1153 | * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1154 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1155 | * @return 0 on success, non-zero otherwise. |
| 1156 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 1157 | int nc_server_config_del_ch_tls_server_cert(const char *client_name, const char *endpt_name, |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 1158 | struct lyd_node **config); |
| 1159 | |
| 1160 | /** |
| 1161 | * @brief Creates new YANG configuration data nodes for a keystore reference to the Call Home TLS server's certificate. |
| 1162 | * |
| 1163 | * @param[in] ctx libyang context. |
| 1164 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1165 | * If a Call Home client with this identifier already exists, its contents will be changed. |
| 1166 | * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint. |
| 1167 | * If a Call Home client's endpoint with this identifier already exists, its contents will be changed. |
| 1168 | * @param[in] asym_key_ref Name of the asymmetric key pair in the keystore to be referenced. |
| 1169 | * @param[in] cert_ref Name of the certificate, which must belong to the given asymmetric key pair, to be referenced. |
| 1170 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 1171 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1172 | * @return 0 on success, non-zero otherwise. |
| 1173 | */ |
| 1174 | int nc_server_config_add_ch_tls_keystore_ref(const struct ly_ctx *ctx, const char *client_name, |
| 1175 | const char *endpt_name, const char *asym_key_ref, const char *cert_ref, struct lyd_node **config); |
| 1176 | |
| 1177 | /** |
| 1178 | * @brief Deletes a TLS server certificate keystore reference from the YANG data. |
| 1179 | * |
| 1180 | * @param[in] client_name Identifier of an existing Call Home client. |
| 1181 | * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client. |
| 1182 | * @param[in,out] config Modified configuration YANG data tree. |
| 1183 | * @return 0 on success, non-zero otherwise. |
| 1184 | */ |
| 1185 | int nc_server_config_del_ch_tls_keystore_ref(const char *client_name, const char *endpt_name, |
Roytak | 934edc3 | 2023-07-27 12:04:18 +0200 | [diff] [blame] | 1186 | struct lyd_node **config); |
| 1187 | |
| 1188 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1189 | * @brief Creates new YANG configuration data nodes for a Call Home client's (end-entity) certificate. |
roman | b6f4403 | 2023-06-30 15:07:56 +0200 | [diff] [blame] | 1190 | * |
| 1191 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1192 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1193 | * If a Call Home client with this identifier already exists, its contents will be changed. |
| 1194 | * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint. |
| 1195 | * If a Call Home client's endpoint with this identifier already exists, its contents will be changed. |
| 1196 | * @param[in] cert_name Arbitrary identifier of the Call Home endpoint's end-entity certificate. |
| 1197 | * If an Call Home endpoint's end-entity certificate with this identifier already exists, its contents will be changed. |
roman | b6f4403 | 2023-06-30 15:07:56 +0200 | [diff] [blame] | 1198 | * @param[in] cert_path Path to the certificate file. |
Roytak | 934edc3 | 2023-07-27 12:04:18 +0200 | [diff] [blame] | 1199 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
roman | b6f4403 | 2023-06-30 15:07:56 +0200 | [diff] [blame] | 1200 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1201 | * @return 0 on success, non-zero otherwise. |
| 1202 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 1203 | int nc_server_config_add_ch_tls_client_cert(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name, |
roman | b6f4403 | 2023-06-30 15:07:56 +0200 | [diff] [blame] | 1204 | const char *cert_name, const char *cert_path, struct lyd_node **config); |
| 1205 | |
| 1206 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1207 | * @brief Deletes a Call Home client (end-entity) certificate from the YANG data. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1208 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1209 | * @param[in] client_name Identifier of an existing Call Home client. |
| 1210 | * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1211 | * @param[in] cert_name Optional identifier of a client certificate to be deleted. |
| 1212 | * If NULL, all of the client certificates will be deleted. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1213 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1214 | * @return 0 on success, non-zero otherwise. |
| 1215 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 1216 | int nc_server_config_del_ch_tls_client_cert(const char *client_name, const char *endpt_name, |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1217 | const char *cert_name, struct lyd_node **config); |
| 1218 | |
| 1219 | /** |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 1220 | * @brief Creates new YANG configuration data nodes for a Call Home truststore reference to a set of client (end-entity) certificates. |
| 1221 | * |
| 1222 | * @param[in] ctx libyang context. |
| 1223 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1224 | * If a Call Home client with this identifier already exists, its contents will be changed. |
| 1225 | * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint. |
| 1226 | * If a Call Home client's endpoint with this identifier already exists, its contents will be changed. |
| 1227 | * @param[in] cert_bag_ref Identifier of the certificate bag in the truststore to be referenced. |
| 1228 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 1229 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1230 | * @return 0 on success, non-zero otherwise. |
| 1231 | */ |
| 1232 | int nc_server_config_add_ch_tls_client_cert_truststore_ref(const struct ly_ctx *ctx, const char *client_name, |
| 1233 | const char *endpt_name, const char *cert_bag_ref, struct lyd_node **config); |
| 1234 | |
| 1235 | /** |
| 1236 | * @brief Deletes a Call Home client (end-entity) certificates truststore reference from the YANG data. |
| 1237 | * |
| 1238 | * @param[in] client_name Identifier of an existing Call Home client. |
| 1239 | * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client. |
| 1240 | * @param[in,out] config Modified configuration YANG data tree. |
| 1241 | * @return 0 on success, non-zero otherwise. |
| 1242 | */ |
| 1243 | int nc_server_config_del_ch_tls_client_cert_truststore_ref(const char *client_name, const char *endpt_name, |
| 1244 | struct lyd_node **config); |
| 1245 | |
| 1246 | /** |
roman | b6f4403 | 2023-06-30 15:07:56 +0200 | [diff] [blame] | 1247 | * @brief Creates new YANG configuration data nodes for a client certificate authority (trust-anchor) certificate. |
| 1248 | * |
| 1249 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1250 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1251 | * If a Call Home client with this identifier already exists, its contents will be changed. |
| 1252 | * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint. |
| 1253 | * If a Call Home client's endpoint with this identifier already exists, its contents will be changed. |
| 1254 | * @param[in] cert_name Arbitrary identifier of the Call Home endpoint's certificate authority certificate. |
| 1255 | * If an Call Home endpoint's CA certificate with this identifier already exists, its contents will be changed. |
roman | b6f4403 | 2023-06-30 15:07:56 +0200 | [diff] [blame] | 1256 | * @param[in] cert_path Path to the certificate file. |
Roytak | 9b32c0f | 2023-08-02 15:07:29 +0200 | [diff] [blame] | 1257 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
roman | b6f4403 | 2023-06-30 15:07:56 +0200 | [diff] [blame] | 1258 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1259 | * @return 0 on success, non-zero otherwise. |
| 1260 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 1261 | int nc_server_config_add_ch_tls_ca_cert(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name, |
roman | b6f4403 | 2023-06-30 15:07:56 +0200 | [diff] [blame] | 1262 | const char *cert_name, const char *cert_path, struct lyd_node **config); |
| 1263 | |
| 1264 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1265 | * @brief Deletes a Call Home client certificate authority (trust-anchor) certificate from the YANG data. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1266 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1267 | * @param[in] client_name Identifier of an existing Call Home client. |
| 1268 | * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1269 | * @param[in] cert_name Optional identifier of a CA certificate to be deleted. |
| 1270 | * If NULL, all of the CA certificates will be deleted. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1271 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1272 | * @return 0 on success, non-zero otherwise. |
| 1273 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 1274 | int nc_server_config_del_ch_tls_ca_cert(const char *client_name, const char *endpt_name, |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1275 | const char *cert_name, struct lyd_node **config); |
| 1276 | |
| 1277 | /** |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 1278 | * @brief Creates new YANG configuration data nodes for a Call Home truststore reference to a set of client certificate authority (trust-anchor) certificates. |
| 1279 | * |
| 1280 | * @param[in] ctx libyang context. |
| 1281 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1282 | * If a Call Home client with this identifier already exists, its contents will be changed. |
| 1283 | * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint. |
| 1284 | * If a Call Home client's endpoint with this identifier already exists, its contents will be changed. |
| 1285 | * @param[in] cert_bag_ref Identifier of the certificate bag in the truststore to be referenced. |
| 1286 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 1287 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1288 | * @return 0 on success, non-zero otherwise. |
| 1289 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 1290 | int nc_server_config_add_ch_tls_ca_cert_truststore_ref(const struct ly_ctx *ctx, const char *client_name, |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 1291 | const char *endpt_name, const char *cert_bag_ref, struct lyd_node **config); |
| 1292 | |
| 1293 | /** |
| 1294 | * @brief Deletes a Call Home client certificate authority (trust-anchor) certificates truststore reference from the YANG data. |
| 1295 | * |
| 1296 | * @param[in] client_name Identifier of an existing Call Home client. |
| 1297 | * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client. |
| 1298 | * @param[in,out] config Modified configuration YANG data tree. |
| 1299 | * @return 0 on success, non-zero otherwise. |
| 1300 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 1301 | int nc_server_config_del_ch_tls_ca_cert_truststore_ref(const char *client_name, const char *endpt_name, |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 1302 | struct lyd_node **config); |
| 1303 | |
| 1304 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1305 | * @brief Creates new YANG configuration data nodes for a Call Home cert-to-name entry. |
roman | b6f4403 | 2023-06-30 15:07:56 +0200 | [diff] [blame] | 1306 | * |
| 1307 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1308 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1309 | * If a Call Home client with this identifier already exists, its contents will be changed. |
| 1310 | * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint. |
| 1311 | * If a Call Home client's endpoint with this identifier already exists, its contents will be changed. |
roman | b6f4403 | 2023-06-30 15:07:56 +0200 | [diff] [blame] | 1312 | * @param[in] id ID of the entry. The lower the ID, the higher the priority of the entry (it will be checked earlier). |
| 1313 | * @param[in] fingerprint Optional fingerprint of the entry. The fingerprint should always be set, however if it is |
| 1314 | * not set, it will match any certificate. Entry with no fingerprint should therefore be placed only as the last entry. |
| 1315 | * @param[in] map_type Mapping username to the certificate option. |
| 1316 | * @param[in] name Username for this cert-to-name entry. |
Roytak | 9b32c0f | 2023-08-02 15:07:29 +0200 | [diff] [blame] | 1317 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
roman | b6f4403 | 2023-06-30 15:07:56 +0200 | [diff] [blame] | 1318 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1319 | * @return 0 on success, non-zero otherwise. |
| 1320 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 1321 | int nc_server_config_add_ch_tls_ctn(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name, |
roman | b6f4403 | 2023-06-30 15:07:56 +0200 | [diff] [blame] | 1322 | uint32_t id, const char *fingerprint, NC_TLS_CTN_MAPTYPE map_type, const char *name, struct lyd_node **config); |
| 1323 | |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1324 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1325 | * @brief Deletes a Call Home cert-to-name entry from the YANG data. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1326 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1327 | * @param[in] client_name Identifier of an existing Call Home client. |
| 1328 | * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client. |
| 1329 | * @param[in] id Optional identifier of the Call Home CTN entry to be deleted. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1330 | * If 0, all of the CTN entries will be deleted. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1331 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1332 | * @return 0 on success, non-zero otherwise. |
| 1333 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 1334 | int nc_server_config_del_ch_tls_ctn(const char *client_name, const char *endpt_name, |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1335 | uint32_t id, struct lyd_node **config); |
| 1336 | |
| 1337 | /** |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 1338 | * @} TLS Call Home Server Configuration |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1339 | */ |
| 1340 | |
roman | 2eab474 | 2023-06-06 10:00:26 +0200 | [diff] [blame] | 1341 | #endif /* NC_ENABLED_SSH_TLS */ |
roman | 45cec4e | 2023-02-17 10:21:39 +0100 | [diff] [blame] | 1342 | |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 1343 | #ifdef __cplusplus |
| 1344 | } |
| 1345 | #endif |
| 1346 | |
| 1347 | #endif /* NC_SESSION_SERVER_H_ */ |