]> git.proxmox.com Git - mirror_frr.git/blame - bgpd/bgp_attr_evpn.h
bgpd: extended community for EAD routes
[mirror_frr.git] / bgpd / bgp_attr_evpn.h
CommitLineData
212f5cbc 1/* E-VPN attribute handling structure file
896014f4
DL
2 * Copyright (C) 2016 6WIND
3 *
4 * This file is part of FRRouting.
5 *
6 * FRRouting is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
9 * later version.
10 *
11 * FRRouting is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
212f5cbc
PG
20
21#ifndef _QUAGGA_BGP_ATTR_EVPN_H
22#define _QUAGGA_BGP_ATTR_EVPN_H
23
24/* value of first byte of ESI */
128ea8ab 25#define ESI_TYPE_ARBITRARY 0 /* */
26#define ESI_TYPE_LACP 1 /* <> */
27#define ESI_TYPE_BRIDGE 2 /* <Root bridge Mac-6B>:<Root Br Priority-2B>:00 */
28#define ESI_TYPE_MAC 3 /* <Syst Mac Add-6B>:<Local Discriminator Value-3B> */
29#define ESI_TYPE_ROUTER 4 /* <RouterId-4B>:<Local Discriminator Value-4B> */
30#define ESI_TYPE_AS 5 /* <AS-4B>:<Local Discriminator Value-4B> */
31
212f5cbc
PG
32#define MAX_ESI {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}
33#define ESI_LEN 10
34
35#define MAX_ET 0xffffffff
128ea8ab 36
dfa42ea3 37struct attr;
212f5cbc 38
554cd77a 39/* EVPN ESI */
d62a17ae 40struct eth_segment_id {
d7c0a89a 41 uint8_t val[ESI_LEN];
212f5cbc
PG
42};
43
d62a17ae 44union gw_addr {
45 struct in_addr ipv4;
46 struct in6_addr ipv6;
212f5cbc
PG
47};
48
d62a17ae 49struct bgp_route_evpn {
50 struct eth_segment_id eth_s_id;
51 union gw_addr gw_ip;
7ef5a232
PG
52};
53
3dc339cd 54extern bool str2esi(const char *str, struct eth_segment_id *id);
4d0e6ece 55extern char *esi2str(struct eth_segment_id *id);
212f5cbc
PG
56extern char *ecom_mac2str(char *ecom_mac);
57
d62a17ae 58extern void bgp_add_routermac_ecom(struct attr *attr,
59 struct ethaddr *routermac);
4d0e6ece 60extern int bgp_build_evpn_prefix(int type, uint32_t eth_tag,
d62a17ae 61 struct prefix *dst);
eee353c5 62extern bool bgp_attr_rmac(struct attr *attr, struct ethaddr *rmac);
d7c0a89a
QY
63extern uint32_t bgp_attr_mac_mobility_seqnum(struct attr *attr,
64 uint8_t *sticky);
ead40654 65extern uint8_t bgp_attr_default_gw(struct attr *attr);
128ea8ab 66
68e33151
CS
67extern void bgp_attr_evpn_na_flag(struct attr *attr, uint8_t *router_flag);
68
c6ec0c74
KA
69extern bool is_zero_gw_ip(const union gw_addr *gw_ip, afi_t afi);
70
71extern bool is_zero_esi(const struct eth_segment_id *esi);
d62a17ae 72#endif /* _QUAGGA_BGP_ATTR_EVPN_H */