OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
bvx_environment.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 /* Pick up the local environment. We probably ought to be more picky here. */
6 
7 #ifndef BVX_ENVIRONMENT_H
8 #define BVX_ENVIRONMENT_H
9 
10 #include "gmpx_basic_types.h"
11 
12 /* Map all patricia stuff directly. */
13 
14 #define bvx_patnode patnode
15 #define bvx_patroot patroot
16 #define BVX_PATNODE_TO_STRUCT PATNODE_TO_STRUCT
17 #define bvx_patricia_lookup_least patricia_lookup_least
18 #define bvx_patricia_lookup_greatest patricia_lookup_greatest
19 #define bvx_patroot_init(keylen, offset) \
20  patricia_root_init(NULL, FALSE, (keylen), (offset))
21 #define BVX_PATRICIA_OFFSET STRUCT_OFFSET
22 #define bvx_patricia_add patricia_add
23 #define bvx_patroot_destroy patricia_root_delete
24 #define bvx_patricia_get_next patricia_get_next
25 #define bvx_patricia_lookup patricia_lookup
26 #define bvx_patricia_delete patricia_delete
27 
28 /* Same with the memory block stuff. */
29 
30 #define bvx_block_tag block_t
31 #define bvx_malloc_block task_block_alloc
32 #define bvx_free_block task_block_free
33 #define bvx_malloc_block_create task_block_init
34 
35 /* And with assertion. */
36 
37 #define bvx_assert assert
38 
39 #define BVX_UNUSED UNUSED
40 
41 /*
42  * Define the bit vector entry size.
43  */
44 #define BV_BITSIZE_LOG2 5 /* 32 bits per entry for now */
45 
46 /*
47  * Define the size of a bit vector word.
48  */
49 typedef uint32_t bv_word_t; /* Bit vector word type */
50 
51 #endif
uint32_t bv_word_t