]>
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 | * | |
896014f4 DL |
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 | |
fe18ee2d DS |
21 | */ |
22 | #if !defined(__ZEBRA_NS_H__) | |
23 | #define __ZEBRA_NS_H__ | |
24 | ||
13460c44 | 25 | #include <lib/ns.h> |
942bf97b | 26 | #include <lib/vrf.h> |
13460c44 | 27 | |
bf094f69 QY |
28 | #include "zebra/rib.h" |
29 | #include "zebra/zebra_vrf.h" | |
30 | ||
51e94aa7 EDP |
31 | #ifdef __cplusplus |
32 | extern "C" { | |
33 | #endif | |
34 | ||
fe18ee2d DS |
35 | #ifdef HAVE_NETLINK |
36 | /* Socket interface to kernel */ | |
d62a17ae | 37 | struct nlsock { |
38 | int sock; | |
39 | int seq; | |
40 | struct sockaddr_nl snl; | |
41 | char name[64]; | |
fe18ee2d DS |
42 | }; |
43 | #endif | |
44 | ||
d62a17ae | 45 | struct zebra_ns { |
46 | /* net-ns name. */ | |
47 | char name[VRF_NAMSIZ]; | |
fe18ee2d | 48 | |
d62a17ae | 49 | /* Identifier. */ |
50 | ns_id_t ns_id; | |
fe18ee2d DS |
51 | |
52 | #ifdef HAVE_NETLINK | |
62b8bb7a MS |
53 | struct nlsock netlink; /* kernel messages */ |
54 | struct nlsock netlink_cmd; /* command channel */ | |
80dcc388 MS |
55 | |
56 | /* dplane system's channels: one for outgoing programming, | |
57 | * for the FIB e.g., and one for incoming events from the OS. | |
58 | */ | |
59 | struct nlsock netlink_dplane_out; | |
60 | struct nlsock netlink_dplane_in; | |
d62a17ae | 61 | struct thread *t_netlink; |
fe18ee2d DS |
62 | #endif |
63 | ||
d62a17ae | 64 | struct route_table *if_table; |
fe18ee2d | 65 | |
3347430b PG |
66 | /* Back pointer */ |
67 | struct ns *ns; | |
fe18ee2d DS |
68 | }; |
69 | ||
d62a17ae | 70 | struct zebra_ns *zebra_ns_lookup(ns_id_t ns_id); |
fe18ee2d | 71 | |
ac2cb9bf | 72 | int zebra_ns_init(void); |
d62a17ae | 73 | int zebra_ns_enable(ns_id_t ns_id, void **info); |
ff705b15 | 74 | int zebra_ns_disabled(struct ns *ns); |
2961d060 PG |
75 | int zebra_ns_early_shutdown(struct ns *ns, |
76 | void *param_in __attribute__((unused)), | |
77 | void **param_out __attribute__((unused))); | |
78 | int zebra_ns_final_shutdown(struct ns *ns, | |
79 | void *param_in __attribute__((unused)), | |
80 | void **param_out __attribute__((unused))); | |
b95c1883 | 81 | int zebra_ns_config_write(struct vty *vty, struct ns *ns); |
47a08aa9 | 82 | |
51e94aa7 EDP |
83 | #ifdef __cplusplus |
84 | } | |
85 | #endif | |
86 | ||
fe18ee2d | 87 | #endif |