yumapro  20.10-12
YumaPro SDK
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_ses
13 #define _H_ses
14 /* FILE: ses.h
15 *********************************************************************
16 * *
17 * P U R P O S E *
18 * *
19 *********************************************************************/
20 
26 /*********************************************************************
27 * *
28 * C H A N G E H I S T O R Y *
29 * *
30 *********************************************************************
31 
32 date init comment
33 ----------------------------------------------------------------------
34 30-dec-05 abb Begun.
35 */
36 
37 /* used by applications to generate FILE output */
38 #include <stdio.h>
39 
40 /* used for timestamps and time deltas */
41 #include <time.h>
42 
43 /* used by the agent for the xmlTextReader interface */
44 #include <xmlreader.h>
45 
46 #ifndef _H_dlq
47 #include "dlq.h"
48 #endif
49 
50 #ifndef _H_ncxtypes
51 #include "ncxtypes.h"
52 #endif
53 
54 #ifndef _H_status
55 #include "status.h"
56 #endif
57 
58 #ifndef _H_tstamp
59 #include "tstamp.h"
60 #endif
61 
62 #if defined(WITH_SNMP) && defined(WITH_RESTCONF)
63 #include <net-snmp/net-snmp-config.h>
64 
65 #ifndef UCLINUX
66 #include <net-snmp/net-snmp-features.h>
67 #endif
68 
69 #include <net-snmp/net-snmp-includes.h>
70 #endif
71 
72 #ifdef __cplusplus
73 extern "C" {
74 #endif
75 
76 /********************************************************************
77 * *
78 * C O N S T A N T S *
79 * *
80 *********************************************************************/
81 
105 #define SES_MY_SID(S) ((S)->sid)
106 
108 #define SES_MY_FD(S) ((S)->fd)
109 
111 #define SES_MY_USERNAME(S) ((S)->username)
112 
114 #define SES_KILLREQ_SET(S) ((S)->state >= SES_ST_SHUTDOWN_REQ)
115 
117 #define SES_ACK_KILLREQ(S) ((S)->state = SES_ST_SHUTDOWN)
118 
120 #define SES_OUT_BYTES(S) (S)->stats.out_bytes
121 
123 #define SES_LINELEN(S) (S)->stats.out_line
124 
126 #define SES_LINESIZE(S) (S)->linesize
127 
129 #define SES_IN_ENCODING(S) (S)->in_encoding
130 
132 #define SES_OUT_ENCODING(S) (S)->out_encoding
133 
135 #define SES_IS_DUMMY(S) ((S)->sid == 0)
136 
138 #define SES_IS_YCONTROL(S) ((S)->ycontrol)
139 
141 #define SES_CONN_CLOSED(S) (S)->conn_closed
142 
144 #define SES_SET_CUR_RPC_MSG(S,MSG) (S)->cur_rpc_msg = MSG
145 
147 #define SES_GET_CUR_RPC_MSG(S) (S)->cur_rpc_msg
148 
150 #define SES_GET_JSON_1LINE(S) (S)->json_1line
151 
153 #define SES_USE_JSON_ATTRS(S) (S)->json_attrs
154 
156 #define SES_SET_JSON_ATTRS(S) (S)->json_attrs = TRUE
157 
159 #define SES_SET_LEAFLIST_PTR(S,V) (S)->leaflist = V
160 
162 #define SES_GET_LEAFLIST_PTR(S) (S)->leaflist
163 
165 #define SES_SET_LEAFLIST_ATTRS(S,A) (S)->any_leaflist_attrs = A
166 
168 #define SES_GET_LEAFLIST_ATTRS(S) (S)->any_leaflist_attrs
169 
171 #define SES_KEEP_XMLNS(S) (S)->keep_xmlns
172 
174 #define SES_RAWXML_MODE(S) (S)->rawxml_mode
175 
177 #define SES_STATE(S) (S)->state
178 
180 #define SES_PEERADDR(S) (S)->peeraddr
181 
183 #define SES_TRANSPORT(S) (S)->transport
184 
186 #define SES_PROTOCOL(S) (S)->protocol
187 
189 #define SES_IS_IPV6(S) (S)->is_ipv6
190 
192 #define SES_IS_CALLHOME(S) (S)->is_callhome
193 
195 #define SES_TYPE(S) (S)->type
196 
198 #define SES_GET_COOKIE(S) (S)->get_cookie
199 
201 #define SES_BREADCRUMBQ(S) &(S)->breadcrumbQ
202 
204 #define SES_CURMSG(S) (S)->curmsg
205 
207 #define SES_START_TLS(S) (S)->start_tls
208 
210 #define SES_WILDCARD_OK(S) (S)->wildcard_ok
211 
213 #define SES_MGRCB(S) (S)->mgrcb
214 
216 #define SES_NOTIF_ACTIVE(S) (S)->notif_active
217 
219 #define SES_RFC8639_NOTIF_COUNT(S) (S)->rfc8639_notif_cnt
220 
222 #define SES_NULL_SID 0
223 
232 #define SES_MSG_BUFFSIZE 1000
233 
238 #define SES_MAX_BUFFERS 500000
239 
241 #ifdef WITH_COAP
242 #define SES_MAX_FREE_BUFFERS 4
243 #else
244 #define SES_MAX_FREE_BUFFERS 32
245 #endif // WITH_COAP
246 
248 #define SES_MAX_BUFFSEND 32
249 
251 #define SES_MAX_BYTESEND 0xffff
252 
254 #define SES_DEF_LINESIZE 72
255 
257 #define SES_MAX_STARTCHUNK_SIZE 13
258 
260 #define SES_MAX_CHUNKNUM_SIZE 10
261 
273 #define SES_STARTCHUNK_PAD 10
274 
278 #define SES_ENDCHUNK_PAD 8
279 
281 #define SES_READBUFF_SIZE 1000
282 
284 #define SES_GET_YPMODE(S) (S)->yp_mode
285 
287 #define SES_SET_YPMODE(S,V) (S)->yp_mode = V
288 
290 #define SES_REMOTE_WAIT(S) (S)->remote_wait
291 
293 #define SES_NEED_FILE_OVERRIDE(S) ((S)->file_override && (S)->fp)
294 
296 #define SES_SYSTEM_USERNAME NCX_EL_SYSTEM
297 
298 
299 /********************************************************************
300 * *
301 * T Y P E S *
302 * *
303 *********************************************************************/
304 
306 typedef uint32 ses_id_t;
307 
309 typedef enum ses_ypmode_t_ {
314 } ses_ypmode_t;
315 
316 
318 typedef enum ses_type_t_ {
326 } ses_type_t;
327 
328 
330 typedef enum ses_transport_t_ {
344  SES_TRANSPORT_COAP_DTLS, /* CoAP DTLS/UDP socket */
348 } ses_transport_t;
349 
350 
352 typedef enum ses_state_t_ {
362 } ses_state_t;
363 
364 
366 typedef enum ses_instate_t_ {
373 } ses_instate_t;
374 
375 
377 typedef enum ses_mode_t_ {
383 } ses_mode_t;
384 
385 
387 typedef enum ses_term_reason_t_ {
396 } ses_term_reason_t;
397 
398 
400 typedef enum ses_prolog_state_t_ {
404 } ses_prolog_state_t;
405 
406 
414 typedef struct ses_stats_t_ {
416  uint32 in_bytes;
417 
419  uint32 out_bytes;
420 
422  uint32 out_line;
423 
425  uint32 inRpcs;
426 
428  uint32 inBadRpcs;
429 
431  uint32 outRpcErrors;
432 
435 
437  uint32 requests;
438 } ses_stats_t;
439 
440 
442 typedef struct ses_total_stats_t_ {
445 
448 
451 
453  uint32 inBadHellos;
454 
456  uint32 inSessions;
457 
460 
462  ses_stats_t stats;
463 
466 } ses_total_stats_t;
467 
468 
470 typedef struct ses_msg_buff_t_ {
471  dlq_hdr_t qhdr;
472  size_t buffstart;
473  size_t bufflen;
474  size_t buffpos;
475  boolean islast;
481  xmlChar buff[SES_MSG_BUFFSIZE+1];
482 } ses_msg_buff_t;
483 
484 
488 typedef struct ses_ready_t_ {
490  dlq_hdr_t hdr;
491 
494 
496  boolean inq;
497 
499  boolean ycontrol;
500 } ses_ready_t;
501 
502 
504 typedef struct ses_msg_t_ {
505  dlq_hdr_t qhdr;
506  boolean ready;
507  boolean dispatched;
508  ses_msg_buff_t *curbuff;
509  dlq_hdr_t buffQ;
510  ses_prolog_state_t prolog_state;
511  size_t curchunksize;
512  size_t expchunksize;
513 } ses_msg_t;
514 
515 
526 typedef ssize_t (*ses_read_fn_t) (void *s,
527  char *buff,
528  size_t bufflen,
529  boolean *erragain);
530 
531 
538 typedef status_t (*ses_write_fn_t) (void *s);
539 
540 
542 typedef struct ses_cb_t_ {
543  dlq_hdr_t qhdr;
544  ses_type_t type;
546  ncx_protocol_t protocol;
547  ses_transport_t transport;
548  ncx_msg_encoding_t encoding;
549  ses_state_t state;
550  ses_mode_t mode;
554  ses_term_reason_t termreason;
555  time_t hello_time;
556  time_t last_rpc_time;
557  xmlChar *start_time;
558  xmlChar *username;
559  xmlChar *peeraddr;
562  xmlChar *subsys_id;
564  int tid;
565  void *tcb;
566  boolean locks_released;
568  boolean conn_closed;
569  boolean active;
570  boolean notif_active;
571  boolean stream_output;
572  boolean noxmlns;
573  boolean framing11;
574  boolean keep_xmlns;
575  boolean warn_xml;
576  boolean rawxml_mode;
577  boolean direct_mode;
578  boolean msg_mode;
579  boolean ycontrol;
580  boolean dbapi;
581  boolean dbapi_system;
582  boolean sse_mode;
583  boolean ypgnmi;
586  boolean restconf_notif;
588  boolean json_1line;
589  boolean http_chunk_mode;
590  boolean http_waitrn;
591  boolean json_attrs;
593  boolean is_ycontrol_scb;
594  boolean is_ipv6;
595  boolean is_callhome;
596  boolean dropped;
597  boolean start_tls;
598  boolean checksum_mode;
599  uint32 last_ch;
605  ncx_display_mode_t in_encoding;
606 
610  ncx_display_mode_t out_encoding;
611 
612  xmlTextReaderPtr reader;
613  FILE *fp;
614  int fd;
617  uint32 inendpos;
618  ses_instate_t instate;
619  uint32 buffcnt;
620  uint32 freecnt;
621  dlq_hdr_t msgQ;
622  dlq_hdr_t freeQ;
623  dlq_hdr_t outQ;
624  ses_msg_buff_t *outbuff;
625  ses_ready_t inready;
626  ses_ready_t outready;
627  ses_stats_t stats;
628  void *mgrcb;
631  struct yangapi_cb_t_ *rcb;
632  xmlChar *entry_point;
639 
641  xmlChar *readbuff;
642  uint32 readbuffsize;
644  /*** user preferences ***/
645  int8 indent;
646  int8 msg_indent;
647  uint32 linesize;
648  ncx_withdefaults_t withdef;
649  uint32 cache_timeout;
658  struct agt_acm_cache_t_ *acm_cache;
659 
661  xmlChar *service_name;
664  boolean reading_header;
666  boolean chunk_based;
667  int32 total_length;
670  boolean use_traceid;
671 
677  ses_ypmode_t yp_mode;
678 
683  boolean skip_modnames;
684 
685  void *openssl_ctx;
686  void *openssl_ssl;
691  void *get_cookie;
692 
697  boolean remote_wait;
698 
703  dlq_hdr_t breadcrumbQ;
706  ses_msg_t *curmsg;
707 
712  boolean wildcard_ok;
713 
718  boolean file_override;
719 
722 
725 
727  uint32 checksum;
728  uint32 checksum_cnt;
731  /* SNMP pointers */
732 
733  /* Q of malloced val_value struc
734  * Q of list entries with only keys in it.
735  * Used to find the best getnext match.
736  * This Queue is getting saved only if the
737  * operation is GETNEXT. So the server can reuse
738  * the same Queue if the getnext operation is trying
739  * to getnext leaf object on the same TABLE
740  */
741  dlq_hdr_t snmp_getnext_listQ;
742 
743  /* Current SNMP walk table */
744  struct obj_template_t_ *snmp_table_obj;
745 
746 } ses_cb_t;
747 
748 
752 /********************************************************************
753 * *
754 * F U N C T I O N S *
755 * *
756 *********************************************************************/
757 
774 extern ses_cb_t *
775  ses_new_scb (void);
776 
777 
783 extern ses_cb_t *
784  ses_new_dummy_scb (void);
785 
786 
787 #ifdef WITH_COAP
788 
793 extern ses_cb_t *
794  ses_new_coap_scb (void);
795 
796 
802 extern void
803  ses_init_coap_scb (ses_cb_t *scb);
804 
805 #endif // WITH_COAP
806 
807 
808 #if defined(WITH_SNMP) && defined(WITH_RESTCONF)
809 
814 extern ses_cb_t *
815  ses_new_snmp_scb (void);
816 
817 #endif // WITH_SNMP
818 
819 
825 extern void
826  ses_free_scb (ses_cb_t *scb);
827 
828 
842 extern void
843  ses_putchar (ses_cb_t *scb,
844  uint32 ch);
845 
846 
853 extern void
854  ses_putstr (ses_cb_t *scb,
855  const xmlChar *str);
856 
857 
871 extern void
872  ses_putstr_indent (ses_cb_t *scb,
873  const xmlChar *str,
874  int32 indent);
875 
876 
887 extern void
888  ses_putcstr (ses_cb_t *scb,
889  const xmlChar *str,
890  int32 indent);
891 
892 
902 extern void
903  ses_puthstr (ses_cb_t *scb,
904  const xmlChar *str);
905 
906 
913 extern void
914  ses_putcchar (ses_cb_t *scb,
915  uint32 ch);
916 
917 
928 extern void
929  ses_putastr (ses_cb_t *scb,
930  const xmlChar *str,
931  int32 indent);
932 
933 
944 extern void
945  ses_putjstr (ses_cb_t *scb,
946  const xmlChar *str,
947  int32 indent);
948 
949 
960 extern void
961  ses_indent (ses_cb_t *scb,
962  int32 indent);
963 
964 
971 extern int32
972  ses_indent_count (const ses_cb_t *scb);
973 
974 
981 extern int32
982  ses_message_indent_count (const ses_cb_t *scb);
983 
984 
991 extern void
992  ses_set_indent (ses_cb_t *scb,
993  int32 indent);
994 
995 
1002 extern void
1003  ses_set_message_indent (ses_cb_t *scb, int32 indent);
1004 
1005 
1012 extern void
1013  ses_set_mode (ses_cb_t *scb,
1014  ses_mode_t mode);
1015 
1016 
1023 extern ses_mode_t
1024  ses_get_mode (ses_cb_t *scb);
1025 
1026 
1032 extern void ses_start_msg_mode (ses_cb_t *scb);
1033 
1034 
1040 extern void ses_stop_msg_mode (ses_cb_t *scb);
1041 
1042 
1049 extern status_t
1050  ses_start_msg (ses_cb_t *scb);
1051 
1052 
1058 extern void
1059  ses_finish_msg (ses_cb_t *scb);
1060 
1061 
1082 extern int
1083  ses_read_cb (void *context,
1084  char *buffer,
1085  int len);
1086 
1087 
1102 extern status_t
1103  ses_accept_input (ses_cb_t *scb);
1104 
1105 
1112 extern const xmlChar *
1113  ses_state_name (ses_state_t state);
1114 
1115 
1122 extern ncx_withdefaults_t
1123  ses_withdef (const ses_cb_t *scb);
1124 
1125 
1133 extern uint32
1134  ses_line_left (const ses_cb_t *scb);
1135 
1136 
1147 extern void
1148  ses_put_extern (ses_cb_t *scb,
1149  const xmlChar *fname);
1150 
1151 
1159 extern status_t
1160  ses_put_extern2 (ses_cb_t *scb,
1161  const xmlChar *fname);
1162 
1163 
1164 
1170 extern ses_total_stats_t *
1171  ses_get_total_stats (void);
1172 
1173 
1182 extern ses_transport_t
1183  ses_get_transport (ses_cb_t *scb);
1184 
1185 
1192 extern ses_transport_t
1193  ses_get_transport_enum (const xmlChar *str);
1194 
1195 
1202 extern const xmlChar *
1203  ses_get_transport_name (ses_transport_t transport);
1204 
1205 
1214 extern const xmlChar *
1215  ses_get_transport_yang_name (ses_transport_t transport);
1216 
1217 
1223 extern void
1224  ses_set_xml_nons (ses_cb_t *scb);
1225 
1226 
1235 extern boolean
1236  ses_get_xml_nons (const ses_cb_t *scb);
1237 
1238 
1246 extern status_t
1247  ses_set_protocol (ses_cb_t *scb,
1248  ncx_protocol_t proto);
1249 
1250 
1258 extern ncx_protocol_t
1259  ses_get_protocol (const ses_cb_t *scb);
1260 
1261 
1268 extern void
1269  ses_set_protocols_requested (ses_cb_t *scb,
1270  ncx_protocol_t proto);
1271 
1272 
1280 extern boolean
1281  ses_protocol_requested (ses_cb_t *scb,
1282  ncx_protocol_t proto);
1283 
1284 
1295 extern void
1296  ses_set_extern_xml_mode (ses_cb_t *scb,
1297  boolean rawxml_mode);
1298 
1299 
1311 extern void
1312  ses_set_extern_xml_mode_ex (ses_cb_t *scb,
1313  boolean rawxml_mode,
1314  boolean keep_xmlns);
1315 
1316 
1328 extern void
1329  ses_clear_extern_xml_mode (ses_cb_t *scb,
1330  boolean rawxml_mode);
1331 
1332 
1344 extern void
1345  ses_clear_extern_xml_mode_ex (ses_cb_t *scb,
1346  boolean rawxml_mode,
1347  boolean keep_xmlns);
1348 
1349 
1356 extern void
1357  ses_set_out_encoding (ses_cb_t *scb,
1358  ncx_display_mode_t encoding);
1359 
1360 
1367 extern void
1368  ses_set_SSE_encoding (ses_cb_t *scb);
1369 
1370 
1377 extern ncx_display_mode_t
1378  ses_get_out_encoding (ses_cb_t *scb);
1379 
1380 
1389 extern int32
1390  ses_new_indent_count (boolean indent_in,
1391  int32 indent,
1392  int32 indent_amount);
1393 
1394 
1402 extern void
1403  ses_free_xml_reader (ses_cb_t *scb);
1404 
1405 
1419 extern status_t
1420  ses_getline_cb (xmlChar *fillbuff,
1421  uint32 fillbuffsize,
1422  void *cookie);
1423 
1424 
1431 extern status_t
1432  ses_set_control_session (ses_cb_t *scb);
1433 
1434 
1441 extern boolean
1442  ses_is_control_session (ses_cb_t *scb);
1443 
1444 
1450 extern void
1451  ses_set_dbapi_session (ses_cb_t *scb);
1452 
1453 
1460 extern boolean
1461  ses_is_dbapi_session (ses_cb_t *scb);
1462 
1463 
1470 extern void
1471  ses_set_dbapi_system_session (ses_cb_t *scb);
1472 
1473 
1481 extern boolean
1482  ses_is_dbapi_system_session (ses_cb_t *scb);
1483 
1484 
1490 extern void
1491  ses_clear_dbapi_system_session (ses_cb_t *scb);
1492 
1493 
1500 extern boolean
1501  ses_is_system_session (ses_cb_t *scb);
1502 
1503 
1511 extern int32
1512  ses_add_indent (ses_cb_t *scb,
1513  int32 indent);
1514 
1515 
1523 extern int32
1524  ses_dec_indent (ses_cb_t *scb,
1525  int32 indent);
1526 
1527 
1534 extern ncx_msg_encoding_t
1535  ses_get_msg_encoding (const ses_cb_t *scb);
1536 
1537 
1544 extern status_t
1545  ses_start_http_chunk_mode (ses_cb_t *scb);
1546 
1547 
1554 extern const xmlChar *
1555  ses_get_entry_point (ses_cb_t *scb);
1556 
1557 
1565 extern status_t
1566  ses_set_entry_point (ses_cb_t *scb,
1567  const xmlChar *point);
1568 
1569 
1576 extern boolean
1577  ses_notifications_active (const ses_cb_t *scb);
1578 
1579 
1580 #ifdef WITH_GNMI
1581 
1587 extern status_t
1588  ses_set_gnmi_control_session (ses_cb_t *scb);
1589 
1590 
1597 extern boolean
1598  ses_is_gnmi_control_session (ses_cb_t *scb);
1599 
1600 
1606 extern void
1607  ses_set_gnmi_session (ses_cb_t *scb);
1608 
1609 
1616 extern boolean
1617  ses_is_gnmi_session (ses_cb_t *scb);
1618 
1619 #endif //WITH_GNMI
1620 
1621 
1629 extern status_t
1630  ses_add_breadcrumb_obj (ses_cb_t *scb,
1631  struct obj_template_t_ *obj);
1632 
1633 
1639 extern void
1640  ses_clean_breadcrumbQ (ses_cb_t *scb);
1641 
1642 
1649 extern boolean
1650  ses_dropped (const ses_cb_t *scb);
1651 
1652 
1660 extern status_t
1661  ses_set_file_override (ses_cb_t *scb,
1662  const xmlChar *filespec);
1663 
1664 
1671 extern void
1672  ses_clear_file_override (ses_cb_t *scb);
1673 
1674 
1680 extern void
1681  ses_start_checksum (ses_cb_t *scb);
1682 
1683 
1695 extern uint32
1696  ses_finish_checksum (ses_cb_t *scb,
1697  uint32 *checksum_cnt);
1698 
1699 
1709 extern boolean
1710  ses_dropped_ex (ses_cb_t *scb);
1711 
1712 
1716 #ifdef __cplusplus
1717 } /* end extern 'C' */
1718 #endif
1719 
1720 #endif /* _H_ses */
ses_set_SSE_encoding
void ses_set_SSE_encoding(ses_cb_t *scb)
Set the output encoding to have a Server Sent Events filter Used for notification delivery over RESTC...
Definition: ses.c:4103
rpc_msg_t_
NETCONF Server and Client RPC Request/Reply Message Header.
Definition: rpc.h:181
ses.h
NETCONF Session Common definitions module.
ERR_NCX_SKIPPED
@ ERR_NCX_SKIPPED
2001
Definition: status_enum.h:551
ses_finish_checksum
uint32 ses_finish_checksum(ses_cb_t *scb, uint32 *checksum_cnt)
Stop checksum mode and return the final checksum.
Definition: ses.c:4966
ses_cb_t_::checksum_cnt
uint32 checksum_cnt
byte count
Definition: ses.h:728
xml_strlen
uint32 xml_strlen(const xmlChar *str)
Get the String len for xmlChar.
Definition: xml_util.c:1406
SES_TR_OTHER
@ SES_TR_OTHER
other
Definition: ses.h:393
ses_cb_t_::tid
int tid
Thread ID representing session.
Definition: ses.h:564
ses_set_protocol
status_t ses_set_protocol(ses_cb_t *scb, ncx_protocol_t proto)
set the NETCONF protocol version in use
Definition: ses.c:3780
ses_cb_t_::leaflist
struct val_value_t_ * leaflist
JSON attrs backptr.
Definition: ses.h:600
ses_transport_t_
ses_transport_t_
NETCONF Transport Types.
Definition: ses.h:330
cfg.h
ses_cb_t_::withdef
ncx_withdefaults_t withdef
with-defaults default
Definition: ses.h:648
ses_set_extern_xml_mode_ex
void ses_set_extern_xml_mode_ex(ses_cb_t *scb, boolean rawxml_mode, boolean keep_xmlns)
Setup the scb for external XML parsing.
Definition: ses.c:4002
SES_DEF_LINESIZE
#define SES_DEF_LINESIZE
max desired lines size; not a hard limit
Definition: ses.h:254
ses_total_stats_t_::inBadHellos
uint32 inBadHellos
total in bad hello messages
Definition: ses.h:453
xml_strncpy
uint32 xml_strncpy(xmlChar *copyTo, const xmlChar *copyFrom, uint32 maxlen)
String copy for xmlChar – checks for buffer overflow.
Definition: xml_util.c:1518
ses_finish_msg
void ses_finish_msg(ses_cb_t *scb)
Finish an outbound message on the specified session.
Definition: ses.c:3013
SES_YPMODE_NETCONF
@ SES_YPMODE_NETCONF
NETCONF mode.
Definition: ses.h:313
ses_cb_t_::readbuff
xmlChar * readbuff
input buffer for session
Definition: ses.h:641
ses_set_mode
void ses_set_mode(ses_cb_t *scb, ses_mode_t mode)
Set the output mode for the specified session.
Definition: ses.c:2895
ses_cb_t_::entry_point
xmlChar * entry_point
REST-API entry point.
Definition: ses.h:632
ses_cb_t_::rcb
struct yangapi_cb_t_ * rcb
REST-API control block.
Definition: ses.h:631
ses_cb_t_::protocol
ncx_protocol_t protocol
protocol version in use
Definition: ses.h:546
SES_YPMODE_HA
@ SES_YPMODE_HA
YP-HA mode.
Definition: ses.h:311
NCX_SERVER_TRANSPORT_CLI
#define NCX_SERVER_TRANSPORT_CLI
ncxserver server transport for Yuma CLI connections
Definition: ncxconst.h:171
ses_new_indent_count
int32 ses_new_indent_count(boolean indent_in, int32 indent, int32 indent_amount)
Get the new indent count from the current and indent_amount.
Definition: ses.c:4148
ses_cb_t_::mode
ses_mode_t mode
session mode
Definition: ses.h:550
SES_INST_NONE
@ SES_INST_NONE
not set
Definition: ses.h:367
tstamp.h
Timestamp utilities.
SES_PRST_NONE
@ SES_PRST_NONE
not set
Definition: ses.h:401
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_msg_init_buff
void ses_msg_init_buff(ses_cb_t *scb, boolean outbuff, ses_msg_buff_t *buff)
Init the buffer fields.
Definition: ses_msg.c:1266
ncx_find_backptr
ncx_backptr_t * ncx_find_backptr(const dlq_hdr_t *que, void *node)
Find the specified back pointer struct.
Definition: ncx.c:11609
ses_get_transport
ses_transport_t ses_get_transport(ses_cb_t *scb)
Get the transport enum for a given session.
Definition: ses.c:3578
NCX_DEF_COAP_USER
#define NCX_DEF_COAP_USER
default value for the agent CoAP user
Definition: ncxconst.h:496
ncx_get_protocol_name
const xmlChar * ncx_get_protocol_name(ncx_protocol_t proto)
Get the name string for the protocol.
Definition: ncx.c:10480
ses_cb_t_::warn_xml
boolean warn_xml
T: xml warns, F: no warn.
Definition: ses.h:575
ses_new_dummy_scb
ses_cb_t * ses_new_dummy_scb(void)
Create a new dummy session control block.
Definition: ses.c:2100
ses_start_msg_mode
void ses_start_msg_mode(ses_cb_t *scb)
Set the message output mode to active.
Definition: ses.c:2932
ses_init_coap_scb
void ses_init_coap_scb(ses_cb_t *scb)
Initialize a CoAP session control block.
Definition: ses.c:2153
ses_cb_t_::is_callhome
boolean is_callhome
T: callhome session.
Definition: ses.h:595
ses_msg_t_
Session Message.
Definition: ses.h:504
ses_cb_t_::stream_output
boolean stream_output
buffer/stream svr
Definition: ses.h:571
ses_protocol_requested
boolean ses_protocol_requested(ses_cb_t *scb, ncx_protocol_t proto)
check if the NETCONF protocol version was requested
Definition: ses.c:3918
ses_msg_t_::qhdr
dlq_hdr_t qhdr
Q header for buffcb->msgQ.
Definition: ses.h:505
SES_INST_INMSG
@ SES_INST_INMSG
in message body
Definition: ses.h:369
SES_ST_IDLE
@ SES_ST_IDLE
adble to accept requests
Definition: ses.h:358
ses_get_transport_yang_name
const xmlChar * ses_get_transport_yang_name(ses_transport_t transport)
Get the name of the transport for a given enum value.
Definition: ses.c:3656
log_error
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
ses_msg_t_::dispatched
boolean dispatched
in processing
Definition: ses.h:507
ses_stats_t_::inBadRpcs
uint32 inBadRpcs
netconf-state in-bad-rpcs counter
Definition: ses.h:428
val.h
Value Node Basic Support.
ses_cb_t_::msg_indent
int8 msg_indent
indent N spaces (-1..9)
Definition: ses.h:646
xml_util.h
XML Utilities.
NCX_DEF_ENCODING
#define NCX_DEF_ENCODING
default encoding
Definition: ncxconst.h:319
ses_cb_t_::cache_timeout
uint32 cache_timeout
vir-val cache tmr in sec
Definition: ses.h:649
cfg_template_t_
struct representing 1 configuration database
Definition: cfg.h:225
ses_cb_t_::service_name
xmlChar * service_name
variables for ycontrol sessions
Definition: ses.h:661
ses_cb_t_::readbuffsize
uint32 readbuffsize
input buffer size
Definition: ses.h:642
ses_ypmode_t_
ses_ypmode_t_
YANG-PATCH Mode.
Definition: ses.h:309
ses_cb_t_::any_leaflist_attrs
boolean any_leaflist_attrs
T: leaf-list has attrs.
Definition: ses.h:592
ses_instate_t_
ses_instate_t_
Session Input Handler States for base:1.0 EOM processing.
Definition: ses.h:366
ncx_clean_backptrQ
void ncx_clean_backptrQ(dlq_hdr_t *backptrQ)
Clean an entire Q of ncx_backptr_t structs.
Definition: ncx.c:11470
ses_cb_t_::state
ses_state_t state
session state
Definition: ses.h:549
NCX_PROTO_NETCONF11
@ NCX_PROTO_NETCONF11
RFC 6241 base:1.1.
Definition: ncxtypes.h:784
ses_cb_t_::inready
ses_ready_t inready
header for inreadyQ
Definition: ses.h:625
ses_cb_t_::last_ch
uint32 last_ch
save in case cr/lf in SSE mode
Definition: ses.h:599
ses_cb_t_::last_rpc_time
time_t last_rpc_time
used for idle timeout
Definition: ses.h:556
log_debug3
void void void void void void void void void void void log_debug3(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG3 log entry.
ses_total_stats_t_
Session Total Statistics.
Definition: ses.h:442
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
ses_cb_t_::outbuff
ses_msg_buff_t * outbuff
current output buffer
Definition: ses.h:624
ncx_num.h
NCX Module Library Number Utility Functions.
ses_cb_t_::checksum
uint32 checksum
running checksum for YANG Push Simulated Operational mode
Definition: ses.h:727
ses_cb_t_::type
ses_type_t type
session type
Definition: ses.h:544
SES_TRANSPORT_SOAP
@ SES_TRANSPORT_SOAP
not used
Definition: ses.h:334
ses_putcchar
void ses_putcchar(ses_cb_t *scb, uint32 ch)
Write one content char to the session, with translation as needed.
Definition: ses.c:2604
ses_cb_t_::ypgnmi
boolean ypgnmi
T: is gNMI ycontrol session.
Definition: ses.h:583
SES_TYP_SNMP
@ SES_TYP_SNMP
RESTCONF over SNMP.
Definition: ses.h:324
ses_cb_t_::encoding
ncx_msg_encoding_t encoding
HTTP msg encoding.
Definition: ses.h:548
ERR_NCX_READ_FAILED
@ ERR_NCX_READ_FAILED
240
Definition: status_enum.h:279
ERR_NCX_TOO_BIG
@ ERR_NCX_TOO_BIG
259
Definition: status_enum.h:300
ERR_NCX_INVALID_FRAMING
@ ERR_NCX_INVALID_FRAMING
378
Definition: status_enum.h:421
SES_INST_INSTART
@ SES_INST_INSTART
starting in the EOM field
Definition: ses.h:370
ses_add_indent
int32 ses_add_indent(ses_cb_t *scb, int32 indent)
Add in the new indent amount.
Definition: ses.c:4515
SES_YPMODE_RESTCONF
@ SES_YPMODE_RESTCONF
RESTCONF mode.
Definition: ses.h:312
ncx_init_num
void ncx_init_num(ncx_num_t *num)
Init a ncx_num_t struct.
Definition: ncx_num.c:162
dlq_lastEntry
#define dlq_lastEntry(listP)
get the last entry in the queue list
Definition: dlq.h:352
SES_TYP_NETCONF
@ SES_TYP_NETCONF
any network configuration protocol
Definition: ses.h:320
SES_TRANSPORT_SSH
@ SES_TRANSPORT_SSH
NETCONF over SSH (RFC 4742 and 6242)
Definition: ses.h:332
ses_msg_new_msg
status_t ses_msg_new_msg(ses_msg_t **msg)
Malloc a new session message control header.
Definition: ses_msg.c:281
ses_cb_t_::cur_rpc_msg
struct rpc_msg_t_ * cur_rpc_msg
for SIL-SA get callback
Definition: ses.h:629
NCX_DEF_MSG_INDENT
#define NCX_DEF_MSG_INDENT
default indent amount for protocol message output
Definition: ncxconst.h:444
NCX_PROTO_YUMA_YANGAPI
@ NCX_PROTO_YUMA_YANGAPI
YumaPro YANG-API 1.0.
Definition: ncxtypes.h:785
SES_TRANSPORT_SOAPBEEP
@ SES_TRANSPORT_SOAPBEEP
not used
Definition: ses.h:335
NCX_PROTO_YUMA_CLI
@ NCX_PROTO_YUMA_CLI
YumaPro Internal CLI 1.0.
Definition: ncxtypes.h:786
ses_cb_t_::outready
ses_ready_t outready
header for outreadyQ
Definition: ses.h:626
ses_msg_free_buff
void ses_msg_free_buff(ses_cb_t *scb, ses_msg_buff_t *buff)
Free the session buffer chunk.
Definition: ses_msg.c:460
SES_MODE_TEXT
@ SES_MODE_TEXT
text mode
Definition: ses.h:382
xml_isspace
boolean xml_isspace(uint32 ch)
Check if an xmlChar is a space char.
Definition: xml_util.c:1901
ses_set_gnmi_control_session
status_t ses_set_gnmi_control_session(ses_cb_t *scb)
Set the specified session as a gNMI control session.
Definition: ses.c:4700
ses_cb_t_::yp_mode
ses_ypmode_t yp_mode
YANG-PATCH mode:
Definition: ses.h:677
ses_set_message_indent
void ses_set_message_indent(ses_cb_t *scb, int32 indent)
Set the message indent count for this session.
Definition: ses.c:2867
ses_set_file_override
status_t ses_set_file_override(ses_cb_t *scb, const xmlChar *filespec)
Setup the session in file write override mode.
Definition: ses.c:4881
ses_cb_t_::json_1line
boolean json_1line
T: output JSON leaf-list on 1 line.
Definition: ses.h:588
ses_cb_t_::in_encoding
ncx_display_mode_t in_encoding
input encoding can be different in RESTCONF, set by the Content-Type header
Definition: ses.h:605
ses_msg.h
NETCONF Session Message Common definitions module.
ses_cb_t_::total_length
int32 total_length
total length
Definition: ses.h:667
ses_id_t
uint32 ses_id_t
Session ID.
Definition: ses.h:306
ses_cb_t_::killedbysid
ses_id_t killedbysid
killed-by session ID
Definition: ses.h:552
ses_cb_t_::content_length_based
boolean content_length_based
content len based msg body
Definition: ses.h:665
NCX_NF_DEC
@ NCX_NF_DEC
YANG deciaml format.
Definition: ncxtypes.h:335
SES_TRANSPORT_COAP
@ SES_TRANSPORT_COAP
CoAP UDP socket.
Definition: ses.h:343
ses_putchar
void ses_putchar(ses_cb_t *scb, uint32 ch)
Write one char to the session, without any translation.
Definition: ses.c:2353
ses_stats_t_::inRpcs
uint32 inRpcs
netconf-state in-rpcs counter
Definition: ses.h:425
ses_set_dbapi_session
void ses_set_dbapi_session(ses_cb_t *scb)
Set the specified session as a DB-API control session.
Definition: ses.c:4404
ses_cb_t_::fp
FILE * fp
set if output to a file
Definition: ses.h:613
ses_get_entry_point
const xmlChar * ses_get_entry_point(ses_cb_t *scb)
Get the RESTCONF entry_point.
Definition: ses.c:4642
log_info
void void void void void log_info(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_INFO log entry.
NCX_SERVER_TRANSPORT_HTTP
#define NCX_SERVER_TRANSPORT_HTTP
ncxserver server transport for Yuma HTTP/REST-API connections
Definition: ncxconst.h:168
ses_cb_t_::freecnt
uint32 freecnt
current freeQ count
Definition: ses.h:620
ses_free_xml_reader
void ses_free_xml_reader(ses_cb_t *scb)
Free the xmlTextReader for the session The encoding is switching from XML to something else.
Definition: ses.c:4180
SES_TYP_GNMI
@ SES_TYP_GNMI
RESTCONF over GNMI.
Definition: ses.h:325
ses_total_stats_t_::failed_sessions
uint32 failed_sessions
total failed sessions
Definition: ses.h:450
ses_putjstr
void ses_putjstr(ses_cb_t *scb, const xmlChar *str, int32 indent)
write JSON safe content string Write a zero-terminated element content string to the session
Definition: ses.c:2700
ses_msg_buff_t_::qhdr
dlq_hdr_t qhdr
not set
Definition: ses.h:471
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
ses_cb_t_::is_ycontrol_scb
boolean is_ycontrol_scb
T: is ycontrol_scb for HA.
Definition: ses.h:593
NCX_DEF_SNMP_USER
#define NCX_DEF_SNMP_USER
default value for the agent SNMP user
Definition: ncxconst.h:499
ses_cb_t_::is_ipv6
boolean is_ipv6
T: using IPv6 address, F: IPv4.
Definition: ses.h:594
ses_cb_t_::hello_time
time_t hello_time
used for hello timeout
Definition: ses.h:555
errno_to_status
status_t errno_to_status(void)
Get the errno variable and convert it to a status_t.
Definition: status.c:968
SES_SET_JSON_ATTRS
#define SES_SET_JSON_ATTRS(S)
set the JSON attributes flag
Definition: ses.h:156
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
ERR_NCX_SESSION_CLOSED
@ ERR_NCX_SESSION_CLOSED
1010
Definition: status_enum.h:499
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
ses_clean_breadcrumbQ
void ses_clean_breadcrumbQ(ses_cb_t *scb)
Clean the breadcrumbQ.
Definition: ses.c:4841
ses_cb_t_::skip_modnames
boolean skip_modnames
YPW-888: new restconf cli parameter to turn strict JSON YANG enconding off, do not include module nam...
Definition: ses.h:683
ses_cb_t_::tcb
void * tcb
Thread control block.
Definition: ses.h:565
ses_cb_t_::file_override
boolean file_override
set by server DB-API session to capture <rpc-reply> output to a file.
Definition: ses.h:718
NCX_PROTO_RESTCONF
@ NCX_PROTO_RESTCONF
IETF RESTCONF.
Definition: ncxtypes.h:788
NCX_DEF_VTIMEOUT
#define NCX_DEF_VTIMEOUT
default virtual value cache timeout value in seconds use 0 to disable the cache and refresh a virtual...
Definition: ncxconst.h:451
ncx_get_message_indent
int8 ncx_get_message_indent(void)
Get the protoco9l output indent amount.
Definition: ncx.c:10775
ses_cb_t_::wildcard_ok
boolean wildcard_ok
set by yangcli when parsing an XML file and wildcard strings are allowed; read by mgr_val_parse check...
Definition: ses.h:712
ses_stats_t_::outRpcErrors
uint32 outRpcErrors
netconf-state out-rpc-errors counter
Definition: ses.h:431
ses_cb_t_
Session Control Block.
Definition: ses.h:542
ses_cb_t_::locks_released
boolean locks_released
Signal release point in kill.
Definition: ses.h:566
ses_stats_t_::requests
uint32 requests
internal request counters for EVAL tracking
Definition: ses.h:437
ses_cb_t_::fd
int fd
set if output to a socket
Definition: ses.h:614
ses_cb_t_::protocols_requested
uint32 protocols_requested
bitmask
Definition: ses.h:545
SES_INST_INEND
@ SES_INST_INEND
ending the EOM field
Definition: ses.h:372
ses_msg_buff_t_::buff
xmlChar buff[SES_MSG_BUFFSIZE+1]
buffer memory has 1 extra byte set to zero to make sure log input does not print past end of the inpu...
Definition: ses.h:481
ses_total_stats_t_::closed_sessions
uint32 closed_sessions
total closed sessions
Definition: ses.h:447
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.
obj_get_name
const xmlChar * obj_get_name(const obj_template_t *obj)
Get the name field for this obj.
Definition: obj.c:10511
ses_get_protocol
ncx_protocol_t ses_get_protocol(const ses_cb_t *scb)
Get the NETCONF protocol set (or unset) for this session.
Definition: ses.c:3854
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
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
ses_message_indent_count
int32 ses_message_indent_count(const ses_cb_t *scb)
Get the message indent count for this session.
Definition: ses.c:2822
ses_putastr
void ses_putastr(ses_cb_t *scb, const xmlChar *str, int32 indent)
write XML attribute safe content string Write a zero-terminated attribute content string to the sessi...
Definition: ses.c:2646
LOGDEBUG2
#define LOGDEBUG2
Check if at least log-level=debug2.
Definition: log.h:292
SES_ST_NONE
@ SES_ST_NONE
not set
Definition: ses.h:353
NCX_SERVER_TRANSPORT_WEBUI
#define NCX_SERVER_TRANSPORT_WEBUI
ncxserver server transport for Yuma WEBui connections
Definition: ncxconst.h:174
ses_cb_t_::rfc8639_notif_cnt
uint16 rfc8639_notif_cnt
New subscriptions allow more than 1 per session.
Definition: ses.h:724
dlq_createSQue
void dlq_createSQue(dlq_hdrT *queAddr)
create a static queue header
Definition: dlq.c:177
SES_TRANSPORT_NONE
@ SES_TRANSPORT_NONE
not set
Definition: ses.h:331
SES_READBUFF_SIZE
#define SES_READBUFF_SIZE
default read buffer size
Definition: ses.h:281
log_warn
void void void log_warn(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_WARN log entry.
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
SES_TYP_YCONTROL
@ SES_TYP_YCONTROL
internal YControl session w/ subsystem
Definition: ses.h:322
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
ses_indent_count
int32 ses_indent_count(const ses_cb_t *scb)
Get the logging indent count for this session.
Definition: ses.c:2801
ses_cb_t_::restconf_sse_mode
boolean restconf_sse_mode
T: RESTCONF SSE mode.
Definition: ses.h:585
ses_cb_t_::wrfn
ses_write_fn_t wrfn
set if external read fn
Definition: ses.h:616
ses_putcstr
void ses_putcstr(ses_cb_t *scb, const xmlChar *str, int32 indent)
write XML element safe content string Write a zero-terminated element content string to the session
Definition: ses.c:2522
ses_cb_t_::mgrcb
void * mgrcb
if manager session, mgr_scb_t
Definition: ses.h:628
ses_cb_t_::start_time
xmlChar * start_time
dateTime start time
Definition: ses.h:557
ses_cb_t_::sse_mode
boolean sse_mode
T: Server Sent Events, F: normal.
Definition: ses.h:582
ses_type_t_
ses_type_t_
Session Types.
Definition: ses.h:318
yangapi_cb_t_
Restapi Control Block Used by RESTCONF to hold parse and request processing state.
Definition: yangapi.h:224
ERR_NCX_INVALID_VALUE
@ ERR_NCX_INVALID_VALUE
258
Definition: status_enum.h:299
ses_start_http_chunk_mode
status_t ses_start_http_chunk_mode(ses_cb_t *scb)
Start outputting buffers in HTTP 1.1 chunk mode.
Definition: ses.c:4605
SES_TR_BAD_HELLO
@ SES_TR_BAD_HELLO
bad <hello> received
Definition: ses.h:395
ses_cb_t_::termreason
ses_term_reason_t termreason
termination reason
Definition: ses.h:554
SES_TRANSPORT_GNMI
@ SES_TRANSPORT_GNMI
GNMI Internal processing over RESTCONF.
Definition: ses.h:347
ses_cb_t_::direct_mode
boolean direct_mode
T: yp-shell, F: normal.
Definition: ses.h:577
ses_cb_t_::msg_mode
boolean msg_mode
T:msg-indent F:indent.
Definition: ses.h:578
ses_cb_t_::qhdr
dlq_hdr_t qhdr
queued by manager only
Definition: ses.h:543
SES_NEED_FILE_OVERRIDE
#define SES_NEED_FILE_OVERRIDE(S)
get file override flag (used in client)
Definition: ses.h:293
ses_cb_t_::fake_candidate
struct cfg_template_t_ * fake_candidate
a fake candidate config for target=running YANG-PATCH
Definition: ses.h:721
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_cb_t_::peeraddr
xmlChar * peeraddr
Inet address string.
Definition: ses.h:559
ses_is_dbapi_system_session
boolean ses_is_dbapi_system_session(ses_cb_t *scb)
Check if the specified session is a DB-API control session for system edits.
Definition: ses.c:4478
ses_cb_t_::sid
ses_id_t sid
session ID
Definition: ses.h:551
xml_strncmp
int xml_strncmp(const xmlChar *s1, const xmlChar *s2, uint32 maxlen)
String compare for xmlChar for at most 'maxlen' xmlChars.
Definition: xml_util.c:1824
NCX_DISPLAY_MODE_XML_NONS
@ NCX_DISPLAY_MODE_XML_NONS
XML display mode without any prefixes (not compliant XML!)
Definition: ncxtypes.h:463
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_cb_t_::indent
int8 indent
indent N spaces (0..9)
Definition: ses.h:645
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
ses_line_left
uint32 ses_line_left(const ses_cb_t *scb)
Get the number of bytes that can be added to the current line before the session linesize limit is re...
Definition: ses.c:3482
get_error_string
const char * get_error_string(status_t res)
Get the error message for a specific internal error.
Definition: status.c:239
ses_cb_t_::transport
ses_transport_t transport
transport type
Definition: ses.h:547
ses_ready_t_::inq
boolean inq
flag that already in the ready Q
Definition: ses.h:496
ses_stats_t_::outNotifications
uint32 outNotifications
netconf-state out-notifications counter
Definition: ses.h:434
SES_TRANSPORT_TCP_NCX
@ SES_TRANSPORT_TCP_NCX
YumaWorks NETCONF over TCP.
Definition: ses.h:338
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.
ses_put_extern2
status_t ses_put_extern2(ses_cb_t *scb, const xmlChar *fname)
write the contents of a file to the session
Definition: ses.c:3527
ncx_protocol_enabled
boolean ncx_protocol_enabled(ncx_protocol_t proto)
Check if the specified protocol version is enabled.
Definition: ncx.c:10192
SES_MAX_STARTCHUNK_SIZE
#define SES_MAX_STARTCHUNK_SIZE
max size of a valid base:1.1 chunk header start tag
Definition: ses.h:257
dlq_count
unsigned int dlq_count(const dlq_hdrT *listP)
get the number of queue entries in the listP queue list
Definition: dlq.c:994
ses_msg_buff_t_
Session Message Buffer.
Definition: ses.h:470
ses_stats_t_
Per Session Statistics.
Definition: ses.h:414
ses_is_system_session
boolean ses_is_system_session(ses_cb_t *scb)
Check if the specified session is an internal system session.
Definition: ses.c:4441
ses_set_protocols_requested
void ses_set_protocols_requested(ses_cb_t *scb, ncx_protocol_t proto)
set the NETCONF protocol versions requested
Definition: ses.c:3875
ses_cb_t_::openssl_ssl
void * openssl_ssl
malloced with SSL_new
Definition: ses.h:686
dlq_prevEntry
#define dlq_prevEntry(nodeP)
get the previous queue entry before the current entry
Definition: dlq.h:280
ERR_NCX_EOF
@ ERR_NCX_EOF
244
Definition: status_enum.h:283
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
ses_cb_t_::noxmlns
boolean noxmlns
xml-nons display-mode
Definition: ses.h:572
ses_withdef
ncx_withdefaults_t ses_withdef(const ses_cb_t *scb)
Get the with-defaults value for this session.
Definition: ses.c:3461
ses_get_mode
ses_mode_t ses_get_mode(ses_cb_t *scb)
Get the output mode for the specified session.
Definition: ses.c:2914
ses_stop_msg_mode
void ses_stop_msg_mode(ses_cb_t *scb)
Set the message output mode to inactive.
Definition: ses.c:2950
ses_write_fn_t
status_t(* ses_write_fn_t)(void *s)
optional write function for the session
Definition: ses.h:538
ses_is_gnmi_session
boolean ses_is_gnmi_session(ses_cb_t *scb)
Check if the specified session is a gNMI session.
Definition: ses.c:4765
val_value_t_
one value to match one type
Definition: val.h:860
SES_TRANSPORT_AFLOCAL
@ SES_TRANSPORT_AFLOCAL
ncxserver.sock AF_LOCAL socket – control msg
Definition: ses.h:342
NCX_PROTO_YCONTROL
@ NCX_PROTO_YCONTROL
YumaPro Internal Control 1.0.
Definition: ncxtypes.h:787
SES_ST_SHUTDOWN
@ SES_ST_SHUTDOWN
session shutting down
Definition: ses.h:361
ses_cb_t_::freeQ
dlq_hdr_t freeQ
Q of ses_msg_buff_t.
Definition: ses.h:622
SES_TR_KILLED
@ SES_TR_KILLED
kill-session
Definition: ses.h:390
ses_cb_t_::framing11
boolean framing11
T: base:1.1, F: base:1.0.
Definition: ses.h:573
ses_set_control_session
status_t ses_set_control_session(ses_cb_t *scb)
Set the specified session as a control session.
Definition: ses.c:4365
ses_clear_dbapi_system_session
void ses_clear_dbapi_system_session(ses_cb_t *scb)
Clear a session of the DB-API system status.
Definition: ses.c:4494
ses_cb_t_::msgQ
dlq_hdr_t msgQ
Q of ses_msg_t input.
Definition: ses.h:621
ses_cb_t_::curmsg
ses_msg_t * curmsg
pointer to current message to read set by agt only
Definition: ses.h:706
ses_clear_file_override
void ses_clear_file_override(ses_cb_t *scb)
Cleanup the session in file write override mode Does not delete the file, just closes it!
Definition: ses.c:4915
ses_msg_t_::expchunksize
size_t expchunksize
expected chunk size
Definition: ses.h:512
SES_YPMODE_NONE
@ SES_YPMODE_NONE
not set
Definition: ses.h:310
SES_TRANSPORT_TCP_TAILF
@ SES_TRANSPORT_TCP_TAILF
tail-f NETCONF over TCP
Definition: ses.h:337
ses_cb_t_::checksum_mode
boolean checksum_mode
T: add out byte to checksum.
Definition: ses.h:598
ses_msg_t_::buffQ
dlq_hdr_t buffQ
Q of ses_msg_buff_t.
Definition: ses.h:509
NCX_SERVER_TRANSPORT_AFLOCAL
#define NCX_SERVER_TRANSPORT_AFLOCAL
ncxserver server transport for local system connections
Definition: ncxconst.h:177
ses_cb_t_::stats
ses_stats_t stats
per-session statistics
Definition: ses.h:627
NCX_MAX_NUMLEN
#define NCX_MAX_NUMLEN
max number len to use for static buffer allocation only
Definition: ncxconst.h:136
ses_total_stats_t_::startTime
xmlChar startTime[TSTAMP_MIN_SIZE]
session start timestamp
Definition: ses.h:465
ses_prolog_state_t_
ses_prolog_state_t_
prolog parsing state
Definition: ses.h:400
ses_cb_t_::chunk_based
boolean chunk_based
chunked based msg body
Definition: ses.h:666
ses_stats_t_::out_bytes
uint32 out_bytes
extra original internal out byte counter
Definition: ses.h:419
ses_set_extern_xml_mode
void ses_set_extern_xml_mode(ses_cb_t *scb, boolean rawxml_mode)
Setup the scb for external XML parsing.
Definition: ses.c:3979
ses_cb_t_::http_chunk_mode
boolean http_chunk_mode
T: send HTTP chunks, F: normal.
Definition: ses.h:589
ses_new_scb
ses_cb_t * ses_new_scb(void)
Create a new session control block.
Definition: ses.c:2025
ses_msg_write_buff
status_t ses_msg_write_buff(ses_cb_t *scb, ses_msg_buff_t *buff, xmlChar ch)
Add some text to the message buffer.
Definition: ses_msg.c:523
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
ses_cb_t_::dropped
boolean dropped
T: session dropped in a msg.
Definition: ses.h:596
ses_ready_t_
embedded Q header for the message ready Q The 'inq' flag is used to prevent queue corruption
Definition: ses.h:488
ses_cb_t_::instate
ses_instate_t instate
input state enum
Definition: ses.h:618
ses_msg_buff_t_::bufflen
size_t bufflen
buff actual size
Definition: ses.h:473
ncx_clean_num
void ncx_clean_num(ncx_btype_t btyp, ncx_num_t *num)
Scrub the memory in a ncx_num_t by freeing all the sub-fields.
Definition: ncx_num.c:189
ses_indent
void ses_indent(ses_cb_t *scb, int32 indent)
Write the proper newline + indentation to the specified session.
Definition: ses.c:2768
ses_term_reason_t_
ses_term_reason_t_
Session Termination reason.
Definition: ses.h:387
ses_cb_t_::inendpos
uint32 inendpos
inside framing directive
Definition: ses.h:617
tstamp_datetime
void tstamp_datetime(xmlChar *buff)
Set the current date and time in an XML dateTime string format.
Definition: tstamp.c:160
ses_dropped
boolean ses_dropped(const ses_cb_t *scb)
Check if the session has been dropped by the client.
Definition: ses.c:4860
ses_set_xml_nons
void ses_set_xml_nons(ses_cb_t *scb)
force xmlns attributes to be skipped in XML mode
Definition: ses.c:3741
ses_msg_buff_t_::buffstart
size_t buffstart
buff start pos
Definition: ses.h:472
SES_MODE_HTML
@ SES_MODE_HTML
HTML mode.
Definition: ses.h:381
ses_cb_t_::username
xmlChar * username
user ID
Definition: ses.h:558
SES_ST_SHUTDOWN_REQ
@ SES_ST_SHUTDOWN_REQ
session shutdown requested
Definition: ses.h:360
ses_set_entry_point
status_t ses_set_entry_point(ses_cb_t *scb, const xmlChar *point)
Set the RESTCONF entry_point.
Definition: ses.c:4667
ncx_netconfd_running
boolean ncx_netconfd_running(void)
Check if netconfd running.
Definition: ncx.c:11805
ses_cb_t_::dbapi_system
boolean dbapi_system
T: is DB-API system session.
Definition: ses.h:581
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
ses_total_stats_t_::stats
ses_stats_t stats
per-session stats added up for all sessions
Definition: ses.h:462
ses_ready_t_::hdr
dlq_hdr_t hdr
< embedded queue header threaded into ready Q
Definition: ses.h:490
NC_SSH_END_LEN
#define NC_SSH_END_LEN
Length of NETCONF SSH End of Message Marker.
Definition: ncxconst.h:106
NCX_FL_PROTO_NETCONF10
#define NCX_FL_PROTO_NETCONF10
bit definitions for NETCONF session protocol versions
Definition: ncxconst.h:1585
ses_cb_t_::out_encoding
ncx_display_mode_t out_encoding
output encoding can be different in RESTCONF, set by the Accept header
Definition: ses.h:610
ses_total_stats_t_::inSessions
uint32 inSessions
total inbound sessions
Definition: ses.h:456
LOGDEBUG4
#define LOGDEBUG4
Check if at least log-level=debug4.
Definition: log.h:302
log.h
NCX System Logging Manager.
SES_TR_NONE
@ SES_TR_NONE
not set
Definition: ses.h:388
ERR_BUFF_OVFL
@ ERR_BUFF_OVFL
106
Definition: status_enum.h:218
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
ses_add_breadcrumb_obj
status_t ses_add_breadcrumb_obj(ses_cb_t *scb, struct obj_template_t_ *obj)
Add an object to the breadcrumbQ.
LOGDEBUG
#define LOGDEBUG
Check if at least log-level=debug.
Definition: log.h:287
ses_dec_indent
int32 ses_dec_indent(ses_cb_t *scb, int32 indent)
Remove the specified indent amount.
Definition: ses.c:4549
ses_cb_t_::outQ
dlq_hdr_t outQ
Q of ses_msg_buff_t.
Definition: ses.h:623
SES_TRANSPORT_WEBUI
@ SES_TRANSPORT_WEBUI
not used YumaPro WEBui (ncxconnect, no framing)
Definition: ses.h:341
ses_cb_t_::rdfn
ses_read_fn_t rdfn
set if external write fn
Definition: ses.h:615
xml_free_reader
void xml_free_reader(xmlTextReaderPtr reader)
Free the previously allocated xmlTextReader.
Definition: xml_util.c:453
NCX_DEF_SUPERUSER
#define NCX_DEF_SUPERUSER
default value for the agent superuser
Definition: ncxconst.h:493
ses_stats_t_::in_bytes
uint32 in_bytes
extra original internal in byte counter
Definition: ses.h:416
ses_clear_extern_xml_mode
void ses_clear_extern_xml_mode(ses_cb_t *scb, boolean rawxml_mode)
Clear the scb from external XML parsing.
Definition: ses.c:4034
ses_cb_t_::ycontrol
boolean ycontrol
T: is ycontrol session.
Definition: ses.h:579
NC_SSH_END
#define NC_SSH_END
NETCONF SSH End of Message Marker.
Definition: ncxconst.h:103
cfg_free_template
void cfg_free_template(cfg_template_t *cfg)
Clean and free the cfg_template_t struct.
Definition: cfg.c:1383
SES_ST_RESTCAPS_WAIT
@ SES_ST_RESTCAPS_WAIT
RESTCONF Capabilities processing.
Definition: ses.h:357
NCX_BT_UINT32
@ NCX_BT_UINT32
uint32
Definition: ncxtypes.h:213
dlq_deque
void * dlq_deque(dlq_hdrT *listP)
remove the first queue node from the queue list
Definition: dlq.c:286
ses_cb_t_::start_tls
boolean start_tls
T: need to start TLS session first.
Definition: ses.h:597
SES_MODE_XMLDOC
@ SES_MODE_XMLDOC
XML documentation mode.
Definition: ses.h:380
SES_TRANSPORT_BEEP
@ SES_TRANSPORT_BEEP
not used
Definition: ses.h:333
ses_mode_t_
ses_mode_t_
Session Output Mode.
Definition: ses.h:377
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
ncx_get_max_strlen
int32 ncx_get_max_strlen(void)
Get the –max-strlen parameter.
Definition: ncx.c:14799
ses_cb_t_::reading_header
boolean reading_header
variables for SSL sessions; used by yangcli-pro
Definition: ses.h:664
ses_cb_t_::acm_cache
struct agt_acm_cache_t_ * acm_cache
agent access control for database reads and writes; for incoming agent <rpc> requests,...
Definition: ses.h:658
ses_get_xml_nons
boolean ses_get_xml_nons(const ses_cb_t *scb)
force xmlns attributes to be skipped in XML mode
Definition: ses.c:3761
ses_cb_t_::subsys_id
xmlChar * subsys_id
used for YCONTROL session only
Definition: ses.h:562
ses_cb_t_::dbapi
boolean dbapi
T: is DB-API session.
Definition: ses.h:580
NCX_DEF_WITHDEF
#define NCX_DEF_WITHDEF
default value for the with-defaults option
Definition: ncxconst.h:487
ses_set_dbapi_system_session
void ses_set_dbapi_system_session(ses_cb_t *scb)
Set the specified session as a DB-API control session for system edits.
Definition: ses.c:4459
yangapi_free_rcb
void yangapi_free_rcb(yangapi_cb_t *rcb)
Free a YANGAPI control block.
Definition: yangapi.c:351
ses_state_t_
ses_state_t_
Session States.
Definition: ses.h:352
ses_cb_t_::http_waitrn
boolean http_waitrn
T: wait for EOchunk, F: no wait.
Definition: ses.h:590
ncx_write_tracefile
void ncx_write_tracefile(const char *buff, uint32 count)
Write a byte to the tracefile.
Definition: ncx.c:10723
ses_set_gnmi_session
void ses_set_gnmi_session(ses_cb_t *scb)
Set the specified session as a gNMI session.
Definition: ses.c:4746
ses_cb_t_::reader
xmlTextReaderPtr reader
input stream reader
Definition: ses.h:612
ses_get_out_encoding
ncx_display_mode_t ses_get_out_encoding(ses_cb_t *scb)
Get the output encoding.
Definition: ses.c:4126
ses_cb_t_::breadcrumbQ
dlq_hdr_t breadcrumbQ
Queue of breadcrumb object back pointers used in XPath GET2 processing of when-stmts in operational s...
Definition: ses.h:703
XML_START_MSG
#define XML_START_MSG
copied from ncx/xml_util.h to avoid inluding that file and all the files it includes
Definition: subsystem.h:106
ses_cb_t_::startchunk
xmlChar startchunk[SES_MAX_STARTCHUNK_SIZE+1]
base:1.1 chunk state handling; need to store number part of incoming chunk markers in the scb in case...
Definition: ses.h:638
ses_putstr_indent
void ses_putstr_indent(ses_cb_t *scb, const xmlChar *str, int32 indent)
Write a zero-terminated content string to the session with indentation.
Definition: ses.c:2486
SES_TR_CLOSED
@ SES_TR_CLOSED
close-session
Definition: ses.h:389
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
ses_puthstr
void ses_puthstr(ses_cb_t *scb, const xmlChar *str)
write HTML element safe content string Write a zero-terminated element content string to the session
Definition: ses.c:2566
ses_is_dbapi_session
boolean ses_is_dbapi_session(ses_cb_t *scb)
Check if the specified session is a DB-API control session.
Definition: ses.c:4423
ses_is_gnmi_control_session
boolean ses_is_gnmi_control_session(ses_cb_t *scb)
Check if the specified session is a gNMI control session.
Definition: ses.c:4723
ses_cb_t_::rawxml_mode
boolean rawxml_mode
T: expand_anyxml, F: normal.
Definition: ses.h:576
ses_cb_t_::active
boolean active
<hello> completed ok
Definition: ses.h:569
SES_ST_HELLO_WAIT
@ SES_ST_HELLO_WAIT
waiting for peer <hello>
Definition: ses.h:355
ses_msg_buff_t_::islast
boolean islast
T: last buff in msg.
Definition: ses.h:475
ncx.h
YANG module utility functions.
ses_cb_t_::rollback_sid
ses_id_t rollback_sid
session ID for rollback
Definition: ses.h:553
ses_total_stats_t_::active_sessions
uint32 active_sessions
total active sessions
Definition: ses.h:444
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
NCX_PROTO_NONE
@ NCX_PROTO_NONE
not set
Definition: ncxtypes.h:782
ses_get_transport_enum
ses_transport_t ses_get_transport_enum(const xmlChar *str)
Get the enum value for the yumaworks-types:transport-type.
Definition: ses.c:3702
ses_msg_t_::ready
boolean ready
ready for parsing
Definition: ses.h:506
SES_TR_TIMEOUT
@ SES_TR_TIMEOUT
inactivity timeout
Definition: ses.h:392
ses_getline_cb
status_t ses_getline_cb(xmlChar *fillbuff, uint32 fillbuffsize, void *cookie)
The IO input front-end for the tk_parse_json_buffs function.
Definition: ses.c:4215
TSTAMP_MIN_SIZE
#define TSTAMP_MIN_SIZE
normal minimum buffer size for a tstamp buffer
Definition: tstamp.h:67
ERR_NCX_DEF_LOOP
@ ERR_NCX_DEF_LOOP
325
Definition: status_enum.h:368
ses_start_msg
status_t ses_start_msg(ses_cb_t *scb)
Start a new outbound message on the specified session.
Definition: ses.c:2970
ses_cb_t_::get_cookie
void * get_cookie
this pointer available to pass a cookie to a GET1 callback will not be freed when the scb is deleted
Definition: ses.h:691
SES_MY_SID
#define SES_MY_SID(S)
get session-id
Definition: ses.h:105
SES_INST_INBETWEEN
@ SES_INST_INBETWEEN
in between 2 messages
Definition: ses.h:371
ERR_NCX_IN_USE
@ ERR_NCX_IN_USE
match netconf errors (257 - 275)
Definition: status_enum.h:298
ses_set_out_encoding
void ses_set_out_encoding(ses_cb_t *scb, ncx_display_mode_t encoding)
Set the output encoding.
Definition: ses.c:4084
ses_msg_finish_outmsg
void ses_msg_finish_outmsg(ses_cb_t *scb)
Put the outbuff in the outQ if non-empty.
Definition: ses_msg.c:907
ses_cb_t_::remote_wait
boolean remote_wait
if there is a remote operation in progress then this flag will be set so new input can be held off on...
Definition: ses.h:697
ses_read_fn_t
ssize_t(* ses_read_fn_t)(void *s, char *buff, size_t bufflen, boolean *erragain)
optional read function for the session
Definition: ses.h:526
ses_cb_t_::notif_active
boolean notif_active
subscription active
Definition: ses.h:570
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
ses_start_checksum
void ses_start_checksum(ses_cb_t *scb)
Clear the checksum field and start checksum mode.
Definition: ses.c:4939
ses_cb_t_::linesize
uint32 linesize
TERM line length.
Definition: ses.h:647
ses_msg_buff_t_::buffpos
size_t buffpos
buff cur position
Definition: ses.h:474
ses_total_stats_t_::droppedSessions
uint32 droppedSessions
total dropped sessions
Definition: ses.h:459
ses_get_msg_encoding
ncx_msg_encoding_t ses_get_msg_encoding(const ses_cb_t *scb)
Get the message encoding for the HTTP session.
Definition: ses.c:4585
ncx_file_close
void ncx_file_close(FILE *fp)
Close a file; check result.
Definition: ncx.c:13235
dlq_enque
void dlq_enque(REG void *newP, REG dlq_hdrT *listP)
add a queue node to the end of a queue list Add newP to listP
Definition: dlq.c:246
SES_TRANSPORT_HTTP
@ SES_TRANSPORT_HTTP
YumaPro REST API ncxconnect, no framing.
Definition: ses.h:339
ncx_convert_num
status_t ncx_convert_num(const xmlChar *numstr, ncx_numfmt_t numfmt, ncx_btype_t btyp, ncx_num_t *val)
Convert a number string to a numeric type.
Definition: ncx_num.c:717
SES_TRANSPORT_SNMP
@ SES_TRANSPORT_SNMP
SNMP UDP socket.
Definition: ses.h:345
ses_cb_t_::use_traceid
boolean use_traceid
TRUE if OK to use Trace ID attr in the RPC calls.
Definition: ses.h:670
ses_ready_t_::ycontrol
boolean ycontrol
flag YControl session for priority processing
Definition: ses.h:499
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_stats_t_::out_line
uint32 out_line
hack: bytes since ' ', pretty-print
Definition: ses.h:422
SES_ST_INIT
@ SES_ST_INIT
initialization state
Definition: ses.h:354
ses_cb_t_::restconf_notif
boolean restconf_notif
REST SSE notifications in progress.
Definition: ses.h:586
ses_clear_extern_xml_mode_ex
void ses_clear_extern_xml_mode_ex(ses_cb_t *scb, boolean rawxml_mode, boolean keep_xmlns)
Clear the scb from external XML parsing.
Definition: ses.c:4058
ses_putstr
void ses_putstr(ses_cb_t *scb, const xmlChar *str)
Write a zero-terminated string to the session.
Definition: ses.c:2460
ses_cb_t_::openssl_ctx
void * openssl_ctx
backptr to TLS context
Definition: ses.h:685
ERR_FIL_OPEN
@ ERR_FIL_OPEN
system errors start at 100
Definition: status_enum.h:212
ses_accept_input
status_t ses_accept_input(ses_cb_t *scb)
The IO input handler for the ncxserver loop.
Definition: ses.c:3215
ses_set_indent
void ses_set_indent(ses_cb_t *scb, int32 indent)
Set the logging indent count for this session.
Definition: ses.c:2840
ses_put_extern
void ses_put_extern(ses_cb_t *scb, const xmlChar *fname)
write the contents of a file to the session
Definition: ses.c:3504
ses_cb_t_::keep_xmlns
boolean keep_xmlns
T: parse extern, F: msg
Definition: ses.h:574
ses_notifications_active
boolean ses_notifications_active(const ses_cb_t *scb)
Check if the session has notifications active.
Definition: ses.c:4784
ses_msg_t_::curchunksize
size_t curchunksize
cur chunk rcvd
Definition: ses.h:511
val_free_value
void val_free_value(val_value_t *val)
Scrub the memory in a val_value_t by freeing all the sub-fields and then freeing the entire struct it...
Definition: val.c:2842
NCX_PROTO_NETCONF10
@ NCX_PROTO_NETCONF10
RFC 4741 base:1.0
Definition: ncxtypes.h:783
ses_cb_t_::json_attrs
boolean json_attrs
T: use JSON attributes.
Definition: ses.h:591
SES_CURMSG
#define SES_CURMSG(S)
get the session current message
Definition: ses.h:204
SES_PRST_WAITING
@ SES_PRST_WAITING
waiting
Definition: ses.h:402
status.h
Global error messages for status code enumerations.
yangapi.h
YANG-API definitions (pre-RESTCONF)
SES_TYP_NONE
@ SES_TYP_NONE
not set
Definition: ses.h:319
ses_msg_t_::curbuff
ses_msg_buff_t * curbuff
cur position in buffQ
Definition: ses.h:508
NCX_DISPLAY_MODE_XML
@ NCX_DISPLAY_MODE_XML
XML display mode.
Definition: ncxtypes.h:460
log_debug3_append
void void void void void void void void void void void void log_debug3_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG3 log entry.
ses_cb_t_::conn_closed
boolean conn_closed
T: scb IO closed last buffer.
Definition: ses.h:568
SES_TRANSPORT_NETCONF_TLS
@ SES_TRANSPORT_NETCONF_TLS
NETCONF over TLS.
Definition: ses.h:346
SES_PRST_DONE
@ SES_PRST_DONE
done
Definition: ses.h:403
dlq.h
dlq provides general double-linked list and queue support:
SES_ST_XRD_WAIT
@ SES_ST_XRD_WAIT
RESTCONF Entry point processing.
Definition: ses.h:356
SES_TRANSPORT_TLS
@ SES_TRANSPORT_TLS
YANGAPI/RESTCONF over TLS.
Definition: ses.h:336
SES_ST_IN_MSG
@ SES_ST_IN_MSG
processing a request
Definition: ses.h:359
ncx_new_backptr
ncx_backptr_t * ncx_new_backptr(void *node)
Malloc and initialize a new ncx_backptr_t struct.
Definition: ncx.c:11412
ses_msg_t_::prolog_state
ses_prolog_state_t prolog_state
for insert prolog
Definition: ses.h:510
SES_INST_IDLE
@ SES_INST_IDLE
idle state
Definition: ses.h:368
ses_dropped_ex
boolean ses_dropped_ex(ses_cb_t *scb)
Check if the session has been dropped by the client.
Definition: ses.c:5005
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297
ses_cb_t_::buffcnt
uint32 buffcnt
current buffer count
Definition: ses.h:619
ses_msg_new_output_buff
status_t ses_msg_new_output_buff(ses_cb_t *scb, boolean start_chunk_mode)
Put the current outbuff on the outQ.
Definition: ses_msg.c:771
ses_ready_t_::sid
ses_id_t sid
session ID of this session
Definition: ses.h:493
SES_MODE_NONE
@ SES_MODE_NONE
not set
Definition: ses.h:378
obj_template_t_
One YANG data-def-stmt.
Definition: obj.h:1056
SES_MSG_BUFFSIZE
#define SES_MSG_BUFFSIZE
controls the size of each buffer chunk
Definition: ses.h:232
NCX_DEF_INDENT
#define NCX_DEF_INDENT
default indent amount for nesting XML or other structured output
Definition: ncxconst.h:441