|
libnetconf2
3.7.10
NETCONF server and client library in C.
|
libnetconf2 session server manipulation More...
#include <libyang/libyang.h>#include <stdint.h>#include <sys/types.h>#include "netconf.h"#include "session.h"#include <libssh/callbacks.h>#include <libssh/libssh.h>#include <libssh/server.h>Go to the source code of this file.
Macros | |
| #define | NC_PSPOLL_BAD_RPC 0x0008 |
| #define | NC_PSPOLL_ERROR 0x0080 |
| #define | NC_PSPOLL_NOSESSIONS 0x0001 |
| #define | NC_PSPOLL_REPLY_ERROR 0x0010 |
| #define | NC_PSPOLL_RPC 0x0004 |
| #define | NC_PSPOLL_SESSION_ERROR 0x0040 |
| #define | NC_PSPOLL_SESSION_TERM 0x0020 |
| #define | NC_PSPOLL_SSH_CHANNEL 0x0200 |
| #define | NC_PSPOLL_SSH_MSG 0x00100 |
| #define | NC_PSPOLL_TIMEOUT 0x0002 |
Typedefs | |
| typedef void(* | nc_cert_exp_notif_clb )(const char *expiration_time, const char *xpath, void *user_data) |
| Callback for certificate expiration notification. More... | |
| typedef int(* | nc_ps_session_match_cb )(struct nc_session *session, void *cb_data) |
| Callback for finding a session in a pollsession structure. More... | |
| typedef struct nc_server_reply *(* | nc_rpc_clb )(struct lyd_node *rpc, struct nc_session *session) |
| Prototype of callbacks that are called if some RPCs are received. More... | |
| typedef int(* | nc_server_ssh_interactive_auth_clb )(const struct nc_session *session, ssh_session ssh_sess, ssh_message msg, void *user_data) |
| Keyboard interactive authentication callback. More... | |
Functions | |
| NC_MSG_TYPE | nc_accept (int timeout, const struct ly_ctx *ctx, struct nc_session **session) |
| Accept new sessions on all the listening endpoints. More... | |
| NC_MSG_TYPE | nc_accept_inout (int fdin, int fdout, const char *username, const struct ly_ctx *ctx, struct nc_session **session) |
| Accept a new session on a pre-established transport session. More... | |
| struct nc_server_reply * | nc_clb_default_close_session (struct lyd_node *rpc, struct nc_session *session) |
| Default RPC callback used for "ietf-netconf:close-session" RPC if no other specific or global callback is set. More... | |
| struct nc_server_reply * | nc_clb_default_get_schema (struct lyd_node *rpc, struct nc_session *session) |
| Default RPC callback used for "ietf-netconf-monitoring:get-schema" RPC if no other specific or global callback is set. More... | |
| NC_MSG_TYPE | nc_ps_accept_ssh_channel (struct nc_pollsession *ps, struct nc_session **session) |
Accept a new NETCONF session on an SSH session of a running NETCONF session that was polled in ps. Call this function only when nc_ps_poll() on ps returns NC_PSPOLL_SSH_CHANNEL. The new session is only returned in session, it is not added to ps. More... | |
| int | nc_ps_add_session (struct nc_pollsession *ps, struct nc_session *session) |
| Add a session to a pollsession structure. More... | |
| void | nc_ps_clear (struct nc_pollsession *ps, int all, void(*data_free)(void *)) |
| Remove sessions from a pollsession structure and call nc_session_free() on them. More... | |
| int | nc_ps_del_session (struct nc_pollsession *ps, struct nc_session *session) |
| Remove a session from a pollsession structure. More... | |
| struct nc_session * | nc_ps_find_session (const struct nc_pollsession *ps, nc_ps_session_match_cb match_cb, void *cb_data) |
| Find a session in a pollsession structure using a matching callback. More... | |
| void | nc_ps_free (struct nc_pollsession *ps) |
| Free a pollsession structure. More... | |
| struct nc_session * | nc_ps_get_session (const struct nc_pollsession *ps, uint16_t idx) |
| Get a session from a pollsession structure matching the session ID. More... | |
| struct nc_pollsession * | nc_ps_new (void) |
| Create an empty structure for polling sessions. More... | |
| int | nc_ps_poll (struct nc_pollsession *ps, int timeout, struct nc_session **session) |
| Poll sessions and process any received RPCs. More... | |
| uint16_t | nc_ps_session_count (struct nc_pollsession *ps) |
| Learn the number of sessions in a pollsession structure. More... | |
| int | nc_server_add_endpt_unix_socket_listen (const char *endpt_name, const char *unix_socket_path, mode_t mode, uid_t uid, gid_t gid) |
| Create a new UNIX socket endpoint and start listening. More... | |
| void | nc_server_del_endpt_unix_socket (const char *endpt_name) |
| Deletes a UNIX socket endpoint. More... | |
| void | nc_server_destroy (void) |
| Destroy any dynamically allocated libssh and/or libssl/libcrypto and server resources. More... | |
| int | nc_server_endpt_count (void) |
| Get the number of currently configured listening endpoints. Note that an ednpoint without address and/or port will be included even though it is not, in fact, listening. More... | |
| void | nc_server_get_capab_withdefaults (NC_WD_MODE *basic_mode, int *also_supported) |
| Get with-defaults capability extra parameters. More... | |
| char ** | nc_server_get_cpblts (const struct ly_ctx *ctx) |
| Get all the server capabilities including all the schemas. More... | |
| char ** | nc_server_get_cpblts_version (const struct ly_ctx *ctx, LYS_VERSION version) |
| Get the server capabilities including the schemas with the specified YANG version. More... | |
| int | nc_server_init (void) |
| Initialize libssh and/or libssl/libcrypto and the server. More... | |
| int | nc_server_init_ctx (struct ly_ctx **ctx) |
| Initialize a context which can serve as a default server context. More... | |
| int | nc_server_notif_cert_expiration_thread_start (nc_cert_exp_notif_clb cert_exp_notif_clb, void *user_data, void(*free_data)(void *)) |
| Start the certificate expiration notification thread. More... | |
| void | nc_server_notif_cert_expiration_thread_stop (int wait) |
| Stop the certificate expiration notification thread. More... | |
| int | nc_server_set_capab_withdefaults (NC_WD_MODE basic_mode, int also_supported) |
| Set the with-defaults capability extra parameters. More... | |
| int | nc_server_set_capability (const char *value) |
| Set capability of the server. More... | |
| void | nc_server_set_content_id_clb (char *(*content_id_clb)(void *user_data), void *user_data, void(*free_user_data)(void *user_data)) |
| Set the callback for getting yang-library capability identifier. If none is set, libyang context change count is used. More... | |
| int | nc_server_ssh_kbdint_get_nanswers (const struct nc_session *session, ssh_session libssh_session) |
| Get the number of answers to Keyboard interactive authentication prompts. More... | |
| int | nc_server_ssh_set_authkey_path_format (const char *path) |
| Set the format of the path to authorized_keys files. More... | |
| void | nc_server_ssh_set_interactive_auth_clb (nc_server_ssh_interactive_auth_clb auth_clb, void *user_data, void(*free_user_data)(void *user_data)) |
| Set the callback for SSH interactive authentication. More... | |
| int | nc_server_ssh_set_pam_conf_filename (const char *filename) |
| Set the name of the PAM configuration file. More... | |
| void | nc_server_tls_set_verify_clb (int(*verify_clb)(const struct nc_session *session)) |
| Set TLS authentication additional verify callback. More... | |
| NC_MSG_TYPE | nc_session_accept_ssh_channel (struct nc_session *orig_session, struct nc_session **session) |
Accept a new NETCONF session on an SSH session of a running NETCONF orig_session. Call this function only when nc_ps_poll() returns NC_PSPOLL_SSH_CHANNEL on orig_session. More... | |
| void | nc_session_dec_notif_status (struct nc_session *session) |
| Decrease session notification subscription flag count. Supports multiple subscriptions on one session. More... | |
| const void * | nc_session_get_client_cert (const struct nc_session *session) |
| Get client certificate. More... | |
| int | nc_session_get_notif_status (const struct nc_session *session) |
| Get session notification subscription flag. More... | |
| struct timespec | nc_session_get_start_time (const struct nc_session *session) |
| Get session start time. More... | |
| void | nc_session_inc_notif_status (struct nc_session *session) |
| Increase session notification subscription flag count. Supports multiple subscriptions on one session. More... | |
| void | nc_session_set_killed_by (struct nc_session *session, uint32_t sid) |
| Set the session-id of the session responsible for this session's termination. More... | |
| void | nc_session_set_status (struct nc_session *session, NC_STATUS status) |
| Set the status of a session. More... | |
| void | nc_session_set_term_reason (struct nc_session *session, NC_SESSION_TERM_REASON reason) |
| Set the termination reason for a session. Use only in nc_rpc_clb callbacks. More... | |
| void | nc_set_global_rpc_clb (nc_rpc_clb clb) |
| Set a global nc_rpc_clb that is called if the particular RPC request is received and the private field in the corresponding RPC schema node is NULL. More... | |
libnetconf2 session server manipulation
This source code is licensed under BSD 3-Clause License (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at
https://opensource.org/licenses/BSD-3-Clause
Definition in file session_server.h.