libnetconf2  1.1.48
NETCONF library for clients and servers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
session.h
Go to the documentation of this file.
1 
15 #ifndef NC_SESSION_H_
16 #define NC_SESSION_H_
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 #include "netconf.h"
23 
24 #ifdef NC_ENABLED_SSH
25 
29 typedef enum {
34 
35 #endif /* NC_ENABLED_SSH */
36 
37 #ifdef NC_ENABLED_TLS
38 
42 typedef enum {
51 
52 #endif /* NC_ENABLED_TLS */
53 
57 typedef enum {
63 } NC_STATUS;
64 
68 typedef enum {
69  NC_TI_NONE = 0,
73 #ifdef NC_ENABLED_SSH
75 #endif
76 #ifdef NC_ENABLED_TLS
78 #endif
80 
84 typedef enum {
89 
93 typedef enum {
94  NC_CH_FIRST_LISTED = 0, //default
98 
102 typedef enum {
108 
112 struct nc_session;
113 
120 NC_STATUS nc_session_get_status(const struct nc_session *session);
121 
128 NC_SESSION_TERM_REASON nc_session_get_term_reason(const struct nc_session *session);
129 
136 uint32_t nc_session_get_killed_by(const struct nc_session *session);
137 
144 uint32_t nc_session_get_id(const struct nc_session *session);
145 
152 uint32_t nc_session_get_refcnt(const struct nc_session *session);
160 void nc_session_reference(struct nc_session *session);
167 void nc_session_dereference(struct nc_session *session);
168 
175 int nc_session_get_version(const struct nc_session *session);
176 
183 NC_TRANSPORT_IMPL nc_session_get_ti(const struct nc_session *session);
184 
191 const char *nc_session_get_username(const struct nc_session *session);
192 
199 const char *nc_session_get_host(const struct nc_session *session);
200 
207 uint16_t nc_session_get_port(const struct nc_session *session);
208 
215 const char *nc_session_get_path(const struct nc_session *session);
216 
223 struct ly_ctx *nc_session_get_ctx(const struct nc_session *session);
224 
231 void nc_session_set_data(struct nc_session *session, void *data);
232 
239 void *nc_session_get_data(const struct nc_session *session);
240 
247 void nc_session_free(struct nc_session *session, void (*data_free)(void *));
248 
249 #if defined(NC_ENABLED_SSH) || defined(NC_ENABLED_TLS)
250 
259 void nc_thread_destroy(void);
260 
261 #endif /* NC_ENABLED_SSH || NC_ENABLED_TLS */
262 
263 #ifdef __cplusplus
264 }
265 #endif
266 
267 #endif /* NC_SESSION_H_ */
uint32_t nc_session_get_refcnt(const struct nc_session *session)
Get reference count.
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:29
uint16_t nc_session_get_port(const struct nc_session *session)
Get session port.
void nc_session_dereference(struct nc_session *session)
Take reference from the session.
NC_TRANSPORT_IMPL
Enumeration of transport implementations (ways how libnetconf implements NETCONF transport protocol) ...
Definition: session.h:68
NC_STATUS
Enumeration of possible session statuses.
Definition: session.h:57
NC_SSH_KEY_TYPE
Enumeration of SSH key types.
Definition: session.h:102
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.
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:84
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_reference(struct nc_session *session)
Put a reference to the session in order to avoid unwanted release of session.
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:42
NC_CH_START_WITH
Enumeration of Call Home client priority policy.
Definition: session.h:93
void nc_thread_destroy(void)
Free all the dynamically allocated thread-specific libssl/libcrypto resources.
libnetconf2's general public functions and structures definitions.