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