]>
Commit | Line | Data |
---|---|---|
fe18ee2d DS |
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 | |
19 | * along with Quagga; see the file COPYING. If not, write to the Free | |
20 | * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
21 | * 02111-1307, USA. | |
22 | */ | |
23 | #if !defined(__ZEBRA_NS_H__) | |
24 | #define __ZEBRA_NS_H__ | |
25 | ||
13460c44 FL |
26 | #include <lib/ns.h> |
27 | ||
fe18ee2d DS |
28 | #ifdef HAVE_NETLINK |
29 | /* Socket interface to kernel */ | |
ac4d0be5 | 30 | struct nlsock { |
31 | int sock; | |
32 | int seq; | |
33 | struct sockaddr_nl snl; | |
34 | char name[64]; | |
fe18ee2d DS |
35 | }; |
36 | #endif | |
37 | ||
ac4d0be5 | 38 | struct zebra_ns { |
39 | /* net-ns name. */ | |
40 | char name[VRF_NAMSIZ]; | |
fe18ee2d | 41 | |
ac4d0be5 | 42 | /* Identifier. */ |
43 | ns_id_t ns_id; | |
fe18ee2d DS |
44 | |
45 | #ifdef HAVE_NETLINK | |
ac4d0be5 | 46 | struct nlsock netlink; /* kernel messages */ |
47 | struct nlsock netlink_cmd; /* command channel */ | |
48 | struct thread *t_netlink; | |
fe18ee2d DS |
49 | #endif |
50 | ||
ac4d0be5 | 51 | struct route_table *if_table; |
fe18ee2d | 52 | |
ac4d0be5 | 53 | #if defined(HAVE_RTADV) |
54 | struct rtadv rtadv; | |
fe18ee2d DS |
55 | #endif /* HAVE_RTADV */ |
56 | }; | |
57 | ||
58 | #define NS_DEFAULT 0 | |
59 | #define NS_UNKNOWN UINT16_MAX | |
60 | ||
ac4d0be5 | 61 | struct zebra_ns *zebra_ns_lookup(ns_id_t ns_id); |
fe18ee2d | 62 | |
ac4d0be5 | 63 | int zebra_ns_init(void); |
64 | int zebra_ns_enable(ns_id_t ns_id, void **info); | |
65 | int zebra_ns_disable(ns_id_t ns_id, void **info); | |
fe18ee2d | 66 | #endif |