FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
adj_types.h
Go to the documentation of this file.
1 /*
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:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
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.
14  */
15 
16 #ifndef __ADJ_TYPES_H__
17 #define __ADJ_TYPES_H__
18 
19 #include <vnet/vnet.h>
20 
21 /**
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);
27  * than we can from
28  * foo bar(u32 t);
29  */
30 typedef u32 adj_index_t;
31 
32 /**
33  * @brief Invalid ADJ index - used when no adj is known
34  * likewise blazoned capitals INVALID speak volumes where ~0 does not.
35  */
36 #define ADJ_INDEX_INVALID ((u32)~0)
37 
38 /**
39  * @brief return codes from a adjacency walker callback function
40  */
41 typedef enum adj_walk_rc_t_
42 {
46 
47 /**
48  * @brief Call back function when walking adjacencies
49  */
51  void *ctx);
52 
53 #endif
adj_walk_rc_t
enum adj_walk_rc_t_ adj_walk_rc_t
return codes from a adjacency walker callback function
ADJ_WALK_RC_STOP
@ ADJ_WALK_RC_STOP
Definition: adj_types.h:43
adj_walk_rc_t_
adj_walk_rc_t_
return codes from a adjacency walker callback function
Definition: adj_types.h:41
u32
unsigned int u32
Definition: types.h:88
ctx
long ctx[MAX_CONNS]
Definition: main.c:144
adj_index_t
u32 adj_index_t
An index for adjacencies.
Definition: adj_types.h:30
ADJ_WALK_RC_CONTINUE
@ ADJ_WALK_RC_CONTINUE
Definition: adj_types.h:44
adj_walk_cb_t
adj_walk_rc_t(* adj_walk_cb_t)(adj_index_t ai, void *ctx)
Call back function when walking adjacencies.
Definition: adj_types.h:50
vnet.h