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 #ifndef __FIB_ENTRY_SRC_RR_H__
17 #define __FIB_ENTRY_SRC_RR_H__
19 #include "fib_entry_src.h"
22 * the flags that an RR sourced entry can inherit from its cover
24 #define FIB_ENTRY_FLAGS_RR_INHERITED (FIB_ENTRY_FLAG_CONNECTED | \
25 FIB_ENTRY_FLAG_ATTACHED)
28 * fib_entry_src_rr_resolve_via_connected
30 * Resolve via a connected cover.
33 fib_entry_src_rr_resolve_via_connected (fib_entry_src_t *src,
34 const fib_entry_t *fib_entry,
35 const fib_entry_t *cover);
38 * use the path-list of the cover, unless it would form a loop.
39 * that is unless the cover is via this entry.
40 * If a loop were to form it would be a 1 level loop (i.e. X via X),
41 * and there would be 2 locks on the path-list; one since its used
42 * by the cover, and 1 from here. The first lock will go when the
43 * cover is removed, the second, and last, when the covered walk
44 * occurs during the cover's removel - this is not a place where
45 * we can handle last lock gone.
46 * In short, don't let the loop form. The usual rules of 'we must
47 * let it form so we know when it breaks' don't apply here, since
48 * the loop will break when the cover changes, and this function
49 * will be called again when that happens.
52 fib_entry_src_rr_use_covers_pl (fib_entry_src_t *src,
53 const fib_entry_t *fib_entry,
54 const fib_entry_t *cover);
58 * fib_entry_src_rr_cover_update
60 * This entry's cover has changed. This entry
61 * will need to re-inheret.
63 fib_entry_src_cover_res_t
64 fib_entry_src_rr_cover_change (fib_entry_src_t *src,
65 const fib_entry_t *fib_entry);
68 * fib_entry_src_rr_cover_update
70 * This entry's cover has updated its forwarding info. This entry
71 * will need to re-inheret.
73 fib_entry_src_cover_res_t
74 fib_entry_src_rr_cover_update (fib_entry_src_t *src,
75 const fib_entry_t *fib_entry);