mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-03 00:51:52 +00:00

The `struct zebra_ns` data structure is being used for both router information as well as support for the vrf backend( as appropriate ). This is a confusing state. Start the movement of `struct zebra_ns` into 2 things `struct zebra_router` and `struct zebra_ns`. In this new regime `struct zebra_router` is purely for handling data about the router. It has no knowledge of the underlying representation of the Data Plane. `struct zebra_ns` becomes a linux specific bit of code that allows us to handle the vrf backend and is allowed to have knowledge about underlying data plane constructs. When someone implements a *bsd backend the zebra_vrf data structure will need to be abstracted to take advantage of this instead of relying on zebra_ns. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
82 lines
1.9 KiB
C
82 lines
1.9 KiB
C
/*
|
|
* Zebra NS header
|
|
* Copyright (C) 2016 Cumulus Networks, Inc.
|
|
* Donald Sharp
|
|
*
|
|
* This file is part of Quagga.
|
|
*
|
|
* Quagga is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the
|
|
* Free Software Foundation; either version 2, or (at your option) any
|
|
* later version.
|
|
*
|
|
* Quagga is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along
|
|
* with this program; see the file COPYING; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
#if !defined(__ZEBRA_NS_H__)
|
|
#define __ZEBRA_NS_H__
|
|
|
|
#include <lib/ns.h>
|
|
#include <lib/vrf.h>
|
|
|
|
#include "zebra/rib.h"
|
|
#include "zebra/zebra_vrf.h"
|
|
|
|
#ifdef HAVE_NETLINK
|
|
/* Socket interface to kernel */
|
|
struct nlsock {
|
|
int sock;
|
|
int seq;
|
|
struct sockaddr_nl snl;
|
|
char name[64];
|
|
};
|
|
#endif
|
|
|
|
struct zebra_ns {
|
|
/* net-ns name. */
|
|
char name[VRF_NAMSIZ];
|
|
|
|
/* Identifier. */
|
|
ns_id_t ns_id;
|
|
|
|
#ifdef HAVE_NETLINK
|
|
struct nlsock netlink; /* kernel messages */
|
|
struct nlsock netlink_cmd; /* command channel */
|
|
struct thread *t_netlink;
|
|
#endif
|
|
|
|
struct route_table *if_table;
|
|
|
|
#if defined(HAVE_RTADV)
|
|
struct rtadv rtadv;
|
|
#endif /* HAVE_RTADV */
|
|
|
|
struct hash *rules_hash;
|
|
|
|
struct hash *ipset_hash;
|
|
|
|
struct hash *ipset_entry_hash;
|
|
|
|
struct hash *iptable_hash;
|
|
|
|
/* Back pointer */
|
|
struct ns *ns;
|
|
};
|
|
|
|
struct zebra_ns *zebra_ns_lookup(ns_id_t ns_id);
|
|
|
|
int zebra_ns_init(void);
|
|
int zebra_ns_enable(ns_id_t ns_id, void **info);
|
|
int zebra_ns_disabled(struct ns *ns);
|
|
int zebra_ns_disable(ns_id_t ns_id, void **info);
|
|
|
|
int zebra_ns_config_write(struct vty *vty, struct ns *ns);
|
|
|
|
#endif
|