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