yumapro  20.10-12
YumaPro SDK
agt_ypgnmi_set.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 - 2021, YumaWorks, Inc., All Rights Reserved.
3  *
4  * Unless required by applicable law or agreed to in writing,
5  * software distributed under the License is distributed on an
6  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
7  * KIND, either express or implied. See the License for the
8  * specific language governing permissions and limitations
9  * under the License.
10  */
11 #if defined(WITH_GNMI) && defined(WITH_RESTCONF) && defined(WITH_YCONTROL)
12 #ifndef _H_agt_ypgnmi_set
13 #define _H_agt_ypgnmi_set
14 
15 /* FILE: agt_ypgnmi_set.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
28 /*********************************************************************
29 * *
30 * C H A N G E H I S T O R Y *
31 * *
32 *********************************************************************
33 
34 date init comment
35 ----------------------------------------------------------------------
36 27-JULE-18 am Begun
37 */
38 
39 #ifndef _H_ncxtypes
40 #include "ncxtypes.h"
41 #endif
42 
43 #ifndef _H_dlq
44 #include "dlq.h"
45 #endif
46 
47 #ifndef _H_status
48 #include "status.h"
49 #endif
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 /********************************************************************
56 * *
57 * C O N S T A N T S *
58 * *
59 *********************************************************************/
60 
61 /********************************************************************
62 * *
63 * T Y P E S *
64 * *
65 *********************************************************************/
66 
67 
68 /********************************************************************
69 * *
70 * F U N C T I O N S *
71 * *
72 *********************************************************************/
73 
74 
75 /* group defined in agt_ypgnmi.h */
76 
93 extern status_t
94  agt_ypgnmi_set_setup (ses_cb_t *scb,
95  rpc_msg_t *msg,
96  val_value_t *input_val);
97 
98 
102 #ifdef __cplusplus
103 } /* end extern 'C' */
104 #endif
105 
106 #endif /* _H_agt_ypgnmi_set */
107 #endif // WITH_GNMI && WITH_RESTCONF && WITH_YCONTROL
ses.h
NETCONF Session Common definitions module.
xml_strlen
uint32 xml_strlen(const xmlChar *str)
Get the String len for xmlChar.
Definition: xml_util.c:1406
agt_restconf.h
IETF RESTCONF Protocol Message Handler.
ypgnmi_new_ecb
ypgnmi_edit_cb_t * ypgnmi_new_ecb(void)
Create a new ypgnmi_edit_cb_t control block.
Definition: ypgnmi.c:271
agt_ses.h
Server Session Management.
OP_EDITOP_REPLACE
@ OP_EDITOP_REPLACE
edit op is replace
Definition: op.h:125
agt_restcmn_get_method
yangapi_method_t agt_restcmn_get_method(const xmlChar *method)
Get the HTTP method enum from the string.
Definition: agt_restcmn.c:6297
xml_strdup
xmlChar * xml_strdup(const xmlChar *copyFrom)
String duplicate for xmlChar.
Definition: xml_util.c:1553
cfg_rwlock_acquire_single_wrlock
status_t cfg_rwlock_acquire_single_wrlock(thd_tcb_t *tcb, cfg_template_t *cfg)
Acquire a single RWLOCK for write access.
Definition: cfg.c:978
val_find_child
val_value_t * val_find_child(const val_value_t *parent, const xmlChar *modname, const xmlChar *childname)
Find the first instance of the specified child node.
Definition: val.c:8560
agt_ypgnmi_set_setup
status_t agt_ypgnmi_set_setup(ses_cb_t *scb, rpc_msg_t *msg, val_value_t *input_val)
handle the YP-GNMI SET request from the subsystem
Definition: agt_ypgnmi_set.c:852
yang_patch_add_edit
void yang_patch_add_edit(yang_patch_cb_t *pcb, yang_patch_edit_t *edit)
Malloc and add new YANG Patch edit control block.
Definition: yang_patch.c:393
yang_patch_free_cb
void yang_patch_free_cb(yang_patch_cb_t *pcb)
Free a YANG Patch control block.
Definition: yang_patch.c:214
log_error
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
val.h
Value Node Basic Support.
val_next_child_same
val_value_t * val_next_child_same(val_value_t *curchild)
Get the next instance of the corresponding child node.
Definition: val.c:8456
YANG_PATCH_WHERE_NONE
@ YANG_PATCH_WHERE_NONE
not set
Definition: yang_patch.h:109
log_debug3
void void void void void void void void void void void log_debug3(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG3 log entry.
ypgnmi_free_ecb
void ypgnmi_free_ecb(ypgnmi_edit_cb_t *cb)
Clean and free a ypgnmi_edit_cb_t control block.
Definition: ypgnmi.c:295
agt_yangpatch_gnmi_edit
status_t agt_yangpatch_gnmi_edit(ses_cb_t *scb, yangapi_cb_t *rcb, yang_patch_cb_t *pcb, rpc_msg_t *msg)
Handle a YP-GNMI edit.
Definition: agt_yangpatch.c:1536
SES_YPMODE_RESTCONF
@ SES_YPMODE_RESTCONF
RESTCONF mode.
Definition: ses.h:312
op.h
NETCONF protocol operations.
ncxconst.h
Contains NCX constants.
ncxmod.h
NCX Module Load Manager.
yangapi_new_rcb
yangapi_cb_t * yangapi_new_rcb(void)
Create a new YANG-API control block.
Definition: yangapi.c:317
OP_EDITOP_MERGE
@ OP_EDITOP_MERGE
edit op is merge
Definition: op.h:124
log_info
void void void void void log_info(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_INFO log entry.
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.
Definition: ses.c:4180
SES_TYP_GNMI
@ SES_TYP_GNMI
RESTCONF over GNMI.
Definition: ses.h:325
log_debug2
void void void void void void void void void log_debug2(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG2 log entry.
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
NCX_PROTO_RESTCONF
@ NCX_PROTO_RESTCONF
IETF RESTCONF.
Definition: ncxtypes.h:788
agt_restconf_get_root
val_value_t * agt_restconf_get_root(void)
Get the RESTCONF Context root val_value_t node.
Definition: agt_restconf.c:2687
agt_restcmn_entry_point
const xmlChar * agt_restcmn_entry_point(void)
Get the RESTCONF entry point name.
Definition: agt_restcmn.c:7482
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
LOGDEBUG2
#define LOGDEBUG2
Check if at least log-level=debug2.
Definition: log.h:292
OP_EDITOP_DELETE
@ OP_EDITOP_DELETE
edit op is delete
Definition: op.h:127
dlq_createSQue
void dlq_createSQue(dlq_hdrT *queAddr)
create a static queue header
Definition: dlq.c:177
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
agt_restcmn_parse_path
status_t agt_restcmn_parse_path(ses_cb_t *scb, rpc_msg_t *msg, yangapi_cb_t *rcb, val_value_t *root, const xmlChar *path)
parse the request URI path
Definition: agt_restcmn.c:4593
ERR_NCX_INVALID_VALUE
@ ERR_NCX_INVALID_VALUE
258
Definition: status_enum.h:299
SES_TRANSPORT_GNMI
@ SES_TRANSPORT_GNMI
GNMI Internal processing over RESTCONF.
Definition: ses.h:347
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
json_parse_buffer
status_t json_parse_buffer(xmlChar *buff, obj_template_t *obj, dlq_hdr_t *returnQ)
Parse buffer of JSON into val_value_t structs.
Definition: json_parse.c:2639
val_child.h
Value Node Child Access Support.
get_error_string
const char * get_error_string(status_t res)
Get the error message for a specific internal error.
Definition: status.c:239
typ.h
Parameter Type Handler.
NCX_CFGID_RUNNING
@ NCX_CFGID_RUNNING
running datastore (no value for not set!)
Definition: ncxtypes.h:384
agt.h
Multi-Protocol Network Management Server.
NCX_PROTO_YCONTROL
@ NCX_PROTO_YCONTROL
YumaPro Internal Control 1.0.
Definition: ncxtypes.h:787
agt_ypgnmi_set.h
YP-GNMI SET request support module.
agt_restcmn.h
Common function for RESTCONF and YANG-API protocols.
YANGAPI_METHOD_NONE
@ YANGAPI_METHOD_NONE
not set
Definition: yangapi.h:116
yang_patch_editop_to_op
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.
Definition: yang_patch.c:1195
yang_patch_new_cb
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.
Definition: yang_patch.c:162
agt_yangpatch.h
YumaPro YANG-PATCH Edit Handler for HA/RESTCONF/NETCONF.
ycontrol_msg_cmn.h
YControl Message Utilities.
val_get_next_child
val_value_t * val_get_next_child(const val_value_t *curchild)
Get the next child node.
Definition: val.c:8496
get_first_edit_entry
ypgnmi_edit_t * get_first_edit_entry(ypgnmi_edit_cb_t *cb)
Get the first edit entry in editsQ.
Definition: ypgnmi.c:142
log.h
NCX System Logging Manager.
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
ypgnmi.h
YP-GNMI requests support module.
get_next_edit_entry
ypgnmi_edit_t * get_next_edit_entry(ypgnmi_edit_t *entry)
Get the next edit entry in the editsQ.
Definition: ypgnmi.c:169
val_clean_valQ
void val_clean_valQ(dlq_hdr_t *valQ)
Clean a queue of val_value_t.
Definition: val.c:13911
dlq_deque
void * dlq_deque(dlq_hdrT *listP)
remove the first queue node from the queue list
Definition: dlq.c:286
val_get_first_child
val_value_t * val_get_first_child(const val_value_t *parent)
Get the first child node.
Definition: val.c:8477
ypgnmi_new_edit
ypgnmi_edit_t * ypgnmi_new_edit(xmlChar *path_str, xmlChar *input, op_editop_t editop)
Create a new yp-gnmi Edit entriy.
Definition: ypgnmi.c:198
cfg_rwlock_unlock
status_t cfg_rwlock_unlock(thd_tcb_t *tcb, cfg_template_t *cfg)
Release a lock associated with a cfg (datastore) RWLOCK structure.
Definition: cfg.c:535
typ_is_string
boolean typ_is_string(ncx_btype_t btyp)
Check if the base type is a simple string (not list)
Definition: typ.c:4097
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
agt_acm.h
NETCONF Server Access Control Entry Points.
xml_strcpy
uint32 xml_strcpy(xmlChar *copyTo, const xmlChar *copyFrom)
String copy for xmlChar.
Definition: xml_util.c:1486
YANGAPI_LAUNCHPT_DATASTORE
@ YANGAPI_LAUNCHPT_DATASTORE
/restconf/data launch point
Definition: yangapi.h:134
yangapi_free_rcb
void yangapi_free_rcb(yangapi_cb_t *rcb)
Free a YANGAPI control block.
Definition: yangapi.c:351
VAL_BTYPE
#define VAL_BTYPE(V)
Access the base type : same as VAL_TYPE.
Definition: val.h:548
VAL_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
ncx.h
YANG module utility functions.
YANGAPI_METHOD_PATCH
@ YANGAPI_METHOD_PATCH
PATCH method.
Definition: yangapi.h:122
obj.h
Data Object Support.
cfg_get_config_id
cfg_template_t * cfg_get_config_id(ncx_cfg_t cfgid)
Get the config struct from its ID.
Definition: cfg.c:1530
json_parse.h
JSON input stream parser module.
agt_ycontrol.h
Handle the YumaPro Control Protocol <ycontrol> (top-level) element.
dlq_enque
void dlq_enque(REG void *newP, REG dlq_hdrT *listP)
add a queue node to the end of a queue list Add newP to listP
Definition: dlq.c:246
yang_patch_dump_pcb
void yang_patch_dump_pcb(yang_patch_cb_t *pcb)
Dump the current Patch Control block with all the edits.
Definition: yang_patch.c:1240
yang_patch_new_edit
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.
Definition: yang_patch.c:255
VAL_STR
#define VAL_STR(V)
Access the value as a string ONLY if typ_is_string() is true.
Definition: val.h:464
ERR_NCX_DATA_MISSING
@ ERR_NCX_DATA_MISSING
272
Definition: status_enum.h:313
yangapi_clean_rcb
void yangapi_clean_rcb(yangapi_cb_t *rcb)
Clean a YANGAPI/RESTCONF control block.
Definition: yangapi.c:476
xmlns.h
XML namespace support.
status.h
Global error messages for status code enumerations.
YANG_PATCH_EDIT_TYPE_USER
@ YANG_PATCH_EDIT_TYPE_USER
edit by user
Definition: yang_patch.h:102
dlq.h
dlq provides general double-linked list and queue support:
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297