]>
Commit | Line | Data |
---|---|---|
89272910 DS |
1 | /* Zebra Router header. |
2 | * Copyright (C) 2018 Cumulus Networks, Inc. | |
3 | * Donald Sharp | |
4 | * | |
5 | * This file is part of FRR. | |
6 | * | |
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 | |
10 | * later version. | |
11 | * | |
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. | |
16 | * | |
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 | |
20 | * 02111-1307, USA. | |
21 | */ | |
22 | #ifndef __ZEBRA_ROUTER_H__ | |
23 | #define __ZEBRA_ROUTER_H__ | |
24 | ||
25 | #include "zebra/zebra_ns.h" | |
26 | ||
27 | /* | |
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 | |
30 | * perspective. | |
31 | */ | |
32 | ||
33 | struct zebra_router_table { | |
34 | RB_ENTRY(zebra_router_table) zebra_router_table_entry; | |
35 | ||
36 | uint32_t tableid; | |
37 | afi_t afi; | |
38 | safi_t safi; | |
39 | ns_id_t ns_id; | |
40 | ||
41 | struct route_table *table; | |
42 | }; | |
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) | |
46 | ||
47 | struct zebra_router { | |
3801e764 DS |
48 | /* Thread master */ |
49 | struct thread_master *master; | |
89272910 | 50 | |
161e9ab7 DS |
51 | /* Lists of clients who have connected to us */ |
52 | struct list *client_list; | |
53 | ||
89272910 | 54 | struct zebra_router_table_head tables; |
7f0ea8a4 | 55 | |
89272910 DS |
56 | /* L3-VNI hash table (for EVPN). Only in default instance */ |
57 | struct hash *l3vni_table; | |
7f0ea8a4 DS |
58 | |
59 | struct hash *rules_hash; | |
62f20a52 DS |
60 | |
61 | struct hash *ipset_hash; | |
62 | ||
63 | struct hash *ipset_entry_hash; | |
64 | ||
65 | struct hash *iptable_hash; | |
a3be9fa1 DS |
66 | |
67 | #if defined(HAVE_RTADV) | |
68 | struct rtadv rtadv; | |
69 | #endif /* HAVE_RTADV */ | |
1485bbe7 DS |
70 | |
71 | /* A sequence number used for tracking routes */ | |
72 | _Atomic uint32_t sequence_num; | |
b3d43ff4 DS |
73 | |
74 | /* The default table used for this router */ | |
75 | uint32_t rtm_table_default; | |
489a9614 DS |
76 | |
77 | /* rib work queue */ | |
78 | #define ZEBRA_RIB_PROCESS_HOLD_TIME 10 | |
79 | #define ZEBRA_RIB_PROCESS_RETRY_TIME 1 | |
80 | struct work_queue *ribq; | |
ea45a4e7 DS |
81 | |
82 | /* Meta Queue Information */ | |
83 | struct meta_queue *mq; | |
e2353ec2 DS |
84 | |
85 | /* LSP work queue */ | |
86 | struct work_queue *lsp_process_q; | |
5ec5a716 DS |
87 | |
88 | #define ZEBRA_ZAPI_PACKETS_TO_PROCESS 1000 | |
89 | _Atomic uint32_t packets_to_process; | |
89272910 DS |
90 | }; |
91 | ||
92 | extern struct zebra_router zrouter; | |
93 | ||
94 | extern void zebra_router_init(void); | |
95 | extern void zebra_router_terminate(void); | |
96 | ||
97 | extern struct route_table *zebra_router_find_table(struct zebra_vrf *zvrf, | |
98 | uint32_t tableid, afi_t afi, | |
99 | safi_t safi); | |
100 | extern struct route_table *zebra_router_get_table(struct zebra_vrf *zvrf, | |
101 | uint32_t tableid, afi_t afi, | |
102 | safi_t safi); | |
103 | ||
104 | extern int zebra_router_config_write(struct vty *vty); | |
105 | ||
106 | extern unsigned long zebra_router_score_proto(uint8_t proto, | |
107 | unsigned short instance); | |
108 | extern void zebra_router_sweep_route(void); | |
ac5aa23f DS |
109 | |
110 | extern void zebra_router_show_table_summary(struct vty *vty); | |
1485bbe7 DS |
111 | |
112 | extern uint32_t zebra_router_get_next_sequence(void); | |
89272910 | 113 | #endif |