3 * Copyright (C) 2016 Cumulus Networks, Inc.
6 * This file is part of Quagga.
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
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.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; see the file COPYING; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #if !defined(__ZEBRA_NS_H__)
23 #define __ZEBRA_NS_H__
29 /* Socket interface to kernel */
33 struct sockaddr_nl snl
;
38 struct zebra_ns_table
{
39 RB_ENTRY(zebra_ns_table
) zebra_ns_table_entry
;
44 struct route_table
*table
;
46 RB_HEAD(zebra_ns_table_head
, zebra_ns_table
);
47 RB_PROTOTYPE(zebra_ns_table_head
, zebra_ns_table
, zebra_ns_table_entry
,
48 zebra_ns_table_entry_compare
)
52 char name
[VRF_NAMSIZ
];
58 struct nlsock netlink
; /* kernel messages */
59 struct nlsock netlink_cmd
; /* command channel */
60 struct thread
*t_netlink
;
63 struct route_table
*if_table
;
65 /* L3-VNI hash table (for EVPN). Only in default instance */
66 struct hash
*l3vni_table
;
68 #if defined(HAVE_RTADV)
70 #endif /* HAVE_RTADV */
72 struct zebra_ns_table_head ns_tables
;
74 struct hash
*rules_hash
;
80 struct zebra_ns
*zebra_ns_lookup(ns_id_t ns_id
);
82 int zebra_ns_init(void);
83 int zebra_ns_enable(ns_id_t ns_id
, void **info
);
84 int zebra_ns_disabled(struct ns
*ns
);
85 int zebra_ns_disable(ns_id_t ns_id
, void **info
);
87 extern struct route_table
*zebra_ns_find_table(struct zebra_ns
*zns
,
88 uint32_t tableid
, afi_t afi
);
89 extern struct route_table
*zebra_ns_get_table(struct zebra_ns
*zns
,
90 struct zebra_vrf
*zvrf
,
91 uint32_t tableid
, afi_t afi
);
92 int zebra_ns_config_write(struct vty
*vty
, struct ns
*ns
);
94 unsigned long zebra_ns_score_proto(u_char proto
, u_short instance
);
95 void zebra_ns_sweep_route(void);