blob: fa28a6e13b88cfe1767c19a8ca8ddae9044d82c5 [file] [log] [blame]
Neale Ranns0bfe5d82016-08-25 15:29:12 +01001/*
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 * FIB attached export
17 *
18 * what's it all about?
19 * say one does this:
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
34 * is restored.
35 */
36
37#ifndef __FIB_ATTACHED_EXPORT_H__
38#define __FIB_ATTACHED_EXPORT_H__
39
40#include <vnet/fib/fib_types.h>
41
42extern void fib_attached_export_import(fib_entry_t *fib_entry,
43 fib_node_index_t export_fib);
44
45extern void fib_attached_export_purge(fib_entry_t *fib_entry);
46
47extern void fib_attached_export_covered_added(fib_entry_t *cover,
48 fib_node_index_t covered);
49extern void fib_attached_export_covered_removed(fib_entry_t *cover,
50 fib_node_index_t covered);
51extern void fib_attached_export_cover_change(fib_entry_t *fib_entry);
52extern void fib_attached_export_cover_update(fib_entry_t *fib_entry);
53
Neale Rannsad422ed2016-11-02 14:20:04 +000054extern u8* fib_ae_import_format(fib_entry_t *fib_entry, u8*s);
55extern u8* fib_ae_export_format(fib_entry_t *fib_entry, u8*s);
Neale Ranns0bfe5d82016-08-25 15:29:12 +010056
57#endif