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"
20 * Source initialisation Function
23 fib_entry_src_default_route_init (fib_entry_src_t *src)
25 src->fes_flags = FIB_ENTRY_SRC_FLAG_NONE;
29 fib_entry_src_default_route_remove (fib_entry_src_t *src)
31 src->fes_pl = FIB_NODE_INDEX_INVALID;
35 fib_entry_src_default_route_add (fib_entry_src_t *src,
36 const fib_entry_t *entry,
37 fib_entry_flag_t flags,
41 src->fes_pl = fib_path_list_create_special(proto,
42 FIB_PATH_LIST_FLAG_DROP,
46 const static fib_entry_src_vft_t interface_src_vft = {
47 .fesv_init = fib_entry_src_default_route_init,
48 .fesv_add = fib_entry_src_default_route_add,
49 .fesv_remove = fib_entry_src_default_route_remove,
53 fib_entry_src_default_route_register (void)
55 fib_entry_src_register(FIB_SOURCE_DEFAULT_ROUTE, &interface_src_vft);