FD.io VPP  v18.04-17-g3a0d853
Vector Packet Processing
mfib_itf.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 __MFIB_ITF_H__
17 #define __MFIB_ITF_H__
18 
19 #include <vlib/vlib.h>
20 #include <vnet/mfib/mfib_types.h>
21 
22 /**
23  * @brief An interface associated with a particular MFIB entry
24  */
25 typedef struct mfib_itf_t_
26 {
27  /**
28  * Required for pool_get_aligned
29  */
30  CLIB_CACHE_LINE_ALIGN_MARK(cacheline0);
31 
32  /**
33  * @brief Forwarding Flags on the entry - checked in the data-path
34  */
36 
37  /**
38  * The SW IF index that this MFIB interface represents
39  */
41 
42  /**
43  * The index of the signal in the pending list
44  */
46 } mfib_itf_t;
47 
48 
49 extern index_t mfib_itf_create(u32 sw_if_index,
51 extern void mfib_itf_delete(mfib_itf_t *mfi);
52 
53 extern u8 *format_mfib_itf(u8 * s, va_list * args);
54 
56 
57 static inline mfib_itf_t *
59 {
60  return (pool_elt_at_index(mfib_itf_pool, mi));
61 }
62 static inline index_t
64 {
65  return (mfi - mfib_itf_pool);
66 }
67 
68 #endif
u8 * format_mfib_itf(u8 *s, va_list *args)
Definition: mfib_itf.c:47
void mfib_itf_delete(mfib_itf_t *mfi)
Definition: mfib_itf.c:40
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
Definition: dpo.h:41
struct mfib_itf_t_ mfib_itf_t
An interface associated with a particular MFIB entry.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:461
static mfib_itf_t * mfib_itf_get(index_t mi)
Definition: mfib_itf.h:58
u32 mfi_si
The index of the signal in the pending list.
Definition: mfib_itf.h:45
mfib_itf_flags_t mfi_flags
Forwarding Flags on the entry - checked in the data-path.
Definition: mfib_itf.h:35
CLIB_CACHE_LINE_ALIGN_MARK(cacheline0)
Required for pool_get_aligned.
unsigned int u32
Definition: types.h:88
An interface associated with a particular MFIB entry.
Definition: mfib_itf.h:25
unsigned char u8
Definition: types.h:56
enum mfib_itf_flags_t_ mfib_itf_flags_t
static index_t mfib_itf_get_index(const mfib_itf_t *mfi)
Definition: mfib_itf.h:63
u32 mfi_sw_if_index
The SW IF index that this MFIB interface represents.
Definition: mfib_itf.h:40
mfib_itf_t * mfib_itf_pool
Definition: mfib_itf.c:21
index_t mfib_itf_create(u32 sw_if_index, mfib_itf_flags_t mfi_flags)
Definition: mfib_itf.c:24