yumapro  23.10T-6
YumaPro SDK
Loading...
Searching...
No Matches
Core Session Support Functions

Core Functions to manage, read, and write sessions. More...

Collaboration diagram for Core Session Support Functions:

Functions

ses_cb_tses_new_scb (void)
 Create a new session control block. More...
 
ses_cb_tses_new_dummy_scb (void)
 Create a new dummy session control block. More...
 
ses_cb_tses_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_tses_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_tses_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...
 

Detailed Description

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.

Function Documentation

◆ ses_accept_input()

status_t ses_accept_input ( ses_cb_t scb)

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

Parameters
scbsession control block to accept input for
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Parameters
scbsession control block to check
objbreadcrumb object to add
Returns
status ERR_NCX_DEF_LOOP if duplicate found

◆ ses_add_indent()

int32 ses_add_indent ( ses_cb_t scb,
int32  indent 
)

Add in the new indent amount.

Parameters
scbsession control block
indentcurrent indent amount
Returns
new indent amount
Here is the call graph for this function:

◆ ses_clean_breadcrumbQ()

void ses_clean_breadcrumbQ ( ses_cb_t scb)

Clean the breadcrumbQ.

Parameters
scbsession control block to check
Here is the call graph for this function:

◆ ses_clear_dbapi_system_session()

void ses_clear_dbapi_system_session ( ses_cb_t scb)

Clear a session of the DB-API system status.

Parameters
scbsession control block to use

◆ 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.

Parameters
scbsession to check
rawxml_modeTRUE 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
Here is the call graph for this function:

◆ 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.

Parameters
scbsession to check
rawxml_modeTRUE 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_xmlnsTRUE to keep xmlns attributes; FALSE to ignore them
Here is the caller graph for this function:

◆ 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!

Parameters
scbsession control block to change
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ses_dec_indent()

int32 ses_dec_indent ( ses_cb_t scb,
int32  indent 
)

Remove the specified indent amount.

Parameters
scbsession control block
indentcurrent indent amount
Returns
new indent amount
Here is the call graph for this function:

◆ ses_dropped()

boolean ses_dropped ( const ses_cb_t scb)

Check if the session has been dropped by the client.

Parameters
scbsession control block to check
Returns
true if session shutting down due to session dropped; false if not
Here is the caller graph for this function:

◆ ses_dropped_ex()

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

Parameters
scbsession control block to check
Returns
true if session shutting down due to session dropped; false if not

◆ ses_dump_binary_buff()

void ses_dump_binary_buff ( const xmlChar *  buff,
size_t  bufflen 
)

Dump some bytes from the binary buffer (max 256)

Parameters
buffbuffer to dump
bufflennumber of bytes in the buffer
Here is the caller graph for this function:

◆ ses_finish_checksum()

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

Parameters
scbsession control block to change
[out]checksum_cntaddress of return checksum byte count
  • *checksum_cnt number of bytes in checksum calculation
Returns
final checksum
Here is the caller graph for this function:

◆ ses_finish_msg()

void ses_finish_msg ( ses_cb_t scb)

Finish an outbound message on the specified session.

Parameters
scbsession control block to finish msg
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ses_free_scb()

void ses_free_scb ( ses_cb_t scb)

Free a session control block.

Parameters
scbsession control block to free
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Parameters
scbsession control block to use free
scb->reader will be NULL
Here is the call graph for this function:

◆ ses_get_entry_point()

const xmlChar * ses_get_entry_point ( ses_cb_t scb)

Get the RESTCONF entry_point.

Parameters
scbsession control block to check
Returns
entry point or NULL if none

◆ ses_get_mode()

ses_mode_t ses_get_mode ( ses_cb_t scb)

Get the output mode for the specified session.

Parameters
scbsession control block to get
Returns
session mode value
Here is the caller graph for this function:

◆ 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.

Parameters
scbsession to get
Returns
message encoding enumeration in use

◆ ses_get_out_encoding()

ncx_display_mode_t ses_get_out_encoding ( ses_cb_t scb)

Get the output encoding.

Parameters
scbsession to check
Returns
session output encoding
Here is the caller graph for this function:

◆ ses_get_protocol()

ncx_protocol_t ses_get_protocol ( const ses_cb_t scb)

Get the NETCONF protocol set (or unset) for this session.

Parameters
scbsession to get
Returns
protocol enumeration in use
Here is the caller graph for this function:

◆ ses_get_total_stats()

ses_total_stats_t * ses_get_total_stats ( void  )

Get a r/w pointer to the the session totals stats.

Returns
pointer to the global session stats struct
Here is the caller graph for this function:

◆ ses_get_transport()

ses_transport_t ses_get_transport ( ses_cb_t scb)

Get the transport enum for a given session.

Same as SES_TRANSPORT(S)

Parameters
scbsession control block
Returns
enum for transport type
Here is the caller graph for this function:

◆ ses_get_transport_enum()

ses_transport_t ses_get_transport_enum ( const xmlChar *  str)

Get the enum value for the yumaworks-types:transport-type.

Parameters
strstring with enum value
Returns
ses_transport_t enum value
Here is the call graph for this function:

◆ 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.

Parameters
transportses_transport_t enum value
Returns
pointer to the string value for the specified enum
Here is the caller graph for this function:

◆ 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.

Use the yumaworks-types:transport-type enumerations

Parameters
transportses_transport_t enum value
Returns
pointer to the string value for the specified enum

◆ ses_get_xml_nons()

boolean ses_get_xml_nons ( const ses_cb_t scb)

force xmlns attributes to be skipped in XML mode

Parameters
scbsession to get
Returns
TRUE if no xmlns attributes set
FALSE if OK to use xmlns attributes

◆ 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.

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

Parameters
[out]fillbuffbuffer to contain the next input line
  • fillbuff has line copied into it; zero-terminated
fillbuffsizenumber of bytes allowed in fillbuff
cookieuser cookie passed at init time
Returns
status
Here is the call graph for this function:

◆ ses_indent()

void ses_indent ( ses_cb_t scb,
int32  indent 
)

Write the proper newline + indentation to the specified session.

Parameters
scbsession control block to start msg
indentnumber 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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ses_indent_count()

int32 ses_indent_count ( const ses_cb_t scb)

Get the logging indent count for this session.

Parameters
scbsession control block to check
Returns
logging indent value for the session
Here is the caller graph for this function:

◆ ses_init_coap_scb()

void ses_init_coap_scb ( ses_cb_t scb)

Initialize a CoAP session control block.

Parameters
scbsession control block to initialize
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ses_is_control_session()

boolean ses_is_control_session ( ses_cb_t scb)

Check if the specified session is a control session.

Parameters
scbsession control block to use
Returns
TRUE if a control session
Here is the caller graph for this function:

◆ ses_is_dbapi_session()

boolean ses_is_dbapi_session ( ses_cb_t scb)

Check if the specified session is a DB-API control session.

Parameters
scbsession control block to use
Returns
TRUE if a DB-API control session

◆ 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.

Parameters
scbsession control block to use
Returns
TRUE if a DB-API control session
Here is the caller graph for this function:

◆ 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.

Parameters
scbsession control block to use
Returns
TRUE if a DB-API control session

◆ ses_is_gnmi_session()

boolean ses_is_gnmi_session ( ses_cb_t scb)

Check if the specified session is a gNMI session.

Parameters
scbsession control block to use
Returns
TRUE if a gNMI control session

◆ ses_is_grpc_control_session()

boolean ses_is_grpc_control_session ( ses_cb_t scb)

Check if the specified session is a gRPC control session.

Parameters
scbsession control block to use
Returns
TRUE if a DB-API control session

◆ ses_is_grpc_session()

boolean ses_is_grpc_session ( ses_cb_t scb)

Check if the specified session is a gRPC session.

Parameters
scbsession control block to use
Returns
TRUE if a gRPC control session

◆ ses_is_system_session()

boolean ses_is_system_session ( ses_cb_t scb)

Check if the specified session is an internal system session.

Parameters
scbsession control block to use
Returns
TRUE if an internal dummy session
Here is the caller graph for this function:

◆ 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 reached.

Parameters
scbsession control block to check
Returns
number of bytes left, or zero if limit already reached

◆ ses_message_indent_count()

int32 ses_message_indent_count ( const ses_cb_t scb)

Get the message indent count for this session.

Parameters
scbsession control block to check
Returns
message indent value for the session
Here is the caller graph for this function:

◆ ses_new_coap_scb()

ses_cb_t * ses_new_coap_scb ( void  )

Create a new global CoAP session control block.

Returns
pointer to initialized SCB, or NULL if malloc error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ses_new_dummy_scb()

ses_cb_t * ses_new_dummy_scb ( void  )

Create a new dummy session control block.

Returns
pointer to initialized SCB, or NULL if malloc error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Parameters
indent_inTRUE if indenting in, FALSE if indenting out
indentcurrent indent value
indent_amountsession indent amount
Returns
new indent amount
Here is the caller graph for this function:

◆ ses_new_scb()

ses_cb_t * ses_new_scb ( void  )

Create a new session control block.

Returns
pointer to initialized SCB, or NULL if malloc error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ses_new_snmp_scb()

ses_cb_t * ses_new_snmp_scb ( void  )

Create a new global SNMP session control block.

Returns
pointer to initialized SCB, or NULL if malloc error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ses_notifications_active()

boolean ses_notifications_active ( const ses_cb_t scb)

Check if the session has notifications active.

Parameters
scbsession control block to check
Returns
TRUE if notifications are active; FALSE if not

◆ ses_poll_ready()

boolean ses_poll_ready ( ses_cb_t scb)

Check if the specified session is ready to read bytes.

Parameters
scbsession control block to use
Returns
TRUE if fd is set and reports POLLIN in the poll() function; FALSE otherwise

◆ ses_protocol_requested()

boolean ses_protocol_requested ( ses_cb_t scb,
ncx_protocol_t  proto 
)

check if the NETCONF protocol version was requested

Parameters
scbsession to check
protoprotocol to check
Returns
TRUE is requested; FALSE otherwise

◆ ses_put_binchar()

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.

Parameters
scbsession control block to start msg
chxmlChar to write, cast as uint32 to avoid compiler warnings
Here is the caller graph for this function:

◆ ses_put_binstr()

void ses_put_binstr ( ses_cb_t scb,
const xmlChar *  str,
uint32  len 
)

Write a binary string to the session.

Parameters
scbsession control block to start msg
strstring to write
lennumber of bytes to write
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ses_put_extern()

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!

Parameters
scbsession to write
fnamefilespec to write
Here is the call graph for this function:

◆ ses_put_extern2()

status_t ses_put_extern2 ( ses_cb_t scb,
const xmlChar *  fname 
)

write the contents of a file to the session

Parameters
scbsession to write
fnamefilespec to write
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ses_put_extern_bin()

status_t ses_put_extern_bin ( ses_cb_t scb,
const xmlChar *  fname 
)

write the contents of a binary file to the session

Parameters
scbsession to write
fnamefilespec to write
Returns
status
Here is the call graph for this function:

◆ 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 session

ILLEGAL XML CHARS ARE CONVERTED TO CHAR ENTITIES

Parameters
scbsession control block to start msg
strstring to write
indentcurrent indent amount
Here is the call graph for this function:

◆ ses_putcchar()

void ses_putcchar ( ses_cb_t scb,
uint32  ch 
)

Write one content char to the session, with translation as needed.

Parameters
scbsession control block to write
chxmlChar to write, cast as uint32 to avoid compiler warnings
Here is the call graph for this function:

◆ ses_putchar()

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.

Parameters
scbsession control block to start msg
chxmlChar to write, cast as uint32 to avoid compiler warnings
Here is the caller graph for this function:

◆ 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

ILLEGAL XML CHARS ARE CONVERTED TO CHAR ENTITIES

Parameters
scbsession control block to start msg
strstring to write
indentcurrent indent amount
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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

ILLEGAL XML CHARS ARE CONVERTED TO CHAR ENTITIES

Parameters
scbsession control block to start msg
strstring to write
Here is the call graph for this function:

◆ 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

ILLEGAL JSON CHARS ARE CONVERTED TO ESCAPED CHARS

Parameters
scbsession control block to start msg
strstring to write
indentcurrent indent amount
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ses_putstr()

void ses_putstr ( ses_cb_t scb,
const xmlChar *  str 
)

Write a zero-terminated string to the session.

Parameters
scbsession control block to start msg
strstring to write
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

A newline plus indent is done first

ILLEGAL XML CHARS ARE CONVERTED TO CHAR ENTITIES

Parameters
scbsession control block to start msg
strstring to write
indentcurrent indent amount
Here is the call graph for this function:

◆ ses_read_cb()

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

Parameters
contextscb pointer for the session to read
bufferchar buffer to fill
lenlength of the buffer
Returns
number of bytes read into the buffer
-1 indicates error and EOF
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ses_set_control_session()

status_t ses_set_control_session ( ses_cb_t scb)

Set the specified session as a control session.

Parameters
scbsession control block to use
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ses_set_dbapi_session()

void ses_set_dbapi_session ( ses_cb_t scb)

Set the specified session as a DB-API control session.

Parameters
scbsession control block to use

◆ 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.

Parameters
scbsession control block to use

◆ ses_set_entry_point()

status_t ses_set_entry_point ( ses_cb_t scb,
const xmlChar *  point 
)

Set the RESTCONF entry_point.

Parameters
scbsession control block to check
pointentry point string
Returns
status
Here is the call graph for this function:

◆ 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.

Parameters
scbsession to check
rawxml_modeTRUE 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
Here is the call graph for this function:

◆ 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.

Parameters
scbsession to check
rawxml_modeTRUE 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_xmlnsTRUE to keep xmlns attributes; FALSE to ignore them
Here is the caller graph for this function:

◆ ses_set_file_override()

status_t ses_set_file_override ( ses_cb_t scb,
const xmlChar *  filespec,
boolean  is_binary 
)

Setup the session in file write override mode.

Parameters
scbsession control block to change
filespecoutput filespec
is_binaryTRUE if the content of this file is binary
Returns
status
Here is the caller graph for this function:

◆ 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.

Parameters
scbsession control block to use
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ses_set_gnmi_session()

void ses_set_gnmi_session ( ses_cb_t scb)

Set the specified session as a gNMI session.

Parameters
scbsession control block to use

◆ ses_set_grpc_control_session()

status_t ses_set_grpc_control_session ( ses_cb_t scb)

Set the specified session as a gRPC control session.

Parameters
scbsession control block to use
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ses_set_grpc_session()

void ses_set_grpc_session ( ses_cb_t scb)

Set the specified session as a gRPC session.

Parameters
scbsession control block to use

◆ ses_set_indent()

void ses_set_indent ( ses_cb_t scb,
int32  indent 
)

Set the logging indent count for this session.

Parameters
scbsession control block to check
indentvalue to use (may get adjusted)

◆ ses_set_message_indent()

void ses_set_message_indent ( ses_cb_t scb,
int32  indent 
)

Set the message indent count for this session.

Parameters
scbsession control block to cchange
indentmessage indent amount

◆ ses_set_mode()

void ses_set_mode ( ses_cb_t scb,
ses_mode_t  mode 
)

Set the output mode for the specified session.

Parameters
scbsession control block to set
modenew mode value
Here is the caller graph for this function:

◆ ses_set_out_encoding()

void ses_set_out_encoding ( ses_cb_t scb,
ncx_display_mode_t  encoding 
)

Set the output encoding.

Parameters
scbsession to check
encodingoutput encoding to set
Here is the caller graph for this function:

◆ ses_set_protocol()

status_t ses_set_protocol ( ses_cb_t scb,
ncx_protocol_t  proto 
)

set the NETCONF protocol version in use

Parameters
scbsession to set
protoprotocol to set
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ses_set_protocols_requested()

void ses_set_protocols_requested ( ses_cb_t scb,
ncx_protocol_t  proto 
)

set the NETCONF protocol versions requested

Parameters
scbsession to set
protoprotocol to set
Here is the caller graph for this function:

◆ 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 RESTCONF/HTTP.

Parameters
scbsession to check
Here is the caller graph for this function:

◆ ses_set_xml_nons()

void ses_set_xml_nons ( ses_cb_t scb)

force xmlns attributes to be skipped in XML mode

Parameters
scbsession to set
Here is the caller graph for this function:

◆ ses_start_checksum()

void ses_start_checksum ( ses_cb_t scb)

Clear the checksum field and start checksum mode.

Parameters
scbsession control block to change
Here is the caller graph for this function:

◆ 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.

Parameters
scbsession control block to start HTTP chunk mode
Returns
status
Here is the call graph for this function:

◆ ses_start_msg()

status_t ses_start_msg ( ses_cb_t scb)

Start a new outbound message on the specified session.

Parameters
scbsession control block to start msg
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ses_start_msg_mode()

void ses_start_msg_mode ( ses_cb_t scb)

Set the message output mode to active.

Parameters
scbsession control block to set
Here is the caller graph for this function:

◆ ses_state_name()

const xmlChar * ses_state_name ( ses_state_t  state)

Get the name of a session state from the enum value.

Parameters
statesession state enum value
Returns
staing corresponding to the state name

◆ ses_stop_msg_mode()

void ses_stop_msg_mode ( ses_cb_t scb)

Set the message output mode to inactive.

Parameters
scbsession control block to set
Here is the caller graph for this function:

◆ ses_withdef()

ncx_withdefaults_t ses_withdef ( const ses_cb_t scb)

Get the with-defaults value for this session.

Parameters
scbsession control block to check
Returns
with-defaults value for the session
Here is the caller graph for this function: