FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
bier_fmask_db.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  * @brief bier_fmask_db : The BIER fmask Database
17  */
18 
19 #ifndef __BIER_FMASK_DB_H__
20 #define __BIER_FMASK_DB_H__
21 
22 #include <vnet/ip/ip.h>
23 
24 #include <vnet/fib/fib_types.h>
25 
26 /**
27  * BIER header encapulsation types
28  */
29 typedef enum bier_hdr_type_t_ {
30  /**
31  * BIER Header in MPLS networks
32  */
34 
35  /**
36  * BIER header in non-MPLS networks
37  */
39 } __attribute__((packed)) bier_hdr_type_t;
40 
41 /**
42  * BIER next-hop type
43  */
44 typedef enum bier_nh_type_t_ {
45  /**
46  * BIER Header in MPLS networks
47  */
49 
50  /**
51  * BIER header in non-MPLS networks
52  */
54 } __attribute__((packed)) bier_nh_type_t;
55 
56 /**
57  * A key/ID for a BIER forwarding Mas (FMask).
58  * This is a simplified version of a fib_route_path_t.
59  */
60 typedef struct bier_fmask_id_t_ {
61  union {
62  /**
63  * next-hop of the peer
64  */
65  ip46_address_t bfmi_nh;
66 
67  /**
68  * ID of the next-hop object, e.g. a UDP-encap
69  */
71  };
72  /**
73  * The BIER table this fmask is in
74  */
76 
77  /**
78  * Type of BIER header this fmask supports
79  */
81 
82  /**
83  * Union discriminator
84  */
86 } __attribute__((packed)) bier_fmask_id_t;
87 
88 extern index_t
90  const fib_route_path_t *rpath);
92  const fib_route_path_t *rpath);
93 
94 extern void bier_fmask_db_remove (const bier_fmask_id_t *fmid);
95 
96 /**
97  * Walk all the BIER fmasks
98  */
99 typedef walk_rc_t (*bier_fmask_walk_fn_t) (index_t bfmi, void *ctx);
100 
101 extern void bier_fmask_db_walk(bier_fmask_walk_fn_t fn, void *ctx);
102 
103 #endif
bier_fmask_db_find_or_create_and_lock
index_t bier_fmask_db_find_or_create_and_lock(index_t bti, const fib_route_path_t *rpath)
Definition: bier_fmask_db.c:108
bier_fmask_id_t_::bfmi_bti
index_t bfmi_bti
The BIER table this fmask is in.
Definition: bier_fmask_db.h:75
BIER_HDR_O_MPLS
@ BIER_HDR_O_MPLS
BIER Header in MPLS networks.
Definition: bier_fmask_db.h:33
bier_fmask_id_t_::bfmi_id
u32 bfmi_id
ID of the next-hop object, e.g.
Definition: bier_fmask_db.h:70
bier_fmask_id_t_::bfmi_hdr_type
bier_hdr_type_t bfmi_hdr_type
Type of BIER header this fmask supports.
Definition: bier_fmask_db.h:80
BIER_HDR_O_OTHER
@ BIER_HDR_O_OTHER
BIER header in non-MPLS networks.
Definition: bier_fmask_db.h:38
bier_fmask_id_t_::bfmi_nh_type
bier_nh_type_t bfmi_nh_type
Union discriminator.
Definition: bier_fmask_db.h:85
bier_nh_type_t
enum bier_nh_type_t_ bier_nh_type_t
BIER next-hop type.
fib_types.h
index_t
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:43
bier_fmask_id_t_::bfmi_nh
ip46_address_t bfmi_nh
next-hop of the peer
Definition: bier_fmask_db.h:65
bier_hdr_type_t
enum bier_hdr_type_t_ bier_hdr_type_t
bier_fmask_db : The BIER fmask Database
bier_fmask_db_find
index_t bier_fmask_db_find(index_t bti, const fib_route_path_t *rpath)
Definition: bier_fmask_db.c:90
BIER_NH_UDP
@ BIER_NH_UDP
BIER header in non-MPLS networks.
Definition: bier_fmask_db.h:53
bier_fmask_walk_fn_t
walk_rc_t(* bier_fmask_walk_fn_t)(index_t bfmi, void *ctx)
Walk all the BIER fmasks.
Definition: bier_fmask_db.h:99
bier_nh_type_t_
bier_nh_type_t_
BIER next-hop type.
Definition: bier_fmask_db.h:44
ip.h
u32
unsigned int u32
Definition: types.h:88
fib_route_path_t_
A representation of a path as described by a route producer.
Definition: fib_types.h:500
ctx
long ctx[MAX_CONNS]
Definition: main.c:144
bier_fmask_db_remove
void bier_fmask_db_remove(const bier_fmask_id_t *fmid)
Definition: bier_fmask_db.c:138
bier_fmask_db_walk
void bier_fmask_db_walk(bier_fmask_walk_fn_t fn, void *ctx)
Definition: bier_fmask_db.c:155
BIER_NH_IP
@ BIER_NH_IP
BIER Header in MPLS networks.
Definition: bier_fmask_db.h:48
bier_fmask_id_t
struct bier_fmask_id_t_ bier_fmask_id_t
A key/ID for a BIER forwarding Mas (FMask).
bier_fmask_id_t_
A key/ID for a BIER forwarding Mas (FMask).
Definition: bier_fmask_db.h:60
walk_rc_t
enum walk_rc_t_ walk_rc_t
Walk return code.
bier_hdr_type_t_
bier_hdr_type_t_
bier_fmask_db : The BIER fmask Database
Definition: bier_fmask_db.h:29