yumapro  25.10-1
YumaPro SDK
Loading...
Searching...
No Matches
ses.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3 * Copyright (c) 2012 - 2024, 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
32date init comment
33----------------------------------------------------------------------
3430-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/* Used for UDP-Notif to store */
47#include <sys/socket.h>
48//#include <netinet/in.h>
49//#include <arpa/inet.h>
50
51#ifndef _H_dlq
52#include "dlq.h"
53#endif
54
55#ifndef _H_ncxtypes
56#include "ncxtypes.h"
57#endif
58
59#ifndef _H_status
60#include "status.h"
61#endif
62
63#ifndef _H_tstamp
64#include "tstamp.h"
65#endif
66
67#if defined(WITH_SNMP) && defined(WITH_RESTCONF)
68#include <net-snmp/net-snmp-config.h>
69
70#ifndef UCLINUX
71#include <net-snmp/net-snmp-features.h>
72#endif
73
74#include <net-snmp/net-snmp-includes.h>
75#endif
76
77#ifdef __cplusplus
78extern "C" {
79#endif
80
81/********************************************************************
82* *
83* C O N S T A N T S *
84* *
85*********************************************************************/
86
98/* this buffer length used in recvfrom to allow for
99 * maximum IPv6 address length
100 */
101#define SES_SOCKADDR_BUFFLEN 128
102
103/* this buffer length used in udpnot for displayable
104 * IP address length
105 * maximum IPv6 address length should be 46
106 */
107#define SES_PRINTADDR_BUFFLEN 50
108
120#define SES_MY_SID(S) ((S)->sid)
121
123#define SES_MY_FD(S) ((S)->fd)
124
126#define SES_MY_USERNAME(S) ((S)->username)
127
129#define SES_KILLREQ_SET(S) ((S)->state >= SES_ST_SHUTDOWN_REQ)
130
132#define SES_ACK_KILLREQ(S) ((S)->state = SES_ST_SHUTDOWN)
133
135#define SES_OUT_BYTES(S) (S)->stats.out_bytes
136
138#define SES_LINELEN(S) (S)->stats.out_line
139
141#define SES_LINESIZE(S) (S)->linesize
142
144#define SES_BUFFSIZE(S) (S)->session_buffsize
145
147#define SES_IN_ENCODING(S) (S)->in_encoding
148
150#define SES_OUT_ENCODING(S) (S)->out_encoding
151
153#define SES_IS_DUMMY(S) ((S)->sid == 0)
154
156#define SES_IS_YCONTROL(S) ((S)->ycontrol)
157
159#define SES_CONN_CLOSED(S) (S)->conn_closed
160
162#define SES_SET_CUR_RPC_MSG(S,MSG) (S)->cur_rpc_msg = MSG
163
165#define SES_GET_CUR_RPC_MSG(S) (S)->cur_rpc_msg
166
168#define SES_GET_JSON_1LINE(S) (S)->json_1line
169
171#define SES_USE_JSON_ATTRS(S) (S)->json_attrs
172
174#define SES_SET_JSON_ATTRS(S) (S)->json_attrs = TRUE
175
177#define SES_SET_LEAFLIST_PTR(S,V) (S)->leaflist = V
178
180#define SES_GET_LEAFLIST_PTR(S) (S)->leaflist
181
183#define SES_SET_LEAFLIST_ATTRS(S,A) (S)->any_leaflist_attrs = A
184
186#define SES_GET_LEAFLIST_ATTRS(S) (S)->any_leaflist_attrs
187
189#define SES_KEEP_XMLNS(S) (S)->keep_xmlns
190
192#define SES_RAWXML_MODE(S) (S)->rawxml_mode
193
195#define SES_STATE(S) (S)->state
196
198#define SES_PEERADDR(S) (S)->peeraddr
199
201#define SES_PEERPORT(S) (S)->peerport
202
204#define SES_TRANSPORT(S) (S)->transport
205
207#define SES_PROTOCOL(S) (S)->protocol
208
210#define SES_IS_IPV6(S) (S)->is_ipv6
211
213#define SES_IS_CALLHOME(S) (S)->is_callhome
214
216#define SES_TYPE(S) (S)->type
217
219#define SES_GET_COOKIE(S) (S)->get_cookie
220
222#define SES_BREADCRUMBQ(S) &(S)->breadcrumbQ
223
225#define SES_CURMSG(S) (S)->curmsg
226
228#define SES_START_TLS(S) (S)->start_tls
229
231#define SES_WILDCARD_OK(S) (S)->wildcard_ok
232
234#define SES_MGRCB(S) (S)->mgrcb
235
237#define SES_NOTIF_ACTIVE(S) (S)->notif_active
238
240#define SES_RFC8639_NOTIF_COUNT(S) (S)->rfc8639_notif_cnt
241
242
246#define SES_BINARY_NOTIFS(S) (S)->binary_notifs
247
251#define BINLOG (const xmlChar *)"***binary***"
252
254#define SES_RDFN(S) (S)->rdfn
255
257#define SES_WRFN(S) (S)->wrfn
258
259
261#define SES_SENDHOOK_FN(S) (S)->sendhook_fn
262
263
269#define SES_LAST_OUTBUFF(S) (S)->last_outbuff
270
271
275#define SES_SKIP_OUTMSG(S) (S)->skip_outmsg
276
281#define SES_CALLHOME_NAME(S) (S)->callhome_name
282
283
289#define SES_FREE_PENDING(S) (S)->free_pending
290
291
296#define SES_RCVR_CB(S) (S)->rcvr_cb
297
298
302#define SES_CUR_DSCP(S) (S)->cur_dscp
303
304
306#define SES_NULL_SID 0
307
324#define SES_MSG_BUFFSIZE 9000
325
330#define SES_MAX_BUFFERS 500000
331
333#ifdef WITH_COAP
334#define SES_MAX_FREE_BUFFERS 4
335#else
336#define SES_MAX_FREE_BUFFERS 32
337#endif // WITH_COAP
338
340#define SES_MAX_BUFFSEND 32
341
343#define SES_MAX_BYTESEND 0xffff
344
346#define SES_DEF_LINESIZE 72
347
349#define SES_MAX_STARTCHUNK_SIZE 13
350
352#define SES_MAX_CHUNKNUM_SIZE 10
353
365#define SES_STARTCHUNK_PAD 10
366
370#define SES_ENDCHUNK_PAD 8
371
376#define SES_READBUFF_SIZE SES_MSG_BUFFSIZE
377
382#define SES_UDPNOTIF_READBUFF_SIZE 65532
383
385#define SES_GET_YPMODE(S) (S)->yp_mode
386
388#define SES_SET_YPMODE(S,V) (S)->yp_mode = V
389
391#define SES_REMOTE_WAIT(S) (S)->remote_wait
392
394#define SES_NEED_FILE_OVERRIDE(S) ((S)->file_override && (S)->fp)
395
397#define SES_SYSTEM_USERNAME NCX_EL_SYSTEM
398
399
400/********************************************************************
401* *
402* T Y P E S *
403* *
404*********************************************************************/
405
407typedef uint32 ses_id_t;
408
410typedef enum ses_ypmode_t_ {
416
417
419typedef enum ses_type_t_ {
429
430
432typedef enum ses_transport_t_ {
446 SES_TRANSPORT_COAP_DTLS, /* CoAP DTLS/UDP socket */
452
453
455typedef enum ses_state_t_ {
466
467
469typedef enum ses_instate_t_ {
477
478
480typedef enum ses_mode_t_ {
487} ses_mode_t;
488
489
491typedef enum ses_term_reason_t_ {
501
502
504typedef enum ses_prolog_state_t_ {
509
510
518typedef struct ses_stats_t_ {
520 uint32 in_bytes;
521
523 uint32 out_bytes;
524
526 uint32 out_line;
527
529 uint32 inRpcs;
530
532 uint32 inBadRpcs;
533
536
539
542
544 uint32 requests;
546
547
549typedef struct ses_total_stats_t_ {
552
555
558
561
564
567
570
572 xmlChar startTime[TSTAMP_MIN_SIZE];
574
575
577typedef struct ses_msg_buff_t_ {
578 dlq_hdr_t qhdr;
579 size_t buffstart;
580 size_t bufflen;
581 size_t buffpos;
582 boolean islast;
583 boolean isbinary;
589 uint32 segment;
590
600 xmlChar buff[SES_MSG_BUFFSIZE+1];
602
603
607typedef struct ses_ready_t_ {
609 dlq_hdr_t hdr;
610
613
615 boolean inq;
616
618 boolean ycontrol;
620
621
623typedef struct ses_msg_t_ {
624 dlq_hdr_t qhdr;
625 boolean ready;
626 boolean dispatched;
628 dlq_hdr_t buffQ;
635
638
641
642} ses_msg_t;
643
644
655typedef ssize_t (*ses_read_fn_t) (void *s,
656 char *buff,
657 size_t bufflen,
658 bool *erragain);
659
660
667typedef status_t (*ses_write_fn_t) (void *s);
668
669
687typedef status_t (*ses_sendhook_fn_t) (void *s,
688 boolean start);
689
690
691
702typedef status_t (*ses_setup_fn_t) (void *s,
703 void *cookie);
704
705
706
711typedef struct ses_udpnotif_cb_t_ {
712
715
729 xmlChar curmsg_addr[SES_SOCKADDR_BUFFLEN];
730
737 dlq_hdr_t pubcbQ; // Q of udpnotif::pubcb_t
738
746
748 void *cookie;
749
753 const xmlChar *curmsg_print_addr;
754
756
757
759typedef struct ses_cb_t_ {
760 dlq_hdr_t qhdr;
772 time_t hello_time;
774 xmlChar *start_time;
775 xmlChar *username;
776 xmlChar *peeraddr;
777 uint16 peerport;
780 xmlChar *subsys_id;
782 int tid;
783 void *tcb;
786 boolean conn_closed;
787 boolean active;
788 boolean notif_active;
790 boolean noxmlns;
791 boolean framing11;
792 boolean keep_xmlns;
793 boolean warn_xml;
794 boolean rawxml_mode;
795 boolean direct_mode;
796 boolean msg_mode;
797 boolean ycontrol;
798 boolean dbapi;
799 boolean dbapi_system;
800 boolean sse_mode;
801 boolean ypgnmi;
806 boolean json_1line;
808 boolean http_waitrn;
809 boolean json_attrs;
812 boolean is_ipv6;
813 boolean is_callhome;
814 boolean dropped;
815 boolean free_pending;
816 boolean start_tls;
818 uint32 last_ch;
819 struct val_value_t_ *leaflist;
825
832
833 xmlTextReaderPtr reader;
834 FILE *fp;
835 int fd;
843
844 uint32 inendpos;
846 uint32 buffcnt;
847 uint32 freecnt;
848 dlq_hdr_t msgQ;
849 dlq_hdr_t freeQ;
850 dlq_hdr_t outQ;
855 void *mgrcb;
856 struct rpc_msg_t_ *cur_rpc_msg;
858 struct yangapi_cb_t_ *rcb;
859 xmlChar *entry_point;
865 xmlChar startchunk[SES_MAX_STARTCHUNK_SIZE+1];
866
868 xmlChar *readbuff;
871 /*** user preferences ***/
872 int8 indent;
874 uint32 linesize;
885 struct agt_acm_cache_t_ *acm_cache;
886
888 xmlChar *service_name;
893 boolean chunk_based;
897 boolean use_traceid;
898
905
911
919
924 boolean remote_wait;
925
930 dlq_hdr_t breadcrumbQ;
934
939 boolean wildcard_ok;
940
946
948 struct cfg_template_t_ *fake_candidate;
949
952
954 uint32 checksum;
967
969 struct obj_template_t_ *snmp_table_obj;
970
971 boolean ypgrpc;
979
984
991
999
1009
1015
1022
1027 void *rcvr_cb;
1028
1033
1034} ses_cb_t;
1035
1036
1040/********************************************************************
1041* *
1042* F U N C T I O N S *
1043* *
1044*********************************************************************/
1045
1062extern ses_cb_t *
1063 ses_new_scb (void);
1064
1065
1073extern ses_cb_t *
1074 ses_new_udpnotif_scb (void);
1075
1076
1082extern ses_cb_t *
1083 ses_new_dummy_scb (void);
1084
1085
1086#ifdef WITH_COAP
1092extern ses_cb_t *
1093 ses_new_coap_scb (void);
1094
1095
1101extern void
1103
1104#endif // WITH_COAP
1105
1106
1107#if defined(WITH_SNMP) && defined(WITH_RESTCONF)
1113extern ses_cb_t *
1114 ses_new_snmp_scb (void);
1115
1116#endif // WITH_SNMP
1117
1118
1124extern void
1125 ses_free_scb (ses_cb_t *scb);
1126
1127
1141extern void
1142 ses_putchar (ses_cb_t *scb,
1143 uint32 ch);
1144
1145
1159extern void
1161 uint32 ch);
1162
1163
1170extern void
1171 ses_putstr (ses_cb_t *scb,
1172 const xmlChar *str);
1173
1174
1182extern void
1184 const xmlChar *str,
1185 uint32 len);
1186
1187
1201extern void
1203 const xmlChar *str,
1204 int32 indent);
1205
1206
1217extern void
1218 ses_putcstr (ses_cb_t *scb,
1219 const xmlChar *str,
1220 int32 indent);
1221
1222
1232extern void
1233 ses_puthstr (ses_cb_t *scb,
1234 const xmlChar *str);
1235
1236
1243extern void
1244 ses_putcchar (ses_cb_t *scb,
1245 uint32 ch);
1246
1247
1258extern void
1259 ses_putastr (ses_cb_t *scb,
1260 const xmlChar *str,
1261 int32 indent);
1262
1263
1274extern void
1275 ses_putjstr (ses_cb_t *scb,
1276 const xmlChar *str,
1277 int32 indent);
1278
1279
1290extern void
1291 ses_indent (ses_cb_t *scb,
1292 int32 indent);
1293
1294
1301extern int32
1302 ses_indent_count (const ses_cb_t *scb);
1303
1304
1311extern int32
1313
1314
1321extern void
1323 int32 indent);
1324
1325
1332extern void
1333 ses_set_message_indent (ses_cb_t *scb, int32 indent);
1334
1335
1342extern void
1343 ses_set_mode (ses_cb_t *scb,
1344 ses_mode_t mode);
1345
1346
1353extern ses_mode_t
1354 ses_get_mode (ses_cb_t *scb);
1355
1356
1362extern void ses_start_msg_mode (ses_cb_t *scb);
1363
1364
1370extern void ses_stop_msg_mode (ses_cb_t *scb);
1371
1372
1379extern status_t
1380 ses_start_msg (ses_cb_t *scb);
1381
1382
1388extern void
1389 ses_finish_msg (ses_cb_t *scb);
1390
1391
1412extern int
1413 ses_read_cb (void *context,
1414 char *buffer,
1415 int len);
1416
1417
1432extern status_t
1434
1435
1442extern const xmlChar *
1444
1445
1452extern ncx_withdefaults_t
1453 ses_withdef (const ses_cb_t *scb);
1454
1455
1463extern uint32
1464 ses_line_left (const ses_cb_t *scb);
1465
1466
1476extern void
1478 const xmlChar *fname);
1479
1480
1488extern status_t
1490 const xmlChar *fname);
1491
1492
1500extern status_t
1502 const xmlChar *fname);
1503
1504
1505
1511extern ses_total_stats_t *
1512 ses_get_total_stats (void);
1513
1514
1523extern ses_transport_t
1525
1526
1533extern ses_transport_t
1534 ses_get_transport_enum (const xmlChar *str);
1535
1536
1543extern const xmlChar *
1545
1546
1555extern const xmlChar *
1557
1558
1564extern void
1566
1567
1576extern boolean
1577 ses_get_xml_nons (const ses_cb_t *scb);
1578
1579
1587extern status_t
1589 ncx_protocol_t proto);
1590
1591
1599extern ncx_protocol_t
1600 ses_get_protocol (const ses_cb_t *scb);
1601
1602
1609extern void
1611 ncx_protocol_t proto);
1612
1613
1621extern boolean
1623 ncx_protocol_t proto);
1624
1625
1636extern void
1638 boolean rawxml_mode);
1639
1640
1652extern void
1654 boolean rawxml_mode,
1655 boolean keep_xmlns);
1656
1657
1669extern void
1671 boolean rawxml_mode);
1672
1673
1685extern void
1687 boolean rawxml_mode,
1688 boolean keep_xmlns);
1689
1690
1697extern void
1699 ncx_display_mode_t encoding);
1700
1701
1708extern void
1710
1711
1718extern ncx_display_mode_t
1720
1721
1730extern int32
1731 ses_new_indent_count (boolean indent_in,
1732 int32 indent,
1733 int32 indent_amount);
1734
1735
1743extern void
1745
1746
1760extern status_t
1761 ses_getline_cb (xmlChar *fillbuff,
1762 uint32 fillbuffsize,
1763 void *cookie);
1764
1765
1772extern status_t
1774
1775
1782extern boolean
1784
1785
1791extern void
1793
1794
1801extern boolean
1803
1804
1811extern void
1813
1814
1822extern boolean
1824
1825
1831extern void
1833
1834
1841extern boolean
1843
1844
1852extern int32
1854 int32 indent);
1855
1856
1864extern int32
1866 int32 indent);
1867
1868
1875extern ncx_msg_encoding_t
1876 ses_get_msg_encoding (const ses_cb_t *scb);
1877
1878
1885extern status_t
1887
1888
1895extern const xmlChar *
1897
1898
1906extern status_t
1908 const xmlChar *point);
1909
1910
1917extern boolean
1919
1920
1921#ifdef WITH_GNMI
1928extern status_t
1930
1931
1938extern boolean
1940
1941
1947extern void
1949
1950
1957extern boolean
1959
1960#endif //WITH_GNMI
1961
1962
1970extern status_t
1972 struct obj_template_t_ *obj);
1973
1974
1980extern void
1982
1983
1990extern boolean
1991 ses_dropped (const ses_cb_t *scb);
1992
1993
2002extern status_t
2004 const xmlChar *filespec,
2005 boolean is_binary);
2006
2007
2014extern void
2016
2017
2023extern void
2025
2026
2038extern uint32
2040 uint32 *checksum_cnt);
2041
2042
2052extern boolean
2053 ses_dropped_ex (ses_cb_t *scb);
2054
2055
2056#ifdef WITH_GRPC
2063extern status_t
2065
2066
2073extern boolean
2075
2076
2082extern void
2084
2085
2092extern boolean
2094
2095#endif //WITH_GRPC
2096
2097
2104extern void
2105 ses_dump_binary_buff (const xmlChar *buff,
2106 size_t bufflen);
2107
2115extern boolean
2116 ses_poll_ready (ses_cb_t *scb);
2117
2118
2125extern const xmlChar *
2127
2128
2135extern const xmlChar *
2137
2138
2145extern size_t
2146 ses_get_outbuff_len (const ses_cb_t *scb);
2147
2154extern xmlChar *
2156
2157
2168extern status_t
2170 ses_setup_fn_t fn,
2171 void *cookie);
2172
2173
2174
2178#ifdef __cplusplus
2179} /* end extern 'C' */
2180#endif
2181
2182#endif /* _H_ses */
dlq provides general double-linked list and queue support:
status_t
global error return code
Definition: status_enum.h:219
const xmlChar * ses_get_scb_client_addr(ses_cb_t *scb)
Get the client addr to use from an SCB.
Definition: ses.c:6023
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:3198
void ses_set_out_encoding(ses_cb_t *scb, ncx_display_mode_t encoding)
Set the output encoding.
Definition: ses.c:4759
void ses_free_scb(ses_cb_t *scb)
Free a session control block.
Definition: ses.c:2629
int32 ses_indent_count(const ses_cb_t *scb)
Get the logging indent count for this session.
Definition: ses.c:3299
void ses_start_checksum(ses_cb_t *scb)
Clear the checksum field and start checksum mode.
Definition: ses.c:5681
void ses_start_msg_mode(ses_cb_t *scb)
Set the message output mode to active.
Definition: ses.c:3439
boolean ses_protocol_requested(ses_cb_t *scb, ncx_protocol_t proto)
check if the NETCONF protocol version was requested
Definition: ses.c:4584
void ses_set_grpc_session(ses_cb_t *scb)
Set the specified session as a gRPC session.
Definition: ses.c:5849
void ses_set_gnmi_session(ses_cb_t *scb)
Set the specified session as a gNMI session.
Definition: ses.c:5470
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:4096
void ses_set_mode(ses_cb_t *scb, ses_mode_t mode)
Set the output mode for the specified session.
Definition: ses.c:3395
void ses_put_extern(ses_cb_t *scb, const xmlChar *fname)
write the contents of a file to the session
Definition: ses.c:4118
boolean ses_is_control_session(ses_cb_t *scb)
Check if the specified session is a control session.
Definition: ses.c:5071
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:4671
boolean ses_is_dbapi_session(ses_cb_t *scb)
Check if the specified session is a DB-API control session.
Definition: ses.c:5114
void ses_finish_msg(ses_cb_t *scb)
Finish an outbound message on the specified session.
Definition: ses.c:3550
void ses_put_binstr(ses_cb_t *scb, const xmlChar *str, uint32 len)
Write a binary string to the session.
Definition: ses.c:2950
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:3064
void ses_clear_extern_xml_mode(ses_cb_t *scb, boolean rawxml_mode)
Clear the scb from external XML parsing.
Definition: ses.c:4706
ncx_withdefaults_t ses_withdef(const ses_cb_t *scb)
Get the with-defaults value for this session.
Definition: ses.c:4072
ncx_display_mode_t ses_get_out_encoding(ses_cb_t *scb)
Get the output encoding.
Definition: ses.c:4807
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:2984
status_t ses_start_msg(ses_cb_t *scb)
Start a new outbound message on the specified session.
Definition: ses.c:3481
status_t ses_set_protocol(ses_cb_t *scb, ncx_protocol_t proto)
set the NETCONF protocol version in use
Definition: ses.c:4439
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:4864
void ses_clear_dbapi_system_session(ses_cb_t *scb)
Clear a session of the DB-API system status.
Definition: ses.c:5198
const xmlChar * ses_state_name(ses_state_t state)
Get the name of a session state from the enum value.
Definition: ses.c:4030
const xmlChar * ses_get_entry_point(ses_cb_t *scb)
Get the RESTCONF entry_point.
Definition: ses.c:5359
status_t ses_set_file_override(ses_cb_t *scb, const xmlChar *filespec, boolean is_binary)
Setup the session in file write override mode.
Definition: ses.c:5619
ncx_protocol_t ses_get_protocol(const ses_cb_t *scb)
Get the NETCONF protocol set (or unset) for this session.
Definition: ses.c:4515
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:4832
ses_cb_t * ses_new_snmp_scb(void)
Create a new global SNMP session control block.
Definition: ses.c:2593
int32 ses_message_indent_count(const ses_cb_t *scb)
Get the message indent count for this session.
Definition: ses.c:3320
xmlChar * ses_get_outbuff(ses_cb_t *scb)
Get the session outbuffer character array.
Definition: ses.c:6069
const xmlChar * ses_get_scb_username(ses_cb_t *scb)
Get the username to use from an SCB.
Definition: ses.c:6000
status_t ses_set_gnmi_control_session(ses_cb_t *scb)
Set the specified session as a gNMI control session.
Definition: ses.c:5421
ses_transport_t ses_get_transport_enum(const xmlChar *str)
Get the enum value for the yumaworks-types:transport-type.
Definition: ses.c:4358
void ses_stop_msg_mode(ses_cb_t *scb)
Set the message output mode to inactive.
Definition: ses.c:3459
void ses_putstr(ses_cb_t *scb, const xmlChar *str)
Write a zero-terminated string to the session.
Definition: ses.c:2927
status_t ses_put_extern_bin(ses_cb_t *scb, const xmlChar *fname)
write the contents of a binary file to the session
Definition: ses.c:4177
void ses_indent(ses_cb_t *scb, int32 indent)
Write the proper newline + indentation to the specified session.
Definition: ses.c:3266
status_t ses_set_entry_point(ses_cb_t *scb, const xmlChar *point)
Set the RESTCONF entry_point.
Definition: ses.c:5387
boolean ses_notifications_active(const ses_cb_t *scb)
Check if the session has notifications active.
Definition: ses.c:5514
ses_total_stats_t * ses_get_total_stats(void)
Get a r/w pointer to the the session totals stats.
Definition: ses.c:4214
void ses_init_coap_scb(ses_cb_t *scb)
Initialize a CoAP session control block.
Definition: ses.c:2555
void ses_set_indent(ses_cb_t *scb, int32 indent)
Set the logging indent count for this session.
Definition: ses.c:3338
const xmlChar * ses_get_transport_name(ses_transport_t transport)
Get the name of the transport for a given enum value.
Definition: ses.c:4252
boolean ses_poll_ready(ses_cb_t *scb)
Check if the specified session is ready to read bytes.
Definition: ses.c:5950
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:5157
boolean ses_is_grpc_control_session(ses_cb_t *scb)
Check if the specified session is a gRPC control session.
Definition: ses.c:5824
size_t ses_get_outbuff_len(const ses_cb_t *scb)
Get the current outbuffer length for the session.
Definition: ses.c:6045
void ses_clean_breadcrumbQ(ses_cb_t *scb)
Clean the breadcrumbQ.
Definition: ses.c:5575
status_t ses_accept_input(ses_cb_t *scb)
The IO input handler for the ncxserver loop.
Definition: ses.c:3772
boolean ses_dropped(const ses_cb_t *scb)
Check if the session has been dropped by the client.
Definition: ses.c:5597
status_t ses_set_control_session(ses_cb_t *scb)
Set the specified session as a control session.
Definition: ses.c:5049
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:3020
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:3144
ses_cb_t * ses_new_udpnotif_scb(void)
Create a new session control block for UDP-Notif Collector.
Definition: ses.c:2477
ses_cb_t * ses_new_coap_scb(void)
Create a new global CoAP session control block.
Definition: ses.c:2534
status_t ses_add_breadcrumb_obj(ses_cb_t *scb, struct obj_template_t_ *obj)
Add an object to the breadcrumbQ.
void ses_putchar(ses_cb_t *scb, uint32 ch)
Write one char to the session, without any translation.
Definition: ses.c:2874
boolean ses_get_xml_nons(const ses_cb_t *scb)
force xmlns attributes to be skipped in XML mode
Definition: ses.c:4420
void ses_set_protocols_requested(ses_cb_t *scb, ncx_protocol_t proto)
set the NETCONF protocol versions requested
Definition: ses.c:4538
void ses_set_message_indent(ses_cb_t *scb, int32 indent)
Set the message indent count for this session.
Definition: ses.c:3367
void ses_putcchar(ses_cb_t *scb, uint32 ch)
Write one content char to the session, with translation as needed.
Definition: ses.c:3102
status_t ses_start_http_chunk_mode(ses_cb_t *scb)
Start outputting buffers in HTTP 1.1 chunk mode.
Definition: ses.c:5320
ncx_msg_encoding_t ses_get_msg_encoding(const ses_cb_t *scb)
Get the message encoding for the HTTP session.
Definition: ses.c:5298
int32 ses_add_indent(ses_cb_t *scb, int32 indent)
Add in the new indent amount.
Definition: ses.c:5222
ses_transport_t ses_get_transport(ses_cb_t *scb)
Get the transport enum for a given session.
Definition: ses.c:4232
int ses_read_cb(void *context, char *buffer, int len)
The IO input front-end for the xmlTextReader parser read fn.
Definition: ses.c:3645
void ses_set_xml_nons(ses_cb_t *scb)
force xmlns attributes to be skipped in XML mode
Definition: ses.c:4400
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:4730
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:4781
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:5179
int32 ses_dec_indent(ses_cb_t *scb, int32 indent)
Remove the specified indent amount.
Definition: ses.c:5259
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:4899
void ses_set_dbapi_session(ses_cb_t *scb)
Set the specified session as a DB-API control session.
Definition: ses.c:5092
boolean ses_is_gnmi_control_session(ses_cb_t *scb)
Check if the specified session is a gNMI control session.
Definition: ses.c:5445
ses_cb_t * ses_new_dummy_scb(void)
Create a new dummy session control block.
Definition: ses.c:2502
uint32 ses_finish_checksum(ses_cb_t *scb, uint32 *checksum_cnt)
Stop checksum mode and return the final checksum.
Definition: ses.c:5711
boolean ses_is_grpc_session(ses_cb_t *scb)
Check if the specified session is a gRPC session.
Definition: ses.c:5871
boolean ses_is_system_session(ses_cb_t *scb)
Check if the specified session is an internal system session.
Definition: ses.c:5135
void ses_set_extern_xml_mode(ses_cb_t *scb, boolean rawxml_mode)
Setup the scb for external XML parsing.
Definition: ses.c:4648
boolean ses_dropped_ex(ses_cb_t *scb)
Check if the session has been dropped by the client.
Definition: ses.c:5751
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:4312
status_t ses_set_grpc_control_session(ses_cb_t *scb)
Set the specified session as a gRPC control session.
Definition: ses.c:5800
status_t ses_put_extern2(ses_cb_t *scb, const xmlChar *fname)
write the contents of a file to the session
Definition: ses.c:4141
void ses_dump_binary_buff(const xmlChar *buff, size_t bufflen)
Dump some bytes from the binary buffer (max 256)
Definition: ses.c:5895
status_t ses_set_setup_cb(ses_cb_t *scb, ses_setup_fn_t fn, void *cookie)
Set the setup handler callback for UDP-Notif.
Definition: ses.c:6092
ses_cb_t * ses_new_scb(void)
Create a new session control block.
Definition: ses.c:2460
ses_mode_t ses_get_mode(ses_cb_t *scb)
Get the output mode for the specified session.
Definition: ses.c:3416
boolean ses_is_gnmi_session(ses_cb_t *scb)
Check if the specified session is a gNMI session.
Definition: ses.c:5492
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:5655
void ses_put_binchar(ses_cb_t *scb, uint32 ch)
Write one binary char to the session, without any translation.
Definition: ses.c:2900
status_t(* ses_write_fn_t)(void *s)
optional write function for the session
Definition: ses.h:667
ses_transport_t
NETCONF Transport Types.
Definition: ses.h:432
ses_ypmode_t
YANG-PATCH Mode.
Definition: ses.h:410
ses_state_t
Session States.
Definition: ses.h:455
status_t(* ses_sendhook_fn_t)(void *s, boolean start)
optional send message start/end callback function
Definition: ses.h:687
ses_mode_t
Session Output Mode.
Definition: ses.h:480
ses_term_reason_t
Session Termination reason.
Definition: ses.h:491
ses_type_t
Session Types.
Definition: ses.h:419
ses_instate_t
Session Input Handler States for base:1.0 EOM processing.
Definition: ses.h:469
uint32 ses_id_t
Session ID.
Definition: ses.h:407
status_t(* ses_setup_fn_t)(void *s, void *cookie)
(UDP-Notif) session setup callback
Definition: ses.h:702
#define SES_MSG_BUFFSIZE
controls the size of each buffer chunk
Definition: ses.h:324
#define SES_MAX_STARTCHUNK_SIZE
max size of a valid base:1.1 chunk header start tag
Definition: ses.h:349
ses_prolog_state_t
prolog parsing state
Definition: ses.h:504
ssize_t(* ses_read_fn_t)(void *s, char *buff, size_t bufflen, bool *erragain)
optional read function for the session
Definition: ses.h:655
@ SES_TRANSPORT_UDPNOTIF
UDP-Notif Protocol.
Definition: ses.h:450
@ SES_TRANSPORT_TCP_TAILF
tail-f NETCONF over TCP
Definition: ses.h:439
@ SES_TRANSPORT_BEEP
not used
Definition: ses.h:435
@ SES_TRANSPORT_COAP
CoAP UDP socket.
Definition: ses.h:445
@ SES_TRANSPORT_CLI
YumaPro CLI hook (ncxconnect, NETCONF framing)
Definition: ses.h:442
@ SES_TRANSPORT_NETCONF_TLS
NETCONF over TLS.
Definition: ses.h:448
@ SES_TRANSPORT_WEBUI
not used YumaPro WEBui (ncxconnect, no framing)
Definition: ses.h:443
@ SES_TRANSPORT_SOAP
not used
Definition: ses.h:436
@ SES_TRANSPORT_SNMP
SNMP UDP socket.
Definition: ses.h:447
@ SES_TRANSPORT_NONE
not set
Definition: ses.h:433
@ SES_TRANSPORT_SSH
NETCONF over SSH (RFC 4742 and 6242)
Definition: ses.h:434
@ SES_TRANSPORT_TLS
YANGAPI/RESTCONF over TLS.
Definition: ses.h:438
@ SES_TRANSPORT_AFLOCAL
ncxserver.sock AF_LOCAL socket – control msg
Definition: ses.h:444
@ SES_TRANSPORT_GNMI
GNMI Internal processing over RESTCONF.
Definition: ses.h:449
@ SES_TRANSPORT_HTTP
YumaPro REST API ncxconnect, no framing.
Definition: ses.h:441
@ SES_TRANSPORT_SOAPBEEP
not used
Definition: ses.h:437
@ SES_TRANSPORT_TCP_NCX
YumaWorks NETCONF over TCP.
Definition: ses.h:440
@ SES_YPMODE_RESTCONF
RESTCONF mode.
Definition: ses.h:413
@ SES_YPMODE_HA
YP-HA mode.
Definition: ses.h:412
@ SES_YPMODE_NONE
not set
Definition: ses.h:411
@ SES_YPMODE_NETCONF
NETCONF mode.
Definition: ses.h:414
@ SES_ST_IN_MSG
processing a request
Definition: ses.h:462
@ SES_ST_HELLO_WAIT
waiting for peer <hello>
Definition: ses.h:458
@ SES_ST_INIT
initialization state
Definition: ses.h:457
@ SES_ST_IDLE
adble to accept requests
Definition: ses.h:461
@ SES_ST_NONE
not set
Definition: ses.h:456
@ SES_ST_SHUTDOWN_REQ
session shutdown requested
Definition: ses.h:463
@ SES_ST_SHUTDOWN
session shutting down
Definition: ses.h:464
@ SES_ST_XRD_WAIT
RESTCONF Entry point processing.
Definition: ses.h:459
@ SES_ST_RESTCAPS_WAIT
RESTCONF Capabilities processing.
Definition: ses.h:460
@ SES_MODE_TEXT
text mode
Definition: ses.h:485
@ SES_MODE_BINARY
binary mode
Definition: ses.h:486
@ SES_MODE_HTML
HTML mode.
Definition: ses.h:484
@ SES_MODE_XMLDOC
XML documentation mode.
Definition: ses.h:483
@ SES_MODE_NONE
not set
Definition: ses.h:481
@ SES_MODE_XML
XML mode.
Definition: ses.h:482
@ SES_TR_CLOSED
close-session
Definition: ses.h:493
@ SES_TR_NONE
not set
Definition: ses.h:492
@ SES_TR_BAD_START
bad session start
Definition: ses.h:498
@ SES_TR_KILLED
kill-session
Definition: ses.h:494
@ SES_TR_TIMEOUT
inactivity timeout
Definition: ses.h:496
@ SES_TR_DROPPED
dropped by remote peer
Definition: ses.h:495
@ SES_TR_OTHER
other
Definition: ses.h:497
@ SES_TR_BAD_HELLO
bad <hello> received
Definition: ses.h:499
@ SES_TYP_NONE
not set
Definition: ses.h:420
@ SES_TYP_NETCONF
any network configuration protocol
Definition: ses.h:421
@ SES_TYP_COAP
RESTCONF over CoAP; static socket, libcoap.
Definition: ses.h:424
@ SES_TYP_GNMI
RESTCONF over GNMI.
Definition: ses.h:426
@ SES_TYP_YCONTROL
internal YControl session w/ subsystem
Definition: ses.h:423
@ SES_TYP_UDPNOTIF
UDP-Notif Publisher or Subscriber.
Definition: ses.h:427
@ SES_TYP_DUMMY
internal session for rollback, etc.
Definition: ses.h:422
@ SES_TYP_SNMP
RESTCONF over SNMP.
Definition: ses.h:425
@ SES_INST_INMSG
in message body
Definition: ses.h:472
@ SES_INST_NONE
not set
Definition: ses.h:470
@ SES_INST_INSTART
starting in the EOM field
Definition: ses.h:473
@ SES_INST_IDLE
idle state
Definition: ses.h:471
@ SES_INST_INEND
ending the EOM field
Definition: ses.h:475
@ SES_INST_INBETWEEN
in between 2 messages
Definition: ses.h:474
@ SES_PRST_WAITING
waiting
Definition: ses.h:506
@ SES_PRST_DONE
done
Definition: ses.h:507
@ SES_PRST_NONE
not set
Definition: ses.h:505
#define TSTAMP_MIN_SIZE
normal minimum buffer size for a tstamp buffer
Definition: tstamp.h:71
ncx_msg_encoding_t
enumeration for message encoding formats
Definition: ncxtypes.h:648
ncx_protocol_t
NCX session protocol versions supported.
Definition: ncxtypes.h:980
ncx_display_mode_t
enumeration of val_dump_value display modes Some RESTCONF code uses this field incorrectly for messag...
Definition: ncxtypes.h:618
ncx_withdefaults_t
enum for with-defaults enum values
Definition: ncxtypes.h:1259
YANG module data structures Many internal representations of YANG module constructs.
Global error messages for status code enumerations.
Session Control Block.
Definition: ses.h:759
boolean content_length_based
content len based msg body
Definition: ses.h:892
boolean rawxml_mode
T: expand_anyxml, F: normal.
Definition: ses.h:794
ses_read_fn_t rdfn
set if external write fn
Definition: ses.h:836
boolean framing11
T: base:1.1, F: base:1.0.
Definition: ses.h:791
xmlChar * readbuff
input buffer for session
Definition: ses.h:868
uint32 checksum
running checksum for YANG Push Simulated Operational mode
Definition: ses.h:954
uint32 freecnt
current freeQ count
Definition: ses.h:847
boolean http_chunk_mode
T: send HTTP chunks, F: normal.
Definition: ses.h:807
boolean locks_released
Signal release point in kill.
Definition: ses.h:784
boolean binary_notifs
Flag to indicate Binary Notification Messages are expected to be received on this session.
Definition: ses.h:978
uint32 linesize
TERM line length.
Definition: ses.h:874
ses_msg_t * curmsg
pointer to current message to read set by agt only
Definition: ses.h:933
xmlChar * callhome_name
set for server NETCONF over TLS callhome sessions so the callhome reconnect can be checked when the s...
Definition: ses.h:990
void * openssl_ssl
malloced with SSL_new
Definition: ses.h:913
xmlChar * username
user ID
Definition: ses.h:775
boolean direct_mode
T: yp-shell, F: normal.
Definition: ses.h:795
boolean is_ipv6
T: using IPv6 address, F: IPv4.
Definition: ses.h:812
boolean sse_mode
T: Server Sent Events, F: normal.
Definition: ses.h:800
struct rpc_msg_t_ * cur_rpc_msg
for SIL-SA get callback
Definition: ses.h:856
size_t session_buffsize
the session_buffsize parameter is usually based on the ncx_get_chunk_size function which is set from ...
Definition: ses.h:998
uint32 readbuffsize
input buffer size
Definition: ses.h:869
boolean skip_outmsg
UDP-Notif Send function needs to keep a 'skip' state to dkip messages that need to be segmented,...
Definition: ses.h:1021
dlq_hdr_t breadcrumbQ
Queue of breadcrumb object back pointers used in XPath GET2 processing of when-stmts in operational s...
Definition: ses.h:930
dlq_hdr_t freeQ
Q of ses_msg_buff_t.
Definition: ses.h:849
uint32 checksum_cnt
byte count
Definition: ses.h:955
boolean stream_output
buffer/stream svr
Definition: ses.h:789
boolean msg_mode
T:msg-indent F:indent.
Definition: ses.h:796
boolean ypgnmi
T: is gNMI ycontrol session.
Definition: ses.h:801
boolean active
<hello> completed ok
Definition: ses.h:787
ses_id_t sid
session ID
Definition: ses.h:768
boolean json_1line
T: output JSON leaf-list on 1 line.
Definition: ses.h:806
uint32 cache_timeout
vir-val cache tmr in sec
Definition: ses.h:876
ses_stats_t stats
per-session statistics
Definition: ses.h:854
ses_ready_t outready
header for outreadyQ
Definition: ses.h:853
boolean reading_header
variables for SSL sessions; used by yangcli-pro
Definition: ses.h:891
boolean dbapi_system
T: is DB-API system session.
Definition: ses.h:799
boolean skip_modnames
YPW-888: new restconf cli parameter to turn strict JSON YANG enconding off, do not include module nam...
Definition: ses.h:910
boolean start_tls
T: need to start TLS session first.
Definition: ses.h:816
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:939
uint32 inendpos
inside framing directive
Definition: ses.h:844
int32 total_length
total length
Definition: ses.h:894
boolean use_traceid
TRUE if OK to use Trace ID attr in the RPC calls.
Definition: ses.h:897
struct agt_acm_cache_t_ * acm_cache
agent access control for database reads and writes; for incoming agent <rpc> requests,...
Definition: ses.h:885
ses_ready_t inready
header for inreadyQ
Definition: ses.h:852
ncx_withdefaults_t withdef
with-defaults default
Definition: ses.h:875
ses_msg_buff_t * outbuff
current output buffer
Definition: ses.h:851
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:918
dlq_hdr_t qhdr
queued by manager only
Definition: ses.h:760
boolean http_waitrn
T: wait for EOchunk, F: no wait.
Definition: ses.h:808
ses_write_fn_t wrfn
set if external read fn
Definition: ses.h:837
int8 indent
indent N spaces (0..9)
Definition: ses.h:872
ses_mode_t mode
session mode
Definition: ses.h:767
int fd
set if output to a socket
Definition: ses.h:835
int8 msg_indent
indent N spaces (-1..9)
Definition: ses.h:873
boolean ycontrol
T: is ycontrol session.
Definition: ses.h:797
boolean checksum_mode
T: add out byte to checksum.
Definition: ses.h:817
dlq_hdr_t snmp_getnext_listQ
SNMP pointers Q of malloced val_value struct Q of list entries with only keys in it.
Definition: ses.h:966
uint32 yang_sid_tree
SID Tree Assignment for this session.
Definition: ses.h:983
struct cfg_template_t_ * fake_candidate
a fake candidate config for target=running YANG-PATCH
Definition: ses.h:948
boolean warn_xml
T: xml warns, F: no warn.
Definition: ses.h:793
uint32 buffcnt
current buffer count
Definition: ses.h:846
uint8 cur_dscp
UDP-Notif YANG-Push sessions can set the DSCP for the publisher output.
Definition: ses.h:1008
boolean restconf_sse_mode
T: RESTCONF SSE mode.
Definition: ses.h:803
uint32 protocols_requested
bitmask
Definition: ses.h:762
uint16 rfc8639_notif_cnt
New subscriptions allow more than 1 per session.
Definition: ses.h:951
int tid
Thread ID representing session.
Definition: ses.h:782
xmlChar * service_name
variables for ycontrol sessions
Definition: ses.h:888
ncx_protocol_t protocol
protocol version in use
Definition: ses.h:763
boolean is_callhome
T: callhome session.
Definition: ses.h:813
FILE * fp
set if output to a file
Definition: ses.h:834
ses_sendhook_fn_t sendhook_fn
set if Send Hook Callback used: internal for UDP-Notif Publisher session.
Definition: ses.h:842
uint32 last_ch
save in case cr/lf in SSE mode
Definition: ses.h:818
boolean any_leaflist_attrs
T: leaf-list has attrs.
Definition: ses.h:810
dlq_hdr_t outQ
Q of ses_msg_buff_t.
Definition: ses.h:850
boolean chunk_based
chunked based msg body
Definition: ses.h:893
ses_id_t rollback_sid
session ID for rollback
Definition: ses.h:770
ses_instate_t instate
input state enum
Definition: ses.h:845
ses_udpnotif_cb_t * udpnotif_cb
UDP-Notif Collector control block for this session not used unless client-side SES_TYP_UDPNOTIF Colle...
Definition: ses.h:1032
dlq_hdr_t msgQ
Q of ses_msg_t input.
Definition: ses.h:848
boolean dbapi
T: is DB-API session.
Definition: ses.h:798
struct obj_template_t_ * snmp_table_obj
Current SNMP walk table.
Definition: ses.h:969
ses_state_t state
session state
Definition: ses.h:766
ncx_display_mode_t in_encoding
input encoding can be different in RESTCONF, set by the Content-Type header
Definition: ses.h:824
xmlChar * start_time
dateTime start time
Definition: ses.h:774
boolean restconf_notif
REST SSE notifications in progress.
Definition: ses.h:804
ses_transport_t transport
transport type
Definition: ses.h:764
void * openssl_ctx
backptr to TLS context
Definition: ses.h:912
uint16 peerport
Inet TCP port number.
Definition: ses.h:777
struct val_value_t_ * leaflist
JSON attrs backptr.
Definition: ses.h:819
boolean keep_xmlns
T: parse extern, F: msg
Definition: ses.h:792
ses_ypmode_t yp_mode
YANG-PATCH mode:
Definition: ses.h:904
boolean last_outbuff
UDP-Notif Send function needs to know if ses_finish_msg is sending the last buff or ses_msg_new_outpu...
Definition: ses.h:1014
xmlTextReaderPtr reader
input stream reader
Definition: ses.h:833
void * tcb
Thread control block.
Definition: ses.h:783
ses_type_t type
session type
Definition: ses.h:761
boolean notif_active
subscription active
Definition: ses.h:788
boolean file_override
set by server DB-API session to capture <rpc-reply> output to a file.
Definition: ses.h:945
void * mgrcb
if manager session, mgr_scb_t
Definition: ses.h:855
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:924
time_t last_rpc_time
used for idle timeout
Definition: ses.h:773
ses_term_reason_t termreason
termination reason
Definition: ses.h:771
boolean is_ycontrol_scb
T: is ycontrol_scb for HA.
Definition: ses.h:811
boolean free_pending
T: dropped SUBSYS waiting free.
Definition: ses.h:815
boolean noxmlns
xml-nons display-mode
Definition: ses.h:790
xmlChar * subsys_id
used for YCONTROL session only
Definition: ses.h:780
boolean dropped
T: session dropped in a msg.
Definition: ses.h:814
void * rcvr_cb
UDP-Notif Publisher uses 1 SCB for each receiver this is a backptr to the rcvr_cb_t struct in agt/agt...
Definition: ses.h:1027
boolean conn_closed
T: scb IO closed last buffer.
Definition: ses.h:786
xmlChar * peeraddr
Inet address string.
Definition: ses.h:776
time_t hello_time
used for hello timeout
Definition: ses.h:772
boolean json_attrs
T: use JSON attributes.
Definition: ses.h:809
ncx_msg_encoding_t encoding
HTTP msg encoding.
Definition: ses.h:765
ncx_display_mode_t out_encoding
output encoding can be different in RESTCONF, set by the Accept header.
Definition: ses.h:831
boolean ypgrpc
T: is gRPC ycontrol session.
Definition: ses.h:971
xmlChar * entry_point
REST-API entry point.
Definition: ses.h:859
ses_id_t killedbysid
killed-by session ID
Definition: ses.h:769
struct yangapi_cb_t_ * rcb
REST-API control block.
Definition: ses.h:858
Session Message Buffer.
Definition: ses.h:577
size_t buffstart
buff start pos
Definition: ses.h:579
boolean isbinary
T: CBOR, F: XML.
Definition: ses.h:583
dlq_hdr_t qhdr
not set
Definition: ses.h:578
uint32 segment
For UDP-Notif the segment-id is recorded If a segment is biffer than 1 buffer there will be multiple ...
Definition: ses.h:589
size_t buffpos
buff cur position
Definition: ses.h:581
boolean islast
T: last buff in msg.
Definition: ses.h:582
size_t bufflen
buff actual size
Definition: ses.h:580
Session Message.
Definition: ses.h:623
ncx_msg_encoding_t msg_encoding
UDP-Notif Standard Media Type.
Definition: ses.h:634
dlq_hdr_t buffQ
Q of ses_msg_buff_t.
Definition: ses.h:628
size_t curchunksize
cur chunk rcvd
Definition: ses.h:630
size_t expchunksize
expected chunk size
Definition: ses.h:631
boolean dispatched
in processing
Definition: ses.h:626
dlq_hdr_t qhdr
Q header for buffcb->msgQ.
Definition: ses.h:624
boolean ready
ready for parsing
Definition: ses.h:625
ses_prolog_state_t prolog_state
for insert prolog
Definition: ses.h:629
uint32 message_id
UDP-Notif Message-ID.
Definition: ses.h:640
ses_msg_buff_t * curbuff
cur position in buffQ
Definition: ses.h:627
uint32 publisher_id
UDP-Notif Publisher-ID.
Definition: ses.h:637
embedded Q header for the message ready Q The 'inq' flag is used to prevent queue corruption
Definition: ses.h:607
boolean inq
flag that already in the ready Q
Definition: ses.h:615
dlq_hdr_t hdr
< embedded queue header threaded into ready Q
Definition: ses.h:609
ses_id_t sid
session ID of this session
Definition: ses.h:612
boolean ycontrol
flag YControl session for priority processing
Definition: ses.h:618
Per Session Statistics.
Definition: ses.h:518
uint32 inRpcs
netconf-state in-rpcs counter
Definition: ses.h:529
uint32 in_bytes
extra original internal in byte counter
Definition: ses.h:520
uint32 requests
internal request counters for EVAL tracking
Definition: ses.h:544
uint32 outNotifications
netconf-state out-notifications counter
Definition: ses.h:538
uint32 out_line
hack: bytes since ' ', pretty-print
Definition: ses.h:526
uint32 outRpcErrors
netconf-state out-rpc-errors counter
Definition: ses.h:535
uint32 excluded_events
yang-push excluded-events counter
Definition: ses.h:541
uint32 inBadRpcs
netconf-state in-bad-rpcs counter
Definition: ses.h:532
uint32 out_bytes
extra original internal out byte counter
Definition: ses.h:523
Session Total Statistics.
Definition: ses.h:549
uint32 closed_sessions
total closed sessions
Definition: ses.h:554
uint32 inBadHellos
total in bad hello messages
Definition: ses.h:560
ses_stats_t stats
per-session stats added up for all sessions
Definition: ses.h:569
uint32 droppedSessions
total dropped sessions
Definition: ses.h:566
uint32 inSessions
total inbound sessions
Definition: ses.h:563
uint32 failed_sessions
total failed sessions
Definition: ses.h:557
uint32 active_sessions
total active sessions
Definition: ses.h:551
Special UDP-Notif Collector Control Block Used to manage the DGRAM connection where the publishers ar...
Definition: ses.h:711
void * cookie
parameter to send to callback function
Definition: ses.h:748
dlq_hdr_t pubcbQ
UDP-Notif needs a special Queue of publisher control blocks since multiple source addresses can be se...
Definition: ses.h:737
ses_setup_fn_t setup_fn
The session control block setup by udpnotif_init is the collector session listening to the collector ...
Definition: ses.h:745
const xmlChar * curmsg_print_addr
back-pointer to the pubcb->print_addr that matches the curmsg_addr field
Definition: ses.h:753
uint32 curmsg_addrlen
UDP-Notif read function stores the actual sockaddr length.
Definition: ses.h:714
Timestamp utilities.