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 | * |
roman | c651842 | 2023-11-30 16:39:00 +0100 | [diff] [blame^] | 386 | * One of Linux PAM, local users, or user callback is used to authenticate users with this SSH method (see \ref ln2doc_kbdint "the documentation"). |
roman | 808f3f6 | 2023-11-23 16:01:04 +0100 | [diff] [blame] | 387 | * |
| 388 | * @param[in] ctx libyang context. |
| 389 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
| 390 | * If an endpoint with this identifier already exists, its user might be changed. |
| 391 | * @param[in] user_name Arbitrary identifier of the user. |
| 392 | * If an user with this identifier already exists, its contents will be changed. |
| 393 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 394 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 395 | * @return 0 on success, non-zero otherwise. |
| 396 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 397 | 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] | 398 | const char *user_name, struct lyd_node **config); |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 399 | |
| 400 | /** |
| 401 | * @brief Deletes an SSH user's keyboard interactive authentication from the YANG data. |
| 402 | * |
| 403 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 404 | * @param[in] user_name Identifier of an existing user on the given endpoint. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 405 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 406 | * @return 0 on success, non-zero otherwise. |
| 407 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 408 | 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] | 409 | struct lyd_node **config); |
| 410 | |
| 411 | /** |
| 412 | * @brief Deletes an SSH user from the YANG data. |
| 413 | * |
| 414 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 415 | * @param[in] user_name Optional identifier of an user to be deleted. |
| 416 | * If NULL, all of the users on this endpoint will be deleted. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 417 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 418 | * @return 0 on success, non-zero otherwise. |
| 419 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 420 | int nc_server_config_del_ssh_user(const char *endpt_name, |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 421 | const char *user_name, struct lyd_node **config); |
| 422 | |
| 423 | /** |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 424 | * @brief Creates new YANG data nodes for a reference to a public key bag located in the truststore. |
| 425 | * |
| 426 | * The public key's located in the bag will be used for client authentication. |
| 427 | * |
| 428 | * @param[in] ctx libyang context. |
| 429 | * @param[in] endpt_name Arbitrary identifier of an endpoint. |
| 430 | * If an endpoint with this identifier already exists, its contents will be changed. |
| 431 | * @param[in] user_name Arbitrary identifier of the endpoint's user. |
| 432 | * If an endpoint's user with this identifier already exists, its contents will be changed. |
| 433 | * @param[in] truststore_reference Name of the public key bag to be referenced and used for authentication. |
| 434 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 435 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 436 | * @return 0 on success, non-zero otherwise. |
| 437 | */ |
| 438 | int nc_server_config_add_ssh_truststore_ref(const struct ly_ctx *ctx, const char *endpt_name, const char *user_name, |
| 439 | const char *truststore_reference, struct lyd_node **config); |
| 440 | |
| 441 | /** |
| 442 | * @brief Deletes a truststore reference from the YANG data. |
| 443 | * |
| 444 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 445 | * @param[in] user_name Identifier of an user on the given endpoint whose truststore reference will be deleted. |
| 446 | * @param[in,out] config Modified configuration YANG data tree. |
| 447 | * @return 0 on success, non-zero otherwise. |
| 448 | */ |
| 449 | int nc_server_config_del_ssh_truststore_ref(const char *endpt_name, const char *user_name, |
| 450 | struct lyd_node **config); |
| 451 | |
| 452 | /** |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 453 | * @brief Creates new YANG configuration data nodes, which will be a reference to another SSH endpoint's users. |
| 454 | * |
| 455 | * Whenever a client tries to connect to the referencing endpoint, all of its users will be tried first. If no match is |
| 456 | * found, the referenced endpoint's configured users will be tried. |
| 457 | * |
| 458 | * @param[in] ctx libyang context |
| 459 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
| 460 | * If an endpoint with this identifier already exists, its contents will be changed. |
| 461 | * @param[in] referenced_endpt Identifier of an endpoint, which has to exist whenever this data |
| 462 | * is applied. The referenced endpoint can reference another one and so on, but there mustn't be a cycle. |
| 463 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 464 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 465 | * @return 0 on success, non-zero otherwise. |
| 466 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 467 | 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] | 468 | const char *referenced_endpt, struct lyd_node **config); |
| 469 | |
| 470 | /** |
| 471 | * @brief Deletes reference to another SSH endpoint's users from the YANG data. |
| 472 | * |
| 473 | * @param[in] endpt_name Identifier of an existing endpoint. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 474 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 475 | * @return 0 on success, non-zero otherwise. |
| 476 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 477 | 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] | 478 | |
| 479 | /** |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 480 | * @} SSH Server Configuration |
roman | 9b1379c | 2023-03-31 10:11:10 +0200 | [diff] [blame] | 481 | */ |
roman | 9b1379c | 2023-03-31 10:11:10 +0200 | [diff] [blame] | 482 | |
| 483 | /** |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 484 | * @defgroup server_config_tls TLS Server Configuration |
| 485 | * @ingroup server_config |
roman | 9b1379c | 2023-03-31 10:11:10 +0200 | [diff] [blame] | 486 | * |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 487 | * @brief TLS server configuration creation and deletion |
| 488 | * @{ |
roman | 9b1379c | 2023-03-31 10:11:10 +0200 | [diff] [blame] | 489 | */ |
roman | 2e797ef | 2023-06-19 10:47:49 +0200 | [diff] [blame] | 490 | |
| 491 | /** |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 492 | * @brief Creates new YANG configuration data nodes for a server's certificate. |
| 493 | * |
| 494 | * @param[in] ctx libyang context. |
| 495 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 496 | * 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] | 497 | * @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] | 498 | * @param[in] pubkey_path Optional path to the server's public key file. If not provided, |
| 499 | * it will be generated from the private key. |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 500 | * @param[in] cert_path Path to the server's certificate file. |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 501 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 502 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 503 | * @return 0 on success, non-zero otherwise. |
| 504 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 505 | int nc_server_config_add_tls_server_cert(const struct ly_ctx *ctx, const char *endpt_name, const char *privkey_path, |
| 506 | const char *pubkey_path, const char *cert_path, struct lyd_node **config); |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 507 | |
| 508 | /** |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 509 | * @brief Deletes the server's certificate from the YANG data. |
| 510 | * |
| 511 | * @param[in] endpt_name Identifier of an existing endpoint. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 512 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 513 | * @return 0 on success, non-zero otherwise. |
| 514 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 515 | 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] | 516 | |
| 517 | /** |
| 518 | * @brief Creates new YANG configuration data nodes for a keystore reference to the TLS server's certificate. |
| 519 | * |
| 520 | * @param[in] ctx libyang context. |
| 521 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
| 522 | * If an endpoint with this identifier already exists, its contents will be changed. |
| 523 | * @param[in] asym_key_ref Name of the asymmetric key pair in the keystore to be referenced. |
| 524 | * @param[in] cert_ref Name of the certificate, which must belong to the given asymmetric key pair, to be referenced. |
| 525 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 526 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 527 | * @return 0 on success, non-zero otherwise. |
| 528 | */ |
| 529 | int nc_server_config_add_tls_keystore_ref(const struct ly_ctx *ctx, const char *endpt_name, const char *asym_key_ref, |
| 530 | const char *cert_ref, struct lyd_node **config); |
| 531 | |
| 532 | /** |
| 533 | * @brief Deletes a TLS server certificate keystore reference from the YANG data. |
| 534 | * |
| 535 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 536 | * @param[in,out] config Modified configuration YANG data tree. |
| 537 | * @return 0 on success, non-zero otherwise. |
| 538 | */ |
| 539 | 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] | 540 | |
| 541 | /** |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 542 | * @brief Creates new YANG configuration data nodes for a client's (end-entity) certificate. |
| 543 | * |
| 544 | * @param[in] ctx libyang context. |
| 545 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 546 | * If an endpoint with this identifier already exists, its contents will be changed. |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 547 | * @param[in] cert_name Arbitrary identifier of the client's certificate. |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 548 | * If a client certificate with this identifier already exists, it will be changed. |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 549 | * @param[in] cert_path Path to the client's certificate file. |
| 550 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 551 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 552 | * @return 0 on success, non-zero otherwise. |
| 553 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 554 | 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] | 555 | const char *cert_path, struct lyd_node **config); |
| 556 | |
| 557 | /** |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 558 | * @brief Deletes a client (end-entity) certificate from the YANG data. |
| 559 | * |
| 560 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 561 | * @param[in] cert_name Optional name of a certificate to be deleted. |
| 562 | * 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] | 563 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 564 | * @return 0 on success, non-zero otherwise. |
| 565 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 566 | 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] | 567 | |
| 568 | /** |
| 569 | * @brief Creates new YANG configuration data nodes for a truststore reference to a set of client (end-entity) certificates. |
| 570 | * |
| 571 | * @param[in] ctx libyang context. |
| 572 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
| 573 | * If an endpoint with this identifier already exists, its contents will be changed. |
| 574 | * @param[in] cert_bag_ref Identifier of the certificate bag in the truststore to be referenced. |
| 575 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 576 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 577 | * @return 0 on success, non-zero otherwise. |
| 578 | */ |
| 579 | int nc_server_config_add_tls_client_cert_truststore_ref(const struct ly_ctx *ctx, const char *endpt_name, |
| 580 | const char *cert_bag_ref, struct lyd_node **config); |
| 581 | |
| 582 | /** |
| 583 | * @brief Deletes a client (end-entity) certificates truststore reference from the YANG data. |
| 584 | * |
| 585 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 586 | * @param[in,out] config Modified configuration YANG data tree. |
| 587 | * @return 0 on success, non-zero otherwise. |
| 588 | */ |
| 589 | 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] | 590 | |
| 591 | /** |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 592 | * @brief Creates new YANG configuration data nodes for a client certificate authority (trust-anchor) certificate. |
| 593 | * |
| 594 | * @param[in] ctx libyang context. |
| 595 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 596 | * If an endpoint with this identifier already exists, its contents will be changed. |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 597 | * @param[in] cert_name Arbitrary identifier of the certificate authority certificate. |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 598 | * If a CA with this identifier already exists, it will be changed. |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 599 | * @param[in] cert_path Path to the CA certificate file. |
| 600 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 601 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 602 | * @return 0 on success, non-zero otherwise. |
| 603 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 604 | 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] | 605 | const char *cert_path, struct lyd_node **config); |
| 606 | |
| 607 | /** |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 608 | * @brief Deletes a client certificate authority (trust-anchor) certificate from the YANG data. |
| 609 | * |
| 610 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 611 | * @param[in] cert_name Optional name of a certificate to be deleted. |
| 612 | * 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] | 613 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 614 | * @return 0 on success, non-zero otherwise. |
| 615 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 616 | 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] | 617 | |
| 618 | /** |
| 619 | * @brief Creates new YANG configuration data nodes for a truststore reference to a set of client certificate authority (trust-anchor) certificates. |
| 620 | * |
| 621 | * @param[in] ctx libyang context. |
| 622 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
| 623 | * If an endpoint with this identifier already exists, its contents will be changed. |
| 624 | * @param[in] cert_bag_ref Identifier of the certificate bag in the truststore to be referenced. |
| 625 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 626 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 627 | * @return 0 on success, non-zero otherwise. |
| 628 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 629 | 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] | 630 | const char *cert_bag_ref, struct lyd_node **config); |
| 631 | |
| 632 | /** |
| 633 | * @brief Deletes a client certificate authority (trust-anchor) certificates truststore reference from the YANG data. |
| 634 | * |
| 635 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 636 | * @param[in,out] config Modified configuration YANG data tree. |
| 637 | * @return 0 on success, non-zero otherwise. |
| 638 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 639 | 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] | 640 | |
| 641 | /** |
Roytak | 7695891 | 2023-09-29 15:25:14 +0200 | [diff] [blame] | 642 | * @brief Creates new YANG configuration data nodes, which will be a reference to another TLS endpoint's certificates. |
| 643 | * |
| 644 | * Whenever an user tries to connect to the referencing endpoint, all of its certificates will be tried first. If no match is |
| 645 | * found, the referenced endpoint's configured certificates will be tried. The same applies to cert-to-name entries. |
| 646 | * |
| 647 | * @param[in] ctx libyang context |
| 648 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
| 649 | * If an endpoint with this identifier already exists, its contents will be changed. |
| 650 | * @param[in] referenced_endpt Identifier of an endpoint, which has to exist whenever this data |
| 651 | * is applied. The referenced endpoint can reference another one and so on, but there mustn't be a cycle. |
| 652 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 653 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 654 | * @return 0 on success, non-zero otherwise. |
| 655 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 656 | 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] | 657 | const char *referenced_endpt, struct lyd_node **config); |
| 658 | |
| 659 | /** |
| 660 | * @brief Deletes reference to another TLS endpoint's users from the YANG data. |
| 661 | * |
| 662 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 663 | * @param[in,out] config Modified configuration YANG data tree. |
| 664 | * @return 0 on success, non-zero otherwise. |
| 665 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 666 | 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] | 667 | |
| 668 | /** |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 669 | * @brief Creates new YANG configuration data nodes for a cert-to-name entry. |
| 670 | * |
| 671 | * @param[in] ctx libyang context. |
| 672 | * @param[in] endpt_name Arbitrary identifier of the endpoint. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 673 | * If an endpoint with this identifier already exists, its contents will be changed. |
roman | 3f9b65c | 2023-06-05 14:26:58 +0200 | [diff] [blame] | 674 | * @param[in] id ID of the entry. The lower the ID, the higher the priority of the entry (it will be checked earlier). |
| 675 | * @param[in] fingerprint Optional fingerprint of the entry. The fingerprint should always be set, however if it is |
| 676 | * not set, it will match any certificate. Entry with no fingerprint should therefore be placed only as the last entry. |
| 677 | * @param[in] map_type Mapping username to the certificate option. |
| 678 | * @param[in] name Username for this cert-to-name entry. |
| 679 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 680 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 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_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] | 684 | NC_TLS_CTN_MAPTYPE map_type, const char *name, struct lyd_node **config); |
| 685 | |
roman | 12644fe | 2023-06-08 11:06:42 +0200 | [diff] [blame] | 686 | /** |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 687 | * @brief Deletes a cert-to-name entry from the YANG data. |
| 688 | * |
| 689 | * @param[in] endpt_name Identifier of an existing endpoint. |
| 690 | * @param[in] id Optional ID of the CTN entry. |
| 691 | * 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] | 692 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 693 | * @return 0 on success, non-zero otherwise. |
| 694 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 695 | 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] | 696 | |
| 697 | /** |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 698 | * @} TLS Server Configuration |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 699 | */ |
| 700 | |
| 701 | /** |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 702 | * @defgroup server_config_ch Call Home Server Configuration |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 703 | * @ingroup server_config |
| 704 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 705 | * @brief Call Home server configuration creation and deletion |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 706 | * @{ |
| 707 | */ |
| 708 | |
| 709 | /** |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 710 | * @} Call Home Server Configuration |
| 711 | */ |
| 712 | |
| 713 | /** |
| 714 | * @defgroup server_config_ch_functions Call Home Server Configuration Functions |
| 715 | * @ingroup server_config_ch |
| 716 | * |
| 717 | * @brief Call Home server configuration functions |
| 718 | * @{ |
| 719 | */ |
| 720 | |
| 721 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 722 | * @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] | 723 | * |
| 724 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 725 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 726 | * 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] | 727 | * @param[in] endpt_name Arbitrary identifier of the client's endpoint. |
| 728 | * If the client's endpoint with this identifier already exists, its contents will be changed. |
| 729 | * @param[in] transport Transport protocol to be used on this endpoint - either SSH or TLS. |
| 730 | * @param[in] address Address to connect to. |
| 731 | * @param[in] port Port to connect to. |
| 732 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 733 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 734 | * @return 0 on success, non-zero otherwise. |
| 735 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 736 | 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] | 737 | NC_TRANSPORT_IMPL transport, const char *address, const char *port, struct lyd_node **config); |
| 738 | |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 739 | #endif /* NC_ENABLED_SSH_TLS */ |
| 740 | |
| 741 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 742 | * @brief Deletes a Call Home client from the YANG data. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 743 | * |
| 744 | * @param[in] client_name Optional identifier of a client to be deleted. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 745 | * If NULL, all of the Call Home clients will be deleted. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 746 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 747 | * @return 0 on success, non-zero otherwise. |
| 748 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 749 | 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] | 750 | |
| 751 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 752 | * @brief Deletes a Call Home endpoint from the YANG data. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 753 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 754 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 755 | * @param[in] endpt_name Optional identifier of a CH endpoint to be deleted. |
| 756 | * 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] | 757 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 758 | * @return 0 on success, non-zero otherwise. |
| 759 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 760 | 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] | 761 | |
| 762 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 763 | * @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] | 764 | * |
| 765 | * This is the default connection type. If periodic connection type was set before, it will be unset. |
| 766 | * |
| 767 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 768 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 769 | * 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] | 770 | * @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] | 771 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 772 | * @return 0 on success, non-zero otherwise. |
| 773 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 774 | 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] | 775 | |
| 776 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 777 | * @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] | 778 | * |
| 779 | * If called, the persistent connection type will be replaced by periodic. |
| 780 | * |
| 781 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 782 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 783 | * 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] | 784 | * @param[in] period Duration between periodic connections in minutes. |
Roytak | 9b32c0f | 2023-08-02 15:07:29 +0200 | [diff] [blame] | 785 | * @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] | 786 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 787 | * @return 0 on success, non-zero otherwise. |
| 788 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 789 | 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] | 790 | struct lyd_node **config); |
| 791 | |
| 792 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 793 | * @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] | 794 | * |
| 795 | * This behaves the same as setting the period to 60 minutes, which is the default value of this node. |
| 796 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 797 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 798 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 799 | * @return 0 on success, non-zero otherwise. |
| 800 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 801 | 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] | 802 | |
| 803 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 804 | * @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] | 805 | * |
| 806 | * If called, the persistent connection type will be replaced by periodic. |
| 807 | * |
| 808 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 809 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 810 | * 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] | 811 | * @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] | 812 | * @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] | 813 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 814 | * @return 0 on success, non-zero otherwise. |
| 815 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 816 | 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] | 817 | const char *anchor_time, struct lyd_node **config); |
| 818 | |
| 819 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 820 | * @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] | 821 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 822 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 823 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 824 | * @return 0 on success, non-zero otherwise. |
| 825 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 826 | 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] | 827 | |
| 828 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 829 | * @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] | 830 | * |
| 831 | * If called, the persistent connection type will be replaced by periodic. |
| 832 | * |
| 833 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 834 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 835 | * 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] | 836 | * @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] | 837 | * @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] | 838 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 839 | * @return 0 on success, non-zero otherwise. |
| 840 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 841 | 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] | 842 | uint16_t idle_timeout, struct lyd_node **config); |
| 843 | |
| 844 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 845 | * @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] | 846 | * |
| 847 | * This behaves the same as setting the timeout to 180 seconds, which is the default value of this node. |
| 848 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 849 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 850 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 851 | * @return 0 on success, non-zero otherwise. |
| 852 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 853 | 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] | 854 | |
| 855 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 856 | * @brief Creates new YANG configuration data nodes for the Call Home reconnect strategy. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 857 | * |
| 858 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 859 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 860 | * 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] | 861 | * @param[in] start_with Specifies which endpoint to try if a connection is unsuccessful. Default value is NC_CH_FIRST_LISTED. |
| 862 | * @param[in] max_wait The number of seconds after which a connection to an endpoint is deemed unsuccessful. Default value if 5. |
| 863 | * @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] | 864 | * @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] | 865 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 866 | * @return 0 on success, non-zero otherwise. |
| 867 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 868 | 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] | 869 | NC_CH_START_WITH start_with, uint16_t max_wait, uint8_t max_attempts, struct lyd_node **config); |
| 870 | |
| 871 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 872 | * @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] | 873 | * |
| 874 | * The default values are: start-with = NC_CH_FIRST_LISTED, max-wait = 5 and max-attempts = 3. |
| 875 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 876 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 877 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 878 | * @return 0 on success, non-zero otherwise. |
| 879 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 880 | 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] | 881 | |
| 882 | /** |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 883 | * @} Call Home Server Configuration Functions |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 884 | */ |
| 885 | |
| 886 | #ifdef NC_ENABLED_SSH_TLS |
| 887 | |
| 888 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 889 | * @defgroup server_config_ch_ssh SSH Call Home Server Configuration |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 890 | * @ingroup server_config_ch |
| 891 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 892 | * @brief SSH Call Home server configuration creation and deletion |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 893 | * @{ |
| 894 | */ |
| 895 | |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 896 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 897 | * @brief Creates new YANG data nodes for a Call Home SSH hostkey. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 898 | * |
| 899 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 900 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 901 | * 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] | 902 | * @param[in] endpt_name Arbitrary identifier of the client's endpoint. |
| 903 | * If the client's endpoint with this identifier already exists, its contents will be changed. |
| 904 | * @param[in] hostkey_name Arbitrary identifier of the endpoint's hostkey. |
| 905 | * If the endpoint's hostkey with this identifier already exists, its contents will be changed. |
| 906 | * @param[in] privkey_path Path to a file containing a private key. |
| 907 | * The private key has to be in a PEM format. Only RSA and ECDSA keys are supported. |
| 908 | * @param[in] pubkey_path Path to a file containing a public key. If NULL, public key will be |
| 909 | * generated from the private key. |
| 910 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 911 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 912 | * @return 0 on success, non-zero otherwise. |
| 913 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 914 | 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] | 915 | const char *hostkey_name, const char *privkey_path, const char *pubkey_path, struct lyd_node **config); |
| 916 | |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 917 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 918 | * @brief Deletes a Call Home hostkey from the YANG data. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 919 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 920 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 921 | * @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] | 922 | * @param[in] hostkey_name Optional identifier of a hostkey to be deleted. |
| 923 | * If NULL, all of the hostkeys on the given endpoint will be deleted. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 924 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 925 | * @return 0 on success, non-zero otherwise. |
| 926 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 927 | 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] | 928 | const char *hostkey_name, struct lyd_node **config); |
| 929 | |
| 930 | /** |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 931 | * @brief Creates new YANG data nodes for a reference to an asymmetric key located in the keystore. |
| 932 | * |
| 933 | * This asymmetric key pair will be used as the Call Home SSH hostkey. |
| 934 | * |
| 935 | * @param[in] ctx libyang context. |
| 936 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 937 | * If a Call Home client with this identifier already exists, its contents will be changed. |
| 938 | * @param[in] endpt_name Arbitrary identifier of the client's endpoint. |
| 939 | * If the client's endpoint with this identifier already exists, its contents will be changed. |
| 940 | * @param[in] hostkey_name Arbitrary identifier of the endpoint's hostkey. |
| 941 | * If the endpoint's hostkey with this identifier already exists, its contents will be changed. |
| 942 | * @param[in] keystore_reference Name of the asymmetric key pair to be referenced and used as a hostkey. |
| 943 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 944 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 945 | * @return 0 on success, non-zero otherwise. |
| 946 | */ |
| 947 | int nc_server_config_add_ch_ssh_keystore_ref(const struct ly_ctx *ctx, const char *client_name, |
| 948 | const char *endpt_name, const char *hostkey_name, const char *keystore_reference, struct lyd_node **config); |
| 949 | |
| 950 | /** |
| 951 | * @brief Deletes a Call Home keystore reference from the YANG data. |
| 952 | * |
| 953 | * @param[in] client_name Identifier of an existing Call Home client. |
| 954 | * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client. |
| 955 | * @param[in] hostkey_name Identifier of an existing hostkey that belongs to the given CH endpoint. |
| 956 | * @param[in,out] config Modified configuration YANG data tree. |
| 957 | * @return 0 on success, non-zero otherwise. |
| 958 | */ |
| 959 | int nc_server_config_del_ch_ssh_keystore_ref(const char *client_name, const char *endpt_name, |
| 960 | const char *hostkey_name, struct lyd_node **config); |
| 961 | |
| 962 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 963 | * @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] | 964 | * |
| 965 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 966 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 967 | * 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] | 968 | * @param[in] endpt_name Arbitrary identifier of the client's endpoint. |
| 969 | * If the client's endpoint with this identifier already exists, its contents will be changed. |
| 970 | * @param[in] user_name Arbitrary identifier of the endpoint's user. |
| 971 | * If the endpoint's user with this identifier already exists, its contents will be changed. |
| 972 | * @param[in] pubkey_name Arbitrary identifier of the user's public key. |
| 973 | * If the user's public key with this identifier already exists, its contents will be changed. |
| 974 | * @param[in] pubkey_path Path to a file containing a public key. |
| 975 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 976 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 977 | * @return 0 on success, non-zero otherwise. |
| 978 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 979 | 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] | 980 | const char *user_name, const char *pubkey_name, const char *pubkey_path, struct lyd_node **config); |
| 981 | |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 982 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 983 | * @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] | 984 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 985 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 986 | * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client. |
| 987 | * @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] | 988 | * @param[in] pubkey_name Optional identifier of a public key to be deleted. |
| 989 | * 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] | 990 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 991 | * @return 0 on success, non-zero otherwise. |
| 992 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 993 | 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] | 994 | const char *user_name, const char *pubkey_name, struct lyd_node **config); |
roman | 5cbb653 | 2023-06-22 12:53:17 +0200 | [diff] [blame] | 995 | |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 996 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 997 | * @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] | 998 | * |
| 999 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1000 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1001 | * 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] | 1002 | * @param[in] endpt_name Arbitrary identifier of the client's endpoint. |
| 1003 | * If the client's endpoint with this identifier already exists, its contents will be changed. |
| 1004 | * @param[in] user_name Arbitrary identifier of the endpoint's user. |
| 1005 | * 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] | 1006 | * @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] | 1007 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 1008 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1009 | * @return 0 on success, non-zero otherwise. |
| 1010 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 1011 | 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] | 1012 | const char *user_name, const char *password, struct lyd_node **config); |
| 1013 | |
| 1014 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1015 | * @brief Deletes a Call Home SSH user's password from the YANG data. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1016 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1017 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1018 | * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client. |
| 1019 | * @param[in] user_name Identifier of an existing SSH user that belongs to the given CH endpoint. |
| 1020 | * @param[in,out] config Modified configuration YANG data tree. |
| 1021 | * @return 0 on success, non-zero otherwise. |
| 1022 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 1023 | 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] | 1024 | const char *user_name, struct lyd_node **config); |
| 1025 | |
| 1026 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1027 | * @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] | 1028 | * |
roman | c651842 | 2023-11-30 16:39:00 +0100 | [diff] [blame^] | 1029 | * One of Linux PAM, local users, or user callback is used to authenticate users with this SSH method (see \ref ln2doc_kbdint "the documentation"). |
roman | 808f3f6 | 2023-11-23 16:01:04 +0100 | [diff] [blame] | 1030 | * |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1031 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1032 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1033 | * 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] | 1034 | * @param[in] endpt_name Arbitrary identifier of the client's endpoint. |
| 1035 | * If the client's endpoint with this identifier already exists, its contents will be changed. |
| 1036 | * @param[in] user_name Arbitrary identifier of the endpoint's user. |
| 1037 | * 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] | 1038 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 1039 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1040 | * @return 0 on success, non-zero otherwise. |
| 1041 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 1042 | 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] | 1043 | const char *user_name, struct lyd_node **config); |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1044 | |
| 1045 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1046 | * @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] | 1047 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1048 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1049 | * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client. |
| 1050 | * @param[in] user_name Identifier of an existing SSH user that belongs to the given CH endpoint. |
| 1051 | * @param[in,out] config Modified configuration YANG data tree. |
| 1052 | * @return 0 on success, non-zero otherwise. |
| 1053 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 1054 | 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] | 1055 | const char *user_name, struct lyd_node **config); |
| 1056 | |
| 1057 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1058 | * @brief Deletes a Call Home SSH user from the YANG data. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1059 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1060 | * @param[in] client_name Identifier of an existing Call Home client. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1061 | * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client. |
| 1062 | * @param[in] user_name Identifier of an existing SSH user that belongs to the given CH endpoint. |
| 1063 | * @param[in,out] config Modified configuration YANG data tree. |
| 1064 | * @return 0 on success, non-zero otherwise. |
| 1065 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 1066 | 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] | 1067 | const char *user_name, struct lyd_node **config); |
| 1068 | |
| 1069 | /** |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 1070 | * @brief Creates new YANG data nodes for a reference to a public key bag located in the truststore. |
| 1071 | * |
| 1072 | * The public key's located in the bag will be used for Call Home SSH client authentication. |
| 1073 | * |
| 1074 | * @param[in] ctx libyang context. |
| 1075 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1076 | * If a Call Home client with this identifier already exists, its contents will be changed. |
| 1077 | * @param[in] endpt_name Arbitrary identifier of the client's endpoint. |
| 1078 | * If the client's endpoint with this identifier already exists, its contents will be changed. |
| 1079 | * @param[in] user_name Arbitrary identifier of the endpoint's user. |
| 1080 | * If the endpoint's user with this identifier already exists, its contents will be changed. |
| 1081 | * @param[in] truststore_reference Name of the public key bag to be referenced and used for authentication. |
| 1082 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 1083 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1084 | * @return 0 on success, non-zero otherwise. |
| 1085 | */ |
| 1086 | int nc_server_config_add_ch_ssh_truststore_ref(const struct ly_ctx *ctx, const char *client_name, |
| 1087 | const char *endpt_name, const char *user_name, const char *truststore_reference, struct lyd_node **config); |
| 1088 | |
| 1089 | /** |
| 1090 | * @brief Deletes a Call Home SSH truststore reference from the YANG data. |
| 1091 | * |
| 1092 | * @param[in] client_name Identifier of an existing Call Home client. |
| 1093 | * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client. |
| 1094 | * @param[in] user_name Identifier of an existing SSH user that belongs to the given CH endpoint. |
| 1095 | * @param[in,out] config Modified configuration YANG data tree. |
| 1096 | * @return 0 on success, non-zero otherwise. |
| 1097 | */ |
| 1098 | int nc_server_config_del_ch_ssh_truststore_ref(const char *client_name, const char *endpt_name, |
| 1099 | const char *user_name, struct lyd_node **config); |
| 1100 | |
| 1101 | /** |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 1102 | * @} SSH Call Home Server Configuration |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 1103 | */ |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 1104 | |
| 1105 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1106 | * @defgroup server_config_ch_tls TLS Call Home Server Configuration |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1107 | * @ingroup server_config_ch |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 1108 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1109 | * @brief TLS Call Home server configuration creation and deletion |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1110 | * @{ |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 1111 | */ |
roman | 142718b | 2023-06-29 09:15:29 +0200 | [diff] [blame] | 1112 | |
roman | b6f4403 | 2023-06-30 15:07:56 +0200 | [diff] [blame] | 1113 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1114 | * @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] | 1115 | * |
| 1116 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1117 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1118 | * If a Call Home client with this identifier already exists, its contents will be changed. |
| 1119 | * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint. |
| 1120 | * 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] | 1121 | * @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] | 1122 | * @param[in] pubkey_path Optional path to the server's public key file. If not provided, |
| 1123 | * it will be generated from the private key. |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 1124 | * @param[in] cert_path Path to the server's certificate file. |
Roytak | 934edc3 | 2023-07-27 12:04:18 +0200 | [diff] [blame] | 1125 | * @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] | 1126 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1127 | * @return 0 on success, non-zero otherwise. |
| 1128 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 1129 | int nc_server_config_add_ch_tls_server_cert(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name, |
| 1130 | 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] | 1131 | |
| 1132 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1133 | * @brief Deletes a Call Home server certificate from the YANG data. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1134 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1135 | * @param[in] client_name Identifier of an existing Call Home client. |
| 1136 | * @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] | 1137 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1138 | * @return 0 on success, non-zero otherwise. |
| 1139 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 1140 | 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] | 1141 | struct lyd_node **config); |
| 1142 | |
| 1143 | /** |
| 1144 | * @brief Creates new YANG configuration data nodes for a keystore reference to the Call Home TLS server's certificate. |
| 1145 | * |
| 1146 | * @param[in] ctx libyang context. |
| 1147 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1148 | * If a Call Home client with this identifier already exists, its contents will be changed. |
| 1149 | * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint. |
| 1150 | * If a Call Home client's endpoint with this identifier already exists, its contents will be changed. |
| 1151 | * @param[in] asym_key_ref Name of the asymmetric key pair in the keystore to be referenced. |
| 1152 | * @param[in] cert_ref Name of the certificate, which must belong to the given asymmetric key pair, to be referenced. |
| 1153 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 1154 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1155 | * @return 0 on success, non-zero otherwise. |
| 1156 | */ |
| 1157 | int nc_server_config_add_ch_tls_keystore_ref(const struct ly_ctx *ctx, const char *client_name, |
| 1158 | const char *endpt_name, const char *asym_key_ref, const char *cert_ref, struct lyd_node **config); |
| 1159 | |
| 1160 | /** |
| 1161 | * @brief Deletes a TLS server certificate keystore reference from the YANG data. |
| 1162 | * |
| 1163 | * @param[in] client_name Identifier of an existing Call Home client. |
| 1164 | * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client. |
| 1165 | * @param[in,out] config Modified configuration YANG data tree. |
| 1166 | * @return 0 on success, non-zero otherwise. |
| 1167 | */ |
| 1168 | 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] | 1169 | struct lyd_node **config); |
| 1170 | |
| 1171 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1172 | * @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] | 1173 | * |
| 1174 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1175 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1176 | * If a Call Home client with this identifier already exists, its contents will be changed. |
| 1177 | * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint. |
| 1178 | * If a Call Home client's endpoint with this identifier already exists, its contents will be changed. |
| 1179 | * @param[in] cert_name Arbitrary identifier of the Call Home endpoint's end-entity certificate. |
| 1180 | * 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] | 1181 | * @param[in] cert_path Path to the certificate file. |
Roytak | 934edc3 | 2023-07-27 12:04:18 +0200 | [diff] [blame] | 1182 | * @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] | 1183 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1184 | * @return 0 on success, non-zero otherwise. |
| 1185 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 1186 | 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] | 1187 | const char *cert_name, const char *cert_path, struct lyd_node **config); |
| 1188 | |
| 1189 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1190 | * @brief Deletes a Call Home client (end-entity) certificate from the YANG data. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1191 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1192 | * @param[in] client_name Identifier of an existing Call Home client. |
| 1193 | * @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] | 1194 | * @param[in] cert_name Optional identifier of a client certificate to be deleted. |
| 1195 | * If NULL, all of the client certificates will be deleted. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1196 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1197 | * @return 0 on success, non-zero otherwise. |
| 1198 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 1199 | 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] | 1200 | const char *cert_name, struct lyd_node **config); |
| 1201 | |
| 1202 | /** |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 1203 | * @brief Creates new YANG configuration data nodes for a Call Home truststore reference to a set of client (end-entity) certificates. |
| 1204 | * |
| 1205 | * @param[in] ctx libyang context. |
| 1206 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1207 | * If a Call Home client with this identifier already exists, its contents will be changed. |
| 1208 | * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint. |
| 1209 | * If a Call Home client's endpoint with this identifier already exists, its contents will be changed. |
| 1210 | * @param[in] cert_bag_ref Identifier of the certificate bag in the truststore to be referenced. |
| 1211 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 1212 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1213 | * @return 0 on success, non-zero otherwise. |
| 1214 | */ |
| 1215 | int nc_server_config_add_ch_tls_client_cert_truststore_ref(const struct ly_ctx *ctx, const char *client_name, |
| 1216 | const char *endpt_name, const char *cert_bag_ref, struct lyd_node **config); |
| 1217 | |
| 1218 | /** |
| 1219 | * @brief Deletes a Call Home client (end-entity) certificates truststore reference from the YANG data. |
| 1220 | * |
| 1221 | * @param[in] client_name Identifier of an existing Call Home client. |
| 1222 | * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client. |
| 1223 | * @param[in,out] config Modified configuration YANG data tree. |
| 1224 | * @return 0 on success, non-zero otherwise. |
| 1225 | */ |
| 1226 | int nc_server_config_del_ch_tls_client_cert_truststore_ref(const char *client_name, const char *endpt_name, |
| 1227 | struct lyd_node **config); |
| 1228 | |
| 1229 | /** |
roman | b6f4403 | 2023-06-30 15:07:56 +0200 | [diff] [blame] | 1230 | * @brief Creates new YANG configuration data nodes for a client certificate authority (trust-anchor) certificate. |
| 1231 | * |
| 1232 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1233 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1234 | * If a Call Home client with this identifier already exists, its contents will be changed. |
| 1235 | * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint. |
| 1236 | * If a Call Home client's endpoint with this identifier already exists, its contents will be changed. |
| 1237 | * @param[in] cert_name Arbitrary identifier of the Call Home endpoint's certificate authority certificate. |
| 1238 | * 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] | 1239 | * @param[in] cert_path Path to the certificate file. |
Roytak | 9b32c0f | 2023-08-02 15:07:29 +0200 | [diff] [blame] | 1240 | * @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] | 1241 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1242 | * @return 0 on success, non-zero otherwise. |
| 1243 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 1244 | 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] | 1245 | const char *cert_name, const char *cert_path, struct lyd_node **config); |
| 1246 | |
| 1247 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1248 | * @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] | 1249 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1250 | * @param[in] client_name Identifier of an existing Call Home client. |
| 1251 | * @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] | 1252 | * @param[in] cert_name Optional identifier of a CA certificate to be deleted. |
| 1253 | * If NULL, all of the CA certificates will be deleted. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1254 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1255 | * @return 0 on success, non-zero otherwise. |
| 1256 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 1257 | 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] | 1258 | const char *cert_name, struct lyd_node **config); |
| 1259 | |
| 1260 | /** |
roman | d348b94 | 2023-10-13 14:32:19 +0200 | [diff] [blame] | 1261 | * @brief Creates new YANG configuration data nodes for a Call Home truststore reference to a set of client certificate authority (trust-anchor) certificates. |
| 1262 | * |
| 1263 | * @param[in] ctx libyang context. |
| 1264 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1265 | * If a Call Home client with this identifier already exists, its contents will be changed. |
| 1266 | * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint. |
| 1267 | * If a Call Home client's endpoint with this identifier already exists, its contents will be changed. |
| 1268 | * @param[in] cert_bag_ref Identifier of the certificate bag in the truststore to be referenced. |
| 1269 | * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created. |
| 1270 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1271 | * @return 0 on success, non-zero otherwise. |
| 1272 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 1273 | 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] | 1274 | const char *endpt_name, const char *cert_bag_ref, struct lyd_node **config); |
| 1275 | |
| 1276 | /** |
| 1277 | * @brief Deletes a Call Home client certificate authority (trust-anchor) certificates truststore reference from the YANG data. |
| 1278 | * |
| 1279 | * @param[in] client_name Identifier of an existing Call Home client. |
| 1280 | * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client. |
| 1281 | * @param[in,out] config Modified configuration YANG data tree. |
| 1282 | * @return 0 on success, non-zero otherwise. |
| 1283 | */ |
roman | e6ec60e | 2023-10-19 15:21:52 +0200 | [diff] [blame] | 1284 | 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] | 1285 | struct lyd_node **config); |
| 1286 | |
| 1287 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1288 | * @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] | 1289 | * |
| 1290 | * @param[in] ctx libyang context. |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1291 | * @param[in] client_name Arbitrary identifier of the Call Home client. |
| 1292 | * If a Call Home client with this identifier already exists, its contents will be changed. |
| 1293 | * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint. |
| 1294 | * 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] | 1295 | * @param[in] id ID of the entry. The lower the ID, the higher the priority of the entry (it will be checked earlier). |
| 1296 | * @param[in] fingerprint Optional fingerprint of the entry. The fingerprint should always be set, however if it is |
| 1297 | * not set, it will match any certificate. Entry with no fingerprint should therefore be placed only as the last entry. |
| 1298 | * @param[in] map_type Mapping username to the certificate option. |
| 1299 | * @param[in] name Username for this cert-to-name entry. |
Roytak | 9b32c0f | 2023-08-02 15:07:29 +0200 | [diff] [blame] | 1300 | * @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] | 1301 | * Otherwise the new YANG data will be added to the previous data and may override it. |
| 1302 | * @return 0 on success, non-zero otherwise. |
| 1303 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 1304 | 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] | 1305 | uint32_t id, const char *fingerprint, NC_TLS_CTN_MAPTYPE map_type, const char *name, struct lyd_node **config); |
| 1306 | |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1307 | /** |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1308 | * @brief Deletes a Call Home cert-to-name entry from the YANG data. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1309 | * |
Roytak | 2161df6 | 2023-08-02 15:04:42 +0200 | [diff] [blame] | 1310 | * @param[in] client_name Identifier of an existing Call Home client. |
| 1311 | * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client. |
| 1312 | * @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] | 1313 | * If 0, all of the CTN entries will be deleted. |
roman | 9d5e5a5 | 2023-07-14 12:43:44 +0200 | [diff] [blame] | 1314 | * @param[in,out] config Modified configuration YANG data tree. |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1315 | * @return 0 on success, non-zero otherwise. |
| 1316 | */ |
Roytak | b279485 | 2023-10-18 14:30:22 +0200 | [diff] [blame] | 1317 | 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] | 1318 | uint32_t id, struct lyd_node **config); |
| 1319 | |
| 1320 | /** |
roman | 3512097 | 2023-08-08 10:39:12 +0200 | [diff] [blame] | 1321 | * @} TLS Call Home Server Configuration |
roman | 8ba6efa | 2023-07-12 15:27:52 +0200 | [diff] [blame] | 1322 | */ |
| 1323 | |
roman | 2eab474 | 2023-06-06 10:00:26 +0200 | [diff] [blame] | 1324 | #endif /* NC_ENABLED_SSH_TLS */ |
roman | 45cec4e | 2023-02-17 10:21:39 +0100 | [diff] [blame] | 1325 | |
roman | c1d2b09 | 2023-02-02 08:58:27 +0100 | [diff] [blame] | 1326 | #ifdef __cplusplus |
| 1327 | } |
| 1328 | #endif |
| 1329 | |
| 1330 | #endif /* NC_SESSION_SERVER_H_ */ |