libnetconf2  3.5.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 {
82 } NC_STATUS;
83 
87 typedef enum {
88  NC_TI_NONE = 0,
92 #ifdef NC_ENABLED_SSH_TLS
96 #endif /* NC_ENABLED_SSH_TLS */
98 
102 typedef enum {
107 
111 typedef enum {
112  NC_CH_FIRST_LISTED = 0, // default
116 
120 struct nc_session;
121 
128 NC_STATUS nc_session_get_status(const struct nc_session *session);
129 
136 NC_SESSION_TERM_REASON nc_session_get_term_reason(const struct nc_session *session);
137 
144 uint32_t nc_session_get_killed_by(const struct nc_session *session);
145 
152 uint32_t nc_session_get_id(const struct nc_session *session);
153 
160 int nc_session_get_version(const struct nc_session *session);
161 
168 NC_TRANSPORT_IMPL nc_session_get_ti(const struct nc_session *session);
169 
176 const char *nc_session_get_username(const struct nc_session *session);
177 
184 const char *nc_session_get_host(const struct nc_session *session);
185 
192 uint16_t nc_session_get_port(const struct nc_session *session);
193 
200 const char *nc_session_get_path(const struct nc_session *session);
201 
208 const struct ly_ctx *nc_session_get_ctx(const struct nc_session *session);
209 
216 void nc_session_set_data(struct nc_session *session, void *data);
217 
224 void *nc_session_get_data(const struct nc_session *session);
225 
232 int nc_session_is_callhome(const struct nc_session *session);
233 
240 void nc_session_free(struct nc_session *session, void (*data_free)(void *));
241 
242 #ifdef __cplusplus
243 }
244 #endif
245 
246 #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:87
NC_STATUS
Enumeration of possible session statuses.
Definition: session.h:76
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_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:54
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:102
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:111
libnetconf2's general public functions and structures definitions.