yumapro  20.10-12
YumaPro SDK
u_yumaworks_templates.h
Go to the documentation of this file.
1 #ifdef WITH_TEMPLATES
2 #ifndef _H_u_yumaworks_templates
3 #define _H_u_yumaworks_templates
4 /*
5  * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
6  * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
7  *
8  * Unless required by applicable law or agreed to in writing,
9  * software distributed under the License is distributed on an
10  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
11  * KIND, either express or implied. See the License for the
12  * specific language governing permissions and limitations
13  * under the License.
14  *
15 
16 *** Generated by yangdump-sdk puma-integ-2017-02-20.15.24
17 
18  User SIL header
19  module yumaworks-templates
20  revision 2017-02-20
21  namespace http://yumaworks.com/ns/yumaworks-templates
22  organization YumaWorks, Inc.
23  Created: 2017-02-20T23:28:50Z
24  CLI parameters:
25  format uh
26  indent 4
27  module yumaworks-templates
28  output u_yumaworks-templates.h
29  sil-edit2
30  unified true
31 
32  */
33 
34 
41 #include <xmlstring.h>
42 
43 #include "agt.h"
44 #include "agt_cb.h"
45 #include "dlq.h"
46 #include "ncxtypes.h"
47 #include "op.h"
48 #include "rpc.h"
49 #include "ses.h"
50 #include "status.h"
51 #include "val.h"
52 #include "y_yumaworks_templates.h"
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 #if 0 // NOT USED
59 
60 /* anydata /templates/template/data */
61 typedef struct y_yumaworks_templates_T_templates_template_data_ {
62  dlq_hdr_t qhdr;
63 } y_yumaworks_templates_T_templates_template_data;
64 
65 /* list /templates/template */
66 typedef struct y_yumaworks_templates_T_templates_template_ {
67  dlq_hdr_t qhdr;
68  xmlChar *v_name;
69  xmlChar *v_data_target;
70  y_yumaworks_templates_T_templates_template_data v_data;
71 } y_yumaworks_templates_T_templates_template;
72 
73 /* container /templates */
74 typedef struct y_yumaworks_templates_T_templates_ {
75  dlq_hdr_t v_template;
76 } y_yumaworks_templates_T_templates;
77 
78 #endif // 0 NOT USED
79 
80 
81 
82 /* group definied in agt_templates.h */
83 
84 
115  ses_cb_t *scb,
116  rpc_msg_t *msg,
117  agt_cbtyp_t cbtyp,
118  op_editop_t editop,
119  val_value_t *newval,
120  val_value_t *curval,
121  val_value_t **child_errorval, // added
122  const xmlChar *k_templates_template_name);
123 
124 
145 extern status_t u_yumaworks_templates_templates_edit (
146  ses_cb_t *scb,
147  rpc_msg_t *msg,
148  agt_cbtyp_t cbtyp,
149  op_editop_t editop,
150  val_value_t *newval,
151  val_value_t *curval);
152 
153 
161 extern status_t u_yumaworks_templates_init (
162  const xmlChar *modname,
163  const xmlChar *revision);
164 
165 
173 extern status_t u_yumaworks_templates_init2 (void);
174 
175 
181 extern void u_yumaworks_templates_cleanup (void);
182 
183 
187 #ifdef __cplusplus
188 } /* end extern 'C' */
189 #endif
190 
191 #endif // _H_u_yumaworks_templates
192 #endif // WITH_TEMPLATES
agt_cfg_next_child_edit
agt_cfg_undo_rec_t * agt_cfg_next_child_edit(agt_cfg_undo_rec_t *curedit)
Get the next child node edit record for a given transaction.
Definition: agt_cfg.c:2596
ses.h
NETCONF Session Common definitions module.
ncx_feature.h
NCX Module Library YANG Feature Utility Functions.
u_yumaworks_templates_init2
status_t u_yumaworks_templates_init2(void)
SIL init phase 2: non-config data structures.
Definition: u_yumaworks_templates.c:564
OP_EDITOP_CREATE
@ OP_EDITOP_CREATE
edit op is create
Definition: op.h:126
agt_util.h
Utility Functions for NCX Server method routines.
OP_EDITOP_REPLACE
@ OP_EDITOP_REPLACE
edit op is replace
Definition: op.h:125
OP_EDITOP_NONE
@ OP_EDITOP_NONE
not set
Definition: op.h:123
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
ERR_NCX_DEF_NOT_FOUND
@ ERR_NCX_DEF_NOT_FOUND
250
Definition: status_enum.h:289
val.h
Value Node Basic Support.
xml_util.h
XML Utilities.
agt_rpc.h
NETCONF protocol remote procedure call server-side definitions.
agt_action.h
NETCONF Server YANG action handler.
val_get_mod_name
const xmlChar * val_get_mod_name(const val_value_t *val)
Get the module name associated with this value node.
Definition: val.c:12223
u_yumaworks_templates_templates_edit
status_t u_yumaworks_templates_templates_edit(ses_cb_t *scb, rpc_msg_t *msg, agt_cbtyp_t cbtyp, op_editop_t editop, val_value_t *newval, val_value_t *curval)
Edit database object callback.
Definition: u_yumaworks_templates.c:434
op.h
NETCONF protocol operations.
VAL_NAME
#define VAL_NAME(V)
Access the value name.
Definition: val.h:399
ncxmod.h
NCX Module Load Manager.
agt_cb.h
NETCONF Server Data Model callback handler.
obj_is_list
boolean obj_is_list(const obj_template_t *obj)
Check if object is a YANG list.
Definition: obj.c:13349
OP_EDITOP_MERGE
@ OP_EDITOP_MERGE
edit op is merge
Definition: op.h:124
agt_cbtype_name
const xmlChar * agt_cbtype_name(agt_cbtyp_t cbtyp)
Get the string for the server callback phase.
Definition: agt.c:4247
ERR_NCX_MISSING_PARM
@ ERR_NCX_MISSING_PARM
233
Definition: status_enum.h:272
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.
u_yumaworks_templates_templates_template_edit
status_t u_yumaworks_templates_templates_template_edit(ses_cb_t *scb, rpc_msg_t *msg, agt_cbtyp_t cbtyp, op_editop_t editop, val_value_t *newval, val_value_t *curval, val_value_t **child_errorval, const xmlChar *k_templates_template_name)
Edit database object callback.
Definition: u_yumaworks_templates.c:286
u_yumaworks_templates.h
User SIL callbacks for yumaworks-templates module.
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
val_dump_value
void val_dump_value(val_value_t *val, int32 startindent, log_debug_t lvl)
Printf the specified val_value_t struct to the logfile, or stdout if none set Uses conf file format (...
Definition: val.c:5688
obj_get_name
const xmlChar * obj_get_name(const obj_template_t *obj)
Get the name field for this obj.
Definition: obj.c:10511
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
agt_templates_clear
void agt_templates_clear(const xmlChar *name)
Clear a config template if found.
Definition: agt_templates.c:368
agt_cfg_first_child_edit
agt_cfg_undo_rec_t * agt_cfg_first_child_edit(agt_cfg_transaction_t *txcb, val_value_t *newnode, val_value_t *curnode)
Get the first child node edit record for a given transaction.
Definition: agt_cfg.c:2519
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
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
val_util.h
Value Node Utilities.
ERR_NCX_INVALID_VALUE
@ ERR_NCX_INVALID_VALUE
258
Definition: status_enum.h:299
agt_sil_lib.h
Server Instrumentation Library Support.
AGT_CB_VALIDATE
@ AGT_CB_VALIDATE
P1: write operation validate.
Definition: agt.h:620
rpc.h
NETCONF protocol remote procedure call common definitions.
u_yumaworks_templates_init
status_t u_yumaworks_templates_init(const xmlChar *modname, const xmlChar *revision)
initialize the yumaworks-templates server instrumentation library
Definition: u_yumaworks_templates.c:533
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
val_child.h
Value Node Child Access Support.
log_debug
void void void void void void void log_debug(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG log entry.
y_yumaworks_templates.h
System SIL callbacks for yumaworks-templates module.
ERR_NCX_INVALID_NAME
@ ERR_NCX_INVALID_NAME
228
Definition: status_enum.h:267
agt.h
Multi-Protocol Network Management Server.
op_editop_name
const xmlChar * op_editop_name(op_editop_t ed_id)
Get the keyword for the specified op_editop_t enumeration.
Definition: op.c:106
obj_is_container
boolean obj_is_container(const obj_template_t *obj)
Check if object is a YANG container.
Definition: obj.c:13405
u_yumaworks_templates_cleanup
void u_yumaworks_templates_cleanup(void)
cleanup the server instrumentation library
Definition: u_yumaworks_templates.c:579
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
OP_EDITOP_LOAD
@ OP_EDITOP_LOAD
load, internal enum
Definition: op.h:128
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
LOGDEBUG
#define LOGDEBUG
Check if at least log-level=debug.
Definition: log.h:287
agt_templates.h
YANG Configuration Templates (yumaworks-templates.yang)
agt_cfg.h
Manage Server configuration edit transactions.
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
agt_cfg_child_edit_fields
void agt_cfg_child_edit_fields(agt_cfg_undo_rec_t *child_undo, op_editop_t *editop, val_value_t **newval, val_value_t **curval)
Get the child edit fields from the undo record.
Definition: agt_cfg.c:2647
log_debug2_append
void void void void void void void void void void log_debug2_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG2 log entry.
AGT_CB_ROLLBACK
@ AGT_CB_ROLLBACK
P3-neg: write operation rollback.
Definition: agt.h:623
val_new_value
val_value_t * val_new_value(void)
Malloc and initialize the fields in a val_value_t.
Definition: val.c:2697
VAL_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
ncx.h
YANG module utility functions.
AGT_CB_COMMIT
@ AGT_CB_COMMIT
P3-pos: write operation commit.
Definition: agt.h:622
obj.h
Data Object Support.
val_convert_anyxml_to_real
status_t val_convert_anyxml_to_real(val_value_t *anyxml_val, val_value_t *real_val, val_value_t **error_val)
Convert anydata nodes to match a real template.
Definition: val_util.c:7246
val_init_from_template
void val_init_from_template(val_value_t *val, struct obj_template_t_ *obj)
Initialize a value node from its object template.
obj_is_data_db
boolean obj_is_data_db(const obj_template_t *obj)
Check if the object is some sort of data Constrained to only check the config DB objects,...
Definition: obj.c:13788
VAL_STR
#define VAL_STR(V)
Access the value as a string ONLY if typ_is_string() is true.
Definition: val.h:464
agt_timer.h
Handle timer services for the server.
ncx_find_module
ncx_module_t * ncx_find_module(const xmlChar *modname, const xmlChar *revision)
Find a ncx_module_t in the ncx_sesmodQ.
Definition: ncx.c:3227
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
val_free_value
void val_free_value(val_value_t *val)
Scrub the memory in a val_value_t by freeing all the sub-fields and then freeing the entire struct it...
Definition: val.c:2842
xpath_find_schema_target_restconf
status_t xpath_find_schema_target_restconf(const xmlChar *target, obj_template_t **targobj)
Find a schema target for RESTCONF.
Definition: xpath.c:2515
status.h
Global error messages for status code enumerations.
val_child_count
uint32 val_child_count(val_value_t *parent)
Get the number of non-deleted children in this parent.
Definition: val_child.c:2483
agt_templates_set
status_t agt_templates_set(const xmlChar *name, const xmlChar *targstr, obj_template_t *targobj, val_value_t *targval)
Set a config template (new or replace)
Definition: agt_templates.c:330
dlq.h
dlq provides general double-linked list and queue support:
AGT_CB_APPLY
@ AGT_CB_APPLY
P2: write operation apply.
Definition: agt.h:621