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 __ADJ_TYPES_H__
17 #define __ADJ_TYPES_H__
19 #include <vnet/vnet.h>
22 * @brief An index for adjacencies.
23 * Alas 'C' is not typesafe enough to b0rk when a u32 is used instead of
24 * an adi_index_t. However, for us humans, we can glean much more intent
25 * from the declaration
26 * foo bar(adj_index_t t);
30 typedef u32 adj_index_t;
33 * @brief Invalid ADJ index - used when no adj is known
34 * likewise blazoned capitals INVALID speak volumes where ~0 does not.
36 #define ADJ_INDEX_INVALID ((u32)~0)
39 * @brief return codes from a adjacency walker callback function
41 typedef enum adj_walk_rc_t_
48 * @brief Call back function when walking adjacencies
50 typedef adj_walk_rc_t (*adj_walk_cb_t)(adj_index_t ai,