FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
bier_bift_table.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 __BIER_BIFT_TABLE_H__
17 #define __BIER_BIFT_TABLE_H__
18 
19 #include <vnet/dpo/dpo.h>
20 #include <vnet/bier/bier_types.h>
21 #include <vnet/mpls/packet.h>
22 
23 /*
24  * the lookup table used to get from a BIFT_ID to a load-balance.
25  * As per-draft draft-ietf-bier-mpls-encapsulation-10 this is the
26  * use case for non-MPLS networks
27  */
28 #define BIER_BIFT_N_ENTRIES (1 << 20)
29 typedef struct bier_bfit_table_t_
30 {
31  /**
32  * Forwarding information for each BIFT ID
33  */
35 
36  /**
37  * The number of entries in the table
38  */
41 
42 
44  const dpo_id_t *dpo);
45 
47 
48 /**
49  * Global BIFT table
50  */
52 
53 static inline const dpo_id_t*
55 {
56  return (&bier_bift_table->bblt_dpos[vnet_mpls_uc_get_label(key_host_order)]);
57 }
58 #endif
BIER_BIFT_N_ENTRIES
#define BIER_BIFT_N_ENTRIES
Definition: bier_bift_table.h:28
bier_bift_dp_lookup
static const dpo_id_t * bier_bift_dp_lookup(bier_bift_id_t key_host_order)
Definition: bier_bift_table.h:54
bier_bfit_table_t_
Definition: bier_bift_table.h:29
bier_bfit_table_t
struct bier_bfit_table_t_ bier_bfit_table_t
vnet_mpls_uc_get_label
static u32 vnet_mpls_uc_get_label(mpls_label_t label_exp_s_ttl)
Definition: packet.h:105
packet.h
bier_bift_table_entry_add
void bier_bift_table_entry_add(bier_bift_id_t id, const dpo_id_t *dpo)
Definition: bier_bift_table.c:44
bier_bift_table
bier_bfit_table_t * bier_bift_table
Global BIFT table.
Definition: bier_bift_table.c:36
dpo.h
bier_bift_table_entry_remove
void bier_bift_table_entry_remove(bier_bift_id_t id)
Definition: bier_bift_table.c:88
u32
unsigned int u32
Definition: types.h:88
bier_types.h
bier_bfit_table_t_::bblt_dpos
dpo_id_t bblt_dpos[BIER_BIFT_N_ENTRIES]
Forwarding information for each BIFT ID.
Definition: bier_bift_table.h:34
bier_bift_id_t
u32 bier_bift_id_t
The BIER universal 'label'.
Definition: bier_types.h:458
bier_bfit_table_t_::bblt_n_entries
u32 bblt_n_entries
The number of entries in the table.
Definition: bier_bift_table.h:39
dpo_id_t_
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
Definition: dpo.h:172