]>
git.proxmox.com Git - mirror_frr.git/blob - zebra/zebra_evpn_vxlan.h
2 * Zebra EVPN for VxLAN code
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
23 /* Get the VRR interface for SVI if any */
24 static inline struct interface
*
25 zebra_get_vrr_intf_for_svi(struct interface
*ifp
)
27 struct zebra_vrf
*zvrf
= NULL
;
28 struct interface
*tmp_if
= NULL
;
29 struct zebra_if
*zif
= NULL
;
31 zvrf
= ifp
->vrf
->info
;
34 FOR_ALL_INTERFACES (zvrf
->vrf
, tmp_if
) {
39 if (!IS_ZEBRA_IF_MACVLAN(tmp_if
))
49 /* EVPN<=>vxlan_zif association */
50 static inline void zevpn_vxlan_if_set(struct zebra_evpn
*zevpn
,
51 struct interface
*ifp
, bool set
)
56 if (zevpn
->vxlan_if
== ifp
)
58 zevpn
->vxlan_if
= ifp
;
62 zevpn
->vxlan_if
= NULL
;
70 zebra_evpn_vxl_evpn_set(zif
, zevpn
, set
);
73 /* EVPN<=>Bridge interface association */
74 static inline void zevpn_bridge_if_set(struct zebra_evpn
*zevpn
,
75 struct interface
*ifp
, bool set
)
78 if (zevpn
->bridge_if
== ifp
)
80 zevpn
->bridge_if
= ifp
;
82 if (!zevpn
->bridge_if
)
84 zevpn
->bridge_if
= NULL
;
88 /* EVPN<=>Bridge interface association */
89 static inline void zl3vni_bridge_if_set(struct zebra_l3vni
*zl3vni
,
90 struct interface
*ifp
, bool set
)
93 if (zl3vni
->bridge_if
== ifp
)
95 zl3vni
->bridge_if
= ifp
;
97 if (!zl3vni
->bridge_if
)
99 zl3vni
->bridge_if
= NULL
;