libnetconf2  4.0.1
NETCONF server and client library in C.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
session.h
Go to the documentation of this file.
1 
17 #ifndef NC_SESSION_H_
18 #define NC_SESSION_H_
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 #include "netconf.h"
25 
26 #ifdef NC_ENABLED_SSH_TLS
27 
31 typedef enum {
36 
40 typedef enum {
47 
51 typedef enum {
60 
64 typedef enum {
70 
71 #endif /* NC_ENABLED_SSH_TLS */
72 
76 typedef enum {
80 
84 typedef enum {
90 } NC_STATUS;
91 
95 typedef enum {
96  NC_TI_NONE = 0,
100 #ifdef NC_ENABLED_SSH_TLS
104 #endif /* NC_ENABLED_SSH_TLS */
106 
110 typedef enum {
115 
119 typedef enum {
120  NC_CH_FIRST_LISTED = 0, // default
124 
128 struct nc_session;
129 
136 NC_STATUS nc_session_get_status(const struct nc_session *session);
137 
144 NC_SESSION_TERM_REASON nc_session_get_term_reason(const struct nc_session *session);
145 
152 uint32_t nc_session_get_killed_by(const struct nc_session *session);
153 
160 uint32_t nc_session_get_id(const struct nc_session *session);
161 
168 int nc_session_get_version(const struct nc_session *session);
169 
176 NC_TRANSPORT_IMPL nc_session_get_ti(const struct nc_session *session);
177 
184 const char *nc_session_get_username(const struct nc_session *session);
185 
192 const char *nc_session_get_host(const struct nc_session *session);
193 
200 uint16_t nc_session_get_port(const struct nc_session *session);
201 
202 #ifdef NC_ENABLED_SSH_TLS
203 
210 const char *nc_session_ssh_get_banner(const struct nc_session *session);
211 
212 #endif
213 
220 const char *nc_session_get_path(const struct nc_session *session);
221 
228 const struct ly_ctx *nc_session_get_ctx(const struct nc_session *session);
229 
236 void nc_session_set_data(struct nc_session *session, void *data);
237 
244 void *nc_session_get_data(const struct nc_session *session);
245 
252 int nc_session_is_callhome(const struct nc_session *session);
253 
260 void nc_session_free(struct nc_session *session, void (*data_free)(void *));
261 
262 #ifdef __cplusplus
263 }
264 #endif
265 
266 #endif /* NC_SESSION_H_ */
struct ly_ctx * nc_session_get_ctx(const struct nc_session *session)
Get session context.
NC_SSH_AUTH_TYPE
Enumeration of NETCONF SSH authentication methods.
Definition: session.h:31
int nc_session_is_callhome(const struct nc_session *session)
Learn whether a session was created using Call Home or not.
uint16_t nc_session_get_port(const struct nc_session *session)
Get session port.
NC_TLS_VERSION
Enumeration of TLS versions.
Definition: session.h:64
NC_TRANSPORT_IMPL
Enumeration of transport implementations (ways how libnetconf implements NETCONF transport protocol) ...
Definition: session.h:95
NC_STATUS
Enumeration of possible session statuses.
Definition: session.h:84
NC_STATUS nc_session_get_status(const struct nc_session *session)
Get session status.
NC_TRANSPORT_IMPL nc_session_get_ti(const struct nc_session *session)
Get session transport used.
const char * nc_session_get_host(const struct nc_session *session)
Get session host.
uint32_t nc_session_get_killed_by(const struct nc_session *session)
Get session killer session ID.
void nc_session_set_data(struct nc_session *session, void *data)
Assign arbitrary data to a session.
NC_SSH_KNOWNHOSTS_MODE
Enumeration of host key checking and known_hosts entry adding modes.
Definition: session.h:40
const char * nc_session_ssh_get_banner(const struct nc_session *session)
Get the SSH banner sent by the peer.
const char * nc_session_get_username(const struct nc_session *session)
Get session username.
NC_SESSION_TERM_REASON
Enumeration of reasons of the NETCONF session termination as defined in RFC 6470. ...
Definition: netconf.h:55
uint32_t nc_session_get_id(const struct nc_session *session)
Get session ID.
NC_SESSION_TERM_REASON nc_session_get_term_reason(const struct nc_session *session)
Get session termination reason.
NC_CH_CONN_TYPE
Enumeration of Call Home connection types.
Definition: session.h:110
void nc_session_free(struct nc_session *session, void(*data_free)(void *))
Free the NETCONF session object.
const char * nc_session_get_path(const struct nc_session *session)
Get session path (unix socket only).
int nc_session_get_version(const struct nc_session *session)
Get session NETCONF version.
void * nc_session_get_data(const struct nc_session *session)
Get the data assigned to a session.
NC_TLS_CTN_MAPTYPE
Enumeration of cert-to-name mapping types.
Definition: session.h:51
NC_CH_START_WITH
Enumeration of Call Home client priority policy.
Definition: session.h:119
NC_PROT_VERSION
Enumeration of the supported NETCONF protocol versions.
Definition: session.h:76
libnetconf2's general public functions and structures definitions.