FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
fib_entry_src_simple.c
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 #include "fib_entry.h"
17 #include "fib_entry_src.h"
18 
19 /**
20  * Source initialisation Function
21  */
22 static void
24 {
25  src->fes_flags = FIB_ENTRY_SRC_FLAG_NONE;
26 }
27 
28 /**
29  * Source deinitialisation Function
30  */
31 static void
33 {
34 }
35 
36 static void
38 {
39  src->fes_pl = FIB_NODE_INDEX_INVALID;
40 }
41 
42 static void
44  const fib_entry_t *entry,
47  const dpo_id_t *dpo)
48 {
49  src->fes_pl =
52  dpo);
53 }
54 
55 static void
57  const fib_entry_t *entry,
58  fib_path_list_flags_t pl_flags,
59  const fib_route_path_t *rpaths)
60 {
61  src->fes_pl = fib_path_list_create((FIB_PATH_LIST_FLAG_SHARED | pl_flags),
62  rpaths);
63 }
64 
67  .fesv_deinit = fib_entry_src_simple_deinit,
68  .fesv_add = fib_entry_src_simple_add,
69  .fesv_remove = fib_entry_src_simple_remove,
70  .fesv_path_swap = fib_entry_src_simple_path_swap,
71 };
72 
73 void
75 {
77 }
fib_entry.h
fib_entry_src_simple_register
void fib_entry_src_simple_register(void)
Definition: fib_entry_src_simple.c:74
fib_entry_src_simple_remove
static void fib_entry_src_simple_remove(fib_entry_src_t *src)
Definition: fib_entry_src_simple.c:37
fib_entry_t_
An entry in a FIB table.
Definition: fib_entry.h:305
dpo_proto_t
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
fib_entry_src_t_
Information related to the source of a FIB entry.
Definition: fib_entry.h:197
FIB_NODE_INDEX_INVALID
#define FIB_NODE_INDEX_INVALID
Definition: fib_types.h:30
fib_path_list_flags_t
enum fib_path_list_flags_t_ fib_path_list_flags_t
fib_entry_src.h
fib_entry_src_vft_t_
Virtual function table each FIB entry source will register.
Definition: fib_entry_src.h:195
fib_entry_flag_t
enum fib_entry_flag_t_ fib_entry_flag_t
fib_entry_src_simple_add
static void fib_entry_src_simple_add(fib_entry_src_t *src, const fib_entry_t *entry, fib_entry_flag_t flags, dpo_proto_t proto, const dpo_id_t *dpo)
Definition: fib_entry_src_simple.c:43
FIB_PATH_LIST_FLAG_SHARED
@ FIB_PATH_LIST_FLAG_SHARED
Definition: fib_path_list.h:81
FIB_ENTRY_SRC_FLAG_NONE
@ FIB_ENTRY_SRC_FLAG_NONE
Definition: fib_entry.h:177
simple_src_vft
const static fib_entry_src_vft_t simple_src_vft
Definition: fib_entry_src_simple.c:65
src
vl_api_address_t src
Definition: gre.api:54
fib_path_list_create_special
fib_node_index_t fib_path_list_create_special(dpo_proto_t nh_proto, fib_path_list_flags_t flags, const dpo_id_t *dpo)
Definition: fib_path_list.c:774
fib_entry_src_simple_deinit
static void fib_entry_src_simple_deinit(fib_entry_src_t *src)
Source deinitialisation Function.
Definition: fib_entry_src_simple.c:32
fib_route_path_t_
A representation of a path as described by a route producer.
Definition: fib_types.h:500
fib_entry_src_simple_path_swap
static void fib_entry_src_simple_path_swap(fib_entry_src_t *src, const fib_entry_t *entry, fib_path_list_flags_t pl_flags, const fib_route_path_t *rpaths)
Definition: fib_entry_src_simple.c:56
fib_entry_src_simple_init
static void fib_entry_src_simple_init(fib_entry_src_t *src)
Source initialisation Function.
Definition: fib_entry_src_simple.c:23
fib_entry_src_vft_t_::fesv_init
fib_entry_src_init_t fesv_init
Definition: fib_entry_src.h:196
FIB_SOURCE_BH_SIMPLE
@ FIB_SOURCE_BH_SIMPLE
add paths without path extensions
Definition: fib_source.h:210
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
fib_entry_src_behaviour_register
void fib_entry_src_behaviour_register(fib_source_behaviour_t bh, const fib_entry_src_vft_t *vft)
Definition: fib_entry_src.c:61
proto
vl_api_ip_proto_t proto
Definition: acl_types.api:51
fib_path_list_create
fib_node_index_t fib_path_list_create(fib_path_list_flags_t flags, const fib_route_path_t *rpaths)
Definition: fib_path_list.c:682
fib_entry_src_flags_2_path_list_flags
fib_path_list_flags_t fib_entry_src_flags_2_path_list_flags(fib_entry_flag_t eflags)
Definition: fib_entry_src.c:1532
flags
vl_api_wireguard_peer_flags_t flags
Definition: wireguard.api:105