yumapro  20.10-12
YumaPro SDK
agt_modtags.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 #ifndef _H_agt_modtags
12 #define _H_agt_modtags
13 
14 /* FILE: agt_modtags.h
15 *********************************************************************
16 * *
17 * P U R P O S E *
18 * *
19 *********************************************************************/
20 
27 /*********************************************************************
28 * *
29 * C H A N G E H I S T O R Y *
30 * *
31 *********************************************************************
32 
33 date init comment
34 ----------------------------------------------------------------------
35 14-apr-18 abb Begun
36 
37 */
38 
39 #include <xmlstring.h>
40 
41 #ifndef _H_status_enum
42 #include "status_enum.h"
43 #endif
44 
45 #ifndef _H_xmlns
46 #include "xmlns.h"
47 #endif
48 
49 #ifndef _H_xml_msg
50 #include "xml_msg.h"
51 #endif
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
57 
70 /********************************************************************
71 * *
72 * F U N C T I O N S *
73 * *
74 *********************************************************************/
75 
81 extern status_t
82  agt_modtags_init (void);
83 
84 
90 extern status_t
91  agt_modtags_init2 (void);
92 
93 
99 extern void
100  agt_modtags_cleanup (void);
101 
102 
112 extern status_t
113  agt_modtags_setup_filter (xml_msg_hdr_t *msg,
114  val_value_t *inputval,
115  val_value_t **errval);
116 
117 
128 extern boolean
129  agt_modtags_check_filter (xml_msg_hdr_t *msg,
130  val_value_t *val);
131 
132 
139 extern void *
140  agt_modtags_find_modtag (const xmlChar *tagstr);
141 
142 
151 extern boolean
152  agt_modtags_check_modtag (void *v_modtag,
153  xmlns_id_t nsid);
154 
155 
160 #ifdef __cplusplus
161 } /* end extern 'C' */
162 #endif
163 
164 #endif /* _H_agt_modtags */
ses.h
NETCONF Session Common definitions module.
ERR_NCX_SKIPPED
@ ERR_NCX_SKIPPED
2001
Definition: status_enum.h:551
agt_modtags.h
YumaPro Module tags handler.
agt_util.h
Utility Functions for NCX Server method routines.
agt_rpc_register_method
status_t agt_rpc_register_method(const xmlChar *module, const xmlChar *method_name, agt_rpc_phase_t phase, agt_rpc_method_t method)
add callback for 1 phase of RPC processing
Definition: agt_rpc.c:2557
ncx_find_backptr
ncx_backptr_t * ncx_find_backptr(const dlq_hdr_t *que, void *node)
Find the specified back pointer struct.
Definition: ncx.c:11609
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
VAL_STRING
#define VAL_STRING(V)
Access the value as a string ONLY if typ_is_string(typdef) is true.
Definition: val.h:414
ncx_set_unload_callback
status_t ncx_set_unload_callback(ncx_unload_cbfn_t cbfn)
Set the callback function for an unload-module event.
Definition: ncx.c:8541
ncx_get_modname
const xmlChar * ncx_get_modname(const ncx_module_t *mod)
Get the main module name.
Definition: ncx.c:4834
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
agt_rpc.h
NETCONF protocol remote procedure call server-side definitions.
status_enum.h
global error status code enumerations
ncx_next_backptr
ncx_backptr_t * ncx_next_backptr(ncx_backptr_t *curptr)
Get next back pointer struct.
Definition: ncx.c:11545
agt_rpc_add_return_val
void agt_rpc_add_return_val(val_value_t *return_val, rpc_msg_t *msg)
Add a return value to the msg.
Definition: agt_rpc.c:4350
ERR_NCX_DUP_ENTRY
@ ERR_NCX_DUP_ENTRY
224
Definition: status_enum.h:263
RPC_DATA_YANG
@ RPC_DATA_YANG
STD is used by YANG rpc or action stmts; no extra <data> container will be added to the <rpc-reply> c...
Definition: rpc.h:167
ncxconst.h
Contains NCX constants.
ncxmod.h
NCX Module Load Manager.
ncx_clear_load_callback
void ncx_clear_load_callback(ncx_load_cbfn_t cbfn)
Clear the callback function for a load-module event.
Definition: ncx.c:8510
agt_modtags_setup_filter
status_t agt_modtags_setup_filter(xml_msg_hdr_t *msg, val_value_t *inputval, val_value_t **errval)
Setup a modtag filter in the specified msg.
Definition: agt_modtags.c:889
agt_modtags_init2
status_t agt_modtags_init2(void)
Initialize YumaPro module tags feature (phase 2)
Definition: agt_modtags.c:778
xmlns_id_t
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
agt_rpc_unregister_method
void agt_rpc_unregister_method(const xmlChar *module, const xmlChar *method_name)
remove the callback functions for all phases of RPC or Action processing for the specified RPC method...
Definition: agt_rpc.c:2759
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
xml_strndup
xmlChar * xml_strndup(const xmlChar *copyFrom, uint32 maxlen)
String duplicate for max N xmlChars.
Definition: xml_util.c:1663
val_get_nsid
xmlns_id_t val_get_nsid(const val_value_t *val)
Get the namespace ID for the specified value node.
Definition: val.c:12277
log_debug4
void void void void void void void void void void void void void log_debug4(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG4 log entry.
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
val_gen_index_chain
status_t val_gen_index_chain(const obj_template_t *obj, val_value_t *val)
Create an index chain for the just-parsed table or container struct.
Definition: val_util.c:2632
dlq_createSQue
void dlq_createSQue(dlq_hdrT *queAddr)
create a static queue header
Definition: dlq.c:177
xmlns_find_ns_by_module
xmlns_id_t xmlns_find_ns_by_module(const xmlChar *modname)
Find the NS ID from its module name that registered it.
Definition: xmlns.c:712
ncx_valid_name
boolean ncx_valid_name(const xmlChar *str, uint32 len)
Check if an xmlChar string is a valid YANG identifier value.
Definition: ncx.c:7596
val_child_add
status_t val_child_add(val_value_t *child, val_value_t *parent)
Add a child value node to a parent value node.
Definition: val_child.c:1542
val_util.h
Value Node Utilities.
ncx_set_load_callback
status_t ncx_set_load_callback(ncx_load_cbfn_t cbfn)
Set the callback function for a load-module event.
Definition: ncx.c:8472
ERR_NCX_INVALID_VALUE
@ ERR_NCX_INVALID_VALUE
258
Definition: status_enum.h:299
agt_make_leaf2
val_value_t * agt_make_leaf2(obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, const xmlChar *leafstrval, status_t *res)
make a val_value_t struct for a specified leaf or leaf-list
Definition: agt_util.c:5545
rpc.h
NETCONF protocol remote procedure call common definitions.
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
val_child.h
Value Node Child Access Support.
ERR_INTERNAL_INIT_SEQ
@ ERR_INTERNAL_INIT_SEQ
007
Definition: status_enum.h:197
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.
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
agt.h
Multi-Protocol Network Management Server.
XML_MSG_SET_WITH_MODTAGS_EMPTY
#define XML_MSG_SET_WITH_MODTAGS_EMPTY(M)
Set flag that empty module-tags return set.
Definition: xml_msg.h:288
agt_modtags_check_modtag
boolean agt_modtags_check_modtag(void *v_modtag, xmlns_id_t nsid)
Check a modtag filter for NACM.
Definition: agt_modtags.c:1005
xml_msg.h
XML and JSON Message send and receive support.
ncx_first_backptr
ncx_backptr_t * ncx_first_backptr(dlq_hdr_t *que)
Get first back pointer struct.
Definition: ncx.c:11513
agt_modtags_find_modtag
void * agt_modtags_find_modtag(const xmlChar *tagstr)
Find a modtag; return opaque pointer.
Definition: agt_modtags.c:978
obj_get_mod_name
const xmlChar * obj_get_mod_name(const obj_template_t *obj)
Get the module name for this object.
Definition: obj.c:12176
obj_find_child
obj_template_t * obj_find_child(obj_template_t *obj, const xmlChar *modname, const xmlChar *objname)
Find a child object with the specified Qname.
Definition: obj.c:6116
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
LOGDEBUG4
#define LOGDEBUG4
Check if at least log-level=debug4.
Definition: log.h:302
AGT_RPC_PH_INVOKE
@ AGT_RPC_PH_INVOKE
(3) cb to invoke the requested method
Definition: agt_rpc.h:118
agt_sys.h
NETCONF system.yang DM module support.
agt_cli.h
NETCONF Server Command Line Interface handler.
LOGDEBUG
#define LOGDEBUG
Check if at least log-level=debug.
Definition: log.h:287
agt_modtags_check_filter
boolean agt_modtags_check_filter(xml_msg_hdr_t *msg, val_value_t *val)
Check a modtag filter in the specified msg applies to the value.
Definition: agt_modtags.c:947
dlq_deque
void * dlq_deque(dlq_hdrT *listP)
remove the first queue node from the queue list
Definition: dlq.c:286
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
AGT_YWSYS_MODULE
#define AGT_YWSYS_MODULE
newerr yumaworks-system module mostly replaces yuma-system
Definition: agt_sys.h:99
agt_get_profile
agt_profile_t * agt_get_profile(void)
Get the server profile struct.
Definition: agt.c:4118
ncx_get_backptr_node
void * ncx_get_backptr_node(ncx_backptr_t *backptr)
Get the back pointer node pointer.
Definition: ncx.c:11577
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
val_new_value
val_value_t * val_new_value(void)
Malloc and initialize the fields in a val_value_t.
Definition: val.c:2697
ncx.h
YANG module utility functions.
obj.h
Data Object Support.
agt_modtags_init
status_t agt_modtags_init(void)
Initialize YumaPro module tags feature.
Definition: agt_modtags.c:741
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.
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
xmlns.h
XML namespace support.
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
agt_cli_get_valset
val_value_t * agt_cli_get_valset(void)
Retrieve the command line parameter set from boot time.
Definition: agt_cli.c:3427
status.h
Global error messages for status code enumerations.
XML_MSG_SET_WITH_MODTAGS
#define XML_MSG_SET_WITH_MODTAGS(M)
Set flag that module-tags filtering requested.
Definition: xml_msg.h:281
ncx_clear_unload_callback
void ncx_clear_unload_callback(ncx_unload_cbfn_t cbfn)
Clear the callback function for an unload-module event.
Definition: ncx.c:8579
dlq.h
dlq provides general double-linked list and queue support:
ncx_new_backptr
ncx_backptr_t * ncx_new_backptr(void *node)
Malloc and initialize a new ncx_backptr_t struct.
Definition: ncx.c:11412
agt_modtags_cleanup
void agt_modtags_cleanup(void)
Cleanup the module static data.
Definition: agt_modtags.c:846