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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #include "fib_entry.h"
17 #include "fib_entry_src.h"
18 #include "fib_path_list.h"
21 * Source initialisation Function
24 fib_entry_src_default_init (fib_entry_src_t *src)
29 * Source deinitialisation Function
32 fib_entry_src_default_deinit (fib_entry_src_t *src)
37 fib_entry_src_cover_change (fib_entry_src_t *src)
42 * Source deinitialisation Function
45 fib_entry_src_default_deinit (fib_entry_src_t *src)
50 fib_entry_src_default_path_add (fib_entry_src_t *src,
52 const ip46_address_t *next_hop,
53 u32 next_hop_sw_if_index,
54 u32 next_hop_fib_index,
60 fib_entry_src_default_path_remove (fib_entry_src_t *src,
62 const ip46_address_t *next_hop,
63 u32 next_hop_sw_if_index,
64 u32 next_hop_fib_index,
72 * Called when the source is teh new longer best source on the entry
75 fib_entry_src_default_activate (fib_entry_src_t *src,
76 const fib_entry_t *fib_entry)
82 * Called when the source is no longer best source on the entry
85 fib_entry_src_default_deactivate (fib_entry_src_t *src,
86 const fib_entry_t *fib_entry)
91 fib_entry_src_default_add (fib_entry_src_t *src,
92 fib_entry_flag_t flags,
98 fib_entry_src_default_remove (fib_entry_src_t *src)
102 const static fib_entry_src_vft_t default_src_vft = {
103 .fesv_init = fib_entry_src_default_init,
104 .fesv_deinit = fib_entry_src_default_deinit,
105 .fesv_add = fib_entry_src_default_add,
106 .fesv_remove = fib_entry_src_default_remove,
107 .fesv_path_add = fib_entry_src_default_path_add,
108 .fesv_path_remove = fib_entry_src_default_path_remove,
109 .fesv_activate = fib_entry_src_default_activate,
110 .fesv_deactivate = fib_entry_src_default_deactivate,
114 fib_entry_src_default_register (void)
118 FOR_EACH_FIB_SOURCE(source) {
119 fib_entry_src_register(source, &default_src_vft);