yumapro  20.10-12
YumaPro SDK
val_unique.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3  * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
4  *
5  * Unless required by applicable law or agreed to in writing,
6  * software distributed under the License is distributed on an
7  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8  * KIND, either express or implied. See the License for the
9  * specific language governing permissions and limitations
10  * under the License.
11  */
12 #ifndef _H_val_unique
13 #define _H_val_unique
14 
15 /* FILE: val_unique.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
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 20-jun-15 abb Begun; moved from agt_val.c
36 */
37 
38 #ifndef _H_dlq
39 #include "dlq.h"
40 #endif
41 
42 #ifndef _H_ses
43 #include "ses.h"
44 #endif
45 
46 #ifndef _H_status
47 #include "status.h"
48 #endif
49 
50 #ifndef _H_val
51 #include "val.h"
52 #endif
53 
54 #ifndef _H_xml_msg
55 #include "xml_msg.h"
56 #endif
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
62 /********************************************************************
63 * *
64 * T Y P E S *
65 * *
66 *********************************************************************/
67 
68 
69 
70 
71 /********************************************************************
72 * *
73 * F U N C T I O N S *
74 * *
75 *********************************************************************/
76 
104 typedef void
105  (*record_unique_error_t) (ses_cb_t *scb,
106  xml_msg_hdr_t *msghdr,
107  val_value_t *errval,
108  dlq_hdr_t *valuniqueQ);
109 
110 
111 
112 
113 
131 extern status_t
132  val_unique_stmt_check (ses_cb_t *scb,
133  xml_msg_hdr_t *msg,
134  obj_template_t *obj,
135  val_value_t *parent,
136  val_value_t *firstval,
137  val_value_t *root,
138  record_unique_error_t error_fn);
139 
140 
144 #ifdef __cplusplus
145 } /* end extern 'C' */
146 #endif
147 
148 #endif /* _H_val_unique */
ses.h
NETCONF Session Common definitions module.
xpath_free_pcb
void xpath_free_pcb(xpath_pcb_t *pcb)
Free a malloced XPath parser control block.
Definition: xpath.c:2963
dlq_block_enque
void dlq_block_enque(dlq_hdrT *srcP, dlq_hdrT *dstP)
add all the queue entries in the srcP queue list to the end of the dstP queue list
Definition: dlq.c:731
val_unique_stmt_check
status_t val_unique_stmt_check(ses_cb_t *scb, xml_msg_hdr_t *msg, obj_template_t *obj, val_value_t *parent, val_value_t *firstval, val_value_t *root, record_unique_error_t error_fn)
Check for the proper uniqueness of the tuples within the set of list instances for the specified node...
Definition: val_unique.c:432
tstamp.h
Timestamp utilities.
val_new_unique
val_unique_t * val_new_unique(void)
Malloc and initialize the fields in a val_unique_t.
Definition: val.c:12501
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
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.
obj_first_unique
obj_unique_t * obj_first_unique(obj_template_t *listobj)
Get the first unique-stmt for a list.
Definition: obj.c:9242
obj_first_unique_comp
obj_unique_comp_t * obj_first_unique_comp(obj_unique_t *un)
Get the first identifier in a unique-stmt for a list.
Definition: obj.c:9300
op.h
NETCONF protocol operations.
ncxconst.h
Contains NCX constants.
val_unique.h
unique-stmt tests for val_value_t node
record_unique_error_t
void(* record_unique_error_t)(ses_cb_t *scb, xml_msg_hdr_t *msghdr, val_value_t *errval, dlq_hdr_t *valuniqueQ)
Callback function to generate an rpc_err_rec_t and save it in the msg Use the provided error info rec...
Definition: val_unique.h:105
xpath1.h
XPath 1.0 expression support.
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
xpath.h
Schema and data model Xpath search support.
xml_val.h
Utility functions for creating value structs.
obj_next_unique_comp
obj_unique_comp_t * obj_next_unique_comp(obj_unique_comp_t *uncomp)
Get the next unique-stmt component for a list.
Definition: obj.c:9327
obj_get_name
const xmlChar * obj_get_name(const obj_template_t *obj)
Get the name field for this obj.
Definition: obj.c:10511
dlq_createSQue
void dlq_createSQue(dlq_hdrT *queAddr)
create a static queue header
Definition: dlq.c:177
log_warn
void void void log_warn(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_WARN log entry.
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
val_util.h
Value Node Utilities.
xpath_find_val_unique
status_t xpath_find_val_unique(val_value_t *startval, ncx_module_t *mod, const xmlChar *target, val_value_t *root, boolean logerrors, boolean configonly, xpath_pcb_t **retpcb)
Find the data node for a unique-stmt target.
Definition: xpath.c:2659
rpc.h
NETCONF protocol remote procedure call common definitions.
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
typ.h
Parameter Type Handler.
yangconst.h
Contains YANG constants separated to prevent H file include loops.
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
obj_next_unique
obj_unique_t * obj_next_unique(obj_unique_t *un)
Get the next unique-stmt for a list.
Definition: obj.c:9274
xpath_yang.h
YANG-specific Xpath support.
xml_msg.h
XML and JSON Message send and receive support.
ERR_NCX_CANCELED
@ ERR_NCX_CANCELED
2002
Definition: status_enum.h:552
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
xpath_get_first_resnode
xpath_resnode_t * xpath_get_first_resnode(xpath_result_t *result)
Get the first result in the renodeQ from a result struct.
Definition: xpath.c:3931
log.h
NCX System Logging Manager.
rpc_err.h
NETCONF protocol standard error definitions.
dlq_deque
void * dlq_deque(dlq_hdrT *listP)
remove the first queue node from the queue list
Definition: dlq.c:286
val_free_unique
void val_free_unique(val_unique_t *valuni)
Clean and free a val_unique_t struct.
Definition: val.c:12525
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
ncx.h
YANG module utility functions.
obj.h
Data Object Support.
CHK_EXIT
#define CHK_EXIT(res, retres)
used in parser routines to decide if processing can continue will exit the function if critical error...
Definition: yangconst.h:221
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
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
xpath1_compare_nodeset_results
boolean xpath1_compare_nodeset_results(xpath_pcb_t *pcb, xpath_result_t *result1, xpath_result_t *result2, status_t *res)
Compare an XPath result to another result.
Definition: xpath1.c:6431
xmlns.h
XML namespace support.
ERR_NCX_UNIQUE_TEST_FAILED
@ ERR_NCX_UNIQUE_TEST_FAILED
336 - 13.1
Definition: status_enum.h:379
status.h
Global error messages for status code enumerations.
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