]> git.proxmox.com Git - mirror_frr.git/blob - zebra/zebra_ns.h
merge with upstream
[mirror_frr.git] / zebra / zebra_ns.h
1 /*
2 * Zebra NS header
3 * Copyright (C) 2016 Cumulus Networks, Inc.
4 * Donald Sharp
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 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
21 */
22 #if !defined(__ZEBRA_NS_H__)
23 #define __ZEBRA_NS_H__
24
25 #include <lib/ns.h>
26
27 #ifdef HAVE_NETLINK
28 /* Socket interface to kernel */
29 struct nlsock {
30 int sock;
31 int seq;
32 struct sockaddr_nl snl;
33 char name[64];
34 };
35 #endif
36
37 struct zebra_ns {
38 /* net-ns name. */
39 char name[VRF_NAMSIZ];
40
41 /* Identifier. */
42 ns_id_t ns_id;
43
44 #ifdef HAVE_NETLINK
45 struct nlsock netlink; /* kernel messages */
46 struct nlsock netlink_cmd; /* command channel */
47 struct thread *t_netlink;
48 #endif
49
50 struct route_table *if_table;
51
52 #if defined(HAVE_RTADV)
53 struct rtadv rtadv;
54 #endif /* HAVE_RTADV */
55 };
56
57 #define NS_DEFAULT 0
58 #define NS_UNKNOWN UINT16_MAX
59
60 struct zebra_ns *zebra_ns_lookup(ns_id_t ns_id);
61
62 int zebra_ns_init(void);
63 int zebra_ns_enable(ns_id_t ns_id, void **info);
64 int zebra_ns_disable(ns_id_t ns_id, void **info);
65 #endif