]> git.proxmox.com Git - mirror_frr.git/blob - zebra/zebra_vrf.h
zebra: Fix show vrf and show run to use the zvrf_list
[mirror_frr.git] / zebra / zebra_vrf.h
1 /*
2 * Zebra Vrf Header
3 * Copyright (C) 2016 Cumulus Networks
4 * Donald Sahrp
5 *
6 * This file is part of Quagga.
7 *
8 * Quagga is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2, or (at your option) any
11 * later version.
12 *
13 * Quagga is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with GNU Zebra; see the file COPYING. If not, write to the Free
20 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 * 02111-1307, USA.
22 */
23 #if !defined(__ZEBRA_RIB_H__)
24 #define __ZEBRA_RIB_H__
25
26 #include <zebra/zebra_ns.h>
27
28 /* Routing table instance. */
29 struct zebra_vrf
30 {
31 /* Identifier. */
32 vrf_id_t vrf_id;
33
34 /* Routing table name. */
35 char name[VRF_NAMSIZ];
36
37 /* Description. */
38 char *desc;
39
40 /* FIB identifier. */
41 u_char fib_id;
42
43 /* Flags. */
44 u_int16_t flags;
45 #define ZEBRA_VRF_RIB_SCHEDULED (1 << 0)
46
47 u_int32_t table_id;
48
49 /* Routing table. */
50 struct route_table *table[AFI_MAX][SAFI_MAX];
51
52 /* Static route configuration. */
53 struct route_table *stable[AFI_MAX][SAFI_MAX];
54
55 /* Recursive Nexthop table */
56 struct route_table *rnh_table[AFI_MAX];
57
58 /* Import check table (used mostly by BGP */
59 struct route_table *import_check_table[AFI_MAX];
60
61 /* Routing tables off of main table for redistribute table */
62 struct route_table *other_table[AFI_MAX][ZEBRA_KERNEL_TABLE_MAX];
63
64 /* 2nd pointer type used primarily to quell a warning on
65 * ALL_LIST_ELEMENTS_RO
66 */
67 struct list _rid_all_sorted_list;
68 struct list _rid_lo_sorted_list;
69 struct list *rid_all_sorted_list;
70 struct list *rid_lo_sorted_list;
71 struct prefix rid_user_assigned;
72
73 /*
74 * Back pointer to the owning namespace.
75 */
76 struct zebra_ns *zns;
77 };
78
79 extern struct list *zvrf_list;
80
81 struct route_table *
82 zebra_vrf_table_with_table_id (afi_t afi, safi_t safi,
83 vrf_id_t vrf_id, u_int32_t table_id);
84
85 extern void zebra_vrf_static_route_interface_fixup (struct interface *ifp);
86 extern void zebra_vrf_update_all (struct zserv *client);
87 extern struct zebra_vrf *zebra_vrf_lookup (vrf_id_t vrf_id);
88 extern struct zebra_vrf *zebra_vrf_list_lookup_by_name (const char *);
89 extern struct zebra_vrf *zebra_vrf_alloc (vrf_id_t, const char *);
90 extern struct route_table *zebra_vrf_table (afi_t, safi_t, vrf_id_t);
91 extern struct route_table *zebra_vrf_static_table (afi_t, safi_t, struct zebra_vrf *zvrf);
92 extern struct route_table *zebra_vrf_other_route_table (afi_t afi, u_int32_t table_id,
93 vrf_id_t vrf_id);
94 extern void zebra_vrf_init (void);
95 #endif