blob: 6112f777d5cc95bbffe28d93a727fbac352e3529 [file] [log] [blame]
romanc1d2b092023-02-02 08:58:27 +01001/**
romane028ef92023-02-24 16:33:08 +01002 * @file server_config.h
romanc1d2b092023-02-02 08:58:27 +01003 * @author Roman Janota <janota@cesnet.cz>
4 * @brief libnetconf2 server configuration
5 *
6 * @copyright
roman3f9b65c2023-06-05 14:26:58 +02007 * Copyright (c) 2023 CESNET, z.s.p.o.
romanc1d2b092023-02-02 08:58:27 +01008 *
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
20extern "C" {
21#endif
22
romand348b942023-10-13 14:32:19 +020023#include <stdarg.h>
romanc1d2b092023-02-02 08:58:27 +010024#include <stdint.h>
25
roman3f9b65c2023-06-05 14:26:58 +020026#include <libyang/libyang.h>
27
romanc1d2b092023-02-02 08:58:27 +010028#include "session.h"
romanc1d2b092023-02-02 08:58:27 +010029
30/**
roman8ba6efa2023-07-12 15:27:52 +020031 * @defgroup server_config Server Configuration
32 * @ingroup server
33 *
34 * @brief Server-side configuration creation and application
35 * @{
36 */
37
38/**
roman35120972023-08-08 10:39:12 +020039 * @} 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 *
roman6430c152023-10-12 11:28:47 +020063 * @param[in, out] ctx Optional context in which the modules will be implemented. Created if *ctx is null.
roman35120972023-08-08 10:39:12 +020064 * @return 0 on success, 1 on error.
65 */
66int nc_server_config_load_modules(struct ly_ctx **ctx);
67
68/**
roman6430c152023-10-12 11:28:47 +020069 * @brief Configure server based on the given diff.
romanc1d2b092023-02-02 08:58:27 +010070 *
roman6430c152023-10-12 11:28:47 +020071 * Context must already have implemented the required modules, see ::nc_server_config_load_modules().
romanc1d2b092023-02-02 08:58:27 +010072 *
roman6430c152023-10-12 11:28:47 +020073 * @param[in] diff YANG diff belonging to either ietf-netconf-server, ietf-keystore or ietf-truststore modules.
Roytakb2794852023-10-18 14:30:22 +020074 * The top level node HAS to have an operation (create, replace, delete or none).
romanc1d2b092023-02-02 08:58:27 +010075 * @return 0 on success, 1 on error.
76 */
romanf6f37a52023-05-25 14:27:51 +020077int nc_server_config_setup_diff(const struct lyd_node *diff);
romanc1d2b092023-02-02 08:58:27 +010078
79/**
romanf02273a2023-05-25 09:44:11 +020080 * @brief Configure server based on the given data.
81 *
romanf02273a2023-05-25 09:44:11 +020082 * Behaves as if all the nodes in data had the replace operation. That means that the current configuration will be deleted
roman6430c152023-10-12 11:28:47 +020083 * and just the given data will be applied.
roman0f5fa422023-08-07 09:03:24 +020084 * Context must already have implemented the required modules, see ::nc_server_config_load_modules().
romanf02273a2023-05-25 09:44:11 +020085 *
roman6430c152023-10-12 11:28:47 +020086 * @param[in] data YANG data belonging to either ietf-netconf-server, ietf-keystore or ietf-truststore modules.
Roytakb2794852023-10-18 14:30:22 +020087 * This data __must be valid__. No node can have an operation attribute.
romanf02273a2023-05-25 09:44:11 +020088 * @return 0 on success, 1 on error.
89 */
romanf6f37a52023-05-25 14:27:51 +020090int nc_server_config_setup_data(const struct lyd_node *data);
romanf02273a2023-05-25 09:44:11 +020091
92/**
roman6430c152023-10-12 11:28:47 +020093 * @brief Configure server based on the given data stored in a file.
94 *
roman0f5fa422023-08-07 09:03:24 +020095 * Wrapper around ::nc_server_config_setup_data() hiding work with parsing the data.
roman6430c152023-10-12 11:28:47 +020096 * Context must already have implemented the required modules, see ::nc_server_config_load_modules().
romanc1d2b092023-02-02 08:58:27 +010097 *
98 * @param[in] ctx libyang context.
roman6430c152023-10-12 11:28:47 +020099 * @param[in] path Path to a file with ietf-netconf-server, ietf-keystore or ietf-truststore YANG data.
Roytakb2794852023-10-18 14:30:22 +0200100 * This data __must be valid__. No node can have an operation attribute.
romanc1d2b092023-02-02 08:58:27 +0100101 * @return 0 on success, 1 on error.
102 */
103int nc_server_config_setup_path(const struct ly_ctx *ctx, const char *path);
104
roman2eab4742023-06-06 10:00:26 +0200105#ifdef NC_ENABLED_SSH_TLS
106
romanc1d2b092023-02-02 08:58:27 +0100107/**
roman6430c152023-10-12 11:28:47 +0200108 * @brief Creates new YANG configuration data nodes for address and port.
roman9b1379c2023-03-31 10:11:10 +0200109 *
roman9b1379c2023-03-31 10:11:10 +0200110 * @param[in] ctx libyang context.
111 * @param[in] endpt_name Arbitrary identifier of the endpoint.
roman35120972023-08-08 10:39:12 +0200112 * If an endpoint with this identifier already exists, its contents might be changed.
roman3f9b65c2023-06-05 14:26:58 +0200113 * @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.
roman9b1379c2023-03-31 10:11:10 +0200116 * @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.
roman45cec4e2023-02-17 10:21:39 +0100119 */
Roytakb2794852023-10-18 14:30:22 +0200120int nc_server_config_add_address_port(const struct ly_ctx *ctx, const char *endpt_name, NC_TRANSPORT_IMPL transport,
roman142718b2023-06-29 09:15:29 +0200121 const char *address, uint16_t port, struct lyd_node **config);
roman3f9b65c2023-06-05 14:26:58 +0200122
roman8ba6efa2023-07-12 15:27:52 +0200123#endif /* NC_ENABLED_SSH_TLS */
124
125/**
126 * @brief Deletes an endpoint from the YANG data.
127 *
128 * @param[in] endpt_name Optional identifier of an endpoint to be deleted.
129 * If NULL, all of the endpoints will be deleted.
roman35120972023-08-08 10:39:12 +0200130 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +0200131 * @return 0 on success, non-zero otherwise.
132 */
Roytakb2794852023-10-18 14:30:22 +0200133int nc_server_config_del_endpt(const char *endpt_name, struct lyd_node **config);
roman8ba6efa2023-07-12 15:27:52 +0200134
135#ifdef NC_ENABLED_SSH_TLS
136
137/**
138 * @brief Creates new YANG data nodes for an asymmetric key in the keystore.
139 *
140 * @param[in] ctx libyang context.
roman13145912023-08-17 15:36:54 +0200141 * @param[in] ti Transport in which the key pair will be used. Either SSH or TLS.
roman12c3d522023-07-26 13:39:30 +0200142 * @param[in] asym_key_name Identifier of the asymmetric key pair.
143 * This identifier is used to reference the key pair.
roman8ba6efa2023-07-12 15:27:52 +0200144 * @param[in] privkey_path Path to a private key file.
145 * @param[in] pubkey_path Optional path a public key file.
146 * If not supplied, it will be generated from the private key.
147 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
148 * Otherwise the new YANG data will be added to the previous data and may override it.
149 * @return 0 on success, non-zero otherwise.
150 */
Roytakb2794852023-10-18 14:30:22 +0200151int nc_server_config_add_keystore_asym_key(const struct ly_ctx *ctx, NC_TRANSPORT_IMPL ti, const char *asym_key_name,
roman13145912023-08-17 15:36:54 +0200152 const char *privkey_path, const char *pubkey_path, struct lyd_node **config);
roman8ba6efa2023-07-12 15:27:52 +0200153
154/**
155 * @brief Deletes a keystore's asymmetric key from the YANG data.
156 *
roman12c3d522023-07-26 13:39:30 +0200157 * @param[in] asym_key_name Optional identifier of the asymmetric key to be deleted.
roman8ba6efa2023-07-12 15:27:52 +0200158 * If NULL, all of the asymmetric keys in the keystore will be deleted.
159 * @param[in,out] config Configuration YANG data tree.
160 * @return 0 on success, non-zero otherwise.
161 */
Roytakb2794852023-10-18 14:30:22 +0200162int nc_server_config_del_keystore_asym_key(const char *asym_key_name, struct lyd_node **config);
roman12c3d522023-07-26 13:39:30 +0200163
164/**
165 * @brief Creates new YANG data nodes for a certificate in the keystore.
166 *
roman6430c152023-10-12 11:28:47 +0200167 * A certificate can not exist without its asymmetric key, so you must create an asymmetric key
168 * with the same identifier you pass to this function.
roman12c3d522023-07-26 13:39:30 +0200169 *
170 * @param[in] ctx libyang context.
171 * @param[in] asym_key_name Arbitrary identifier of the asymmetric key.
172 * If an asymmetric key pair with this name already exists, its contents will be changed.
173 * @param[in] cert_name Arbitrary identifier of the key pair's certificate.
174 * If a certificate with this name already exists, its contents will be changed.
175 * @param[in] cert_path Path to the PEM encoded certificate file.
176 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
177 * Otherwise the new YANG data will be added to the previous data and may override it.
178 * @return 0 on success, non-zero otherwise.
179 */
Roytakb2794852023-10-18 14:30:22 +0200180int nc_server_config_add_keystore_cert(const struct ly_ctx *ctx, const char *asym_key_name, const char *cert_name,
roman12c3d522023-07-26 13:39:30 +0200181 const char *cert_path, struct lyd_node **config);
182
183/**
184 * @brief Deletes a keystore's certificate from the YANG data.
185 *
186 * @param[in] asym_key_name Identifier of an existing asymmetric key pair.
187 * @param[in] cert_name Optional identifier of a certificate to be deleted.
188 * If NULL, all of the certificates belonging to the asymmetric key pair will be deleted.
189 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
190 * Otherwise the new YANG data will be added to the previous data and may override it.
191 * @return 0 on success, non-zero otherwise.
192 */
Roytakb2794852023-10-18 14:30:22 +0200193int nc_server_config_del_keystore_cert(const char *asym_key_name, const char *cert_name, struct lyd_node **config);
roman8ba6efa2023-07-12 15:27:52 +0200194
195/**
196 * @brief Creates new YANG data nodes for a public key in the truststore.
197 *
198 * @param[in] ctx libyang context.
roman12c3d522023-07-26 13:39:30 +0200199 * @param[in] pub_bag_name Arbitrary identifier of the public key bag.
roman8ba6efa2023-07-12 15:27:52 +0200200 * This name is used to reference the public keys in the bag.
201 * If a public key bag with this name already exists, its contents will be changed.
202 * @param[in] pubkey_name Arbitrary identifier of the public key.
roman12c3d522023-07-26 13:39:30 +0200203 * If a public key with this name already exists in the given bag, its contents will be changed.
roman8ba6efa2023-07-12 15:27:52 +0200204 * @param[in] pubkey_path Path to a file containing a public key.
205 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
206 * Otherwise the new YANG data will be added to the previous data and may override it.
207 * @return 0 on success, non-zero otherwise.
208 */
romand348b942023-10-13 14:32:19 +0200209int nc_server_config_add_truststore_pubkey(const struct ly_ctx *ctx, const char *pub_bag_name, const char *pubkey_name,
210 const char *pubkey_path, struct lyd_node **config);
roman8ba6efa2023-07-12 15:27:52 +0200211
212/**
213 * @brief Deletes a truststore's public key from the YANG data.
214 *
roman12c3d522023-07-26 13:39:30 +0200215 * @param[in] pub_bag_name Identifier of an existing public key bag.
roman8ba6efa2023-07-12 15:27:52 +0200216 * @param[in] pubkey_name Optional identifier of a public key to be deleted.
217 * If NULL, all of the public keys in the given bag will be deleted.
218 * @param[in,out] config Configuration YANG data tree.
219 * @return 0 on success, non-zero otherwise.
220 */
Roytakb2794852023-10-18 14:30:22 +0200221int nc_server_config_del_truststore_pubkey(const char *pub_bag_name, const char *pubkey_name, struct lyd_node **config);
roman12c3d522023-07-26 13:39:30 +0200222
223/**
224 * @brief Creates new YANG data nodes for a certificate in the truststore.
225 *
226 * @param[in] ctx libyang context.
227 * @param[in] cert_bag_name Arbitrary identifier of the certificate bag.
228 * This name is used to reference the certificates in the bag.
229 * If a certificate bag with this name already exists, its contents will be changed.
230 * @param[in] cert_name Arbitrary identifier of the certificate.
231 * If a certificate with this name already exists in the given bag, its contents will be changed.
232 * @param[in] cert_path Path to a file containing a PEM encoded certificate.
233 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
234 * Otherwise the new YANG data will be added to the previous data and may override it.
235 * @return 0 on success, non-zero otherwise.
236 */
Roytakb2794852023-10-18 14:30:22 +0200237int nc_server_config_add_truststore_cert(const struct ly_ctx *ctx, const char *cert_bag_name, const char *cert_name,
roman12c3d522023-07-26 13:39:30 +0200238 const char *cert_path, struct lyd_node **config);
239
240/**
241 * @brief Deletes a truststore's certificate from the YANG data.
242 *
243 * @param[in] cert_bag_name Identifier of an existing certificate bag.
244 * @param[in] cert_name Optional identifier of a certificate to be deleted.
245 * If NULL, all of the certificates in the given bag will be deleted.
246 * @param[in,out] config Configuration YANG data tree.
247 * @return 0 on success, non-zero otherwise.
248 */
Roytakb2794852023-10-18 14:30:22 +0200249int nc_server_config_del_truststore_cert(const char *cert_bag_name,
roman12c3d522023-07-26 13:39:30 +0200250 const char *cert_name, struct lyd_node **config);
roman8ba6efa2023-07-12 15:27:52 +0200251
252/**
romand05b2ad2024-01-23 12:02:40 +0100253 * @brief Gets the hostkey algorithms supported by the server from the 'iana-ssh-public-key-algs' YANG module.
254 *
255 * @param[in] ctx libyang context.
256 * @param[out] hostkey_algs Container with leaf-lists containing the supported algorithms.
257 * @return 0 on success, non-zero otherwise.
258 */
259int nc_server_config_oper_get_hostkey_algs(const struct ly_ctx *ctx, struct lyd_node **hostkey_algs);
260
261/**
262 * @brief Gets the key exchange algorithms supported by the server from the 'iana-ssh-key-exchange-algs' YANG module.
263 *
264 * @param[in] ctx libyang context.
265 * @param[out] kex_algs Container with leaf-lists containing the supported algorithms.
266 * @return 0 on success, non-zero otherwise.
267 */
268int nc_server_config_oper_get_kex_algs(const struct ly_ctx *ctx, struct lyd_node **kex_algs);
269
270/**
271 * @brief Gets the encryption algorithms supported by the server from the 'iana-ssh-encryption-algs' YANG module.
272 *
273 * @param[in] ctx libyang context.
274 * @param[out] encryption_algs Container with leaf-lists containing the supported algorithms.
275 * @return 0 on success, non-zero otherwise.
276 */
277int nc_server_config_oper_get_encryption_algs(const struct ly_ctx *ctx, struct lyd_node **encryption_algs);
278
279/**
280 * @brief Gets the MAC algorithms supported by the server from the 'iana-ssh-mac-algs' YANG module.
281 *
282 * @param[in] ctx libyang context.
283 * @param[out] mac_algs Container with leaf-lists containing the supported algorithms.
284 * @return 0 on success, non-zero otherwise.
285 */
286int nc_server_config_oper_get_mac_algs(const struct ly_ctx *ctx, struct lyd_node **mac_algs);
287
288/**
roman35120972023-08-08 10:39:12 +0200289 * @} Server Configuration Functions
roman8ba6efa2023-07-12 15:27:52 +0200290 */
291
292/**
293 * @defgroup server_config_ssh SSH Server Configuration
294 * @ingroup server_config
295 *
296 * @brief SSH server configuration creation and deletion
297 * @{
298 */
299
roman3f9b65c2023-06-05 14:26:58 +0200300/**
301 * @brief Creates new YANG configuration data nodes for a hostkey.
302 *
303 * @param[in] ctx libyang context.
304 * @param[in] endpt_name Arbitrary identifier of the endpoint.
roman142718b2023-06-29 09:15:29 +0200305 * If an endpoint with this identifier already exists, its hostkey might be changed.
roman3f9b65c2023-06-05 14:26:58 +0200306 * @param[in] hostkey_name Arbitrary identifier of the hostkey.
roman142718b2023-06-29 09:15:29 +0200307 * If a hostkey with this identifier already exists, its contents will be changed.
roman3f9b65c2023-06-05 14:26:58 +0200308 * @param[in] privkey_path Path to a file containing a private key.
309 * The private key has to be in a PEM format. Only RSA and ECDSA keys are supported.
roman35120972023-08-08 10:39:12 +0200310 * @param[in] pubkey_path Optional path to a file containing a public key. If NULL, public key will be
roman3f9b65c2023-06-05 14:26:58 +0200311 * generated from the private key.
312 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
313 * Otherwise the new YANG data will be added to the previous data and may override it.
314 * @return 0 on success, non-zero otherwise.
315 */
Roytakb2794852023-10-18 14:30:22 +0200316int nc_server_config_add_ssh_hostkey(const struct ly_ctx *ctx, const char *endpt_name, const char *hostkey_name,
roman8ba6efa2023-07-12 15:27:52 +0200317 const char *privkey_path, const char *pubkey_path, struct lyd_node **config);
318
319/**
320 * @brief Deletes a hostkey from the YANG data.
321 *
322 * @param[in] ctx libyang context.
323 * @param[in] endpt_name Identifier of an existing endpoint.
324 * @param[in] hostkey_name Optional identifier of the hostkey to be deleted.
325 * If NULL, all of the hostkeys on this endpoint will be deleted.
326 * @param[in,out] config Configuration YANG data tree.
327 * @return 0 on success, non-zero otherwise.
328 */
Roytakb2794852023-10-18 14:30:22 +0200329int nc_server_config_del_ssh_hostkey(const struct ly_ctx *ctx, const char *endpt_name,
roman8ba6efa2023-07-12 15:27:52 +0200330 const char *hostkey_name, struct lyd_node **config);
331
332/**
romand348b942023-10-13 14:32:19 +0200333 * @brief Creates new YANG data nodes for a reference to an asymmetric key located in the keystore.
334 *
335 * This asymmetric key pair will be used as the SSH hostkey.
336 *
337 * @param[in] ctx libyang context.
338 * @param[in] endpt_name Arbitrary identifier of an endpoint.
339 * If an endpoint with this identifier already exists, its contents will be changed.
340 * @param[in] hostkey_name Arbitrary identifier of the endpoint's hostkey.
341 * If an endpoint's hostkey with this identifier already exists, its contents will be changed.
342 * @param[in] keystore_reference Name of the asymmetric key pair to be referenced and used as a hostkey.
343 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
344 * Otherwise the new YANG data will be added to the previous data and may override it.
345 * @return 0 on success, non-zero otherwise.
346 */
347int nc_server_config_add_ssh_keystore_ref(const struct ly_ctx *ctx, const char *endpt_name, const char *hostkey_name,
348 const char *keystore_reference, struct lyd_node **config);
349
350/**
351 * @brief Deletes a keystore reference from the YANG data.
352 *
353 * @param[in] endpt_name Identifier of an existing endpoint.
354 * @param[in] hostkey_name Identifier of an existing hostkey on the given endpoint.
355 * @param[in,out] config Configuration YANG data tree.
356 * @return 0 on success, non-zero otherwise.
357 */
358int nc_server_config_del_ssh_keystore_ref(const char *endpt_name, const char *hostkey_name,
359 struct lyd_node **config);
360
361/**
roman8ba6efa2023-07-12 15:27:52 +0200362 * @brief Creates new YANG configuration data nodes for an SSH user's public key authentication method.
363 *
364 * @param[in] ctx libyang context.
365 * @param[in] endpt_name Arbitrary identifier of the endpoint.
366 * If an endpoint with this identifier already exists, its user might be changed.
367 * @param[in] user_name Arbitrary identifier of the user.
368 * If an user with this identifier already exists, its contents will be changed.
369 * @param[in] pubkey_name Arbitrary identifier of the user's public key.
370 * If a public key with this identifier already exists for this user, its contents will be changed.
371 * @param[in] pubkey_path Path to a file containing the user's public key.
372 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
373 * Otherwise the new YANG data will be added to the previous data and may override it.
374 * @return 0 on success, non-zero otherwise.
375 */
Roytakb2794852023-10-18 14:30:22 +0200376int nc_server_config_add_ssh_user_pubkey(const struct ly_ctx *ctx, const char *endpt_name,
roman8ba6efa2023-07-12 15:27:52 +0200377 const char *user_name, const char *pubkey_name, const char *pubkey_path, struct lyd_node **config);
378
379/**
380 * @brief Deletes an SSH user's public key from the YANG data.
381 *
382 * @param[in] endpt_name Identifier of an existing endpoint.
383 * @param[in] user_name Identifier of an existing user on the given endpoint.
384 * @param[in] pubkey_name Optional identifier of a public key to be deleted.
385 * If NULL, all of the users public keys will be deleted.
roman9d5e5a52023-07-14 12:43:44 +0200386 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +0200387 * @return 0 on success, non-zero otherwise.
388 */
Roytakb2794852023-10-18 14:30:22 +0200389int nc_server_config_del_ssh_user_pubkey(const char *endpt_name, const char *user_name,
roman8ba6efa2023-07-12 15:27:52 +0200390 const char *pubkey_name, struct lyd_node **config);
391
392/**
romana9ec3362023-12-21 10:59:57 +0100393 * @brief Creates new YANG configuration data nodes for an SSH user that will use system's authorized_keys to authenticate.
394 *
395 * The path to the authorized_keys file must be configured to successfully
396 * authenticate, see ::nc_server_ssh_set_authkey_path_format().
397 *
398 * @param[in] ctx libyang context.
399 * @param[in] endpt_name Arbitrary identifier of the endpoint.
400 * If an endpoint with this identifier already exists, its user might be changed.
401 * @param[in] user_name Arbitrary identifier of the user.
402 * If an user with this identifier already exists, its contents will be changed.
403 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
404 * Otherwise the new YANG data will be added to the previous data and may override it.
405 * @return 0 on success, non-zero otherwise.
406 */
407int nc_server_config_add_ssh_user_authkey(const struct ly_ctx *ctx, const char *endpt_name,
408 const char *user_name, struct lyd_node **config);
409
410/**
411 * @brief Deletes an SSH user's authorized_keys method from the YANG data.
412 *
413 * @param[in] endpt_name Identifier of an existing endpoint.
414 * @param[in] user_name Identifier of an existing user on the given endpoint.
415 * @param[in,out] config Modified configuration YANG data tree.
416 * @return 0 on success, non-zero otherwise.
417 */
418int nc_server_config_del_ssh_user_authkey(const char *endpt_name, const char *user_name, struct lyd_node **config);
419
420/**
roman8ba6efa2023-07-12 15:27:52 +0200421 * @brief Creates new YANG configuration data nodes for an SSH user's password authentication method.
422 *
423 * @param[in] ctx libyang context.
424 * @param[in] endpt_name Arbitrary identifier of the endpoint.
425 * If an endpoint with this identifier already exists, its user might be changed.
426 * @param[in] user_name Arbitrary identifier of the user.
427 * If an user with this identifier already exists, its contents will be changed.
roman35120972023-08-08 10:39:12 +0200428 * @param[in] password Clear-text password to be set for the user. It will be hashed.
roman8ba6efa2023-07-12 15:27:52 +0200429 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
430 * Otherwise the new YANG data will be added to the previous data and may override it.
431 * @return 0 on success, non-zero otherwise.
432 */
Roytakb2794852023-10-18 14:30:22 +0200433int nc_server_config_add_ssh_user_password(const struct ly_ctx *ctx, const char *endpt_name,
roman8ba6efa2023-07-12 15:27:52 +0200434 const char *user_name, const char *password, struct lyd_node **config);
435
436/**
437 * @brief Deletes an SSH user's password from the YANG data.
438 *
439 * @param[in] endpt_name Identifier of an existing endpoint.
440 * @param[in] user_name Identifier of an existing user on the given endpoint.
roman9d5e5a52023-07-14 12:43:44 +0200441 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +0200442 * @return 0 on success, non-zero otherwise.
443 */
Roytakb2794852023-10-18 14:30:22 +0200444int nc_server_config_del_ssh_user_password(const char *endpt_name, const char *user_name,
roman8ba6efa2023-07-12 15:27:52 +0200445 struct lyd_node **config);
446
447/**
448 * @brief Creates new YANG configuration data nodes for an SSH user's keyboard interactive authentication method.
449 *
romanc6518422023-11-30 16:39:00 +0100450 * One of Linux PAM, local users, or user callback is used to authenticate users with this SSH method (see \ref ln2doc_kbdint "the documentation").
roman808f3f62023-11-23 16:01:04 +0100451 *
452 * @param[in] ctx libyang context.
453 * @param[in] endpt_name Arbitrary identifier of the endpoint.
454 * If an endpoint with this identifier already exists, its user might be changed.
455 * @param[in] user_name Arbitrary identifier of the user.
456 * If an user with this identifier already exists, its contents will be changed.
457 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
458 * Otherwise the new YANG data will be added to the previous data and may override it.
459 * @return 0 on success, non-zero otherwise.
460 */
Roytakb2794852023-10-18 14:30:22 +0200461int nc_server_config_add_ssh_user_interactive(const struct ly_ctx *ctx, const char *endpt_name,
roman808f3f62023-11-23 16:01:04 +0100462 const char *user_name, struct lyd_node **config);
roman8ba6efa2023-07-12 15:27:52 +0200463
464/**
465 * @brief Deletes an SSH user's keyboard interactive authentication from the YANG data.
466 *
467 * @param[in] endpt_name Identifier of an existing endpoint.
468 * @param[in] user_name Identifier of an existing user on the given endpoint.
roman9d5e5a52023-07-14 12:43:44 +0200469 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +0200470 * @return 0 on success, non-zero otherwise.
471 */
Roytakb2794852023-10-18 14:30:22 +0200472int nc_server_config_del_ssh_user_interactive(const char *endpt_name, const char *user_name,
roman8ba6efa2023-07-12 15:27:52 +0200473 struct lyd_node **config);
474
475/**
476 * @brief Deletes an SSH user from the YANG data.
477 *
478 * @param[in] endpt_name Identifier of an existing endpoint.
479 * @param[in] user_name Optional identifier of an user to be deleted.
480 * If NULL, all of the users on this endpoint will be deleted.
roman9d5e5a52023-07-14 12:43:44 +0200481 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +0200482 * @return 0 on success, non-zero otherwise.
483 */
Roytakb2794852023-10-18 14:30:22 +0200484int nc_server_config_del_ssh_user(const char *endpt_name,
roman8ba6efa2023-07-12 15:27:52 +0200485 const char *user_name, struct lyd_node **config);
486
487/**
romand348b942023-10-13 14:32:19 +0200488 * @brief Creates new YANG data nodes for a reference to a public key bag located in the truststore.
489 *
490 * The public key's located in the bag will be used for client authentication.
491 *
492 * @param[in] ctx libyang context.
493 * @param[in] endpt_name Arbitrary identifier of an endpoint.
494 * If an endpoint with this identifier already exists, its contents will be changed.
495 * @param[in] user_name Arbitrary identifier of the endpoint's user.
496 * If an endpoint's user with this identifier already exists, its contents will be changed.
497 * @param[in] truststore_reference Name of the public key bag to be referenced and used for authentication.
498 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
499 * Otherwise the new YANG data will be added to the previous data and may override it.
500 * @return 0 on success, non-zero otherwise.
501 */
502int nc_server_config_add_ssh_truststore_ref(const struct ly_ctx *ctx, const char *endpt_name, const char *user_name,
503 const char *truststore_reference, struct lyd_node **config);
504
505/**
506 * @brief Deletes a truststore reference from the YANG data.
507 *
508 * @param[in] endpt_name Identifier of an existing endpoint.
509 * @param[in] user_name Identifier of an user on the given endpoint whose truststore reference will be deleted.
510 * @param[in,out] config Modified configuration YANG data tree.
511 * @return 0 on success, non-zero otherwise.
512 */
513int nc_server_config_del_ssh_truststore_ref(const char *endpt_name, const char *user_name,
514 struct lyd_node **config);
515
516/**
roman8ba6efa2023-07-12 15:27:52 +0200517 * @brief Creates new YANG configuration data nodes, which will be a reference to another SSH endpoint's users.
518 *
519 * Whenever a client tries to connect to the referencing endpoint, all of its users will be tried first. If no match is
520 * found, the referenced endpoint's configured users will be tried.
521 *
522 * @param[in] ctx libyang context
523 * @param[in] endpt_name Arbitrary identifier of the endpoint.
524 * If an endpoint with this identifier already exists, its contents will be changed.
525 * @param[in] referenced_endpt Identifier of an endpoint, which has to exist whenever this data
526 * is applied. The referenced endpoint can reference another one and so on, but there mustn't be a cycle.
527 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
528 * Otherwise the new YANG data will be added to the previous data and may override it.
529 * @return 0 on success, non-zero otherwise.
530 */
Roytakb2794852023-10-18 14:30:22 +0200531int nc_server_config_add_ssh_endpoint_client_ref(const struct ly_ctx *ctx, const char *endpt_name,
roman8ba6efa2023-07-12 15:27:52 +0200532 const char *referenced_endpt, struct lyd_node **config);
533
534/**
535 * @brief Deletes reference to another SSH endpoint's users from the YANG data.
536 *
537 * @param[in] endpt_name Identifier of an existing endpoint.
roman9d5e5a52023-07-14 12:43:44 +0200538 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +0200539 * @return 0 on success, non-zero otherwise.
540 */
Roytakb2794852023-10-18 14:30:22 +0200541int nc_server_config_del_ssh_endpoint_client_ref(const char *endpt_name, struct lyd_node **config);
roman9b1379c2023-03-31 10:11:10 +0200542
543/**
roman35120972023-08-08 10:39:12 +0200544 * @} SSH Server Configuration
roman9b1379c2023-03-31 10:11:10 +0200545 */
roman9b1379c2023-03-31 10:11:10 +0200546
547/**
roman8ba6efa2023-07-12 15:27:52 +0200548 * @defgroup server_config_tls TLS Server Configuration
549 * @ingroup server_config
roman9b1379c2023-03-31 10:11:10 +0200550 *
roman8ba6efa2023-07-12 15:27:52 +0200551 * @brief TLS server configuration creation and deletion
552 * @{
roman9b1379c2023-03-31 10:11:10 +0200553 */
roman2e797ef2023-06-19 10:47:49 +0200554
555/**
roman3f9b65c2023-06-05 14:26:58 +0200556 * @brief Creates new YANG configuration data nodes for a server's certificate.
557 *
558 * @param[in] ctx libyang context.
559 * @param[in] endpt_name Arbitrary identifier of the endpoint.
roman142718b2023-06-29 09:15:29 +0200560 * If an endpoint with this identifier already exists, its server certificate will be changed.
roman6c4efcd2023-08-08 10:18:44 +0200561 * @param[in] privkey_path Path to the server's PEM encoded private key file.
roman3f9b65c2023-06-05 14:26:58 +0200562 * @param[in] pubkey_path Optional path to the server's public key file. If not provided,
563 * it will be generated from the private key.
romane6ec60e2023-10-19 15:21:52 +0200564 * @param[in] cert_path Path to the server's certificate file.
roman3f9b65c2023-06-05 14:26:58 +0200565 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
566 * Otherwise the new YANG data will be added to the previous data and may override it.
567 * @return 0 on success, non-zero otherwise.
568 */
romane6ec60e2023-10-19 15:21:52 +0200569int nc_server_config_add_tls_server_cert(const struct ly_ctx *ctx, const char *endpt_name, const char *privkey_path,
570 const char *pubkey_path, const char *cert_path, struct lyd_node **config);
roman3f9b65c2023-06-05 14:26:58 +0200571
572/**
roman8ba6efa2023-07-12 15:27:52 +0200573 * @brief Deletes the server's certificate from the YANG data.
574 *
575 * @param[in] endpt_name Identifier of an existing endpoint.
roman9d5e5a52023-07-14 12:43:44 +0200576 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +0200577 * @return 0 on success, non-zero otherwise.
578 */
romane6ec60e2023-10-19 15:21:52 +0200579int nc_server_config_del_tls_server_cert(const char *endpt_name, struct lyd_node **config);
romand348b942023-10-13 14:32:19 +0200580
581/**
582 * @brief Creates new YANG configuration data nodes for a keystore reference to the TLS server's certificate.
583 *
584 * @param[in] ctx libyang context.
585 * @param[in] endpt_name Arbitrary identifier of the endpoint.
586 * If an endpoint with this identifier already exists, its contents will be changed.
587 * @param[in] asym_key_ref Name of the asymmetric key pair in the keystore to be referenced.
588 * @param[in] cert_ref Name of the certificate, which must belong to the given asymmetric key pair, to be referenced.
589 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
590 * Otherwise the new YANG data will be added to the previous data and may override it.
591 * @return 0 on success, non-zero otherwise.
592 */
593int nc_server_config_add_tls_keystore_ref(const struct ly_ctx *ctx, const char *endpt_name, const char *asym_key_ref,
594 const char *cert_ref, struct lyd_node **config);
595
596/**
597 * @brief Deletes a TLS server certificate keystore reference from the YANG data.
598 *
599 * @param[in] endpt_name Identifier of an existing endpoint.
600 * @param[in,out] config Modified configuration YANG data tree.
601 * @return 0 on success, non-zero otherwise.
602 */
603int nc_server_config_del_tls_keystore_ref(const char *endpt_name, struct lyd_node **config);
roman12c3d522023-07-26 13:39:30 +0200604
605/**
roman3f9b65c2023-06-05 14:26:58 +0200606 * @brief Creates new YANG configuration data nodes for a client's (end-entity) certificate.
607 *
roman84fc45a2024-05-13 15:44:10 +0200608 * A client certificate is authenticated if it is an exact match to a configured client certificate.
609 *
roman3f9b65c2023-06-05 14:26:58 +0200610 * @param[in] ctx libyang context.
611 * @param[in] endpt_name Arbitrary identifier of the endpoint.
roman142718b2023-06-29 09:15:29 +0200612 * If an endpoint with this identifier already exists, its contents will be changed.
roman3f9b65c2023-06-05 14:26:58 +0200613 * @param[in] cert_name Arbitrary identifier of the client's certificate.
roman35120972023-08-08 10:39:12 +0200614 * If a client certificate with this identifier already exists, it will be changed.
roman3f9b65c2023-06-05 14:26:58 +0200615 * @param[in] cert_path Path to the client's certificate file.
616 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
617 * Otherwise the new YANG data will be added to the previous data and may override it.
618 * @return 0 on success, non-zero otherwise.
619 */
romane6ec60e2023-10-19 15:21:52 +0200620int nc_server_config_add_tls_client_cert(const struct ly_ctx *ctx, const char *endpt_name, const char *cert_name,
roman3f9b65c2023-06-05 14:26:58 +0200621 const char *cert_path, struct lyd_node **config);
622
623/**
roman8ba6efa2023-07-12 15:27:52 +0200624 * @brief Deletes a client (end-entity) certificate from the YANG data.
625 *
626 * @param[in] endpt_name Identifier of an existing endpoint.
627 * @param[in] cert_name Optional name of a certificate to be deleted.
628 * If NULL, all of the end-entity certificates on the given endpoint will be deleted.
roman9d5e5a52023-07-14 12:43:44 +0200629 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +0200630 * @return 0 on success, non-zero otherwise.
631 */
romane6ec60e2023-10-19 15:21:52 +0200632int nc_server_config_del_tls_client_cert(const char *endpt_name, const char *cert_name, struct lyd_node **config);
romand348b942023-10-13 14:32:19 +0200633
634/**
635 * @brief Creates new YANG configuration data nodes for a truststore reference to a set of client (end-entity) certificates.
636 *
637 * @param[in] ctx libyang context.
638 * @param[in] endpt_name Arbitrary identifier of the endpoint.
639 * If an endpoint with this identifier already exists, its contents will be changed.
640 * @param[in] cert_bag_ref Identifier of the certificate bag in the truststore to be referenced.
641 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
642 * Otherwise the new YANG data will be added to the previous data and may override it.
643 * @return 0 on success, non-zero otherwise.
644 */
645int nc_server_config_add_tls_client_cert_truststore_ref(const struct ly_ctx *ctx, const char *endpt_name,
646 const char *cert_bag_ref, struct lyd_node **config);
647
648/**
649 * @brief Deletes a client (end-entity) certificates truststore reference from the YANG data.
650 *
651 * @param[in] endpt_name Identifier of an existing endpoint.
652 * @param[in,out] config Modified configuration YANG data tree.
653 * @return 0 on success, non-zero otherwise.
654 */
655int nc_server_config_del_tls_client_cert_truststore_ref(const char *endpt_name, struct lyd_node **config);
roman12c3d522023-07-26 13:39:30 +0200656
657/**
roman3f9b65c2023-06-05 14:26:58 +0200658 * @brief Creates new YANG configuration data nodes for a client certificate authority (trust-anchor) certificate.
659 *
roman84fc45a2024-05-13 15:44:10 +0200660 * A client certificate is authenticated if it has a valid chain of trust to any configured CA cert.
661 * The configured CA cert, up to which the valid chain of trust can be built, does not have to be
662 * self-signed (the root CA). That means that the chain may be incomplete, yet the client will be authenticated.
663 *
664 * For example assume a certificate chain
665 * A <- B <- C,
666 * where A is the root CA, then the client certificate C will be authenticated either
667 * if solely B is configured, or if both A and B are configured. C will not be authenticated
668 * if just A is configured as a CA certificate.
669 *
roman3f9b65c2023-06-05 14:26:58 +0200670 * @param[in] ctx libyang context.
671 * @param[in] endpt_name Arbitrary identifier of the endpoint.
roman142718b2023-06-29 09:15:29 +0200672 * If an endpoint with this identifier already exists, its contents will be changed.
roman3f9b65c2023-06-05 14:26:58 +0200673 * @param[in] cert_name Arbitrary identifier of the certificate authority certificate.
roman35120972023-08-08 10:39:12 +0200674 * If a CA with this identifier already exists, it will be changed.
roman3f9b65c2023-06-05 14:26:58 +0200675 * @param[in] cert_path Path to the CA certificate file.
676 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
677 * Otherwise the new YANG data will be added to the previous data and may override it.
678 * @return 0 on success, non-zero otherwise.
679 */
romane6ec60e2023-10-19 15:21:52 +0200680int nc_server_config_add_tls_ca_cert(const struct ly_ctx *ctx, const char *endpt_name, const char *cert_name,
roman3f9b65c2023-06-05 14:26:58 +0200681 const char *cert_path, struct lyd_node **config);
682
683/**
roman8ba6efa2023-07-12 15:27:52 +0200684 * @brief Deletes a client certificate authority (trust-anchor) certificate from the YANG data.
685 *
686 * @param[in] endpt_name Identifier of an existing endpoint.
687 * @param[in] cert_name Optional name of a certificate to be deleted.
688 * If NULL, all of the CA certificates on the given endpoint will be deleted.
roman9d5e5a52023-07-14 12:43:44 +0200689 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +0200690 * @return 0 on success, non-zero otherwise.
691 */
romane6ec60e2023-10-19 15:21:52 +0200692int nc_server_config_del_tls_ca_cert(const char *endpt_name, const char *cert_name, struct lyd_node **config);
romand348b942023-10-13 14:32:19 +0200693
694/**
695 * @brief Creates new YANG configuration data nodes for a truststore reference to a set of client certificate authority (trust-anchor) certificates.
696 *
697 * @param[in] ctx libyang context.
698 * @param[in] endpt_name Arbitrary identifier of the endpoint.
699 * If an endpoint with this identifier already exists, its contents will be changed.
700 * @param[in] cert_bag_ref Identifier of the certificate bag in the truststore to be referenced.
701 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
702 * Otherwise the new YANG data will be added to the previous data and may override it.
703 * @return 0 on success, non-zero otherwise.
704 */
romane6ec60e2023-10-19 15:21:52 +0200705int nc_server_config_add_tls_ca_cert_truststore_ref(const struct ly_ctx *ctx, const char *endpt_name,
romand348b942023-10-13 14:32:19 +0200706 const char *cert_bag_ref, struct lyd_node **config);
707
708/**
709 * @brief Deletes a client certificate authority (trust-anchor) certificates truststore reference from the YANG data.
710 *
711 * @param[in] endpt_name Identifier of an existing endpoint.
712 * @param[in,out] config Modified configuration YANG data tree.
713 * @return 0 on success, non-zero otherwise.
714 */
romane6ec60e2023-10-19 15:21:52 +0200715int nc_server_config_del_tls_ca_cert_truststore_ref(const char *endpt_name, struct lyd_node **config);
roman12c3d522023-07-26 13:39:30 +0200716
717/**
Roytak76958912023-09-29 15:25:14 +0200718 * @brief Creates new YANG configuration data nodes, which will be a reference to another TLS endpoint's certificates.
719 *
720 * Whenever an user tries to connect to the referencing endpoint, all of its certificates will be tried first. If no match is
721 * found, the referenced endpoint's configured certificates will be tried. The same applies to cert-to-name entries.
722 *
723 * @param[in] ctx libyang context
724 * @param[in] endpt_name Arbitrary identifier of the endpoint.
725 * If an endpoint with this identifier already exists, its contents will be changed.
726 * @param[in] referenced_endpt Identifier of an endpoint, which has to exist whenever this data
727 * is applied. The referenced endpoint can reference another one and so on, but there mustn't be a cycle.
728 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
729 * Otherwise the new YANG data will be added to the previous data and may override it.
730 * @return 0 on success, non-zero otherwise.
731 */
Roytakb2794852023-10-18 14:30:22 +0200732int nc_server_config_add_tls_endpoint_client_ref(const struct ly_ctx *ctx, const char *endpt_name,
Roytak76958912023-09-29 15:25:14 +0200733 const char *referenced_endpt, struct lyd_node **config);
734
735/**
736 * @brief Deletes reference to another TLS endpoint's users from the YANG data.
737 *
738 * @param[in] endpt_name Identifier of an existing endpoint.
739 * @param[in,out] config Modified configuration YANG data tree.
740 * @return 0 on success, non-zero otherwise.
741 */
Roytakb2794852023-10-18 14:30:22 +0200742int nc_server_config_del_tls_endpoint_client_ref(const char *endpt_name, struct lyd_node **config);
Roytak76958912023-09-29 15:25:14 +0200743
744/**
roman3f9b65c2023-06-05 14:26:58 +0200745 * @brief Creates new YANG configuration data nodes for a cert-to-name entry.
746 *
747 * @param[in] ctx libyang context.
748 * @param[in] endpt_name Arbitrary identifier of the endpoint.
roman142718b2023-06-29 09:15:29 +0200749 * If an endpoint with this identifier already exists, its contents will be changed.
roman3f9b65c2023-06-05 14:26:58 +0200750 * @param[in] id ID of the entry. The lower the ID, the higher the priority of the entry (it will be checked earlier).
751 * @param[in] fingerprint Optional fingerprint of the entry. The fingerprint should always be set, however if it is
752 * not set, it will match any certificate. Entry with no fingerprint should therefore be placed only as the last entry.
753 * @param[in] map_type Mapping username to the certificate option.
754 * @param[in] name Username for this cert-to-name entry.
755 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
756 * Otherwise the new YANG data will be added to the previous data and may override it.
757 * @return 0 on success, non-zero otherwise.
758 */
Roytakb2794852023-10-18 14:30:22 +0200759int nc_server_config_add_tls_ctn(const struct ly_ctx *ctx, const char *endpt_name, uint32_t id, const char *fingerprint,
roman3f9b65c2023-06-05 14:26:58 +0200760 NC_TLS_CTN_MAPTYPE map_type, const char *name, struct lyd_node **config);
761
roman12644fe2023-06-08 11:06:42 +0200762/**
roman8ba6efa2023-07-12 15:27:52 +0200763 * @brief Deletes a cert-to-name entry from the YANG data.
764 *
765 * @param[in] endpt_name Identifier of an existing endpoint.
766 * @param[in] id Optional ID of the CTN entry.
767 * If 0, all of the cert-to-name entries on the given endpoint will be deleted.
roman9d5e5a52023-07-14 12:43:44 +0200768 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +0200769 * @return 0 on success, non-zero otherwise.
770 */
Roytakb2794852023-10-18 14:30:22 +0200771int nc_server_config_del_tls_ctn(const char *endpt_name, uint32_t id, struct lyd_node **config);
roman8ba6efa2023-07-12 15:27:52 +0200772
773/**
roman35120972023-08-08 10:39:12 +0200774 * @} TLS Server Configuration
roman8ba6efa2023-07-12 15:27:52 +0200775 */
776
777/**
roman35120972023-08-08 10:39:12 +0200778 * @defgroup server_config_ch Call Home Server Configuration
roman8ba6efa2023-07-12 15:27:52 +0200779 * @ingroup server_config
780 *
Roytak2161df62023-08-02 15:04:42 +0200781 * @brief Call Home server configuration creation and deletion
roman8ba6efa2023-07-12 15:27:52 +0200782 * @{
783 */
784
785/**
roman35120972023-08-08 10:39:12 +0200786 * @} Call Home Server Configuration
787 */
788
789/**
790 * @defgroup server_config_ch_functions Call Home Server Configuration Functions
791 * @ingroup server_config_ch
792 *
793 * @brief Call Home server configuration functions
794 * @{
795 */
796
797/**
Roytak2161df62023-08-02 15:04:42 +0200798 * @brief Creates new YANG configuration data nodes for a Call Home client's address and port.
roman142718b2023-06-29 09:15:29 +0200799 *
800 * @param[in] ctx libyang context.
Roytak2161df62023-08-02 15:04:42 +0200801 * @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.
roman142718b2023-06-29 09:15:29 +0200803 * @param[in] endpt_name Arbitrary identifier of the client's endpoint.
804 * If the client's endpoint with this identifier already exists, its contents will be changed.
805 * @param[in] transport Transport protocol to be used on this endpoint - either SSH or TLS.
806 * @param[in] address Address to connect to.
807 * @param[in] port Port to connect to.
808 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
809 * Otherwise the new YANG data will be added to the previous data and may override it.
810 * @return 0 on success, non-zero otherwise.
811 */
Roytakb2794852023-10-18 14:30:22 +0200812int nc_server_config_add_ch_address_port(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
roman5cbb6532023-06-22 12:53:17 +0200813 NC_TRANSPORT_IMPL transport, const char *address, const char *port, struct lyd_node **config);
814
roman8ba6efa2023-07-12 15:27:52 +0200815#endif /* NC_ENABLED_SSH_TLS */
816
817/**
Roytak2161df62023-08-02 15:04:42 +0200818 * @brief Deletes a Call Home client from the YANG data.
roman8ba6efa2023-07-12 15:27:52 +0200819 *
820 * @param[in] client_name Optional identifier of a client to be deleted.
Roytak2161df62023-08-02 15:04:42 +0200821 * If NULL, all of the Call Home clients will be deleted.
roman9d5e5a52023-07-14 12:43:44 +0200822 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +0200823 * @return 0 on success, non-zero otherwise.
824 */
Roytakb2794852023-10-18 14:30:22 +0200825int nc_server_config_del_ch_client(const char *client_name, struct lyd_node **config);
roman8ba6efa2023-07-12 15:27:52 +0200826
827/**
Roytak2161df62023-08-02 15:04:42 +0200828 * @brief Deletes a Call Home endpoint from the YANG data.
roman8ba6efa2023-07-12 15:27:52 +0200829 *
Roytak2161df62023-08-02 15:04:42 +0200830 * @param[in] client_name Identifier of an existing Call Home client.
roman8ba6efa2023-07-12 15:27:52 +0200831 * @param[in] endpt_name Optional identifier of a CH endpoint to be deleted.
832 * If NULL, all of the CH endpoints which belong to the given client will be deleted.
roman9d5e5a52023-07-14 12:43:44 +0200833 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +0200834 * @return 0 on success, non-zero otherwise.
835 */
Roytakb2794852023-10-18 14:30:22 +0200836int nc_server_config_del_ch_endpt(const char *client_name, const char *endpt_name, struct lyd_node **config);
roman8ba6efa2023-07-12 15:27:52 +0200837
838/**
Roytak2161df62023-08-02 15:04:42 +0200839 * @brief Creates new YANG configuration data nodes for the Call Home persistent connection type.
roman8ba6efa2023-07-12 15:27:52 +0200840 *
841 * This is the default connection type. If periodic connection type was set before, it will be unset.
842 *
843 * @param[in] ctx libyang context.
Roytak2161df62023-08-02 15:04:42 +0200844 * @param[in] client_name Arbitrary identifier of the Call Home client.
845 * If a Call Home client with this identifier already exists, its contents will be changed.
Roytak9b32c0f2023-08-02 15:07:29 +0200846 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
roman8ba6efa2023-07-12 15:27:52 +0200847 * Otherwise the new YANG data will be added to the previous data and may override it.
848 * @return 0 on success, non-zero otherwise.
849 */
Roytakb2794852023-10-18 14:30:22 +0200850int nc_server_config_add_ch_persistent(const struct ly_ctx *ctx, const char *client_name, struct lyd_node **config);
roman8ba6efa2023-07-12 15:27:52 +0200851
852/**
Roytak2161df62023-08-02 15:04:42 +0200853 * @brief Creates new YANG configuration data nodes for the period parameter of the Call Home periodic connection type.
roman8ba6efa2023-07-12 15:27:52 +0200854 *
855 * If called, the persistent connection type will be replaced by periodic.
856 *
857 * @param[in] ctx libyang context.
Roytak2161df62023-08-02 15:04:42 +0200858 * @param[in] client_name Arbitrary identifier of the Call Home client.
859 * If a Call Home client with this identifier already exists, its contents will be changed.
roman8ba6efa2023-07-12 15:27:52 +0200860 * @param[in] period Duration between periodic connections in minutes.
Roytak9b32c0f2023-08-02 15:07:29 +0200861 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
roman8ba6efa2023-07-12 15:27:52 +0200862 * Otherwise the new YANG data will be added to the previous data and may override it.
863 * @return 0 on success, non-zero otherwise.
864 */
Roytakb2794852023-10-18 14:30:22 +0200865int nc_server_config_add_ch_period(const struct ly_ctx *ctx, const char *client_name, uint16_t period,
roman8ba6efa2023-07-12 15:27:52 +0200866 struct lyd_node **config);
867
868/**
Roytak2161df62023-08-02 15:04:42 +0200869 * @brief Deletes the Call Home period parameter of the periodic connection type from the YANG data.
roman8ba6efa2023-07-12 15:27:52 +0200870 *
871 * This behaves the same as setting the period to 60 minutes, which is the default value of this node.
872 *
Roytak2161df62023-08-02 15:04:42 +0200873 * @param[in] client_name Identifier of an existing Call Home client.
roman9d5e5a52023-07-14 12:43:44 +0200874 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +0200875 * @return 0 on success, non-zero otherwise.
876 */
Roytakb2794852023-10-18 14:30:22 +0200877int nc_server_config_del_ch_period(const char *client_name, struct lyd_node **config);
roman8ba6efa2023-07-12 15:27:52 +0200878
879/**
Roytak2161df62023-08-02 15:04:42 +0200880 * @brief Creates new YANG configuration data nodes for the anchor time parameter of the Call Home periodic connection type.
roman8ba6efa2023-07-12 15:27:52 +0200881 *
882 * If called, the persistent connection type will be replaced by periodic.
883 *
884 * @param[in] ctx libyang context.
Roytak2161df62023-08-02 15:04:42 +0200885 * @param[in] client_name Arbitrary identifier of the Call Home client.
886 * If a Call Home client with this identifier already exists, its contents will be changed.
roman8ba6efa2023-07-12 15:27:52 +0200887 * @param[in] anchor_time Timestamp before or after which a series of periodic connections are determined.
Roytak9b32c0f2023-08-02 15:07:29 +0200888 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
roman8ba6efa2023-07-12 15:27:52 +0200889 * Otherwise the new YANG data will be added to the previous data and may override it.
890 * @return 0 on success, non-zero otherwise.
891 */
Roytakb2794852023-10-18 14:30:22 +0200892int nc_server_config_add_ch_anchor_time(const struct ly_ctx *ctx, const char *client_name,
roman8ba6efa2023-07-12 15:27:52 +0200893 const char *anchor_time, struct lyd_node **config);
894
895/**
Roytak2161df62023-08-02 15:04:42 +0200896 * @brief Deletes the Call Home anchor time parameter of the periodic connection type from the YANG data.
roman8ba6efa2023-07-12 15:27:52 +0200897 *
Roytak2161df62023-08-02 15:04:42 +0200898 * @param[in] client_name Identifier of an existing Call Home client.
roman9d5e5a52023-07-14 12:43:44 +0200899 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +0200900 * @return 0 on success, non-zero otherwise.
901 */
Roytakb2794852023-10-18 14:30:22 +0200902int nc_server_config_del_ch_anchor_time(const char *client_name, struct lyd_node **config);
roman8ba6efa2023-07-12 15:27:52 +0200903
904/**
Roytak2161df62023-08-02 15:04:42 +0200905 * @brief Creates new YANG configuration data nodes for the idle timeout parameter of the Call Home periodic connection type.
roman8ba6efa2023-07-12 15:27:52 +0200906 *
907 * If called, the persistent connection type will be replaced by periodic.
908 *
909 * @param[in] ctx libyang context.
Roytak2161df62023-08-02 15:04:42 +0200910 * @param[in] client_name Arbitrary identifier of the Call Home client.
911 * If a Call Home client with this identifier already exists, its contents will be changed.
roman8ba6efa2023-07-12 15:27:52 +0200912 * @param[in] idle_timeout Specifies the maximum number of seconds that a session may remain idle.
Roytak9b32c0f2023-08-02 15:07:29 +0200913 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
roman8ba6efa2023-07-12 15:27:52 +0200914 * Otherwise the new YANG data will be added to the previous data and may override it.
915 * @return 0 on success, non-zero otherwise.
916 */
Roytakb2794852023-10-18 14:30:22 +0200917int nc_server_config_add_ch_idle_timeout(const struct ly_ctx *ctx, const char *client_name,
roman8ba6efa2023-07-12 15:27:52 +0200918 uint16_t idle_timeout, struct lyd_node **config);
919
920/**
Roytak2161df62023-08-02 15:04:42 +0200921 * @brief Deletes the Call Home idle timeout parameter of the periodic connection type from the YANG data.
roman8ba6efa2023-07-12 15:27:52 +0200922 *
923 * This behaves the same as setting the timeout to 180 seconds, which is the default value of this node.
924 *
Roytak2161df62023-08-02 15:04:42 +0200925 * @param[in] client_name Identifier of an existing Call Home client.
roman9d5e5a52023-07-14 12:43:44 +0200926 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +0200927 * @return 0 on success, non-zero otherwise.
928 */
Roytakb2794852023-10-18 14:30:22 +0200929int nc_server_config_del_ch_idle_timeout(const char *client_name, struct lyd_node **config);
roman8ba6efa2023-07-12 15:27:52 +0200930
931/**
Roytak2161df62023-08-02 15:04:42 +0200932 * @brief Creates new YANG configuration data nodes for the Call Home reconnect strategy.
roman8ba6efa2023-07-12 15:27:52 +0200933 *
934 * @param[in] ctx libyang context.
Roytak2161df62023-08-02 15:04:42 +0200935 * @param[in] client_name Arbitrary identifier of the Call Home client.
936 * If a Call Home client with this identifier already exists, its contents will be changed.
roman8ba6efa2023-07-12 15:27:52 +0200937 * @param[in] start_with Specifies which endpoint to try if a connection is unsuccessful. Default value is NC_CH_FIRST_LISTED.
938 * @param[in] max_wait The number of seconds after which a connection to an endpoint is deemed unsuccessful. Default value if 5.
939 * @param[in] max_attempts The number of unsuccessful connection attempts before moving to the next endpoint. Default value is 3.
Roytak9b32c0f2023-08-02 15:07:29 +0200940 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
roman8ba6efa2023-07-12 15:27:52 +0200941 * Otherwise the new YANG data will be added to the previous data and may override it.
942 * @return 0 on success, non-zero otherwise.
943 */
Roytakb2794852023-10-18 14:30:22 +0200944int nc_server_config_add_ch_reconnect_strategy(const struct ly_ctx *ctx, const char *client_name,
roman8ba6efa2023-07-12 15:27:52 +0200945 NC_CH_START_WITH start_with, uint16_t max_wait, uint8_t max_attempts, struct lyd_node **config);
946
947/**
Roytak2161df62023-08-02 15:04:42 +0200948 * @brief Resets the values of the Call Home reconnect strategy nodes to their defaults.
roman8ba6efa2023-07-12 15:27:52 +0200949 *
950 * The default values are: start-with = NC_CH_FIRST_LISTED, max-wait = 5 and max-attempts = 3.
951 *
Roytak2161df62023-08-02 15:04:42 +0200952 * @param[in] client_name Identifier of an existing Call Home client.
roman9d5e5a52023-07-14 12:43:44 +0200953 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +0200954 * @return 0 on success, non-zero otherwise.
955 */
Roytakb2794852023-10-18 14:30:22 +0200956int nc_server_config_del_ch_reconnect_strategy(const char *client_name, struct lyd_node **config);
roman8ba6efa2023-07-12 15:27:52 +0200957
958/**
roman35120972023-08-08 10:39:12 +0200959 * @} Call Home Server Configuration Functions
roman8ba6efa2023-07-12 15:27:52 +0200960 */
961
962#ifdef NC_ENABLED_SSH_TLS
963
964/**
Roytak2161df62023-08-02 15:04:42 +0200965 * @defgroup server_config_ch_ssh SSH Call Home Server Configuration
roman8ba6efa2023-07-12 15:27:52 +0200966 * @ingroup server_config_ch
967 *
Roytak2161df62023-08-02 15:04:42 +0200968 * @brief SSH Call Home server configuration creation and deletion
roman8ba6efa2023-07-12 15:27:52 +0200969 * @{
970 */
971
roman142718b2023-06-29 09:15:29 +0200972/**
Roytak2161df62023-08-02 15:04:42 +0200973 * @brief Creates new YANG data nodes for a Call Home SSH hostkey.
roman142718b2023-06-29 09:15:29 +0200974 *
975 * @param[in] ctx libyang context.
Roytak2161df62023-08-02 15:04:42 +0200976 * @param[in] client_name Arbitrary identifier of the Call Home client.
977 * If a Call Home client with this identifier already exists, its contents will be changed.
roman142718b2023-06-29 09:15:29 +0200978 * @param[in] endpt_name Arbitrary identifier of the client's endpoint.
979 * If the client's endpoint with this identifier already exists, its contents will be changed.
980 * @param[in] hostkey_name Arbitrary identifier of the endpoint's hostkey.
981 * If the endpoint's hostkey with this identifier already exists, its contents will be changed.
982 * @param[in] privkey_path Path to a file containing a private key.
983 * The private key has to be in a PEM format. Only RSA and ECDSA keys are supported.
984 * @param[in] pubkey_path Path to a file containing a public key. If NULL, public key will be
985 * generated from the private key.
986 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
987 * Otherwise the new YANG data will be added to the previous data and may override it.
988 * @return 0 on success, non-zero otherwise.
989 */
Roytakb2794852023-10-18 14:30:22 +0200990int nc_server_config_add_ch_ssh_hostkey(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
roman5cbb6532023-06-22 12:53:17 +0200991 const char *hostkey_name, const char *privkey_path, const char *pubkey_path, struct lyd_node **config);
992
roman142718b2023-06-29 09:15:29 +0200993/**
Roytak2161df62023-08-02 15:04:42 +0200994 * @brief Deletes a Call Home hostkey from the YANG data.
roman8ba6efa2023-07-12 15:27:52 +0200995 *
Roytak2161df62023-08-02 15:04:42 +0200996 * @param[in] client_name Identifier of an existing Call Home client.
roman9d5e5a52023-07-14 12:43:44 +0200997 * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client.
roman8ba6efa2023-07-12 15:27:52 +0200998 * @param[in] hostkey_name Optional identifier of a hostkey to be deleted.
999 * If NULL, all of the hostkeys on the given endpoint will be deleted.
roman9d5e5a52023-07-14 12:43:44 +02001000 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +02001001 * @return 0 on success, non-zero otherwise.
1002 */
Roytakb2794852023-10-18 14:30:22 +02001003int nc_server_config_del_ch_ssh_hostkey(const char *client_name, const char *endpt_name,
roman9d5e5a52023-07-14 12:43:44 +02001004 const char *hostkey_name, struct lyd_node **config);
1005
1006/**
romand348b942023-10-13 14:32:19 +02001007 * @brief Creates new YANG data nodes for a reference to an asymmetric key located in the keystore.
1008 *
1009 * This asymmetric key pair will be used as the Call Home SSH hostkey.
1010 *
1011 * @param[in] ctx libyang context.
1012 * @param[in] client_name Arbitrary identifier of the Call Home client.
1013 * If a Call Home client with this identifier already exists, its contents will be changed.
1014 * @param[in] endpt_name Arbitrary identifier of the client's endpoint.
1015 * If the client's endpoint with this identifier already exists, its contents will be changed.
1016 * @param[in] hostkey_name Arbitrary identifier of the endpoint's hostkey.
1017 * If the endpoint's hostkey with this identifier already exists, its contents will be changed.
1018 * @param[in] keystore_reference Name of the asymmetric key pair to be referenced and used as a hostkey.
1019 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
1020 * Otherwise the new YANG data will be added to the previous data and may override it.
1021 * @return 0 on success, non-zero otherwise.
1022 */
1023int nc_server_config_add_ch_ssh_keystore_ref(const struct ly_ctx *ctx, const char *client_name,
1024 const char *endpt_name, const char *hostkey_name, const char *keystore_reference, struct lyd_node **config);
1025
1026/**
1027 * @brief Deletes a Call Home keystore reference from the YANG data.
1028 *
1029 * @param[in] client_name Identifier of an existing Call Home client.
1030 * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client.
1031 * @param[in] hostkey_name Identifier of an existing hostkey that belongs to the given CH endpoint.
1032 * @param[in,out] config Modified configuration YANG data tree.
1033 * @return 0 on success, non-zero otherwise.
1034 */
1035int nc_server_config_del_ch_ssh_keystore_ref(const char *client_name, const char *endpt_name,
1036 const char *hostkey_name, struct lyd_node **config);
1037
1038/**
Roytak2161df62023-08-02 15:04:42 +02001039 * @brief Creates new YANG data nodes for a Call Home SSH user's public key authentication method.
roman142718b2023-06-29 09:15:29 +02001040 *
1041 * @param[in] ctx libyang context.
Roytak2161df62023-08-02 15:04:42 +02001042 * @param[in] client_name Arbitrary identifier of the Call Home client.
1043 * If a Call Home client with this identifier already exists, its contents will be changed.
roman142718b2023-06-29 09:15:29 +02001044 * @param[in] endpt_name Arbitrary identifier of the client's endpoint.
1045 * If the client's endpoint with this identifier already exists, its contents will be changed.
1046 * @param[in] user_name Arbitrary identifier of the endpoint's user.
1047 * If the endpoint's user with this identifier already exists, its contents will be changed.
1048 * @param[in] pubkey_name Arbitrary identifier of the user's public key.
1049 * If the user's public key with this identifier already exists, its contents will be changed.
1050 * @param[in] pubkey_path Path to a file containing a public key.
1051 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
1052 * Otherwise the new YANG data will be added to the previous data and may override it.
1053 * @return 0 on success, non-zero otherwise.
1054 */
Roytakb2794852023-10-18 14:30:22 +02001055int nc_server_config_add_ch_ssh_user_pubkey(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
roman5cbb6532023-06-22 12:53:17 +02001056 const char *user_name, const char *pubkey_name, const char *pubkey_path, struct lyd_node **config);
1057
roman142718b2023-06-29 09:15:29 +02001058/**
Roytak2161df62023-08-02 15:04:42 +02001059 * @brief Deletes a Call Home SSH user's public key from the YANG data.
roman142718b2023-06-29 09:15:29 +02001060 *
Roytak2161df62023-08-02 15:04:42 +02001061 * @param[in] client_name Identifier of an existing Call Home client.
roman9d5e5a52023-07-14 12:43:44 +02001062 * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client.
1063 * @param[in] user_name Identifier of an existing SSH user that belongs to the given CH endpoint.
roman8ba6efa2023-07-12 15:27:52 +02001064 * @param[in] pubkey_name Optional identifier of a public key to be deleted.
1065 * If NULL, all of the public keys which belong to the given SSH user will be deleted.
roman9d5e5a52023-07-14 12:43:44 +02001066 * @param[in,out] config Modified configuration YANG data tree.
roman142718b2023-06-29 09:15:29 +02001067 * @return 0 on success, non-zero otherwise.
1068 */
Roytakb2794852023-10-18 14:30:22 +02001069int nc_server_config_del_ch_ssh_user_pubkey(const char *client_name, const char *endpt_name,
roman8ba6efa2023-07-12 15:27:52 +02001070 const char *user_name, const char *pubkey_name, struct lyd_node **config);
roman5cbb6532023-06-22 12:53:17 +02001071
roman142718b2023-06-29 09:15:29 +02001072/**
romana9ec3362023-12-21 10:59:57 +01001073 * @brief Creates new YANG configuration data nodes for a Call Home SSH user that will use system's authorized_keys to authenticate.
1074 *
1075 * The path to the authorized_keys file must be configured to successfully
1076 * authenticate, see ::nc_server_ssh_set_authkey_path_format().
1077 *
1078 * @param[in] ctx libyang context.
1079 * @param[in] client_name Arbitrary identifier of the Call Home client.
1080 * If a Call Home client with this identifier already exists, its contents will be changed.
1081 * @param[in] endpt_name Arbitrary identifier of the client's endpoint.
1082 * If the client's endpoint with this identifier already exists, its contents will be changed.
1083 * @param[in] user_name Arbitrary identifier of the endpoint's user.
1084 * If the endpoint's user with this identifier already exists, its contents will be changed.
1085 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
1086 * Otherwise the new YANG data will be added to the previous data and may override it.
1087 * @return 0 on success, non-zero otherwise.
1088 */
1089int nc_server_config_add_ch_ssh_user_authkey(const struct ly_ctx *ctx, const char *client_name,
1090 const char *endpt_name, const char *user_name, struct lyd_node **config);
1091
1092/**
1093 * @brief Deletes a Call Home SSH user's authorized_keys method from the YANG data.
1094 *
1095 * @param[in] client_name Identifier of an existing Call Home client.
1096 * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client.
1097 * @param[in] user_name Identifier of an existing user on the given endpoint.
1098 * @param[in,out] config Modified configuration YANG data tree.
1099 * @return 0 on success, non-zero otherwise.
1100 */
1101int nc_server_config_ch_del_ssh_user_authkey(const char *client_name, const char *endpt_name,
1102 const char *user_name, struct lyd_node **config);
1103
1104/**
Roytak2161df62023-08-02 15:04:42 +02001105 * @brief Creates new YANG data nodes for a Call Home SSH user's password authentication method.
roman9d5e5a52023-07-14 12:43:44 +02001106 *
1107 * @param[in] ctx libyang context.
Roytak2161df62023-08-02 15:04:42 +02001108 * @param[in] client_name Arbitrary identifier of the Call Home client.
1109 * If a Call Home client with this identifier already exists, its contents will be changed.
roman9d5e5a52023-07-14 12:43:44 +02001110 * @param[in] endpt_name Arbitrary identifier of the client's endpoint.
1111 * If the client's endpoint with this identifier already exists, its contents will be changed.
1112 * @param[in] user_name Arbitrary identifier of the endpoint's user.
1113 * If the endpoint's user with this identifier already exists, its contents will be changed.
roman35120972023-08-08 10:39:12 +02001114 * @param[in] password Clear-text password to be set for the user. It will be hashed.
roman9d5e5a52023-07-14 12:43:44 +02001115 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
1116 * Otherwise the new YANG data will be added to the previous data and may override it.
1117 * @return 0 on success, non-zero otherwise.
1118 */
Roytakb2794852023-10-18 14:30:22 +02001119int nc_server_config_add_ch_ssh_user_password(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
roman9d5e5a52023-07-14 12:43:44 +02001120 const char *user_name, const char *password, struct lyd_node **config);
1121
1122/**
Roytak2161df62023-08-02 15:04:42 +02001123 * @brief Deletes a Call Home SSH user's password from the YANG data.
roman9d5e5a52023-07-14 12:43:44 +02001124 *
Roytak2161df62023-08-02 15:04:42 +02001125 * @param[in] client_name Identifier of an existing Call Home client.
roman9d5e5a52023-07-14 12:43:44 +02001126 * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client.
1127 * @param[in] user_name Identifier of an existing SSH user that belongs to the given CH endpoint.
1128 * @param[in,out] config Modified configuration YANG data tree.
1129 * @return 0 on success, non-zero otherwise.
1130 */
Roytakb2794852023-10-18 14:30:22 +02001131int nc_server_config_del_ch_ssh_user_password(const char *client_name, const char *endpt_name,
roman9d5e5a52023-07-14 12:43:44 +02001132 const char *user_name, struct lyd_node **config);
1133
1134/**
Roytak2161df62023-08-02 15:04:42 +02001135 * @brief Creates new YANG configuration data nodes for a Call Home SSH user's keyboard interactive authentication method.
roman9d5e5a52023-07-14 12:43:44 +02001136 *
romanc6518422023-11-30 16:39:00 +01001137 * One of Linux PAM, local users, or user callback is used to authenticate users with this SSH method (see \ref ln2doc_kbdint "the documentation").
roman808f3f62023-11-23 16:01:04 +01001138 *
roman9d5e5a52023-07-14 12:43:44 +02001139 * @param[in] ctx libyang context.
Roytak2161df62023-08-02 15:04:42 +02001140 * @param[in] client_name Arbitrary identifier of the Call Home client.
1141 * If a Call Home client with this identifier already exists, its contents will be changed.
roman9d5e5a52023-07-14 12:43:44 +02001142 * @param[in] endpt_name Arbitrary identifier of the client's endpoint.
1143 * If the client's endpoint with this identifier already exists, its contents will be changed.
1144 * @param[in] user_name Arbitrary identifier of the endpoint's user.
1145 * If the endpoint's user with this identifier already exists, its contents will be changed.
roman9d5e5a52023-07-14 12:43:44 +02001146 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
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 */
Roytakb2794852023-10-18 14:30:22 +02001150int nc_server_config_add_ch_ssh_user_interactive(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
roman808f3f62023-11-23 16:01:04 +01001151 const char *user_name, struct lyd_node **config);
roman9d5e5a52023-07-14 12:43:44 +02001152
1153/**
Roytak2161df62023-08-02 15:04:42 +02001154 * @brief Deletes a Call Home SSH user's keyboard interactive authentication from the YANG data.
roman9d5e5a52023-07-14 12:43:44 +02001155 *
Roytak2161df62023-08-02 15:04:42 +02001156 * @param[in] client_name Identifier of an existing Call Home client.
roman9d5e5a52023-07-14 12:43:44 +02001157 * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client.
1158 * @param[in] user_name Identifier of an existing SSH user that belongs to the given CH endpoint.
1159 * @param[in,out] config Modified configuration YANG data tree.
1160 * @return 0 on success, non-zero otherwise.
1161 */
Roytakb2794852023-10-18 14:30:22 +02001162int nc_server_config_del_ch_ssh_user_interactive(const char *client_name, const char *endpt_name,
roman9d5e5a52023-07-14 12:43:44 +02001163 const char *user_name, struct lyd_node **config);
1164
1165/**
Roytak2161df62023-08-02 15:04:42 +02001166 * @brief Deletes a Call Home SSH user from the YANG data.
roman9d5e5a52023-07-14 12:43:44 +02001167 *
Roytak2161df62023-08-02 15:04:42 +02001168 * @param[in] client_name Identifier of an existing Call Home client.
roman9d5e5a52023-07-14 12:43:44 +02001169 * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client.
1170 * @param[in] user_name Identifier of an existing SSH user that belongs to the given CH endpoint.
1171 * @param[in,out] config Modified configuration YANG data tree.
1172 * @return 0 on success, non-zero otherwise.
1173 */
Roytakb2794852023-10-18 14:30:22 +02001174int nc_server_config_del_ch_ssh_user(const char *client_name, const char *endpt_name,
roman9d5e5a52023-07-14 12:43:44 +02001175 const char *user_name, struct lyd_node **config);
1176
1177/**
romand348b942023-10-13 14:32:19 +02001178 * @brief Creates new YANG data nodes for a reference to a public key bag located in the truststore.
1179 *
1180 * The public key's located in the bag will be used for Call Home SSH client authentication.
1181 *
1182 * @param[in] ctx libyang context.
1183 * @param[in] client_name Arbitrary identifier of the Call Home client.
1184 * If a Call Home client with this identifier already exists, its contents will be changed.
1185 * @param[in] endpt_name Arbitrary identifier of the client's endpoint.
1186 * If the client's endpoint with this identifier already exists, its contents will be changed.
1187 * @param[in] user_name Arbitrary identifier of the endpoint's user.
1188 * If the endpoint's user with this identifier already exists, its contents will be changed.
1189 * @param[in] truststore_reference Name of the public key bag to be referenced and used for authentication.
1190 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
1191 * Otherwise the new YANG data will be added to the previous data and may override it.
1192 * @return 0 on success, non-zero otherwise.
1193 */
1194int nc_server_config_add_ch_ssh_truststore_ref(const struct ly_ctx *ctx, const char *client_name,
1195 const char *endpt_name, const char *user_name, const char *truststore_reference, struct lyd_node **config);
1196
1197/**
1198 * @brief Deletes a Call Home SSH truststore reference from the YANG data.
1199 *
1200 * @param[in] client_name Identifier of an existing Call Home client.
1201 * @param[in] endpt_name Identifier of an existing endpoint that belongs to the given CH client.
1202 * @param[in] user_name Identifier of an existing SSH user that belongs to the given CH endpoint.
1203 * @param[in,out] config Modified configuration YANG data tree.
1204 * @return 0 on success, non-zero otherwise.
1205 */
1206int nc_server_config_del_ch_ssh_truststore_ref(const char *client_name, const char *endpt_name,
1207 const char *user_name, struct lyd_node **config);
1208
1209/**
roman35120972023-08-08 10:39:12 +02001210 * @} SSH Call Home Server Configuration
roman142718b2023-06-29 09:15:29 +02001211 */
roman142718b2023-06-29 09:15:29 +02001212
1213/**
Roytak2161df62023-08-02 15:04:42 +02001214 * @defgroup server_config_ch_tls TLS Call Home Server Configuration
roman8ba6efa2023-07-12 15:27:52 +02001215 * @ingroup server_config_ch
roman142718b2023-06-29 09:15:29 +02001216 *
Roytak2161df62023-08-02 15:04:42 +02001217 * @brief TLS Call Home server configuration creation and deletion
roman8ba6efa2023-07-12 15:27:52 +02001218 * @{
roman142718b2023-06-29 09:15:29 +02001219 */
roman142718b2023-06-29 09:15:29 +02001220
romanb6f44032023-06-30 15:07:56 +02001221/**
Roytak2161df62023-08-02 15:04:42 +02001222 * @brief Creates new YANG configuration data nodes for a Call Home server's certificate.
romanb6f44032023-06-30 15:07:56 +02001223 *
1224 * @param[in] ctx libyang context.
Roytak2161df62023-08-02 15:04:42 +02001225 * @param[in] client_name Arbitrary identifier of the Call Home client.
1226 * If a Call Home client with this identifier already exists, its contents will be changed.
1227 * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint.
1228 * If a Call Home client's endpoint with this identifier already exists, its contents will be changed.
roman6c4efcd2023-08-08 10:18:44 +02001229 * @param[in] privkey_path Path to the server's PEM encoded private key file.
romanb6f44032023-06-30 15:07:56 +02001230 * @param[in] pubkey_path Optional path to the server's public key file. If not provided,
1231 * it will be generated from the private key.
romane6ec60e2023-10-19 15:21:52 +02001232 * @param[in] cert_path Path to the server's certificate file.
Roytak934edc32023-07-27 12:04:18 +02001233 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
romanb6f44032023-06-30 15:07:56 +02001234 * Otherwise the new YANG data will be added to the previous data and may override it.
1235 * @return 0 on success, non-zero otherwise.
1236 */
romane6ec60e2023-10-19 15:21:52 +02001237int nc_server_config_add_ch_tls_server_cert(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
1238 const char *privkey_path, const char *pubkey_path, const char *cert_path, struct lyd_node **config);
romanb6f44032023-06-30 15:07:56 +02001239
1240/**
Roytak2161df62023-08-02 15:04:42 +02001241 * @brief Deletes a Call Home server certificate from the YANG data.
roman8ba6efa2023-07-12 15:27:52 +02001242 *
Roytak2161df62023-08-02 15:04:42 +02001243 * @param[in] client_name Identifier of an existing Call Home client.
1244 * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client.
roman9d5e5a52023-07-14 12:43:44 +02001245 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +02001246 * @return 0 on success, non-zero otherwise.
1247 */
romane6ec60e2023-10-19 15:21:52 +02001248int nc_server_config_del_ch_tls_server_cert(const char *client_name, const char *endpt_name,
romand348b942023-10-13 14:32:19 +02001249 struct lyd_node **config);
1250
1251/**
1252 * @brief Creates new YANG configuration data nodes for a keystore reference to the Call Home TLS server's certificate.
1253 *
1254 * @param[in] ctx libyang context.
1255 * @param[in] client_name Arbitrary identifier of the Call Home client.
1256 * If a Call Home client with this identifier already exists, its contents will be changed.
1257 * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint.
1258 * If a Call Home client's endpoint with this identifier already exists, its contents will be changed.
1259 * @param[in] asym_key_ref Name of the asymmetric key pair in the keystore to be referenced.
1260 * @param[in] cert_ref Name of the certificate, which must belong to the given asymmetric key pair, to be referenced.
1261 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
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 */
1265int nc_server_config_add_ch_tls_keystore_ref(const struct ly_ctx *ctx, const char *client_name,
1266 const char *endpt_name, const char *asym_key_ref, const char *cert_ref, struct lyd_node **config);
1267
1268/**
1269 * @brief Deletes a TLS server certificate keystore reference from the YANG data.
1270 *
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.
1273 * @param[in,out] config Modified configuration YANG data tree.
1274 * @return 0 on success, non-zero otherwise.
1275 */
1276int nc_server_config_del_ch_tls_keystore_ref(const char *client_name, const char *endpt_name,
Roytak934edc32023-07-27 12:04:18 +02001277 struct lyd_node **config);
1278
1279/**
Roytak2161df62023-08-02 15:04:42 +02001280 * @brief Creates new YANG configuration data nodes for a Call Home client's (end-entity) certificate.
romanb6f44032023-06-30 15:07:56 +02001281 *
1282 * @param[in] ctx libyang context.
Roytak2161df62023-08-02 15:04:42 +02001283 * @param[in] client_name Arbitrary identifier of the Call Home client.
1284 * If a Call Home client with this identifier already exists, its contents will be changed.
1285 * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint.
1286 * If a Call Home client's endpoint with this identifier already exists, its contents will be changed.
1287 * @param[in] cert_name Arbitrary identifier of the Call Home endpoint's end-entity certificate.
1288 * If an Call Home endpoint's end-entity certificate with this identifier already exists, its contents will be changed.
romanb6f44032023-06-30 15:07:56 +02001289 * @param[in] cert_path Path to the certificate file.
Roytak934edc32023-07-27 12:04:18 +02001290 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
romanb6f44032023-06-30 15:07:56 +02001291 * 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 */
romane6ec60e2023-10-19 15:21:52 +02001294int nc_server_config_add_ch_tls_client_cert(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
romanb6f44032023-06-30 15:07:56 +02001295 const char *cert_name, const char *cert_path, struct lyd_node **config);
1296
1297/**
Roytak2161df62023-08-02 15:04:42 +02001298 * @brief Deletes a Call Home client (end-entity) certificate from the YANG data.
roman8ba6efa2023-07-12 15:27:52 +02001299 *
Roytak2161df62023-08-02 15:04:42 +02001300 * @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.
roman8ba6efa2023-07-12 15:27:52 +02001302 * @param[in] cert_name Optional identifier of a client certificate to be deleted.
1303 * If NULL, all of the client certificates will be deleted.
roman9d5e5a52023-07-14 12:43:44 +02001304 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +02001305 * @return 0 on success, non-zero otherwise.
1306 */
romane6ec60e2023-10-19 15:21:52 +02001307int nc_server_config_del_ch_tls_client_cert(const char *client_name, const char *endpt_name,
roman8ba6efa2023-07-12 15:27:52 +02001308 const char *cert_name, struct lyd_node **config);
1309
1310/**
romand348b942023-10-13 14:32:19 +02001311 * @brief Creates new YANG configuration data nodes for a Call Home truststore reference to a set of client (end-entity) certificates.
1312 *
1313 * @param[in] ctx libyang context.
1314 * @param[in] client_name Arbitrary identifier of the Call Home client.
1315 * If a Call Home client with this identifier already exists, its contents will be changed.
1316 * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint.
1317 * If a Call Home client's endpoint with this identifier already exists, its contents will be changed.
1318 * @param[in] cert_bag_ref Identifier of the certificate bag in the truststore to be referenced.
1319 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
1320 * Otherwise the new YANG data will be added to the previous data and may override it.
1321 * @return 0 on success, non-zero otherwise.
1322 */
1323int nc_server_config_add_ch_tls_client_cert_truststore_ref(const struct ly_ctx *ctx, const char *client_name,
1324 const char *endpt_name, const char *cert_bag_ref, struct lyd_node **config);
1325
1326/**
1327 * @brief Deletes a Call Home client (end-entity) certificates truststore reference from the YANG data.
1328 *
1329 * @param[in] client_name Identifier of an existing Call Home client.
1330 * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client.
1331 * @param[in,out] config Modified configuration YANG data tree.
1332 * @return 0 on success, non-zero otherwise.
1333 */
1334int nc_server_config_del_ch_tls_client_cert_truststore_ref(const char *client_name, const char *endpt_name,
1335 struct lyd_node **config);
1336
1337/**
romanb6f44032023-06-30 15:07:56 +02001338 * @brief Creates new YANG configuration data nodes for a client certificate authority (trust-anchor) certificate.
1339 *
1340 * @param[in] ctx libyang context.
Roytak2161df62023-08-02 15:04:42 +02001341 * @param[in] client_name Arbitrary identifier of the Call Home client.
1342 * If a Call Home client with this identifier already exists, its contents will be changed.
1343 * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint.
1344 * If a Call Home client's endpoint with this identifier already exists, its contents will be changed.
1345 * @param[in] cert_name Arbitrary identifier of the Call Home endpoint's certificate authority certificate.
1346 * If an Call Home endpoint's CA certificate with this identifier already exists, its contents will be changed.
romanb6f44032023-06-30 15:07:56 +02001347 * @param[in] cert_path Path to the certificate file.
Roytak9b32c0f2023-08-02 15:07:29 +02001348 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
romanb6f44032023-06-30 15:07:56 +02001349 * Otherwise the new YANG data will be added to the previous data and may override it.
1350 * @return 0 on success, non-zero otherwise.
1351 */
romane6ec60e2023-10-19 15:21:52 +02001352int nc_server_config_add_ch_tls_ca_cert(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
romanb6f44032023-06-30 15:07:56 +02001353 const char *cert_name, const char *cert_path, struct lyd_node **config);
1354
1355/**
Roytak2161df62023-08-02 15:04:42 +02001356 * @brief Deletes a Call Home client certificate authority (trust-anchor) certificate from the YANG data.
roman8ba6efa2023-07-12 15:27:52 +02001357 *
Roytak2161df62023-08-02 15:04:42 +02001358 * @param[in] client_name Identifier of an existing Call Home client.
1359 * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client.
roman8ba6efa2023-07-12 15:27:52 +02001360 * @param[in] cert_name Optional identifier of a CA certificate to be deleted.
1361 * If NULL, all of the CA certificates will be deleted.
roman9d5e5a52023-07-14 12:43:44 +02001362 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +02001363 * @return 0 on success, non-zero otherwise.
1364 */
romane6ec60e2023-10-19 15:21:52 +02001365int nc_server_config_del_ch_tls_ca_cert(const char *client_name, const char *endpt_name,
roman8ba6efa2023-07-12 15:27:52 +02001366 const char *cert_name, struct lyd_node **config);
1367
1368/**
romand348b942023-10-13 14:32:19 +02001369 * @brief Creates new YANG configuration data nodes for a Call Home truststore reference to a set of client certificate authority (trust-anchor) certificates.
1370 *
1371 * @param[in] ctx libyang context.
1372 * @param[in] client_name Arbitrary identifier of the Call Home client.
1373 * If a Call Home client with this identifier already exists, its contents will be changed.
1374 * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint.
1375 * If a Call Home client's endpoint with this identifier already exists, its contents will be changed.
1376 * @param[in] cert_bag_ref Identifier of the certificate bag in the truststore to be referenced.
1377 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
1378 * Otherwise the new YANG data will be added to the previous data and may override it.
1379 * @return 0 on success, non-zero otherwise.
1380 */
romane6ec60e2023-10-19 15:21:52 +02001381int nc_server_config_add_ch_tls_ca_cert_truststore_ref(const struct ly_ctx *ctx, const char *client_name,
romand348b942023-10-13 14:32:19 +02001382 const char *endpt_name, const char *cert_bag_ref, struct lyd_node **config);
1383
1384/**
1385 * @brief Deletes a Call Home client certificate authority (trust-anchor) certificates truststore reference from the YANG data.
1386 *
1387 * @param[in] client_name Identifier of an existing Call Home client.
1388 * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client.
1389 * @param[in,out] config Modified configuration YANG data tree.
1390 * @return 0 on success, non-zero otherwise.
1391 */
romane6ec60e2023-10-19 15:21:52 +02001392int nc_server_config_del_ch_tls_ca_cert_truststore_ref(const char *client_name, const char *endpt_name,
romand348b942023-10-13 14:32:19 +02001393 struct lyd_node **config);
1394
1395/**
Roytak2161df62023-08-02 15:04:42 +02001396 * @brief Creates new YANG configuration data nodes for a Call Home cert-to-name entry.
romanb6f44032023-06-30 15:07:56 +02001397 *
1398 * @param[in] ctx libyang context.
Roytak2161df62023-08-02 15:04:42 +02001399 * @param[in] client_name Arbitrary identifier of the Call Home client.
1400 * If a Call Home client with this identifier already exists, its contents will be changed.
1401 * @param[in] endpt_name Arbitrary identifier of the Call Home client's endpoint.
1402 * If a Call Home client's endpoint with this identifier already exists, its contents will be changed.
romanb6f44032023-06-30 15:07:56 +02001403 * @param[in] id ID of the entry. The lower the ID, the higher the priority of the entry (it will be checked earlier).
1404 * @param[in] fingerprint Optional fingerprint of the entry. The fingerprint should always be set, however if it is
1405 * not set, it will match any certificate. Entry with no fingerprint should therefore be placed only as the last entry.
1406 * @param[in] map_type Mapping username to the certificate option.
1407 * @param[in] name Username for this cert-to-name entry.
Roytak9b32c0f2023-08-02 15:07:29 +02001408 * @param[in,out] config Configuration YANG data tree. If *config is NULL, it will be created.
romanb6f44032023-06-30 15:07:56 +02001409 * Otherwise the new YANG data will be added to the previous data and may override it.
1410 * @return 0 on success, non-zero otherwise.
1411 */
Roytakb2794852023-10-18 14:30:22 +02001412int nc_server_config_add_ch_tls_ctn(const struct ly_ctx *ctx, const char *client_name, const char *endpt_name,
romanb6f44032023-06-30 15:07:56 +02001413 uint32_t id, const char *fingerprint, NC_TLS_CTN_MAPTYPE map_type, const char *name, struct lyd_node **config);
1414
roman8ba6efa2023-07-12 15:27:52 +02001415/**
Roytak2161df62023-08-02 15:04:42 +02001416 * @brief Deletes a Call Home cert-to-name entry from the YANG data.
roman8ba6efa2023-07-12 15:27:52 +02001417 *
Roytak2161df62023-08-02 15:04:42 +02001418 * @param[in] client_name Identifier of an existing Call Home client.
1419 * @param[in] endpt_name Identifier of an existing Call Home endpoint that belongs to the given client.
1420 * @param[in] id Optional identifier of the Call Home CTN entry to be deleted.
roman8ba6efa2023-07-12 15:27:52 +02001421 * If 0, all of the CTN entries will be deleted.
roman9d5e5a52023-07-14 12:43:44 +02001422 * @param[in,out] config Modified configuration YANG data tree.
roman8ba6efa2023-07-12 15:27:52 +02001423 * @return 0 on success, non-zero otherwise.
1424 */
Roytakb2794852023-10-18 14:30:22 +02001425int nc_server_config_del_ch_tls_ctn(const char *client_name, const char *endpt_name,
roman8ba6efa2023-07-12 15:27:52 +02001426 uint32_t id, struct lyd_node **config);
1427
1428/**
roman35120972023-08-08 10:39:12 +02001429 * @} TLS Call Home Server Configuration
roman8ba6efa2023-07-12 15:27:52 +02001430 */
1431
roman2eab4742023-06-06 10:00:26 +02001432#endif /* NC_ENABLED_SSH_TLS */
roman45cec4e2023-02-17 10:21:39 +01001433
romanc1d2b092023-02-02 08:58:27 +01001434#ifdef __cplusplus
1435}
1436#endif
1437
1438#endif /* NC_SESSION_SERVER_H_ */