yumapro  20.10-12
YumaPro SDK
def_reg.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_def_reg
13 #define _H_def_reg
14 
15 /* FILE: def_reg.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 14-oct-05 abb Begun
36 11-nov-05 abb re-design to add OWNER as top-level instead of APP
37 11-feb-06 abb remove application layer; too complicated
38 12-jul-07 abb changed owner-based definitions to
39  module-based definitions throughout all code
40  Change OWNER to MODULE
41 19-feb-09 abb Give up on module/mod_def/cfg_def because
42  too complicated once import-by-revision added
43  Too much memory usage as well.
44 */
45 
46 #include <xmlstring.h>
47 
48 #ifndef _H_ncxtypes
49 #include "ncxtypes.h"
50 #endif
51 
52 #ifndef _H_ses
53 #include "ses.h"
54 #endif
55 
56 #ifndef _H_status_enum
57 #include "status_enum.h"
58 #endif
59 
60 #ifndef _H_xmlns
61 #include "xmlns.h"
62 #endif
63 
64 #ifndef _H_xpath
65 #include "xpath.h"
66 #endif
67 
68 #ifdef __cplusplus
69 extern "C" {
70 #endif
71 
72 /********************************************************************
73 * *
74 * F U N C T I O N S *
75 * *
76 *********************************************************************/
77 
78 
112 extern void
113  def_reg_init (void);
114 
115 
123 extern void
124  def_reg_cleanup (void);
125 
126 
127 /*********************** NS ***************************/
128 
129 
136 extern status_t
137  def_reg_add_ns (xmlns_t *ns);
138 
139 
147 extern xmlns_t *
148  def_reg_find_ns (const xmlChar *nsname);
149 
150 
158 extern void
159  def_reg_del_ns (const xmlChar *nsname);
160 
161 
162 /*********************** SCB ***************************/
163 
164 
172 extern status_t
173  def_reg_add_scb (int fd,
174  ses_cb_t *scb);
175 
176 
183 extern ses_cb_t *
184  def_reg_find_scb (int fd);
185 
186 
193 extern void
194  def_reg_del_scb (int fd);
195 
196 
197 /*********************** MOD CACHE ***************************/
198 
199 
206 extern status_t
207  def_reg_add_modcache (ncx_modcache_t *mc);
208 
209 
216 extern ncx_modcache_t *
217  def_reg_find_modcache (const xmlChar *modname);
218 
219 
227 extern void
228  def_reg_del_modcache (const xmlChar *modname);
229 
230 
231 /*********************** MUST VISIT ***************************/
232 
233 
242 extern status_t
243  def_reg_add_must_visit (xpath_pcb_t *must,
244  val_value_t *curval);
245 
246 
255 extern boolean
256  def_reg_find_must_visit (xpath_pcb_t *must,
257  val_value_t *curval);
258 
259 
265 extern void
267 
268 
271 #ifdef __cplusplus
272 } /* end extern 'C' */
273 #endif
274 
275 #endif /* _H_def_reg */
def_reg_find_scb
ses_cb_t * def_reg_find_scb(int fd)
find one FD-to-SCB mapping in the registry
Definition: def_reg.c:506
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
xml_strncpy
uint32 xml_strncpy(xmlChar *copyTo, const xmlChar *copyFrom, uint32 maxlen)
String copy for xmlChar – checks for buffer overflow.
Definition: xml_util.c:1518
def_reg_add_must_visit
status_t def_reg_add_must_visit(xpath_pcb_t *must, val_value_t *curval)
add one MUST visit to the registry.
Definition: def_reg.c:657
def_reg_find_ns
xmlns_t * def_reg_find_ns(const xmlChar *nsname)
find one xmlns_t in the registry find a xmlns_t by its value (name)
Definition: def_reg.c:397
def_reg_clean_must_visit
void def_reg_clean_must_visit(void)
unregister all must visits entries delete all from the registry
Definition: def_reg.c:732
bobhash
uint32 bobhash(REGISTER const uint8 *k, REGISTER uint32 length, REGISTER uint32 initval)
Calculate a 32-bit BOB hash value.
Definition: bobhash.c:177
xml_util.h
XML Utilities.
status_enum.h
global error status code enumerations
ERR_NCX_DUP_ENTRY
@ ERR_NCX_DUP_ENTRY
224
Definition: status_enum.h:263
def_reg_del_modcache
void def_reg_del_modcache(const xmlChar *modname)
unregister a modcache_t delete one module cache record from the registry
Definition: def_reg.c:621
bobhash.h
BOB hash function.
def_reg.h
Definition Registry module.
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
xpath.h
Schema and data model Xpath search support.
def_reg_find_must_visit
boolean def_reg_find_must_visit(xpath_pcb_t *must, val_value_t *curval)
find one must visit find a vist by curval value and must PCB expression value
Definition: def_reg.c:694
def_reg_add_scb
status_t def_reg_add_scb(int fd, ses_cb_t *scb)
add one FD to SCB mapping to the registry
Definition: def_reg.c:457
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
dlq_remove
void dlq_remove(void *nodeP)
remove the queue entry from its queue list entry MUST have been enqueued somehow before this function...
Definition: dlq.c:519
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
ERR_INTERNAL_PTR
@ ERR_INTERNAL_PTR
002
Definition: status_enum.h:192
yang.h
YANG Module parser utilities.
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
def_reg_cleanup
void def_reg_cleanup(void)
Cleanup all the malloced memory in this module and return the module to an uninitialized state.
Definition: def_reg.c:316
NCX_MAX_NUMLEN
#define NCX_MAX_NUMLEN
max number len to use for static buffer allocation only
Definition: ncxconst.h:136
ERR_NCX_INVALID_NUM
@ ERR_NCX_INVALID_NUM
241
Definition: status_enum.h:280
def_reg_init
void def_reg_init(void)
Initialize the def_reg module.
Definition: def_reg.c:288
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
def_reg_add_ns
status_t def_reg_add_ns(xmlns_t *ns)
add one xmlns_t to the registry
Definition: def_reg.c:372
def_reg_del_ns
void def_reg_del_ns(const xmlChar *nsname)
unregister a xmlns_t delete one ncx_module from the registry
Definition: def_reg.c:426
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
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
def_reg_del_scb
void def_reg_del_scb(int fd)
delete one FD to SCB mapping from the registry
Definition: def_reg.c:542
ncx.h
YANG module utility functions.
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
def_reg_find_modcache
ncx_modcache_t * def_reg_find_modcache(const xmlChar *modname)
find one modcache_t in the registry
Definition: def_reg.c:595
xmlns.h
XML namespace support.
status.h
Global error messages for status code enumerations.
dlq.h
dlq provides general double-linked list and queue support:
def_reg_add_modcache
status_t def_reg_add_modcache(ncx_modcache_t *mc)
add one module info cache to the registry
Definition: def_reg.c:572