2 * Copyright (c) 2016 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #ifndef VNET_CONTROL_H_
17 #define VNET_CONTROL_H_
19 #include <vnet/vnet.h>
20 #include <vnet/lisp-cp/gid_dictionary.h>
21 #include <vnet/lisp-cp/lisp_types.h>
27 u32 src_mapping_index;
28 } pending_map_request_t;
49 miss_packet_type_t type;
55 gid_dictionary_t mapping_index_by_gid;
57 /* pool of mappings */
58 mapping_t * mapping_pool;
60 /* pool of locators */
61 locator_t * locator_pool;
63 /* pool of locator-sets */
64 locator_set_t * locator_set_pool;
66 /* vector of locator-set vectors composed of and indexed by locator index */
67 u32 ** locator_to_locator_sets;
69 /* hash map of locators by name */
70 uword * locator_set_index_by_name;
72 /* vector of eid index vectors supported and indexed by locator-set index */
73 u32 ** locator_set_to_eids;
75 /* vectors of indexes for local locator-sets and mappings */
76 u32 * local_mappings_indexes;
77 u32 * local_locator_set_indexes;
79 /* hash map of forwarding entries by mapping index */
80 u32 * fwd_entry_by_mapping_index;
82 /* forwarding entries pool */
83 fwd_entry_t * fwd_entry_pool;
85 /* hash map keyed by nonce of pending map-requests */
86 uword * pending_map_requests_by_nonce;
88 /* pool of pending map requests */
89 pending_map_request_t * pending_map_requests_pool;
91 /* vector of map-resolver addresses */
92 ip_address_t * map_resolvers;
97 vlib_main_t * vlib_main;
98 vnet_main_t * vnet_main;
101 /* lisp-gpe control plane */
102 lisp_cp_main_t lisp_control_main;
104 extern vlib_node_registration_t lisp_cp_input_node;
105 extern vlib_node_registration_t lisp_cp_lookup_node;
118 locator_t * locators;
120 } vnet_lisp_add_del_locator_set_args_t;
123 vnet_lisp_add_del_locator_set (vnet_lisp_add_del_locator_set_args_t * a,
130 u32 locator_set_index;
137 } vnet_lisp_add_del_mapping_args_t;
140 vnet_lisp_add_del_mapping (vnet_lisp_add_del_mapping_args_t *a,
146 ip_address_t address;
147 } vnet_lisp_add_del_map_resolver_args_t;
150 vnet_lisp_add_del_map_resolver (vnet_lisp_add_del_map_resolver_args_t * a);
152 always_inline lisp_cp_main_t *
153 vnet_lisp_cp_get_main() {
154 return &lisp_control_main;
157 #endif /* VNET_CONTROL_H_ */