2 * Zebra VxLAN (EVPN) Data structures and definitions
3 * These are "internal" to this function.
4 * Copyright (C) 2016, 2017 Cumulus Networks, Inc.
6 * This file is part of FRR.
8 * FRR is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2, or (at your option) any
13 * FRR is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with FRR; see the file COPYING. If not, write to the Free
20 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24 #ifndef _ZEBRA_VXLAN_PRIVATE_H
25 #define _ZEBRA_VXLAN_PRIVATE_H
35 typedef struct zebra_vni_t_ zebra_vni_t
;
36 typedef struct zebra_vtep_t_ zebra_vtep_t
;
37 typedef struct zebra_mac_t_ zebra_mac_t
;
38 typedef struct zebra_neigh_t_ zebra_neigh_t
;
43 * Right now, this just has each remote VTEP's IP address.
48 /* NOTE: Can only be IPv4 right now. */
49 struct in_addr vtep_ip
;
52 struct zebra_vtep_t_
*next
;
53 struct zebra_vtep_t_
*prev
;
60 * Contains information pertaining to a VNI:
61 * - the list of remote VTEPs (with this VNI)
68 /* Corresponding VxLAN interface. */
69 struct interface
*vxlan_if
;
71 /* List of remote VTEPs */
75 struct in_addr local_vtep_ip
;
77 /* List of local or remote MAC */
78 struct hash
*mac_table
;
80 /* List of local or remote neighbors (MAC+IP) */
81 struct hash
*neigh_table
;
87 * This table contains the MAC addresses pertaining to this VNI.
88 * This includes local MACs learnt on an attached VLAN that maps
89 * to this VNI as well as remote MACs learnt and installed by BGP.
90 * Local MACs will be known either on a VLAN sub-interface or
91 * on (port, VLAN); however, it is sufficient for zebra to maintain
92 * against the VNI i.e., it does not need to retain the local "port"
93 * information. The correct VNI will be obtained as zebra maintains
94 * the mapping (of VLAN to VNI).
99 struct ethaddr macaddr
;
102 #define ZEBRA_MAC_LOCAL 0x01
103 #define ZEBRA_MAC_REMOTE 0x02
104 #define ZEBRA_MAC_AUTO 0x04 /* Auto created for neighbor. */
106 /* Local or remote info. */
115 struct in_addr r_vtep_ip
;
118 u_int32_t neigh_refcnt
;
122 * Context for MAC hash walk - used by callbacks.
126 zebra_vni_t
*zvni
; /* VNI hash */
127 struct zebra_vrf
*zvrf
; /* VRF - for client notification. */
128 int uninstall
; /* uninstall from kernel? */
129 int upd_client
; /* uninstall from client? */
132 #define DEL_LOCAL_MAC 0x1
133 #define DEL_REMOTE_MAC 0x2
134 #define DEL_ALL_MAC (DEL_LOCAL_MAC | DEL_REMOTE_MAC)
135 #define DEL_REMOTE_MAC_FROM_VTEP 0x4
136 #define SHOW_REMOTE_MAC_FROM_VTEP 0x8
138 struct in_addr r_vtep_ip
; /* To walk MACs from specific VTEP */
140 struct vty
*vty
; /* Used by VTY handlers */
141 u_int32_t count
; /* Used by VTY handlers */
145 * Neighbor hash table.
147 * This table contains the neighbors (IP to MAC bindings) pertaining to
148 * this VNI. This includes local neighbors learnt on the attached VLAN
149 * device that maps to this VNI as well as remote neighbors learnt and
151 * Local neighbors will be known against the VLAN device (SVI); however,
152 * it is sufficient for zebra to maintain against the VNI. The correct
153 * VNI will be obtained as zebra maintains the mapping (of VLAN to VNI).
155 struct zebra_neigh_t_
163 /* Underlying interface. */
167 #define ZEBRA_NEIGH_LOCAL 0x01
168 #define ZEBRA_NEIGH_REMOTE 0x02
170 /* Remote VTEP IP - applicable only for remote neighbors. */
171 struct in_addr r_vtep_ip
;
175 * Context for neighbor hash walk - used by callbacks.
177 struct neigh_walk_ctx
179 zebra_vni_t
*zvni
; /* VNI hash */
180 struct zebra_vrf
*zvrf
; /* VRF - for client notification. */
181 int uninstall
; /* uninstall from kernel? */
182 int upd_client
; /* uninstall from client? */
185 #define DEL_LOCAL_NEIGH 0x1
186 #define DEL_REMOTE_NEIGH 0x2
187 #define DEL_ALL_NEIGH (DEL_LOCAL_NEIGH | DEL_REMOTE_NEIGH)
188 #define DEL_REMOTE_NEIGH_FROM_VTEP 0x4
189 #define SHOW_REMOTE_NEIGH_FROM_VTEP 0x8
191 struct in_addr r_vtep_ip
; /* To walk neighbors from specific VTEP */
193 struct vty
*vty
; /* Used by VTY handlers */
194 u_int32_t count
; /* Used by VTY handlers */
195 u_char addr_width
; /* Used by VTY handlers */
198 #endif /* _ZEBRA_VXLAN_PRIVATE_H */