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.
18 * what's it all about?
20 * set int ip table Gig0 2
21 * set int ip addr Gig0 10.0.0.1/24
22 * Ggi0 is in table 2 with a connected address.
23 * Now we add a routing matching said connected in a different table
24 * ip route add table 3 10.0.0.0/24 via Gig0
25 * How do we expect traffic in table 3 to be forwarded? Clearly out of
26 * Ggi0. It's an attached route, hence we are saying that we can ARP for
27 * hosts in the attached subnet. and we can. but any ARP entries we send
28 * we be received on Gig0, but since Gig0 is in table 2, it will install
29 * the adj-fins in table 2. So traffic in table 3 will never hit an adj-fib
30 * and hence always the glean, and so thus be effectively dropped.
31 * How do we fix this? Attached Export !! All more specfiic entries in table 2
32 * that track and are covered by the connected are automatically exported into
33 * table 3. Now table 3 also has adj-fibs (and the local) so traffic to hosts
37 #ifndef __FIB_ATTACHED_EXPORT_H__
38 #define __FIB_ATTACHED_EXPORT_H__
40 #include <vnet/fib/fib_types.h>
42 extern void fib_attached_export_import(fib_entry_t *fib_entry,
43 fib_node_index_t export_fib);
45 extern void fib_attached_export_purge(fib_entry_t *fib_entry);
47 extern void fib_attached_export_covered_added(fib_entry_t *cover,
48 fib_node_index_t covered);
49 extern void fib_attached_export_covered_removed(fib_entry_t *cover,
50 fib_node_index_t covered);
51 extern void fib_attached_export_cover_change(fib_entry_t *fib_entry);
52 extern void fib_attached_export_cover_update(fib_entry_t *fib_entry);
54 extern u8* fib_ae_import_format(fib_node_index_t impi, u8*s);
55 extern u8* fib_ae_export_format(fib_node_index_t expi, u8*s);