1 /* Zebra Router header.
2 * Copyright (C) 2018 Cumulus Networks, Inc.
5 * This file is part of FRR.
7 * FRR is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any
12 * FRR is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with FRR; see the file COPYING. If not, write to the Free
19 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 #ifndef __ZEBRA_ROUTER_H__
23 #define __ZEBRA_ROUTER_H__
25 #include "zebra/zebra_ns.h"
28 * This header file contains the idea of a router and as such
29 * owns data that is associated with a router from zebra's
33 struct zebra_router_table
{
34 RB_ENTRY(zebra_router_table
) zebra_router_table_entry
;
41 struct route_table
*table
;
43 RB_HEAD(zebra_router_table_head
, zebra_router_table
);
44 RB_PROTOTYPE(zebra_router_table_head
, zebra_router_table
,
45 zebra_router_table_entry
, zebra_router_table_entry_compare
)
49 struct zebra_router_table_head tables
;
51 /* L3-VNI hash table (for EVPN). Only in default instance */
52 struct hash
*l3vni_table
;
54 struct hash
*rules_hash
;
56 struct hash
*ipset_hash
;
58 struct hash
*ipset_entry_hash
;
60 struct hash
*iptable_hash
;
62 #if defined(HAVE_RTADV)
64 #endif /* HAVE_RTADV */
66 /* A sequence number used for tracking routes */
67 _Atomic
uint32_t sequence_num
;
70 extern struct zebra_router zrouter
;
72 extern void zebra_router_init(void);
73 extern void zebra_router_terminate(void);
75 extern struct route_table
*zebra_router_find_table(struct zebra_vrf
*zvrf
,
76 uint32_t tableid
, afi_t afi
,
78 extern struct route_table
*zebra_router_get_table(struct zebra_vrf
*zvrf
,
79 uint32_t tableid
, afi_t afi
,
82 extern int zebra_router_config_write(struct vty
*vty
);
84 extern unsigned long zebra_router_score_proto(uint8_t proto
,
85 unsigned short instance
);
86 extern void zebra_router_sweep_route(void);
88 extern void zebra_router_show_table_summary(struct vty
*vty
);
90 extern uint32_t zebra_router_get_next_sequence(void);