]>
git.proxmox.com Git - mirror_frr.git/blob - zebra/zebra_l2.h
2 * Zebra Layer-2 interface Data structures and definitions
3 * Copyright (C) 2016, 2017 Cumulus Networks, Inc.
5 * This file is part of FRR.
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
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.
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
36 /* zebra L2 interface information - bridge slave (linkage to bridge) */
37 struct zebra_l2info_brslave
{
38 ifindex_t bridge_ifindex
; /* Bridge Master */
39 struct interface
*br_if
; /* Pointer to master */
40 ns_id_t ns_id
; /* network namespace where bridge is */
43 struct zebra_l2info_bond
{
44 struct list
*mbr_zifs
; /* slaves using this bond as a master */
47 /* zebra L2 interface information - bridge interface */
48 struct zebra_l2info_bridge
{
49 uint8_t vlan_aware
; /* VLAN-aware bridge? */
52 /* zebra L2 interface information - VLAN interface */
53 struct zebra_l2info_vlan
{
54 vlanid_t vid
; /* VLAN id */
57 /* zebra L2 interface information - GRE interface */
58 struct zebra_l2info_gre
{
59 struct in_addr vtep_ip
; /* IFLA_GRE_LOCAL */
60 struct in_addr vtep_ip_remote
; /* IFLA_GRE_REMOTE */
63 ifindex_t ifindex_link
; /* Interface index of interface
69 /* zebra L2 interface information - VXLAN interface */
70 struct zebra_l2info_vxlan
{
72 struct in_addr vtep_ip
; /* Local tunnel IP */
73 vlanid_t access_vlan
; /* Access VLAN - for VLAN-aware bridge. */
74 struct in_addr mcast_grp
;
75 ifindex_t ifindex_link
; /* Interface index of interface
81 struct zebra_l2info_bondslave
{
82 ifindex_t bond_ifindex
; /* Bridge Master */
83 struct interface
*bond_if
; /* Pointer to master */
86 union zebra_l2if_info
{
87 struct zebra_l2info_bridge br
;
88 struct zebra_l2info_vlan vl
;
89 struct zebra_l2info_vxlan vxl
;
90 struct zebra_l2info_gre gre
;
93 /* NOTE: These macros are to be invoked only in the "correct" context.
94 * IOW, the macro VNI_FROM_ZEBRA_IF() will assume the interface is
95 * of type ZEBRA_IF_VXLAN.
97 #define VNI_FROM_ZEBRA_IF(zif) (zif)->l2info.vxl.vni
98 #define VLAN_ID_FROM_ZEBRA_IF(zif) (zif)->l2info.vl.vid
100 #define IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(zif) ((zif)->l2info.br.vlan_aware == 1)
102 extern void zebra_l2_map_slave_to_bridge(struct zebra_l2info_brslave
*br_slave
,
103 struct zebra_ns
*zns
);
105 zebra_l2_unmap_slave_from_bridge(struct zebra_l2info_brslave
*br_slave
);
106 extern void zebra_l2_bridge_add_update(struct interface
*ifp
,
107 struct zebra_l2info_bridge
*bridge_info
,
109 extern void zebra_l2_bridge_del(struct interface
*ifp
);
110 extern void zebra_l2_vlanif_update(struct interface
*ifp
,
111 struct zebra_l2info_vlan
*vlan_info
);
112 extern void zebra_l2_greif_add_update(struct interface
*ifp
,
113 struct zebra_l2info_gre
*vxlan_info
,
115 extern void zebra_l2_vxlanif_add_update(struct interface
*ifp
,
116 struct zebra_l2info_vxlan
*vxlan_info
,
118 extern void zebra_l2_vxlanif_update_access_vlan(struct interface
*ifp
,
119 vlanid_t access_vlan
);
120 extern void zebra_l2_greif_del(struct interface
*ifp
);
121 extern void zebra_l2_vxlanif_del(struct interface
*ifp
);
122 extern void zebra_l2if_update_bridge_slave(struct interface
*ifp
,
123 ifindex_t bridge_ifindex
,
126 extern void zebra_l2if_update_bond_slave(struct interface
*ifp
,
127 ifindex_t bond_ifindex
, bool bypass
);
128 extern void zebra_vlan_bitmap_compute(struct interface
*ifp
,
129 uint32_t vid_start
, uint16_t vid_end
);
130 extern void zebra_vlan_mbr_re_eval(struct interface
*ifp
,
131 bitfield_t vlan_bitmap
);
132 extern void zebra_l2if_update_bond(struct interface
*ifp
, bool add
);
138 #endif /* _ZEBRA_L2_H */