yumapro
23.10T-12
YumaPro SDK
|
Core Functions to manage, read, and write sessions. More...
Functions | |
ses_cb_t * | ses_new_scb (void) |
Create a new session control block. More... | |
ses_cb_t * | ses_new_dummy_scb (void) |
Create a new dummy session control block. More... | |
ses_cb_t * | ses_new_coap_scb (void) |
Create a new global CoAP session control block. More... | |
void | ses_init_coap_scb (ses_cb_t *scb) |
Initialize a CoAP session control block. More... | |
ses_cb_t * | ses_new_snmp_scb (void) |
Create a new global SNMP session control block. More... | |
void | ses_free_scb (ses_cb_t *scb) |
Free a session control block. More... | |
void | ses_putchar (ses_cb_t *scb, uint32 ch) |
Write one char to the session, without any translation. More... | |
void | ses_put_binchar (ses_cb_t *scb, uint32 ch) |
Write one binary char to the session, without any translation. More... | |
void | ses_putstr (ses_cb_t *scb, const xmlChar *str) |
Write a zero-terminated string to the session. More... | |
void | ses_put_binstr (ses_cb_t *scb, const xmlChar *str, uint32 len) |
Write a binary string to the session. More... | |
void | ses_putstr_indent (ses_cb_t *scb, const xmlChar *str, int32 indent) |
Write a zero-terminated content string to the session with indentation. More... | |
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 More... | |
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 More... | |
void | ses_putcchar (ses_cb_t *scb, uint32 ch) |
Write one content char to the session, with translation as needed. More... | |
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 session More... | |
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 More... | |
void | ses_indent (ses_cb_t *scb, int32 indent) |
Write the proper newline + indentation to the specified session. More... | |
int32 | ses_indent_count (const ses_cb_t *scb) |
Get the logging indent count for this session. More... | |
int32 | ses_message_indent_count (const ses_cb_t *scb) |
Get the message indent count for this session. More... | |
void | ses_set_indent (ses_cb_t *scb, int32 indent) |
Set the logging indent count for this session. More... | |
void | ses_set_message_indent (ses_cb_t *scb, int32 indent) |
Set the message indent count for this session. More... | |
void | ses_set_mode (ses_cb_t *scb, ses_mode_t mode) |
Set the output mode for the specified session. More... | |
ses_mode_t | ses_get_mode (ses_cb_t *scb) |
Get the output mode for the specified session. More... | |
void | ses_start_msg_mode (ses_cb_t *scb) |
Set the message output mode to active. More... | |
void | ses_stop_msg_mode (ses_cb_t *scb) |
Set the message output mode to inactive. More... | |
status_t | ses_start_msg (ses_cb_t *scb) |
Start a new outbound message on the specified session. More... | |
void | ses_finish_msg (ses_cb_t *scb) |
Finish an outbound message on the specified session. More... | |
int | ses_read_cb (void *context, char *buffer, int len) |
The IO input front-end for the xmlTextReader parser read fn. More... | |
status_t | ses_accept_input (ses_cb_t *scb) |
The IO input handler for the ncxserver loop. More... | |
const xmlChar * | ses_state_name (ses_state_t state) |
Get the name of a session state from the enum value. More... | |
ncx_withdefaults_t | ses_withdef (const ses_cb_t *scb) |
Get the with-defaults value for this session. More... | |
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 reached. More... | |
void | ses_put_extern (ses_cb_t *scb, const xmlChar *fname) |
write the contents of a file to the session More... | |
status_t | ses_put_extern2 (ses_cb_t *scb, const xmlChar *fname) |
write the contents of a file to the session More... | |
status_t | ses_put_extern_bin (ses_cb_t *scb, const xmlChar *fname) |
write the contents of a binary file to the session More... | |
ses_total_stats_t * | ses_get_total_stats (void) |
Get a r/w pointer to the the session totals stats. More... | |
ses_transport_t | ses_get_transport (ses_cb_t *scb) |
Get the transport enum for a given session. More... | |
ses_transport_t | ses_get_transport_enum (const xmlChar *str) |
Get the enum value for the yumaworks-types:transport-type. More... | |
const xmlChar * | ses_get_transport_name (ses_transport_t transport) |
Get the name of the transport for a given enum value. More... | |
const xmlChar * | ses_get_transport_yang_name (ses_transport_t transport) |
Get the name of the transport for a given enum value. More... | |
void | ses_set_xml_nons (ses_cb_t *scb) |
force xmlns attributes to be skipped in XML mode More... | |
boolean | ses_get_xml_nons (const ses_cb_t *scb) |
force xmlns attributes to be skipped in XML mode More... | |
status_t | ses_set_protocol (ses_cb_t *scb, ncx_protocol_t proto) |
set the NETCONF protocol version in use More... | |
ncx_protocol_t | ses_get_protocol (const ses_cb_t *scb) |
Get the NETCONF protocol set (or unset) for this session. More... | |
void | ses_set_protocols_requested (ses_cb_t *scb, ncx_protocol_t proto) |
set the NETCONF protocol versions requested More... | |
boolean | ses_protocol_requested (ses_cb_t *scb, ncx_protocol_t proto) |
check if the NETCONF protocol version was requested More... | |
void | ses_set_extern_xml_mode (ses_cb_t *scb, boolean rawxml_mode) |
Setup the scb for external XML parsing. More... | |
void | ses_set_extern_xml_mode_ex (ses_cb_t *scb, boolean rawxml_mode, boolean keep_xmlns) |
Setup the scb for external XML parsing. More... | |
void | ses_clear_extern_xml_mode (ses_cb_t *scb, boolean rawxml_mode) |
Clear the scb from external XML parsing. More... | |
void | ses_clear_extern_xml_mode_ex (ses_cb_t *scb, boolean rawxml_mode, boolean keep_xmlns) |
Clear the scb from external XML parsing. More... | |
void | ses_set_out_encoding (ses_cb_t *scb, ncx_display_mode_t encoding) |
Set the output encoding. More... | |
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 RESTCONF/HTTP. More... | |
ncx_display_mode_t | ses_get_out_encoding (ses_cb_t *scb) |
Get the output encoding. More... | |
int32 | ses_new_indent_count (boolean indent_in, int32 indent, int32 indent_amount) |
Get the new indent count from the current and indent_amount. More... | |
void | ses_free_xml_reader (ses_cb_t *scb) |
Free the xmlTextReader for the session The encoding is switching from XML to something else. More... | |
status_t | ses_getline_cb (xmlChar *fillbuff, uint32 fillbuffsize, void *cookie) |
The IO input front-end for the tk_parse_json_buffs function. More... | |
status_t | ses_set_control_session (ses_cb_t *scb) |
Set the specified session as a control session. More... | |
boolean | ses_is_control_session (ses_cb_t *scb) |
Check if the specified session is a control session. More... | |
void | ses_set_dbapi_session (ses_cb_t *scb) |
Set the specified session as a DB-API control session. More... | |
boolean | ses_is_dbapi_session (ses_cb_t *scb) |
Check if the specified session is a DB-API control session. More... | |
void | ses_set_dbapi_system_session (ses_cb_t *scb) |
Set the specified session as a DB-API control session for system edits. More... | |
boolean | ses_is_dbapi_system_session (ses_cb_t *scb) |
Check if the specified session is a DB-API control session for system edits. More... | |
void | ses_clear_dbapi_system_session (ses_cb_t *scb) |
Clear a session of the DB-API system status. More... | |
boolean | ses_is_system_session (ses_cb_t *scb) |
Check if the specified session is an internal system session. More... | |
int32 | ses_add_indent (ses_cb_t *scb, int32 indent) |
Add in the new indent amount. More... | |
int32 | ses_dec_indent (ses_cb_t *scb, int32 indent) |
Remove the specified indent amount. More... | |
ncx_msg_encoding_t | ses_get_msg_encoding (const ses_cb_t *scb) |
Get the message encoding for the HTTP session. More... | |
status_t | ses_start_http_chunk_mode (ses_cb_t *scb) |
Start outputting buffers in HTTP 1.1 chunk mode. More... | |
const xmlChar * | ses_get_entry_point (ses_cb_t *scb) |
Get the RESTCONF entry_point. More... | |
status_t | ses_set_entry_point (ses_cb_t *scb, const xmlChar *point) |
Set the RESTCONF entry_point. More... | |
boolean | ses_notifications_active (const ses_cb_t *scb) |
Check if the session has notifications active. More... | |
status_t | ses_set_gnmi_control_session (ses_cb_t *scb) |
Set the specified session as a gNMI control session. More... | |
boolean | ses_is_gnmi_control_session (ses_cb_t *scb) |
Check if the specified session is a gNMI control session. More... | |
void | ses_set_gnmi_session (ses_cb_t *scb) |
Set the specified session as a gNMI session. More... | |
boolean | ses_is_gnmi_session (ses_cb_t *scb) |
Check if the specified session is a gNMI session. More... | |
status_t | ses_add_breadcrumb_obj (ses_cb_t *scb, struct obj_template_t_ *obj) |
Add an object to the breadcrumbQ. More... | |
void | ses_clean_breadcrumbQ (ses_cb_t *scb) |
Clean the breadcrumbQ. More... | |
boolean | ses_dropped (const ses_cb_t *scb) |
Check if the session has been dropped by the client. More... | |
status_t | ses_set_file_override (ses_cb_t *scb, const xmlChar *filespec, boolean is_binary) |
Setup the session in file write override mode. More... | |
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! More... | |
void | ses_start_checksum (ses_cb_t *scb) |
Clear the checksum field and start checksum mode. More... | |
uint32 | ses_finish_checksum (ses_cb_t *scb, uint32 *checksum_cnt) |
Stop checksum mode and return the final checksum. More... | |
boolean | ses_dropped_ex (ses_cb_t *scb) |
Check if the session has been dropped by the client. More... | |
status_t | ses_set_grpc_control_session (ses_cb_t *scb) |
Set the specified session as a gRPC control session. More... | |
boolean | ses_is_grpc_control_session (ses_cb_t *scb) |
Check if the specified session is a gRPC control session. More... | |
void | ses_set_grpc_session (ses_cb_t *scb) |
Set the specified session as a gRPC session. More... | |
boolean | ses_is_grpc_session (ses_cb_t *scb) |
Check if the specified session is a gRPC session. More... | |
void | ses_dump_binary_buff (const xmlChar *buff, size_t bufflen) |
Dump some bytes from the binary buffer (max 256) More... | |
boolean | ses_poll_ready (ses_cb_t *scb) |
Check if the specified session is ready to read bytes. More... | |
const xmlChar * | ses_get_scb_username (ses_cb_t *scb) |
Get the username to use from an SCB. More... | |
const xmlChar * | ses_get_scb_client_addr (ses_cb_t *scb) |
Get the client addr to use from an SCB. More... | |
Core Functions to manage, read, and write sessions.
A server session usually uses one input buffer and one output buffer at a time. When the output session is full by ses_putchar then the full buffer will be sent.
The IO input handler for the ncxserver loop.
Need to separate the input stream into separate XML instance documents and reset the xmlTextReader each time a new document is encountered. For SSH, also need to detect the EOM flag and remove it + control input to the reader.
This function breaks the byte stream into ses_msg_t structs that get queued on the session's msgQ
scb | session control block to accept input for |
Add an object to the breadcrumbQ.
scb | session control block to check |
obj | breadcrumb object to add |
int32 ses_add_indent | ( | ses_cb_t * | scb, |
int32 | indent | ||
) |
Add in the new indent amount.
scb | session control block |
indent | current indent amount |
void ses_clean_breadcrumbQ | ( | ses_cb_t * | scb | ) |
Clean the breadcrumbQ.
scb | session control block to check |
void ses_clear_dbapi_system_session | ( | ses_cb_t * | scb | ) |
Clear a session of the DB-API system status.
scb | session control block to use |
void ses_clear_extern_xml_mode | ( | ses_cb_t * | scb, |
boolean | rawxml_mode | ||
) |
Clear the scb from external XML parsing.
scb | session to check |
rawxml_mode | TRUE if loading file for expand_rawxml Unknown namespace decls will cause an error Other attributes will be preseved. == FALSE to use INVALID namespace in parsing and convert nc:operation and other known attributes |
void ses_clear_extern_xml_mode_ex | ( | ses_cb_t * | scb, |
boolean | rawxml_mode, | ||
boolean | keep_xmlns | ||
) |
Clear the scb from external XML parsing.
scb | session to check |
rawxml_mode | TRUE if loading file for expand_rawxml Unknown namespace decls will cause an error Other attributes will be preseved. == FALSE to use INVALID namespace in parsing and convert nc:operation and other known attributes |
keep_xmlns | TRUE to keep xmlns attributes; FALSE to ignore them |
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!
scb | session control block to change |
int32 ses_dec_indent | ( | ses_cb_t * | scb, |
int32 | indent | ||
) |
Remove the specified indent amount.
scb | session control block |
indent | current indent amount |
boolean ses_dropped | ( | const ses_cb_t * | scb | ) |
Check if the session has been dropped by the client.
scb | session control block to check |
boolean ses_dropped_ex | ( | ses_cb_t * | scb | ) |
Check if the session has been dropped by the client.
Sets the scb->dropped to TRUE if the test WRITE func call is not successful
scb | session control block to check |
void ses_dump_binary_buff | ( | const xmlChar * | buff, |
size_t | bufflen | ||
) |
Dump some bytes from the binary buffer (max 256)
buff | buffer to dump |
bufflen | number of bytes in the buffer |
uint32 ses_finish_checksum | ( | ses_cb_t * | scb, |
uint32 * | checksum_cnt | ||
) |
Stop checksum mode and return the final checksum.
YANG Push Simulated On-Change mode uses this checksum plus byte count to decide if an update record is needed
scb | session control block to change | |
[out] | checksum_cnt | address of return checksum byte count
|
void ses_finish_msg | ( | ses_cb_t * | scb | ) |
Finish an outbound message on the specified session.
scb | session control block to finish msg |
void ses_free_scb | ( | ses_cb_t * | scb | ) |
Free a session control block.
scb | session control block to free |
void ses_free_xml_reader | ( | ses_cb_t * | scb | ) |
Free the xmlTextReader for the session The encoding is switching from XML to something else.
scb | session control block to use free scb->reader will be NULL |
const xmlChar * ses_get_entry_point | ( | ses_cb_t * | scb | ) |
Get the RESTCONF entry_point.
scb | session control block to check |
ses_mode_t ses_get_mode | ( | ses_cb_t * | scb | ) |
Get the output mode for the specified session.
scb | session control block to get |
ncx_msg_encoding_t ses_get_msg_encoding | ( | const ses_cb_t * | scb | ) |
Get the message encoding for the HTTP session.
scb | session to get |
ncx_display_mode_t ses_get_out_encoding | ( | ses_cb_t * | scb | ) |
Get the output encoding.
scb | session to check |
ncx_protocol_t ses_get_protocol | ( | const ses_cb_t * | scb | ) |
Get the NETCONF protocol set (or unset) for this session.
scb | session to get |
const xmlChar * ses_get_scb_client_addr | ( | ses_cb_t * | scb | ) |
Get the client addr to use from an SCB.
scb | session control block to use |
const xmlChar * ses_get_scb_username | ( | ses_cb_t * | scb | ) |
Get the username to use from an SCB.
scb | session control block to use |
ses_total_stats_t * ses_get_total_stats | ( | void | ) |
Get a r/w pointer to the the session totals stats.
ses_transport_t ses_get_transport | ( | ses_cb_t * | scb | ) |
Get the transport enum for a given session.
Same as SES_TRANSPORT(S)
scb | session control block |
ses_transport_t ses_get_transport_enum | ( | const xmlChar * | str | ) |
Get the enum value for the yumaworks-types:transport-type.
str | string with enum value |
const xmlChar * ses_get_transport_name | ( | ses_transport_t | transport | ) |
Get the name of the transport for a given enum value.
transport | ses_transport_t enum value |
const xmlChar * ses_get_transport_yang_name | ( | ses_transport_t | transport | ) |
Get the name of the transport for a given enum value.
Use the yumaworks-types:transport-type enumerations
transport | ses_transport_t enum value |
boolean ses_get_xml_nons | ( | const ses_cb_t * | scb | ) |
force xmlns attributes to be skipped in XML mode
scb | session to get |
status_t ses_getline_cb | ( | xmlChar * | fillbuff, |
uint32 | fillbuffsize, | ||
void * | cookie | ||
) |
The IO input front-end for the tk_parse_json_buffs function.
Get one line of input from the session buffer Keep track of the read location and return ERR_NCX_EOF when there is no more input to return
[out] | fillbuff | buffer to contain the next input line
|
fillbuffsize | number of bytes allowed in fillbuff | |
cookie | user cookie passed at init time |
void ses_indent | ( | ses_cb_t * | scb, |
int32 | indent | ||
) |
Write the proper newline + indentation to the specified session.
scb | session control block to start msg |
indent | number of chars to indent after a newline will be ignored if indent is turned off in the agent profile -1 means no newline or indent 0 means just newline |
int32 ses_indent_count | ( | const ses_cb_t * | scb | ) |
Get the logging indent count for this session.
scb | session control block to check |
void ses_init_coap_scb | ( | ses_cb_t * | scb | ) |
Initialize a CoAP session control block.
scb | session control block to initialize |
boolean ses_is_control_session | ( | ses_cb_t * | scb | ) |
Check if the specified session is a control session.
scb | session control block to use |
boolean ses_is_dbapi_session | ( | ses_cb_t * | scb | ) |
Check if the specified session is a DB-API control session.
scb | session control block to use |
boolean ses_is_dbapi_system_session | ( | ses_cb_t * | scb | ) |
Check if the specified session is a DB-API control session for system edits.
scb | session control block to use |
boolean ses_is_gnmi_control_session | ( | ses_cb_t * | scb | ) |
Check if the specified session is a gNMI control session.
scb | session control block to use |
boolean ses_is_gnmi_session | ( | ses_cb_t * | scb | ) |
Check if the specified session is a gNMI session.
scb | session control block to use |
boolean ses_is_grpc_control_session | ( | ses_cb_t * | scb | ) |
Check if the specified session is a gRPC control session.
scb | session control block to use |
boolean ses_is_grpc_session | ( | ses_cb_t * | scb | ) |
Check if the specified session is a gRPC session.
scb | session control block to use |
boolean ses_is_system_session | ( | ses_cb_t * | scb | ) |
Check if the specified session is an internal system session.
scb | session control block to use |
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 reached.
scb | session control block to check |
int32 ses_message_indent_count | ( | const ses_cb_t * | scb | ) |
Get the message indent count for this session.
scb | session control block to check |
ses_cb_t * ses_new_coap_scb | ( | void | ) |
Create a new global CoAP session control block.
ses_cb_t * ses_new_dummy_scb | ( | void | ) |
Create a new dummy session control block.
int32 ses_new_indent_count | ( | boolean | indent_in, |
int32 | indent, | ||
int32 | indent_amount | ||
) |
Get the new indent count from the current and indent_amount.
indent_in | TRUE if indenting in, FALSE if indenting out |
indent | current indent value |
indent_amount | session indent amount |
ses_cb_t * ses_new_scb | ( | void | ) |
Create a new session control block.
ses_cb_t * ses_new_snmp_scb | ( | void | ) |
Create a new global SNMP session control block.
boolean ses_notifications_active | ( | const ses_cb_t * | scb | ) |
Check if the session has notifications active.
scb | session control block to check |
boolean ses_poll_ready | ( | ses_cb_t * | scb | ) |
Check if the specified session is ready to read bytes.
scb | session control block to use |
boolean ses_protocol_requested | ( | ses_cb_t * | scb, |
ncx_protocol_t | proto | ||
) |
check if the NETCONF protocol version was requested
scb | session to check |
proto | protocol to check |
void ses_put_binchar | ( | ses_cb_t * | scb, |
uint32 | ch | ||
) |
Write one binary char to the session, without any translation.
The following depends on agt_profile settings in the server
NO CHARS ARE ACTUALLY WRITTEN TO A REAL SESSION!!! The 'output ready' indicator will be set and the session queued in the outreadyQ. Non-blocking IO functions will send the data when the connection allows.
scb | session control block to start msg |
ch | xmlChar to write, cast as uint32 to avoid compiler warnings |
void ses_put_binstr | ( | ses_cb_t * | scb, |
const xmlChar * | str, | ||
uint32 | len | ||
) |
Write a binary string to the session.
scb | session control block to start msg |
str | string to write |
len | number of bytes to write |
void ses_put_extern | ( | ses_cb_t * | scb, |
const xmlChar * | fname | ||
) |
write the contents of a file to the session
DO NOT USE THIS FUNCTION! USE ses_put_extern2 in the server!
scb | session to write |
fname | filespec to write |
write the contents of a file to the session
scb | session to write |
fname | filespec to write |
write the contents of a binary file to the session
scb | session to write |
fname | filespec to write |
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 session
ILLEGAL XML CHARS ARE CONVERTED TO CHAR ENTITIES
scb | session control block to start msg |
str | string to write |
indent | current indent amount |
void ses_putcchar | ( | ses_cb_t * | scb, |
uint32 | ch | ||
) |
Write one content char to the session, with translation as needed.
scb | session control block to write |
ch | xmlChar to write, cast as uint32 to avoid compiler warnings |
void ses_putchar | ( | ses_cb_t * | scb, |
uint32 | ch | ||
) |
Write one char to the session, without any translation.
The following depends on agt_profile settings in the server
NO CHARS ARE ACTUALLY WRITTEN TO A REAL SESSION!!! The 'output ready' indicator will be set and the session queued in the outreadyQ. Non-blocking IO functions will send the data when the connection allows.
scb | session control block to start msg |
ch | xmlChar to write, cast as uint32 to avoid compiler warnings |
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
ILLEGAL XML CHARS ARE CONVERTED TO CHAR ENTITIES
scb | session control block to start msg |
str | string to write |
indent | current indent amount |
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
ILLEGAL XML CHARS ARE CONVERTED TO CHAR ENTITIES
scb | session control block to start msg |
str | string to write |
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
ILLEGAL JSON CHARS ARE CONVERTED TO ESCAPED CHARS
scb | session control block to start msg |
str | string to write |
indent | current indent amount |
void ses_putstr | ( | ses_cb_t * | scb, |
const xmlChar * | str | ||
) |
Write a zero-terminated string to the session.
scb | session control block to start msg |
str | string to write |
void ses_putstr_indent | ( | ses_cb_t * | scb, |
const xmlChar * | str, | ||
int32 | indent | ||
) |
Write a zero-terminated content string to the session with indentation.
A newline plus indent is done first
ILLEGAL XML CHARS ARE CONVERTED TO CHAR ENTITIES
scb | session control block to start msg |
str | string to write |
indent | current indent amount |
int ses_read_cb | ( | void * | context, |
char * | buffer, | ||
int | len | ||
) |
The IO input front-end for the xmlTextReader parser read fn.
Need to separate the input stream into separate XML instance documents and reset the xmlTextReader each time a new document is encountered. For SSH, also need to detect the EOM flag and remove it + control input to the reader.
Uses a complex state machine which does not assume that the input from the network is going to arrive in well-formed chunks. It has to be treated as a byte stream (SOCK_STREAM).
Does not remove char entities or any XML, just the SSH EOM directive
context | scb pointer for the session to read |
buffer | char buffer to fill |
len | length of the buffer |
Set the specified session as a control session.
scb | session control block to use |
void ses_set_dbapi_session | ( | ses_cb_t * | scb | ) |
Set the specified session as a DB-API control session.
scb | session control block to use |
void ses_set_dbapi_system_session | ( | ses_cb_t * | scb | ) |
Set the specified session as a DB-API control session for system edits.
scb | session control block to use |
Set the RESTCONF entry_point.
scb | session control block to check |
point | entry point string |
void ses_set_extern_xml_mode | ( | ses_cb_t * | scb, |
boolean | rawxml_mode | ||
) |
Setup the scb for external XML parsing.
scb | session to check |
rawxml_mode | TRUE if loading file for expand_rawxml Unknown namespace decls will cause an error Other attributes will be preseved. == FALSE to use INVALID namespace in parsing and convert nc:operation and other known attributes |
void ses_set_extern_xml_mode_ex | ( | ses_cb_t * | scb, |
boolean | rawxml_mode, | ||
boolean | keep_xmlns | ||
) |
Setup the scb for external XML parsing.
scb | session to check |
rawxml_mode | TRUE if loading file for expand_rawxml Unknown namespace decls will cause an error Other attributes will be preseved. == FALSE to use INVALID namespace in parsing and convert nc:operation and other known attributes |
keep_xmlns | TRUE to keep xmlns attributes; FALSE to ignore them |
Setup the session in file write override mode.
scb | session control block to change |
filespec | output filespec |
is_binary | TRUE if the content of this file is binary |
Set the specified session as a gNMI control session.
scb | session control block to use |
void ses_set_gnmi_session | ( | ses_cb_t * | scb | ) |
Set the specified session as a gNMI session.
scb | session control block to use |
Set the specified session as a gRPC control session.
scb | session control block to use |
void ses_set_grpc_session | ( | ses_cb_t * | scb | ) |
Set the specified session as a gRPC session.
scb | session control block to use |
void ses_set_indent | ( | ses_cb_t * | scb, |
int32 | indent | ||
) |
Set the logging indent count for this session.
scb | session control block to check |
indent | value to use (may get adjusted) |
void ses_set_message_indent | ( | ses_cb_t * | scb, |
int32 | indent | ||
) |
Set the message indent count for this session.
scb | session control block to cchange |
indent | message indent amount |
void ses_set_mode | ( | ses_cb_t * | scb, |
ses_mode_t | mode | ||
) |
Set the output mode for the specified session.
scb | session control block to set |
mode | new mode value |
void ses_set_out_encoding | ( | ses_cb_t * | scb, |
ncx_display_mode_t | encoding | ||
) |
Set the output encoding.
scb | session to check |
encoding | output encoding to set |
status_t ses_set_protocol | ( | ses_cb_t * | scb, |
ncx_protocol_t | proto | ||
) |
set the NETCONF protocol version in use
scb | session to set |
proto | protocol to set |
void ses_set_protocols_requested | ( | ses_cb_t * | scb, |
ncx_protocol_t | proto | ||
) |
set the NETCONF protocol versions requested
scb | session to set |
proto | protocol to set |
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 RESTCONF/HTTP.
scb | session to check |
void ses_set_xml_nons | ( | ses_cb_t * | scb | ) |
force xmlns attributes to be skipped in XML mode
scb | session to set |
void ses_start_checksum | ( | ses_cb_t * | scb | ) |
Clear the checksum field and start checksum mode.
scb | session control block to change |
Start outputting buffers in HTTP 1.1 chunk mode.
scb | session control block to start HTTP chunk mode |
Start a new outbound message on the specified session.
scb | session control block to start msg |
void ses_start_msg_mode | ( | ses_cb_t * | scb | ) |
Set the message output mode to active.
scb | session control block to set |
const xmlChar * ses_state_name | ( | ses_state_t | state | ) |
Get the name of a session state from the enum value.
state | session state enum value |
void ses_stop_msg_mode | ( | ses_cb_t * | scb | ) |
Set the message output mode to inactive.
scb | session control block to set |
ncx_withdefaults_t ses_withdef | ( | const ses_cb_t * | scb | ) |
Get the with-defaults value for this session.
scb | session control block to check |