libnetconf2 2.0.24
NETCONF server and client library in C.
Loading...
Searching...
No Matches
session_client_ch.h
Go to the documentation of this file.
1
15#ifndef NC_SESSION_CLIENT_CH_H_
16#define NC_SESSION_CLIENT_CH_H_
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22#include <libyang/libyang.h>
23
24#ifdef NC_ENABLED_SSH
25# include <libssh/libssh.h>
26#endif
27
28#include "messages_client.h"
29#include "netconf.h"
30#include "session.h"
31
32#if defined (NC_ENABLED_SSH) || defined (NC_ENABLED_TLS)
33
51int nc_accept_callhome(int timeout, struct ly_ctx *ctx, struct nc_session **session);
52
55#endif /* NC_ENABLED_SSH || NC_ENABLED_TLS */
56
57#ifdef NC_ENABLED_SSH
58
78void nc_client_ssh_ch_set_auth_hostkey_check_clb(int (*auth_hostkey_check)(const char *hostname, ssh_session session, void *priv),
79 void *priv);
80
88void nc_client_ssh_ch_get_auth_hostkey_check_clb(int (**auth_hostkey_check)(const char *hostname, ssh_session session, void *priv),
89 void **priv);
101void nc_client_ssh_ch_set_auth_password_clb(char *(*auth_password)(const char *username, const char *hostname, void *priv),
102 void *priv);
103
111void nc_client_ssh_ch_get_auth_password_clb(char *(**auth_password)(const char *username, const char *hostname, void *priv),
112 void **priv);
113
126void nc_client_ssh_ch_set_auth_interactive_clb(char *(*auth_interactive)(const char *auth_name, const char *instruction,
127 const char *prompt, int echo, void *priv),
128 void *priv);
129
137void nc_client_ssh_ch_get_auth_interactive_clb(char *(**auth_interactive)(const char *auth_name, const char *instruction,
138 const char *prompt, int echo, void *priv),
139 void **priv);
140
152void nc_client_ssh_ch_set_auth_privkey_passphrase_clb(char *(*auth_privkey_passphrase)(const char *privkey_path, void *priv),
153 void *priv);
154
162void nc_client_ssh_ch_get_auth_privkey_passphrase_clb(char *(**auth_privkey_passphrase)(const char *privkey_path, void *priv),
163 void **priv);
164
172int nc_client_ssh_ch_add_bind_listen(const char *address, uint16_t port);
173
181int nc_client_ssh_ch_del_bind(const char *address, uint16_t port);
182
192int nc_client_ssh_ch_add_keypair(const char *pub_key, const char *priv_key);
193
201
208
217int nc_client_ssh_ch_get_keypair(int idx, const char **pub_key, const char **priv_key);
218
231
239
246int nc_client_ssh_ch_set_username(const char *username);
247
254
257#endif /* NC_ENABLED_SSH */
258
259#ifdef NC_ENABLED_TLS
260
276int nc_client_tls_ch_add_bind_listen(const char *address, uint16_t port);
277
285int nc_client_tls_ch_del_bind(const char *address, uint16_t port);
286
295int nc_client_tls_ch_set_cert_key_paths(const char *client_cert, const char *client_key);
296
304void nc_client_tls_ch_get_cert_key_paths(const char **client_cert, const char **client_key);
305
315int nc_client_tls_ch_set_trusted_ca_paths(const char *ca_file, const char *ca_dir);
316
325void nc_client_tls_ch_get_trusted_ca_paths(const char **ca_file, const char **ca_dir);
326
334int nc_client_tls_ch_set_crl_paths(const char *crl_file, const char *crl_dir);
335
344void nc_client_tls_ch_get_crl_paths(const char **crl_file, const char **crl_dir);
345
348#endif /* NC_ENABLED_TLS */
349
350#ifdef __cplusplus
351}
352#endif
353
354#endif /* NC_SESSION_CLIENT_CH_H_ */
int16_t nc_client_ssh_ch_get_auth_pref(NC_SSH_AUTH_TYPE auth_type)
Get SSH Call Home authentication method preference.
void nc_client_ssh_ch_set_auth_privkey_passphrase_clb(char *(*auth_privkey_passphrase)(const char *privkey_path, void *priv), void *priv)
Set SSH Call Home publickey authentication encrypted private key passphrase callback.
int nc_client_ssh_ch_add_keypair(const char *pub_key, const char *priv_key)
Add an SSH public and private key pair to be used for Call Home client authentication.
void nc_client_ssh_ch_set_auth_password_clb(char *(*auth_password)(const char *username, const char *hostname, void *priv), void *priv)
Set SSH Call Home password authentication callback.
void nc_client_ssh_ch_get_auth_hostkey_check_clb(int(**auth_hostkey_check)(const char *hostname, ssh_session session, void *priv), void **priv)
Get currently set SSH Call Home authentication hostkey check (knownhosts) callback and its private da...
void nc_client_ssh_ch_set_auth_pref(NC_SSH_AUTH_TYPE auth_type, int16_t pref)
Set SSH Call Home authentication method preference.
int nc_client_ssh_ch_add_bind_listen(const char *address, uint16_t port)
Add a new client bind and start listening on it for SSH Call Home connections.
const char * nc_client_ssh_ch_get_username(void)
Get client Call Home SSH username used for authentication.
int nc_client_ssh_ch_del_keypair(int idx)
Remove an SSH public and private key pair that was used for Call Home client authentication.
int nc_client_ssh_ch_get_keypair_count(void)
Get the number of public an private key pairs set to be used for Call Home client authentication.
void nc_client_ssh_ch_get_auth_interactive_clb(char *(**auth_interactive)(const char *auth_name, const char *instruction, const char *prompt, int echo, void *priv), void **priv)
Get currently set SSH Call Home interactive authentication callback and its private data previously s...
void nc_client_ssh_ch_set_auth_interactive_clb(char *(*auth_interactive)(const char *auth_name, const char *instruction, const char *prompt, int echo, void *priv), void *priv)
Set SSH Call Home interactive authentication callback.
int nc_client_ssh_ch_del_bind(const char *address, uint16_t port)
Remove an SSH listening client bind.
int nc_client_ssh_ch_get_keypair(int idx, const char **pub_key, const char **priv_key)
Get a specific keypair set to be used for Call Home client authentication.
void nc_client_ssh_ch_get_auth_privkey_passphrase_clb(char *(**auth_privkey_passphrase)(const char *privkey_path, void *priv), void **priv)
Get currently set SSH Call Home publickey authentication encrypted private key passphrase callback an...
int nc_client_ssh_ch_set_username(const char *username)
Set client Call Home SSH username used for authentication.
void nc_client_ssh_ch_set_auth_hostkey_check_clb(int(*auth_hostkey_check)(const char *hostname, ssh_session session, void *priv), void *priv)
Set SSH Call Home authentication hostkey check (knownhosts) callback.
void nc_client_ssh_ch_get_auth_password_clb(char *(**auth_password)(const char *username, const char *hostname, void *priv), void **priv)
Get currently set SSH Call Home password authentication callback and its private data previously set ...
int nc_client_tls_ch_add_bind_listen(const char *address, uint16_t port)
Add a new client bind and start listening on it for TLS Call Home connections.
void nc_client_tls_ch_get_crl_paths(const char **crl_file, const char **crl_dir)
Get client Call Home Certificate Revocation Lists.
int nc_client_tls_ch_set_crl_paths(const char *crl_file, const char *crl_dir)
Set client Call Home Certificate Revocation Lists.
int nc_client_tls_ch_del_bind(const char *address, uint16_t port)
Remove a TLS listening client bind.
void nc_client_tls_ch_get_cert_key_paths(const char **client_cert, const char **client_key)
Get client Call Home authentication identity - a certificate and a private key.
int nc_client_tls_ch_set_trusted_ca_paths(const char *ca_file, const char *ca_dir)
Set client Call Home trusted CA certificates.
void nc_client_tls_ch_get_trusted_ca_paths(const char **ca_file, const char **ca_dir)
Get client Call Home trusted CA certificates.
int nc_client_tls_ch_set_cert_key_paths(const char *client_cert, const char *client_key)
Set client Call Home authentication identity - a certificate and a private key.
int nc_accept_callhome(int timeout, struct ly_ctx *ctx, struct nc_session **session)
Accept a Call Home connection on any of the listening binds.
libnetconf2's public functions and structures of NETCONF client messages.
libnetconf2's general public functions and structures definitions.
libnetconf2 session manipulation
NC_SSH_AUTH_TYPE
Enumeration of NETCONF SSH authentication methods.
Definition session.h:29