yumapro
24.10-1
YumaPro SDK
|
YANG Patch Support (RFC 8072) More...
Data Structures | |
struct | yang_patch_edit_t |
Represents one YANG Patch edit entry. More... | |
struct | yang_patch_cb_t |
One YANG Patch Request. More... | |
Enumerations | |
enum | yang_patch_op_t { YANG_PATCH_OP_NONE , YANG_PATCH_OP_CREATE , YANG_PATCH_OP_DELETE , YANG_PATCH_OP_INSERT , YANG_PATCH_OP_MERGE , YANG_PATCH_OP_MOVE , YANG_PATCH_OP_REPLACE , YANG_PATCH_OP_REMOVE } |
YANG Patch operation type. More... | |
enum | yang_patch_edit_type_t { YANG_PATCH_EDIT_TYPE_NONE , YANG_PATCH_EDIT_TYPE_USER , YANG_PATCH_EDIT_TYPE_SYSTEM } |
Internal edit type for access control and DB-API support. More... | |
enum | yang_patch_where_t { YANG_PATCH_WHERE_NONE , YANG_PATCH_WHERE_BEFORE , YANG_PATCH_WHERE_AFTER , YANG_PATCH_WHERE_FIRST , YANG_PATCH_WHERE_LAST } |
YANG Patch insert location. More... | |
Functions | |
status_t | yang_patch_init (void) |
Load the ietf-yang-patch module. More... | |
void | yang_patch_cleanup (void) |
Cleanup the yang_patch module. More... | |
yang_patch_cb_t * | yang_patch_new_cb (const xmlChar *patch_id, const xmlChar *the_comment, const xmlChar *target) |
Malloc a new YANG Patch control block. More... | |
void | yang_patch_free_cb (yang_patch_cb_t *pcb) |
Free a YANG Patch control block. More... | |
void | yang_patch_free_edit (yang_patch_edit_t *edit) |
Free a YANG Patch edit control block. More... | |
yang_patch_edit_t * | yang_patch_new_edit (const xmlChar *edit_id, yang_patch_op_t operation, const xmlChar *target, const xmlChar *point, yang_patch_where_t insert_where, val_value_t *value) |
Malloc a new YANG Patch edit control block Any of the fields can be NULL to add later or not use. More... | |
yang_patch_edit_t * | yang_patch_new_edit2 (const xmlChar *edit_id, yang_patch_op_t operation, const xmlChar *target, const xmlChar *point, yang_patch_where_t insert_where, val_value_t *value, boolean plain_clone) |
Malloc a new YANG Patch edit control block Any of the fields can be NULL to add later or not use. More... | |
void | yang_patch_add_edit (yang_patch_cb_t *pcb, yang_patch_edit_t *edit) |
Malloc and add new YANG Patch edit control block. More... | |
yang_patch_edit_t * | yang_patch_find_edit (yang_patch_cb_t *pcb, const xmlChar *edit_id) |
Find an edit by its edit_id in the YANG Patch. More... | |
uint32 | yang_patch_edit_count (yang_patch_cb_t *pcb) |
Get the number of edits in the PCB. More... | |
yang_patch_op_t | yang_patch_str_to_op (const xmlChar *opstr) |
Convert a YANG Patch operation string to the operation enumeration for the string. More... | |
const xmlChar * | yang_patch_op_to_str (yang_patch_op_t op) |
Convert a YANG Patch operation enum to the operation string for the enumeration. More... | |
yang_patch_edit_type_t | yang_patch_str_to_edit_type (const xmlChar *str) |
Convert a YANG Patch edit-type string to the edit_type enumeration for the string. More... | |
const xmlChar * | yang_patch_edit_type_to_str (yang_patch_edit_type_t typ) |
Convert a YANG Patch edit type enum to the string for the enumeration. More... | |
yang_patch_where_t | yang_patch_str_to_where (const xmlChar *wherestr) |
Convert a YANG Patch where string to the where enumeration for the string. More... | |
const xmlChar * | yang_patch_where_to_str (yang_patch_where_t wh) |
Convert a YANG Patch where enum to the where string for the enumeration. More... | |
val_value_t * | yang_patch_edit_to_value (obj_template_t *edit_obj, yang_patch_edit_t *edit, status_t *res) |
Convert a YANG Patch edit to a val_value_t tree. More... | |
val_value_t * | yang_patch_to_value (obj_template_t *patch_obj, yang_patch_cb_t *pcb, status_t *res) |
Convert a YANG Patch control block to a val_value_t tree. More... | |
yang_patch_edit_t * | yang_patch_value_to_edit (val_value_t *edit_val, boolean preserve_editval, status_t *res) |
Convert a val_value_t tree to a YANG Patch edit. More... | |
yang_patch_cb_t * | yang_patch_value_to_patch (val_value_t *patch_val, const xmlChar *target, boolean preserve_patchval, status_t *res) |
Convert a val_value tree to a YANG Patch control block. More... | |
op_editop_t | yang_patch_op_to_editop (yang_patch_op_t op, boolean *is_insert) |
Convert a YANG Patch operation enum to the corresponding edit operation. More... | |
yang_patch_op_t | yang_patch_editop_to_op (op_editop_t edit_op) |
Convert an edit operation enum to a YANG Patch operation enum. More... | |
void | yang_patch_dump_pcb (yang_patch_cb_t *pcb) |
Dump the current Patch Control block with all the edits. More... | |
YANG Patch Support (RFC 8072)
enum yang_patch_op_t |
enum yang_patch_where_t |
void yang_patch_add_edit | ( | yang_patch_cb_t * | pcb, |
yang_patch_edit_t * | edit | ||
) |
Malloc and add new YANG Patch edit control block.
pcb | patch control block to add edit into |
edit | edit to add |
void yang_patch_cleanup | ( | void | ) |
Cleanup the yang_patch module.
void yang_patch_dump_pcb | ( | yang_patch_cb_t * | pcb | ) |
Dump the current Patch Control block with all the edits.
Debug function
pcb | Patch control block |
uint32 yang_patch_edit_count | ( | yang_patch_cb_t * | pcb | ) |
Get the number of edits in the PCB.
pcb | patch control block to check |
val_value_t * yang_patch_edit_to_value | ( | obj_template_t * | edit_obj, |
yang_patch_edit_t * | edit, | ||
status_t * | res | ||
) |
Convert a YANG Patch edit to a val_value_t tree.
edit_obj | object template for the <edit> list | |
edit | YANG Patch edit to convert | |
[out] | res | address of return status
|
const xmlChar * yang_patch_edit_type_to_str | ( | yang_patch_edit_type_t | typ | ) |
Convert a YANG Patch edit type enum to the string for the enumeration.
typ | enum to convert |
yang_patch_op_t yang_patch_editop_to_op | ( | op_editop_t | edit_op | ) |
Convert an edit operation enum to a YANG Patch operation enum.
This function does not handle insert and move since these are not NETCONF edit operations
edit_op | enum to convert |
yang_patch_edit_t * yang_patch_find_edit | ( | yang_patch_cb_t * | pcb, |
const xmlChar * | edit_id | ||
) |
Find an edit by its edit_id in the YANG Patch.
pcb | patch control block to search |
edit_id | to find |
void yang_patch_free_cb | ( | yang_patch_cb_t * | pcb | ) |
Free a YANG Patch control block.
pcb | YANG Patch control block to free |
void yang_patch_free_edit | ( | yang_patch_edit_t * | edit | ) |
Free a YANG Patch edit control block.
edit | YANG Patch edit control block to free |
status_t yang_patch_init | ( | void | ) |
Load the ietf-yang-patch module.
yang_patch_cb_t * yang_patch_new_cb | ( | const xmlChar * | patch_id, |
const xmlChar * | the_comment, | ||
const xmlChar * | target | ||
) |
Malloc a new YANG Patch control block.
patch_id | patch ID string (transaction-id) |
the_comment | user comment for entire patch |
target | unified datastore target resource for patch |
yang_patch_edit_t * yang_patch_new_edit | ( | const xmlChar * | edit_id, |
yang_patch_op_t | operation, | ||
const xmlChar * | target, | ||
const xmlChar * | point, | ||
yang_patch_where_t | insert_where, | ||
val_value_t * | value | ||
) |
Malloc a new YANG Patch edit control block Any of the fields can be NULL to add later or not use.
edit_id | edit ID string |
operation | YANG Patch operation |
target | relative offset to patch target |
point | insertion point if operation is insert of move |
insert_where | insertion type if operation is insert or move |
value | the value to use for the patch (if needed) |
yang_patch_edit_t * yang_patch_new_edit2 | ( | const xmlChar * | edit_id, |
yang_patch_op_t | operation, | ||
const xmlChar * | target, | ||
const xmlChar * | point, | ||
yang_patch_where_t | insert_where, | ||
val_value_t * | value, | ||
boolean | plain_clone | ||
) |
Malloc a new YANG Patch edit control block Any of the fields can be NULL to add later or not use.
edit_id | edit ID string |
operation | YANG Patch operation |
target | relative offset to patch target |
point | insertion point if operation is insert of move |
insert_where | insertion type if operation is insert or move |
value | the value to use for the patch (if needed) |
plain_clone | TRUE to clone clompletely FALSE to use clone_config_save |
op_editop_t yang_patch_op_to_editop | ( | yang_patch_op_t | op, |
boolean * | is_insert | ||
) |
Convert a YANG Patch operation enum to the corresponding edit operation.
op | enum to convert | |
[out] | is_insert | address of return is_insert flag
|
const xmlChar * yang_patch_op_to_str | ( | yang_patch_op_t | op | ) |
Convert a YANG Patch operation enum to the operation string for the enumeration.
op | enum to convert |
yang_patch_edit_type_t yang_patch_str_to_edit_type | ( | const xmlChar * | str | ) |
Convert a YANG Patch edit-type string to the edit_type enumeration for the string.
str | string to convert |
yang_patch_op_t yang_patch_str_to_op | ( | const xmlChar * | opstr | ) |
Convert a YANG Patch operation string to the operation enumeration for the string.
opstr | string to convert |
yang_patch_where_t yang_patch_str_to_where | ( | const xmlChar * | wherestr | ) |
Convert a YANG Patch where string to the where enumeration for the string.
wherestr | string to convert |
val_value_t * yang_patch_to_value | ( | obj_template_t * | patch_obj, |
yang_patch_cb_t * | pcb, | ||
status_t * | res | ||
) |
Convert a YANG Patch control block to a val_value_t tree.
patch_obj | object template for the <yang-patch> container | |
pcb | YANG Patch control block to convert | |
[out] | res | address of return status
|
yang_patch_edit_t * yang_patch_value_to_edit | ( | val_value_t * | edit_val, |
boolean | preserve_editval, | ||
status_t * | res | ||
) |
Convert a val_value_t tree to a YANG Patch edit.
edit_val | value node for the <edit> list | |
preserve_editval | TRUE to preserve the edit_val FALSE to move memory from edit_val to value tree as needed You need to call val_free_value(edit_val) after this is done and not continue to use the edit_val value tree | |
[out] | res | address of return status
|
yang_patch_cb_t * yang_patch_value_to_patch | ( | val_value_t * | patch_val, |
const xmlChar * | target, | ||
boolean | preserve_patchval, | ||
status_t * | res | ||
) |
Convert a val_value tree to a YANG Patch control block.
patch_val | value node for the <yang-patch> container | |
target | the target resource string from outside the YANG patch | |
preserve_patchval | TRUE to preserve the patch_val FALSE to move memory from patch_val to value tree as needed You need to call val_free_value(patch_val) after this is done and not continue to use the patch_val value tree | |
[out] | res | address of return status
|
const xmlChar * yang_patch_where_to_str | ( | yang_patch_where_t | wh | ) |
Convert a YANG Patch where enum to the where string for the enumeration.
wh | enum to convert |