]> git.proxmox.com Git - mirror_frr.git/blame - zebra/zebra_l2.h
isisd: implement the 'lsp-too-large' notification
[mirror_frr.git] / zebra / zebra_l2.h
CommitLineData
6675513d 1/*
2 * Zebra Layer-2 interface Data structures and definitions
3 * Copyright (C) 2016, 2017 Cumulus Networks, Inc.
4 *
5 * This file is part of FRR.
6 *
7 * FRR 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
10 * later version.
11 *
12 * FRR 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.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with FRR; see the file COPYING. If not, write to the Free
19 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 * 02111-1307, USA.
21 */
22
23#ifndef _ZEBRA_L2_H
24#define _ZEBRA_L2_H
25
26#include <zebra.h>
27
28#include "if.h"
29#include "vlan.h"
30#include "vxlan.h"
31
32/* zebra L2 interface information - bridge slave (linkage to bridge) */
d62a17ae 33struct zebra_l2info_brslave {
34 ifindex_t bridge_ifindex; /* Bridge Master */
35 struct interface *br_if; /* Pointer to master */
6675513d 36};
37
38/* zebra L2 interface information - bridge interface */
d62a17ae 39struct zebra_l2info_bridge {
d7c0a89a 40 uint8_t vlan_aware; /* VLAN-aware bridge? */
6675513d 41};
42
43/* zebra L2 interface information - VLAN interface */
d62a17ae 44struct zebra_l2info_vlan {
45 vlanid_t vid; /* VLAN id */
6675513d 46};
47
48/* zebra L2 interface information - VXLAN interface */
d62a17ae 49struct zebra_l2info_vxlan {
50 vni_t vni; /* VNI */
51 struct in_addr vtep_ip; /* Local tunnel IP */
52 vlanid_t access_vlan; /* Access VLAN - for VLAN-aware bridge. */
6675513d 53};
54
b9368db9
DD
55struct zebra_l2info_bondslave {
56 ifindex_t bond_ifindex; /* Bridge Master */
57 struct interface *bond_if; /* Pointer to master */
58};
59
d62a17ae 60union zebra_l2if_info {
61 struct zebra_l2info_bridge br;
62 struct zebra_l2info_vlan vl;
63 struct zebra_l2info_vxlan vxl;
6675513d 64};
65
66/* NOTE: These macros are to be invoked only in the "correct" context.
67 * IOW, the macro VNI_FROM_ZEBRA_IF() will assume the interface is
68 * of type ZEBRA_IF_VXLAN.
69 */
70#define VNI_FROM_ZEBRA_IF(zif) (zif)->l2info.vxl.vni
71#define VLAN_ID_FROM_ZEBRA_IF(zif) (zif)->l2info.vl.vid
72
d62a17ae 73#define IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(zif) ((zif)->l2info.br.vlan_aware == 1)
6675513d 74
d62a17ae 75extern void zebra_l2_map_slave_to_bridge(struct zebra_l2info_brslave *br_slave);
76extern void
77zebra_l2_unmap_slave_from_bridge(struct zebra_l2info_brslave *br_slave);
b9368db9
DD
78extern void
79zebra_l2_map_slave_to_bond(struct zebra_l2info_bondslave *bond_slave);
80extern void
81zebra_l2_unmap_slave_from_bond(struct zebra_l2info_bondslave *bond_slave);
d62a17ae 82extern void zebra_l2_bridge_add_update(struct interface *ifp,
83 struct zebra_l2info_bridge *bridge_info,
84 int add);
85extern void zebra_l2_bridge_del(struct interface *ifp);
86extern void zebra_l2_vlanif_update(struct interface *ifp,
87 struct zebra_l2info_vlan *vlan_info);
88extern void zebra_l2_vxlanif_add_update(struct interface *ifp,
89 struct zebra_l2info_vxlan *vxlan_info,
90 int add);
91extern void zebra_l2_vxlanif_update_access_vlan(struct interface *ifp,
92 vlanid_t access_vlan);
93extern void zebra_l2_vxlanif_del(struct interface *ifp);
94extern void zebra_l2if_update_bridge_slave(struct interface *ifp,
95 ifindex_t bridge_ifindex);
6675513d 96
b9368db9
DD
97extern void zebra_l2if_update_bond_slave(struct interface *ifp,
98 ifindex_t bond_ifindex);
6675513d 99#endif /* _ZEBRA_L2_H */