yumapro  24.10-1
YumaPro SDK
Loading...
Searching...
No Matches
CBOR Output Functions

CBOR output to a session control block or a file. More...

Collaboration diagram for CBOR Output Functions:

Data Structures

struct  cbor_wr_parms_t
 Parameter Request Block used instead of passing lots of leafs. More...
 
struct  cbor_walker_cookie_t
 XML walker cookie for GET callback processing. More...
 

Functions

void cbor_wr_begin_elem (ses_cb_t *scb, xml_msg_hdr_t *msg, obj_template_t *obj, cbor_wr_parms_t *parms)
 Write a start CBOR node to the specified session. More...
 
void cbor_wr_begin_list (ses_cb_t *scb, xml_msg_hdr_t *msg)
 Write a start CBOR list entry. More...
 
void cbor_wr_end_elem (ses_cb_t *scb, xml_msg_hdr_t *msg, obj_template_t *obj)
 Write an end container: indef (break) to the specified session. More...
 
void cbor_wr_string_elem (ses_cb_t *scb, xml_msg_hdr_t *msg, const xmlChar *strval, obj_template_t *obj, cbor_wr_parms_t *parms)
 Write a string CBOR node to the specified session. More...
 
void cbor_wr_uint_elem (ses_cb_t *scb, xml_msg_hdr_t *msg, uint64 val, obj_template_t *obj, cbor_wr_parms_t *parms)
 Write a UINT CBOR node to the specified session. More...
 
void cbor_wr_val (ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, cbor_wr_parms_t *parms)
 Output val_value_t node contents only. More...
 
void cbor_wr_child_obj (ses_cb_t *scb, xml_msg_hdr_t *msg, getcb_get2_t *parent_get2cb, obj_template_t *objnode, cbor_wr_parms_t *parms)
 Write an entire <get2> val_value_t out from the obj_template_t callback. More...
 
void cbor_wr_start_msg (ses_cb_t *scb)
 Write the CBOR start message byte. More...
 
status_t cbor_wr_file (const xmlChar *filespec, xml_msg_hdr_t *hdr, val_value_t *val, cbor_wr_parms_t *parms)
 Write the specified value to a FILE in CBOR format. More...
 
status_t cbor_wr_open_file (FILE *fp, xml_msg_hdr_t *hdr, val_value_t *val, cbor_wr_parms_t *parms)
 Write the specified value to an open FILE in CBOR format. More...
 

Detailed Description

CBOR output to a session control block or a file.

Function Documentation

◆ cbor_wr_begin_elem()

void cbor_wr_begin_elem ( ses_cb_t scb,
xml_msg_hdr_t msg,
obj_template_t obj,
cbor_wr_parms_t parms 
)

Write a start CBOR node to the specified session.

Parameters
scbsession control block
msgtop header from message in progress
objobject template to use
parmsCBOR write parms
  • parent_sid forced parent SID to use (if non-zero)
  • force_parent_sid forced parent SID to use (even if zero)
  • To start a top container use parent_sid=0 and force_parent_prefix = true

◆ cbor_wr_begin_list()

void cbor_wr_begin_list ( ses_cb_t scb,
xml_msg_hdr_t msg 
)

Write a start CBOR list entry.

Call for each list entry from agt_tree_get2.c Write a start YANG list entry Call cbor_wr_end_list to finish list entry

Parameters
scbsession control block
msgtop header from message in progress

◆ cbor_wr_child_obj()

void cbor_wr_child_obj ( ses_cb_t scb,
xml_msg_hdr_t msg,
getcb_get2_t parent_get2cb,
obj_template_t objnode,
cbor_wr_parms_t parms 
)

Write an entire <get2> val_value_t out from the obj_template_t callback.

Using an optional testfn to filter output Start from parent_get2cb, not parent object node

Parameters
scbsession control block
msgxml_msg_hdr_t in progress
parent_get2cbparent get2 control block of the object to write
objnodechild object node to write
parmsset of write parameters to use, may be NULL ot accept all defaults
Here is the call graph for this function:

◆ cbor_wr_end_elem()

void cbor_wr_end_elem ( ses_cb_t scb,
xml_msg_hdr_t msg,
obj_template_t obj 
)

Write an end container: indef (break) to the specified session.

Parameters
scbsession control block
msgtop header from message in progress
objobject being ended (can be NULL if unknown)
Here is the call graph for this function:

◆ cbor_wr_file()

status_t cbor_wr_file ( const xmlChar *  filespec,
xml_msg_hdr_t hdr,
val_value_t val,
cbor_wr_parms_t parms 
)

Write the specified value to a FILE in CBOR format.

This is a main module API for high level code.

Parameters
filespecexact path of filename to open
hdrxml_msg_hdr_t for processing (NULL to use empty hdr)
valvalue for output
parmsCBOR write parms
Returns
status
Here is the call graph for this function:

◆ cbor_wr_open_file()

status_t cbor_wr_open_file ( FILE *  fp,
xml_msg_hdr_t hdr,
val_value_t val,
cbor_wr_parms_t parms 
)

Write the specified value to an open FILE in CBOR format.

This is a main module API for high level code

Parameters
fpopen FILE control block
hdrxml_msg_hdr_t for processing (NULL to use empty hdr)
valvalue for output
parmsCBOR write parms
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cbor_wr_start_msg()

void cbor_wr_start_msg ( ses_cb_t scb)

Write the CBOR start message byte.

Writes a map(1) start. No finish_msg is required! The cbor_wr_ functions are expected to output one <identifier, value> map representing the top-level object

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

◆ cbor_wr_string_elem()

void cbor_wr_string_elem ( ses_cb_t scb,
xml_msg_hdr_t msg,
const xmlChar *  strval,
obj_template_t obj,
cbor_wr_parms_t parms 
)

Write a string CBOR node to the specified session.

Parameters
scbsession control block
msgtop header from message in progress
strval== string value to write
objobject template to use
parmsCBOR write parms
  • parent_sid forced parent SID to use (if non-zero)
  • force_parent_sid forced parent SID to use (even if zero)
  • It is expected that a parent-level map entry is in progress.
  • A map entry using the object SID or name is writter

◆ cbor_wr_uint_elem()

void cbor_wr_uint_elem ( ses_cb_t scb,
xml_msg_hdr_t msg,
uint64  val,
obj_template_t obj,
cbor_wr_parms_t parms 
)

Write a UINT CBOR node to the specified session.

Parameters
scbsession control block
msgtop header from message in progress
val== UINT value to write
objobject template to use
parmsCBOR write parms
  • parent_sid forced parent SID to use (if non-zero)
  • force_parent_sid forced parent SID to use (even if zero)
  • It is expected that a parent-level map entry is in progress.
  • A map entry using the object SID or name is writter

◆ cbor_wr_val()

void cbor_wr_val ( ses_cb_t scb,
xml_msg_hdr_t msg,
val_value_t val,
cbor_wr_parms_t parms 
)

Output val_value_t node contents only.

Write an NCX value node in CBOR encoding See cbor_wr_check_write for full details of this fn. It is the same, except a NULL testfn is supplied.

Parameters
scbsession control block
msgxml_msg_hdr_t in progress
valvalue to write
parmsthe set of write parameters to use
Here is the caller graph for this function: