]>
git.proxmox.com Git - mirror_frr.git/blob - zebra/zebra_ns.c
2 * Copyright (C) 2016 Cumulus Networks, Inc.
5 * This file is part of Quagga.
7 * Quagga is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any
12 * Quagga is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; see the file COPYING; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 #include "lib/prefix.h"
26 #include "lib/memory.h"
30 #include "zebra_vrf.h"
31 #include "zebra_memory.h"
33 #include "zebra_vxlan.h"
35 DEFINE_MTYPE(ZEBRA
, ZEBRA_NS
, "Zebra Name Space")
37 static struct zebra_ns
*dzns
;
39 struct zebra_ns
*zebra_ns_lookup(ns_id_t ns_id
)
44 int zebra_ns_enable(ns_id_t ns_id
, void **info
)
46 struct zebra_ns
*zns
= (struct zebra_ns
*)(*info
);
48 #if defined(HAVE_RTADV)
52 zns
->if_table
= route_table_init();
53 zebra_vxlan_ns_init(zns
);
61 int zebra_ns_disable(ns_id_t ns_id
, void **info
)
63 struct zebra_ns
*zns
= (struct zebra_ns
*)(*info
);
65 route_table_finish(zns
->if_table
);
66 zebra_vxlan_ns_disable(zns
);
67 #if defined(HAVE_RTADV)
71 kernel_terminate(zns
);
76 int zebra_ns_init(void)
78 dzns
= XCALLOC(MTYPE_ZEBRA_NS
, sizeof(struct zebra_ns
));
84 zebra_ns_enable(0, (void **)&dzns
);