![]() |
yumapro
25.10-1
YumaPro SDK
|
Macros and data structures used for session management. More...
Data Structures | |
struct | ses_stats_t |
Per Session Statistics. More... | |
struct | ses_total_stats_t |
Session Total Statistics. More... | |
struct | ses_msg_buff_t |
Session Message Buffer. More... | |
struct | ses_ready_t |
embedded Q header for the message ready Q The 'inq' flag is used to prevent queue corruption More... | |
struct | ses_msg_t |
Session Message. More... | |
struct | ses_udpnotif_cb_t |
Special UDP-Notif Collector Control Block Used to manage the DGRAM connection where the publishers are not known in advance. More... | |
struct | ses_cb_t |
Session Control Block. More... | |
Macros | |
#define | SES_MY_SID(S) ((S)->sid) |
get session-id | |
#define | SES_MY_FD(S) ((S)->fd) |
get file descriptor | |
#define | SES_MY_USERNAME(S) ((S)->username) |
get username | |
#define | SES_KILLREQ_SET(S) ((S)->state >= SES_ST_SHUTDOWN_REQ) |
check if a kill request is set | |
#define | SES_ACK_KILLREQ(S) ((S)->state = SES_ST_SHUTDOWN) |
ack a kill request | |
#define | SES_OUT_BYTES(S) (S)->stats.out_bytes |
get session out bytes | |
#define | SES_LINELEN(S) (S)->stats.out_line |
get current out line number | |
#define | SES_LINESIZE(S) (S)->linesize |
get current line size | |
#define | SES_BUFFSIZE(S) (S)->session_buffsize |
get session buffer max used size | |
#define | SES_IN_ENCODING(S) (S)->in_encoding |
get the inbound message encoding | |
#define | SES_OUT_ENCODING(S) (S)->out_encoding |
get the outbound message encoding | |
#define | SES_IS_DUMMY(S) ((S)->sid == 0) |
test if this is a dummy session | |
#define | SES_IS_YCONTROL(S) ((S)->ycontrol) |
test if this is a YControl session | |
#define | SES_CONN_CLOSED(S) (S)->conn_closed |
check if the connection is closed | |
#define | SES_SET_CUR_RPC_MSG(S, MSG) (S)->cur_rpc_msg = MSG |
set the current RPC message | |
#define | SES_GET_CUR_RPC_MSG(S) (S)->cur_rpc_msg |
get the current RPC message | |
#define | SES_GET_JSON_1LINE(S) (S)->json_1line |
get the JSON 1 line state | |
#define | SES_USE_JSON_ATTRS(S) (S)->json_attrs |
get the JSON use attributes flag | |
#define | SES_SET_JSON_ATTRS(S) (S)->json_attrs = TRUE |
set the JSON attributes flag | |
#define | SES_SET_LEAFLIST_PTR(S, V) (S)->leaflist = V |
set the session leaf-list pointer | |
#define | SES_GET_LEAFLIST_PTR(S) (S)->leaflist |
get the session leaf-list pointer | |
#define | SES_SET_LEAFLIST_ATTRS(S, A) (S)->any_leaflist_attrs = A |
set the leaf-list attributes | |
#define | SES_GET_LEAFLIST_ATTRS(S) (S)->any_leaflist_attrs |
get the leaf-list attributes | |
#define | SES_KEEP_XMLNS(S) (S)->keep_xmlns |
get keep xmlns attributes flag | |
#define | SES_RAWXML_MODE(S) (S)->rawxml_mode |
get the raw XML mode | |
#define | SES_STATE(S) (S)->state |
get the session state | |
#define | SES_PEERADDR(S) (S)->peeraddr |
get the session peer address | |
#define | SES_PEERPORT(S) (S)->peerport |
get the session peer port number | |
#define | SES_TRANSPORT(S) (S)->transport |
get the session transport enum | |
#define | SES_PROTOCOL(S) (S)->protocol |
get the session protocol enum | |
#define | SES_IS_IPV6(S) (S)->is_ipv6 |
check if the session is using IPv6 | |
#define | SES_IS_CALLHOME(S) (S)->is_callhome |
check if this is a callhome session | |
#define | SES_TYPE(S) (S)->type |
get the session type | |
#define | SES_GET_COOKIE(S) (S)->get_cookie |
get the session cookie | |
#define | SES_BREADCRUMBQ(S) &(S)->breadcrumbQ |
get the session breadcrumb Q | |
#define | SES_CURMSG(S) (S)->curmsg |
get the session current message | |
#define | SES_START_TLS(S) (S)->start_tls |
get the start TLS flag | |
#define | SES_WILDCARD_OK(S) (S)->wildcard_ok |
check if wildcard OK in XML filters | |
#define | SES_MGRCB(S) (S)->mgrcb |
get the manager session control block | |
#define | SES_NOTIF_ACTIVE(S) (S)->notif_active |
check if notifications are active | |
#define | SES_RFC8639_NOTIF_COUNT(S) (S)->rfc8639_notif_cnt |
get the notification count | |
#define | SES_BINARY_NOTIFS(S) (S)->binary_notifs |
establish-subscription used with encode-yang-cbor used on the session S | |
#define | BINLOG (const xmlChar *)"***binary***" |
If binary encoding then this message will be printed instead of showing binary characters in the log files. | |
#define | SES_RDFN(S) (S)->rdfn |
Access to the session read callback function. | |
#define | SES_WRFN(S) (S)->wrfn |
Access to the session write callback function. | |
#define | SES_SENDHOOK_FN(S) (S)->sendhook_fn |
Access to the session Send Hook callback function. | |
#define | SES_LAST_OUTBUFF(S) (S)->last_outbuff |
This flag is TRUE if the session write function is being called from ses_finish_msg. More... | |
#define | SES_SKIP_OUTMSG(S) (S)->skip_outmsg |
This flag is TRUE if the session write function is in skip mode, dropping segments instead of sending them. | |
#define | SES_CALLHOME_NAME(S) (S)->callhome_name |
agt only: Get the name of the callhome server that this session was started for so it can be reconnected only applies to NETCONF over TLS sessions | |
#define | SES_FREE_PENDING(S) (S)->free_pending |
agt only: Set this flag in agt_ses to delay freeing a subsystem session that is in progress with a remote transaction This will cause agt_top to clean up the session | |
#define | SES_RCVR_CB(S) (S)->rcvr_cb |
Access to the UDP-Notif Receiver Control Block Used by the publisher (server) One SCB per receiver is maintained. | |
#define | SES_CUR_DSCP(S) (S)->cur_dscp |
Save the current DSCP setting if UDP-Notif Publisher session on the server. | |
#define | SES_NULL_SID 0 |
session ID zero not used | |
#define | SES_MSG_BUFFSIZE 9000 |
controls the size of each buffer chunk More... | |
#define | SES_MAX_BUFFERS 500000 |
max number of buffer chunks a session can have allocated at once This is an arbitrary limit – no static memory is allocated based on this constant | |
#define | SES_MAX_FREE_BUFFERS 4 |
max number of buffers a session is allowed to cache in its freeQ | |
#define | SES_MAX_BUFFSEND 32 |
max number of buffers to try to send in one call to the write fn | |
#define | SES_MAX_BYTESEND 0xffff |
max number of bytes to try to send in one call to the write_fn | |
#define | SES_DEF_LINESIZE 72 |
max desired lines size; not a hard limit | |
#define | SES_MAX_STARTCHUNK_SIZE 13 |
max size of a valid base:1.1 chunk header start tag | |
#define | SES_MAX_CHUNKNUM_SIZE 10 |
max size of the chunk size number in the chunk start tag | |
#define | SES_STARTCHUNK_PAD 10 |
padding at start of buffer for chunk tagging More... | |
#define | SES_ENDCHUNK_PAD 8 |
leave enough room at the end for EOChunks for framing11 or http_chunk_mode | |
#define | SES_READBUFF_SIZE SES_MSG_BUFFSIZE |
default read buffer size 24.10T-5: change to match write buffer to support larger read size for UDP-Notif | |
#define | SES_UDPNOTIF_READBUFF_SIZE 65532 |
UDP-Notif read buffer needs a 64K buffer – not full 65535 bytes of UDP Segment available – leaving room for 2 bytes at end and still 16 bits length. | |
#define | SES_GET_YPMODE(S) (S)->yp_mode |
get internal YP mode flag | |
#define | SES_SET_YPMODE(S, V) (S)->yp_mode = V |
set internal YP mode flag | |
#define | SES_REMOTE_WAIT(S) (S)->remote_wait |
get remote wait flag | |
#define | SES_NEED_FILE_OVERRIDE(S) ((S)->file_override && (S)->fp) |
get file override flag (used in client) | |
#define | SES_SYSTEM_USERNAME NCX_EL_SYSTEM |
system username used in agt_state to report session state | |
Typedefs | |
typedef uint32 | ses_id_t |
Session ID. | |
typedef ssize_t(* | ses_read_fn_t) (void *s, char *buff, size_t bufflen, bool *erragain) |
optional read function for the session More... | |
typedef status_t(* | ses_write_fn_t) (void *s) |
optional write function for the session More... | |
typedef status_t(* | ses_sendhook_fn_t) (void *s, boolean start) |
optional send message start/end callback function More... | |
typedef status_t(* | ses_setup_fn_t) (void *s, void *cookie) |
(UDP-Notif) session setup callback More... | |
Macros and data structures used for session management.
The ses_cb_t is the session control block used throughout all programs that use sessions.
#define SES_LAST_OUTBUFF | ( | S | ) | (S)->last_outbuff |
This flag is TRUE if the session write function is being called from ses_finish_msg.
This allows a definite flag for last segment happens to be exactly the same amount as the session_buffsize value
#define SES_MSG_BUFFSIZE 9000 |
controls the size of each buffer chunk
!!! This was set to 2000 but this causes IP fragmentation !!! so it has been changed to 1000. In some small networks this could also cause IP fragmentation
Starting 24.10T: This value now represents the maximum session buffer length, not the configured buffer length. Was 1000 before this change.
This value is used for the buffer allocation and READ operations
The SES_BUFFSIZE(S) macro returns the configured WRITE operations
#define SES_STARTCHUNK_PAD 10 |
padding at start of buffer for chunk tagging
* * Max: \n#xxxxxxx\n --> 7 digit chunk size * * HTTP chunk format * xxxxxxx\r\n * *
typedef ssize_t(* ses_read_fn_t) (void *s, char *buff, size_t bufflen, bool *erragain) |
optional read function for the session
s | session control block cast as void * | |
buff | buffer to fill | |
bufflen | size of buff | |
[out] | erragain | address of return EAGAIN flag
|
typedef status_t(* ses_sendhook_fn_t) (void *s, boolean start) |
optional send message start/end callback function
Send Hook Callback
Internal hook for UDP-Notif Send support
Stert done at start of ses_start_msg Finish done at end of ses_finish_msg
s | session control block cast as void * |
start | TRUE if start-msg; FALSE if finish-msg |
typedef status_t(* ses_setup_fn_t) (void *s, void *cookie) |
(UDP-Notif) session setup callback
Called when UDP-Notif message is read and ready to be processed Stored in the ses_udpnotif_cb_t for the session
s | session control block cast as void * |
cookie | parameter value set in ses_set_setup_fn |
typedef status_t(* ses_write_fn_t) (void *s) |
optional write function for the session
s | session control block cast as void * |
enum ses_instate_t |
enum ses_mode_t |
enum ses_prolog_state_t |
enum ses_state_t |
Session States.
enum ses_term_reason_t |
enum ses_transport_t |
NETCONF Transport Types.
enum ses_type_t |
Session Types.
enum ses_ypmode_t |