mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-30 22:26:28 +00:00

Allow zebra to dump the table information it has from a router perspective. This table looks like this: donna.cumulusnetworks.com# show zebra router table summary VRF NS ID VRF ID AFI SAFI Table Count --------------------------------------------------------------------------- default 0 0 IPv4 unicast 49 1 default 0 0 IPv4 unicast 254 7 default 0 0 IPv4 multicast 254 9 default 0 0 IPv6 unicast 254 1 default 0 0 IPv6 multicast 254 1 BLUE 0 31 IPv4 unicast 1005 0 BLUE 0 31 IPv4 multicast 1005 0 BLUE 0 31 IPv6 unicast 1005 0 BLUE 0 31 IPv6 multicast 1005 0 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
87 lines
2.4 KiB
C
87 lines
2.4 KiB
C
/* Zebra Router header.
|
|
* Copyright (C) 2018 Cumulus Networks, Inc.
|
|
* Donald Sharp
|
|
*
|
|
* This file is part of FRR.
|
|
*
|
|
* FRR is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the
|
|
* Free Software Foundation; either version 2, or (at your option) any
|
|
* later version.
|
|
*
|
|
* FRR is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with FRR; see the file COPYING. If not, write to the Free
|
|
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
* 02111-1307, USA.
|
|
*/
|
|
#ifndef __ZEBRA_ROUTER_H__
|
|
#define __ZEBRA_ROUTER_H__
|
|
|
|
#include "zebra/zebra_ns.h"
|
|
|
|
/*
|
|
* This header file contains the idea of a router and as such
|
|
* owns data that is associated with a router from zebra's
|
|
* perspective.
|
|
*/
|
|
|
|
struct zebra_router_table {
|
|
RB_ENTRY(zebra_router_table) zebra_router_table_entry;
|
|
|
|
uint32_t tableid;
|
|
afi_t afi;
|
|
safi_t safi;
|
|
ns_id_t ns_id;
|
|
|
|
struct route_table *table;
|
|
};
|
|
RB_HEAD(zebra_router_table_head, zebra_router_table);
|
|
RB_PROTOTYPE(zebra_router_table_head, zebra_router_table,
|
|
zebra_router_table_entry, zebra_router_table_entry_compare)
|
|
|
|
struct zebra_router {
|
|
|
|
struct zebra_router_table_head tables;
|
|
|
|
/* L3-VNI hash table (for EVPN). Only in default instance */
|
|
struct hash *l3vni_table;
|
|
|
|
struct hash *rules_hash;
|
|
|
|
struct hash *ipset_hash;
|
|
|
|
struct hash *ipset_entry_hash;
|
|
|
|
struct hash *iptable_hash;
|
|
|
|
#if defined(HAVE_RTADV)
|
|
struct rtadv rtadv;
|
|
#endif /* HAVE_RTADV */
|
|
};
|
|
|
|
extern struct zebra_router zrouter;
|
|
|
|
extern void zebra_router_init(void);
|
|
extern void zebra_router_terminate(void);
|
|
|
|
extern struct route_table *zebra_router_find_table(struct zebra_vrf *zvrf,
|
|
uint32_t tableid, afi_t afi,
|
|
safi_t safi);
|
|
extern struct route_table *zebra_router_get_table(struct zebra_vrf *zvrf,
|
|
uint32_t tableid, afi_t afi,
|
|
safi_t safi);
|
|
|
|
extern int zebra_router_config_write(struct vty *vty);
|
|
|
|
extern unsigned long zebra_router_score_proto(uint8_t proto,
|
|
unsigned short instance);
|
|
extern void zebra_router_sweep_route(void);
|
|
|
|
extern void zebra_router_show_table_summary(struct vty *vty);
|
|
#endif
|