yumapro  20.10-12
YumaPro SDK
agt_ses.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3  * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
4  *
5  * Unless required by applicable law or agreed to in writing,
6  * software distributed under the License is distributed on an
7  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8  * KIND, either express or implied. See the License for the
9  * specific language governing permissions and limitations
10  * under the License.
11  */
12 #ifndef _H_agt_ses
13 #define _H_agt_ses
14 /* FILE: agt_ses.h
15 *********************************************************************
16 * *
17 * P U R P O S E *
18 * *
19 *********************************************************************/
20 
27 /*********************************************************************
28 * *
29 * C H A N G E H I S T O R Y *
30 * *
31 *********************************************************************
32 
33 date init comment
34 ----------------------------------------------------------------------
35 06-jun-06 abb Begun.
36 */
37 
38 #include <sys/select.h>
39 
40 #include <xmlstring.h>
41 
42 #ifndef _H_getcb
43 #include "getcb.h"
44 #endif
45 
46 #ifndef _H_ncxconst
47 #include "ncxconst.h"
48 #endif
49 
50 #ifndef _H_ses
51 #include "ses.h"
52 #endif
53 
54 #ifndef _H_status
55 #include "status.h"
56 #endif
57 
58 #ifndef _H_val
59 #include "val.h"
60 #endif
61 
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65 
66 /********************************************************************
67 * *
68 * C O N S T A N T S *
69 * *
70 *********************************************************************/
71 
72 /********************************************************************
73 * *
74 * T Y P E S *
75 * *
76 *********************************************************************/
77 
78 
101 /********************************************************************
102 * *
103 * F U N C T I O N S *
104 * *
105 *********************************************************************/
106 
107 /* what is this hack? */
108 extern const char *term_reason_str (ses_term_reason_t termreason);
109 
110 
117 extern status_t
118  agt_ses_init (void);
119 
120 
126 extern void
127  agt_ses_cleanup (void);
128 
129 
135 extern ses_cb_t *
137 
138 
147 extern status_t
148  agt_ses_set_dummy_session_acm (ses_cb_t *dummy_session,
149  ses_id_t use_sid);
150 
151 
152 
158 extern void
159  agt_ses_free_dummy_session (ses_cb_t *scb);
160 
161 
162 #ifdef WITH_COAP
163 
168 extern ses_cb_t *
170 
171 
177 extern void
178  agt_ses_free_coap_session (ses_cb_t *scb);
179 
180 #endif // WITH_COAP
181 
182 
183 #if defined(WITH_SNMP) && defined(WITH_RESTCONF)
184 
190 extern ses_cb_t *
192 
193 
199 extern void
200  agt_ses_free_snmp_session (ses_cb_t *scb);
201 
202 #endif // WITH_SNMP
203 
204 
214 extern ses_cb_t *
215  agt_ses_new_session (ses_transport_t transport,
216  int fd);
217 
218 
232 extern ses_cb_t *
233  agt_ses_new_session_tls (ses_transport_t transport,
234  int fd,
235  const char *client_addr);
236 
237 
243 extern void
244  agt_ses_free_session (ses_cb_t *scb);
245 
246 
254 extern void
255  agt_ses_free_session2 (ses_cb_t *scb,
256  boolean clear_locks);
257 
258 
265 extern boolean
267 
268 
277 extern boolean
278  agt_ses_request_close (ses_cb_t *scb,
279  ses_id_t killedby,
280  ses_term_reason_t termreason);
281 
282 
283 #ifdef PTHREADS
284 
291 extern void
292  agt_ses_thread_kill_session (ses_cb_t *scb,
293  ses_id_t killedby,
294  ses_term_reason_t termreason);
295 #endif // PTHREADS
296 
297 
305 extern void
306  agt_ses_kill_session (ses_cb_t *scb,
307  ses_id_t killedby,
308  ses_term_reason_t termreason);
309 
310 
318 extern boolean
320 
321 
330 extern boolean
331  agt_ses_process_first_ready (boolean ycontrol);
332 
333 
334 #ifdef PTHREADS
335 
342 extern void
344 
345 #else
346 
353 extern void
354  agt_ses_check_timeouts (void);
355 
356 #endif // PTHREADS
357 
358 
366 extern boolean
367  agt_ses_ssh_port_allowed (uint16 port);
368 
369 
379 extern void
380  agt_ses_fill_writeset (fd_set *fdset,
381  int *maxfdnum);
382 
383 
396 extern status_t
397  agt_ses_get_inSessions (ses_cb_t *scb,
398  getcb_mode_t cbmode,
399  const val_value_t *virval,
400  val_value_t *dstval);
401 
402 
415 extern status_t
416  agt_ses_get_inBadHellos (ses_cb_t *scb,
417  getcb_mode_t cbmode,
418  const val_value_t *virval,
419  val_value_t *dstval);
420 
421 
434 extern status_t
435  agt_ses_get_inRpcs (ses_cb_t *scb,
436  getcb_mode_t cbmode,
437  const val_value_t *virval,
438  val_value_t *dstval);
439 
440 
453 extern status_t
454  agt_ses_get_inBadRpcs (ses_cb_t *scb,
455  getcb_mode_t cbmode,
456  const val_value_t *virval,
457  val_value_t *dstval);
458 
459 
472 extern status_t
473  agt_ses_get_outRpcErrors (ses_cb_t *scb,
474  getcb_mode_t cbmode,
475  const val_value_t *virval,
476  val_value_t *dstval);
477 
478 
479 
492 extern status_t
493  agt_ses_get_outNotifications (ses_cb_t *scb,
494  getcb_mode_t cbmode,
495  const val_value_t *virval,
496  val_value_t *dstval);
497 
498 
511 extern status_t
512  agt_ses_get_droppedSessions (ses_cb_t *scb,
513  getcb_mode_t cbmode,
514  const val_value_t *virval,
515  val_value_t *dstval);
516 
517 
518 
531 extern status_t
532  agt_ses_get_session_inRpcs (ses_cb_t *scb,
533  getcb_mode_t cbmode,
534  const val_value_t *virval,
535  val_value_t *dstval);
536 
537 
550 extern status_t
551  agt_ses_get_session_inBadRpcs (ses_cb_t *scb,
552  getcb_mode_t cbmode,
553  const val_value_t *virval,
554  val_value_t *dstval);
555 
556 
569 extern status_t
570  agt_ses_get_session_outRpcErrors (ses_cb_t *scb,
571  getcb_mode_t cbmode,
572  const val_value_t *virval,
573  val_value_t *dstval);
574 
575 
588 extern status_t
590  getcb_mode_t cbmode,
591  const val_value_t *virval,
592  val_value_t *dstval);
593 
594 
600 extern void
602 
603 
610 extern ses_cb_t*
612 
613 
619 extern uint32
621 
622 
623 
624 #ifdef WITH_YP_HA
625 
631 extern void
632  agt_ses_go_active (void);
633 
634 #endif // WITH_YP_HA
635 
636 
637 #ifdef WITH_YP_HA
638 
644 extern void
645  agt_ses_go_standby (void);
646 
647 #endif // WITH_YP_HA
648 
649 
655 extern boolean
657 
658 
664 extern void
665  agt_ses_set_max_sessions (uint16 val);
666 
667 
673 extern void
674  agt_ses_set_max_cli_sessions (uint16 val);
675 
676 
682 extern void
683  agt_ses_set_hello_timeout (uint32 val);
684 
685 
691 extern void
692  agt_ses_set_idle_timeout (uint32 val);
693 
694 
699 #ifdef __cplusplus
700 } /* end extern 'C' */
701 #endif
702 
703 #endif /* _H_agt_ses */
ses.h
NETCONF Session Common definitions module.
SES_TR_OTHER
@ SES_TR_OTHER
other
Definition: ses.h:393
agt_ypsnmp.h
Yuma Interface to net-snmp data structures. Agent interface.
cfg.h
agt_ses_get_inBadHellos
status_t agt_ses_get_inBadHellos(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the inBadHellos counter
Definition: agt_ses.c:1888
agt_ses.h
Server Session Management.
agt_util.h
Utility Functions for NCX Server method routines.
xml_reset_reader_for_session
status_t xml_reset_reader_for_session(xmlInputReadCallback readfn, xmlInputCloseCallback closefn, void *context, xmlTextReaderPtr reader)
Reset the xmlTextReader for parsing the input of a NETCONF session.
Definition: xml_util.c:418
tstamp.h
Timestamp utilities.
ses_new_coap_scb
ses_cb_t * ses_new_coap_scb(void)
Create a new global CoAP session control block.
Definition: ses.c:2132
xml_strdup
xmlChar * xml_strdup(const xmlChar *copyFrom)
String duplicate for xmlChar.
Definition: xml_util.c:1553
SES_IS_YCONTROL
#define SES_IS_YCONTROL(S)
test if this is a YControl session
Definition: ses.h:138
val_find_child
val_value_t * val_find_child(const val_value_t *parent, const xmlChar *modname, const xmlChar *childname)
Find the first instance of the specified child node.
Definition: val.c:8560
agt_state.h
NETCONF State Monitoring Data Model Module support.
ses_new_dummy_scb
ses_cb_t * ses_new_dummy_scb(void)
Create a new dummy session control block.
Definition: ses.c:2100
ERR_NCX_DEF_NOT_FOUND
@ ERR_NCX_DEF_NOT_FOUND
250
Definition: status_enum.h:289
SES_ST_IDLE
@ SES_ST_IDLE
adble to accept requests
Definition: ses.h:358
log_error
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
agt_ncxserver_clear_fd
void agt_ncxserver_clear_fd(int fd)
Clear a dead session from the select loop.
Definition: agt_ncxserver.c:4021
val.h
Value Node Basic Support.
NCX_NCSSH_PORT
#define NCX_NCSSH_PORT
Default NETCONF over SSH port.
Definition: ncxconst.h:127
xml_util.h
XML Utilities.
getcb.h
GET1 and GET2 Callback Support.
agt_ses_fill_writeset
void agt_ses_fill_writeset(fd_set *fdset, int *maxfdnum)
Drain the ses_msg outreadyQ and set the specified fdset Used by agt_ncxserver write_fd_set.
Definition: agt_ses.c:1819
agt_ncx_check_cc_timeout
void agt_ncx_check_cc_timeout(void)
Check if a confirmed-commit has timed out, and needs to be canceled.
Definition: agt_ncx.c:5689
agt_rpc.h
NETCONF protocol remote procedure call server-side definitions.
agt_ses_get_inRpcs
status_t agt_ses_get_inRpcs(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the inRpcs counter
Definition: agt_ses.c:1918
ses_msg_get_first_inready
ses_ready_t * ses_msg_get_first_inready(boolean ycontrol)
Dequeue the first entry in the inreadyQ, if any.
Definition: ses_msg.c:971
NCX_PROTO_NETCONF11
@ NCX_PROTO_NETCONF11
RFC 6241 base:1.1.
Definition: ncxtypes.h:784
agt_ses_get_inBadRpcs
status_t agt_ses_get_inBadRpcs(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the inBadRpcs counter
Definition: agt_ses.c:1948
ses_msg_make_inready
void ses_msg_make_inready(ses_cb_t *scb)
Put the session on the inreadyQ if it is not already there.
Definition: ses_msg.c:834
agt_ncxserver_thread_clear_session
boolean agt_ncxserver_thread_clear_session(ses_id_t sid, ses_id_t killedby, ses_term_reason_t termreason)
Signal session clear to the appropriate RX thread for session.
Definition: agt_ncxserver.c:3104
cfg_release_locks
void cfg_release_locks(ses_id_t sesid)
Release any configuration locks held by the specified session.
Definition: cfg.c:2632
agt_ses_set_idle_timeout
void agt_ses_set_idle_timeout(uint32 val)
Set the idle-timeout parameter.
Definition: agt_ses.c:2466
agt_ncxserver.h
NCX Server Transport and IO Library.
SES_TYP_SNMP
@ SES_TYP_SNMP
RESTCONF over SNMP.
Definition: ses.h:324
agt_ncx_cc_active
boolean agt_ncx_cc_active(void)
Check if a confirmed-commit is active, and the timeout may need to be processed.
Definition: agt_ncx.c:5623
thd_clear_locks
void thd_clear_locks(thd_tcb_t *tcb)
Clear mutexes and RWLOCKs prior to termination.
Definition: thd.c:580
agt_ses_go_active
void agt_ses_go_active(void)
Activate MGMT sessions because YP-HA mode is active.
Definition: agt_ses.c:2302
agt_ses_init
status_t agt_ses_init(void)
INIT 1: Initialize the session manager module data structures.
Definition: agt_ses.c:465
SES_TYP_NETCONF
@ SES_TYP_NETCONF
any network configuration protocol
Definition: ses.h:320
agt_acm_clear_session_cache
void agt_acm_clear_session_cache(ses_cb_t *scb)
Clear an agt_acm_cache_t struct in a session control block.
Definition: agt_acm.c:755
ncxconst.h
Contains NCX constants.
ncxmod.h
NCX Module Load Manager.
agt_ses_free_session2
void agt_ses_free_session2(ses_cb_t *scb, boolean clear_locks)
Free a real session control block but with optional unlocking.
Definition: agt_ses.c:889
agt_sys_send_sysSessionEnd
void agt_sys_send_sysSessionEnd(const ses_cb_t *scb, ses_term_reason_t termreason, ses_id_t killedby)
Queue the Session End notification.
Definition: agt_sys.c:1260
ses_msg_dump
void ses_msg_dump(log_debug_t lvl, const ses_msg_t *msg, const xmlChar *text)
Dump the message contents.
Definition: ses_msg.c:1100
ses_msg.h
NETCONF Session Message Common definitions module.
agt_ses_ssh_port_allowed
boolean agt_ses_ssh_port_allowed(uint16 port)
Check if the port number used for SSH connect is okay.
Definition: agt_ses.c:1768
ses_id_t
uint32 ses_id_t
Session ID.
Definition: ses.h:306
agt_ncx_cc_ses_id
ses_id_t agt_ncx_cc_ses_id(void)
Get the confirmed commit session ID.
Definition: agt_ncx.c:5640
agt_cb.h
NETCONF Server Data Model callback handler.
thd_yield_for_cdx
boolean thd_yield_for_cdx(int max_yield_count, uint usec, int ival, test_cdx_int_t sid_test_func)
Yield scheduler in loop until specified condition(s) are met or max loop count is exceeded.
Definition: thd.c:1618
NCX_CC_EVENT_CANCEL
@ NCX_CC_EVENT_CANCEL
cancel event
Definition: ncxtypes.h:1225
agt_ses_get_session_outRpcErrors
status_t agt_ses_get_session_outRpcErrors(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the outRpcErrors counter
Definition: agt_ses.c:2148
agt_ses_session_id_valid
boolean agt_ses_session_id_valid(ses_id_t sid)
Check if a session-id is for an active session.
Definition: agt_ses.c:1031
agt_ses_process_first_ready
boolean agt_ses_process_first_ready(boolean ycontrol)
Check the readyQ and process the first message, if any.
Definition: agt_ses.c:1468
log_info
void void void void void log_info(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_INFO log entry.
agt_ses_mgmt_session_count
uint32 agt_ses_mgmt_session_count(void)
Get number of management sessions open.
Definition: agt_ses.c:2272
log_debug2
void void void void void void void void void log_debug2(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG2 log entry.
SES_TYP_COAP
@ SES_TYP_COAP
RESTCONF over CoAP; static socket, libcoap.
Definition: ses.h:323
def_reg.h
Definition Registry module.
agt_ses_check_timeouts
void agt_ses_check_timeouts(ses_id_t sid)
Check if any sessions need to be dropped because they have been idle too long.
Definition: agt_ses.c:1631
agt_ses_thread_kill_session
void agt_ses_thread_kill_session(ses_cb_t *scb, ses_id_t killedby, ses_term_reason_t termreason)
Kill the specified session; called from session thread.
Definition: agt_ses.c:1118
agt_ses_kill_session
void agt_ses_kill_session(ses_cb_t *scb, ses_id_t killedby, ses_term_reason_t termreason)
Kill the specified session.
Definition: agt_ses.c:1213
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
SES_TRANSPORT_CLI
@ SES_TRANSPORT_CLI
YumaPro CLI hook (ncxconnect, NETCONF framing)
Definition: ses.h:340
ses_read_cb
int ses_read_cb(void *context, char *buffer, int len)
The IO input front-end for the xmlTextReader parser read fn.
Definition: ses.c:3093
agt_ses_new_session
ses_cb_t * agt_ses_new_session(ses_transport_t transport, int fd)
Create a real server session control block.
Definition: agt_ses.c:811
agt_ses_cleanup
void agt_ses_cleanup(void)
Cleanup the session manager module data structures.
Definition: agt_ses.c:499
def_reg_add_scb
status_t def_reg_add_scb(int fd, ses_cb_t *scb)
add one FD to SCB mapping to the registry
Definition: def_reg.c:457
agt_ses_new_snmp_session
ses_cb_t * agt_ses_new_snmp_session(void)
Create a dummy SNMP session control block.
Definition: agt_ses.c:737
NCX_SES_EVENT_END
@ NCX_SES_EVENT_END
session ended event
Definition: ncxtypes.h:1412
agt_audit.h
NETCONF protocol audit log support.
log_debug4
void void void void void void void void void void void void void log_debug4(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG4 log entry.
agt_ncx.h
NETCONF Server standard method routines.
ses_get_transport_name
const xmlChar * ses_get_transport_name(ses_transport_t transport)
Get the name of the transport for a given enum value.
Definition: ses.c:3598
LOGDEBUG2
#define LOGDEBUG2
Check if at least log-level=debug2.
Definition: log.h:292
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
SES_MODE_XML
@ SES_MODE_XML
XML mode.
Definition: ses.h:379
ses_get_total_stats
ses_total_stats_t * ses_get_total_stats(void)
Get a r/w pointer to the the session totals stats.
Definition: ses.c:3560
dlq_remove
void dlq_remove(void *nodeP)
remove the queue entry from its queue list entry MUST have been enqueued somehow before this function...
Definition: dlq.c:519
agt_ses_max_cli_sessions
boolean agt_ses_max_cli_sessions(void)
Check if max-cli-sessions parameter has been reached.
Definition: agt_ses.c:2364
agt_ses_set_dummy_session_acm
status_t agt_ses_set_dummy_session_acm(ses_cb_t *dummy_session, ses_id_t use_sid)
Set the session ID and username of the user that will be responsible for the rollback if needed.
Definition: agt_ses.c:576
ERR_NCX_INVALID_VALUE
@ ERR_NCX_INVALID_VALUE
258
Definition: status_enum.h:299
SES_TR_BAD_HELLO
@ SES_TR_BAD_HELLO
bad <hello> received
Definition: ses.h:395
agt_sil_lib.h
Server Instrumentation Library Support.
agt_acm_invalidate_session_cache
void agt_acm_invalidate_session_cache(ses_cb_t *scb)
Mark an agt_acm_cache_t struct in a session control block as invalid so it will be refreshed next use...
Definition: agt_acm.c:790
rpc.h
NETCONF protocol remote procedure call common definitions.
agt_ses_request_close
boolean agt_ses_request_close(ses_cb_t *scb, ses_id_t killedby, ses_term_reason_t termreason)
Start the close of the specified session.
Definition: agt_ses.c:1056
ses_new_snmp_scb
ses_cb_t * ses_new_snmp_scb(void)
Create a new global SNMP session control block.
Definition: ses.c:2185
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
ses_msg_free_msg
void ses_msg_free_msg(ses_cb_t *scb, ses_msg_t *msg)
Free the session message and all its buffer chunks.
Definition: ses_msg.c:325
SES_TYP_DUMMY
@ SES_TYP_DUMMY
internal session for rollback, etc.
Definition: ses.h:321
ses_state_name
const xmlChar * ses_state_name(ses_state_t state)
Get the name of a session state from the enum value.
Definition: ses.c:3419
SES_TR_DROPPED
@ SES_TR_DROPPED
dropped by remote peer
Definition: ses.h:391
ERR_INTERNAL_INIT_SEQ
@ ERR_INTERNAL_INIT_SEQ
007
Definition: status_enum.h:197
agt_ses_free_snmp_session
void agt_ses_free_snmp_session(ses_cb_t *scb)
Free a dummy snmp session control block.
Definition: agt_ses.c:782
get_error_string
const char * get_error_string(status_t res)
Get the error message for a specific internal error.
Definition: status.c:239
agt_ses_set_max_cli_sessions
void agt_ses_set_max_cli_sessions(uint16 val)
Set the max-cli-sessions parameter.
Definition: agt_ses.c:2428
agt_openssl_cleanup_session
void agt_openssl_cleanup_session(ses_cb_t *scb)
Cleanup a NETCONF over TLS session.
Definition: agt_openssl.c:1243
log_debug
void void void void void void void log_debug(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG log entry.
ncx_protocol_enabled
boolean ncx_protocol_enabled(ncx_protocol_t proto)
Check if the specified protocol version is enabled.
Definition: ncx.c:10192
agt_ses_new_session_tls
ses_cb_t * agt_ses_new_session_tls(ses_transport_t transport, int fd, const char *client_addr)
Create a real agent session control block for TLS.
Definition: agt_ses.c:836
LOGINFO
#define LOGINFO
Check if at least log-level=info.
Definition: log.h:279
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
agt.h
Multi-Protocol Network Management Server.
NCX_PROTO_YCONTROL
@ NCX_PROTO_YCONTROL
YumaPro Internal Control 1.0.
Definition: ncxtypes.h:787
agt_ses_go_standby
void agt_ses_go_standby(void)
Deactivate MGMT sessions because YP-HA mode is standby.
Definition: agt_ses.c:2317
AGT_MAX_PORTS
#define AGT_MAX_PORTS
maximum number of –port leaf-list values that will be saved
Definition: agt.h:188
ERR_NCX_RESOURCE_DENIED
@ ERR_NCX_RESOURCE_DENIED
269
Definition: status_enum.h:310
thd_get_thread_tcb
thd_tcb_t * thd_get_thread_tcb(void)
Return the TCB of the current thread.
Definition: thd.c:994
agt_ses_get_session_inBadRpcs
status_t agt_ses_get_session_inBadRpcs(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the inBadRpcs counter
Definition: agt_ses.c:2108
GETCB_GET_VALUE
@ GETCB_GET_VALUE
GET request.
Definition: getcb.h:247
SES_ST_SHUTDOWN
@ SES_ST_SHUTDOWN
session shutting down
Definition: ses.h:361
agt_ses_invalidate_session_acm_caches
void agt_ses_invalidate_session_acm_caches(void)
Invalidate all session ACM caches so they will be rebuilt.
Definition: agt_ses.c:2224
SES_TR_KILLED
@ SES_TR_KILLED
kill-session
Definition: ses.h:390
agt_ses_set_max_sessions
void agt_ses_set_max_sessions(uint16 val)
Set the max-sessions parameter.
Definition: agt_ses.c:2409
agt_acm_session_is_superuser
boolean agt_acm_session_is_superuser(const ses_cb_t *scb)
Check if the specified session is the superuser.
Definition: agt_acm.c:868
ERR_NCX_OPERATION_NOT_SUPPORTED
@ ERR_NCX_OPERATION_NOT_SUPPORTED
273
Definition: status_enum.h:314
VAL_UINT
#define VAL_UINT(V)
Access the value as an uint32 ONLY if NCX_BT_UINT8, 16, 32.
Definition: val.h:482
agt_ypsnmp_cleanup
void agt_ypsnmp_cleanup(void)
Cleanup the agt_ypsnmp module.
Definition: agt_ypsnmp.c:3390
ses_msg_get_first_inready_ses
ses_ready_t * ses_msg_get_first_inready_ses(ses_id_t sid)
Dequeue the first matching session entry in the inreadyQ, if any.
Definition: ses_msg.c:1005
ses_new_scb
ses_cb_t * ses_new_scb(void)
Create a new session control block.
Definition: ses.c:2025
obj_get_mod_name
const xmlChar * obj_get_mod_name(const obj_template_t *obj)
Get the module name for this object.
Definition: obj.c:12176
agt_ycontrol_remove_subsys
void agt_ycontrol_remove_subsys(ses_id_t sid, const xmlChar *subsys_id)
Remove a subsystem connection to the ycontrol manager because the connection was closed or shutting d...
Definition: agt_ycontrol.c:1871
tstamp_datetime
void tstamp_datetime(xmlChar *buff)
Set the current date and time in an XML dateTime string format.
Definition: tstamp.c:160
agt_ncx_clear_cc_ses_id
void agt_ncx_clear_cc_ses_id(void)
Clear the confirmed commit session ID.
Definition: agt_ncx.c:5657
SES_ST_SHUTDOWN_REQ
@ SES_ST_SHUTDOWN_REQ
session shutdown requested
Definition: ses.h:360
agt_ses_get_outRpcErrors
status_t agt_ses_get_outRpcErrors(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the outRpcErrors counter
Definition: agt_ses.c:1978
agt_ses_get_session_inRpcs
status_t agt_ses_get_session_inRpcs(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the session/inRpcs counter
Definition: agt_ses.c:2068
NCX_FL_PROTO_NETCONF10
#define NCX_FL_PROTO_NETCONF10
bit definitions for NETCONF session protocol versions
Definition: ncxconst.h:1585
LOGDEBUG4
#define LOGDEBUG4
Check if at least log-level=debug4.
Definition: log.h:302
log.h
NCX System Logging Manager.
log_flush
void log_flush(void)
Flush output buffers.
Definition: log.c:1880
agt_top_dispatch_msg
boolean agt_top_dispatch_msg(ses_cb_t **ppscb)
Find the appropriate top node handler and call it.
Definition: agt_top.c:108
agt_sys.h
NETCONF system.yang DM module support.
LOGDEBUG
#define LOGDEBUG
Check if at least log-level=debug.
Definition: log.h:287
agt_connect.h
Handle the <ncx-connect> (top-level) element.
agt_ses_process_first_ready_by_sid
boolean agt_ses_process_first_ready_by_sid(ses_id_t sid)
Check the readyQ and process the first message matching session, if any.
Definition: agt_ses.c:1440
agt_ncx_cc_persist_id
const xmlChar * agt_ncx_cc_persist_id(void)
Get the confirmed commit persist ID.
Definition: agt_ncx.c:5674
SES_STATE
#define SES_STATE(S)
get the session state
Definition: ses.h:177
agt_ncx_cancel_confirmed_commit
void agt_ncx_cancel_confirmed_commit(ses_cb_t *scb, ncx_confirm_event_t event)
Cancel the confirmed-commit in progress and rollback to the backup-cfg.xml file.
Definition: agt_ncx.c:5775
agt_ses_get_outNotifications
status_t agt_ses_get_outNotifications(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the outNotifications counter
Definition: agt_ses.c:2008
agt_ses_get_droppedSessions
status_t agt_ses_get_droppedSessions(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the droppedSessions counter
Definition: agt_ses.c:2038
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
agt_acm.h
NETCONF Server Access Control Entry Points.
xml_strcpy
uint32 xml_strcpy(xmlChar *copyTo, const xmlChar *copyFrom)
String copy for xmlChar.
Definition: xml_util.c:1486
agt_ses_get_session_for_id
ses_cb_t * agt_ses_get_session_for_id(ses_id_t sid)
get the session for the supplied sid
Definition: agt_ses.c:2252
agt_audit_handle_end_session
void agt_audit_handle_end_session(ses_cb_t *scb, ses_term_reason_t termreason, ses_id_t killedby)
Generate an end (client or control) session event if enabled.
Definition: agt_audit.c:531
agt_get_profile
agt_profile_t * agt_get_profile(void)
Get the server profile struct.
Definition: agt.c:4118
agt_cb_run_session_hook
void agt_cb_run_session_hook(ncx_ses_event_t ses_event, const ses_cb_t *scb)
Run Session Hook callbacks.
Definition: agt_cb.c:4742
agt_ses_new_coap_session
ses_cb_t * agt_ses_new_coap_session(void)
Create a dummy CoAP session control block.
Definition: agt_ses.c:666
ses_msg_get_first_outready
ses_ready_t * ses_msg_get_first_outready(void)
Dequeue the first entry in the outreadyQ, if any.
Definition: ses_msg.c:1044
SES_TR_CLOSED
@ SES_TR_CLOSED
close-session
Definition: ses.h:389
agt_timer_get_timenow
void agt_timer_get_timenow(time_t *tnow)
Get the current time using the system or monotonic clock.
Definition: agt_timer.c:457
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
def_reg_del_scb
void def_reg_del_scb(int fd)
delete one FD to SCB mapping from the registry
Definition: def_reg.c:542
SES_ST_HELLO_WAIT
@ SES_ST_HELLO_WAIT
waiting for peer <hello>
Definition: ses.h:355
ses_is_control_session
boolean ses_is_control_session(ses_cb_t *scb)
Check if the specified session is a control session.
Definition: ses.c:4386
SES_TR_TIMEOUT
@ SES_TR_TIMEOUT
inactivity timeout
Definition: ses.h:392
TSTAMP_MIN_SIZE
#define TSTAMP_MIN_SIZE
normal minimum buffer size for a tstamp buffer
Definition: tstamp.h:67
SES_MY_SID
#define SES_MY_SID(S)
get session-id
Definition: ses.h:105
agt_ycontrol.h
Handle the YumaPro Control Protocol <ycontrol> (top-level) element.
agt_ses_new_dummy_session
ses_cb_t * agt_ses_new_dummy_session(void)
Create a dummy session control block.
Definition: agt_ses.c:535
SES_TR_BAD_START
@ SES_TR_BAD_START
bad session start
Definition: ses.h:394
ses_msg_new_buff
status_t ses_msg_new_buff(ses_cb_t *scb, boolean outbuff, ses_msg_buff_t **buff)
Malloc a new session buffer chuck.
Definition: ses_msg.c:378
agt_ses_set_hello_timeout
void agt_ses_set_hello_timeout(uint32 val)
Set the hello-timeout parameter.
Definition: agt_ses.c:2447
agt_state_remove_session
void agt_state_remove_session(ses_cb_t *scb)
Remove a session entry from the netconf-state DM.
Definition: agt_state.c:2402
agt_timer.h
Handle timer services for the server.
ses_free_scb
void ses_free_scb(ses_cb_t *scb)
Free a session control block.
Definition: ses.c:2221
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
SES_ST_INIT
@ SES_ST_INIT
initialization state
Definition: ses.h:354
agt_ses_get_session_outNotifications
status_t agt_ses_get_session_outNotifications(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the outNotifications counter
Definition: agt_ses.c:2188
agt_not_remove_subscription
void agt_not_remove_subscription(ses_id_t sid)
Remove and expire a subscription with the specified session ID.
Definition: agt_not.c:5889
agt_ses_free_coap_session
void agt_ses_free_coap_session(ses_cb_t *scb)
Free a dummy CoAP session control block.
Definition: agt_ses.c:711
tstamp_local_datetime
void tstamp_local_datetime(xmlChar *buff)
Set the current date and time in an XML dateTime string format.
Definition: tstamp.c:189
agt_openssl.h
OpenSSL support for netconf-tls.
agt_ses_free_session
void agt_ses_free_session(ses_cb_t *scb)
Free a real session control block.
Definition: agt_ses.c:870
xmlns.h
XML namespace support.
ncx_socket_close
void ncx_socket_close(int fd)
Close a socket; check result.
Definition: ncx.c:13214
NCX_PROTO_NETCONF10
@ NCX_PROTO_NETCONF10
RFC 4741 base:1.0
Definition: ncxtypes.h:783
SES_CURMSG
#define SES_CURMSG(S)
get the session current message
Definition: ses.h:204
status.h
Global error messages for status code enumerations.
agt_ses_free_dummy_session
void agt_ses_free_dummy_session(ses_cb_t *scb)
Free a dummy session control block.
Definition: agt_ses.c:641
agt_top.h
NETCONF Server Top Element module. Manage callback registry for received XML messages.
SES_ST_IN_MSG
@ SES_ST_IN_MSG
processing a request
Definition: ses.h:359
agt_ses_get_inSessions
status_t agt_ses_get_inSessions(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the inSessions counter
Definition: agt_ses.c:1858
SES_INST_IDLE
@ SES_INST_IDLE
idle state
Definition: ses.h:368
xml_get_reader_for_session
status_t xml_get_reader_for_session(xmlInputReadCallback readfn, xmlInputCloseCallback closefn, void *context, xmlTextReaderPtr *reader)
Get a new xmlTextReader for parsing the input of a NETCONF session.
Definition: xml_util.c:378