]> git.proxmox.com Git - mirror_frr.git/blame - bgpd/bgp_attr_evpn.h
Merge pull request #9194 from idryzhov/pim-bool-false
[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
212f5cbc 24#define MAX_ET 0xffffffff
128ea8ab 25
dfa42ea3 26struct attr;
212f5cbc 27
d62a17ae 28union gw_addr {
29 struct in_addr ipv4;
30 struct in6_addr ipv6;
212f5cbc
PG
31};
32
9c97bc44
AD
33enum overlay_index_type {
34 OVERLAY_INDEX_TYPE_NONE,
35 OVERLAY_INDEX_GATEWAY_IP,
36 OVERLAY_INDEX_ESI,
37 OVERLAY_INDEX_MAC,
38};
39
40/*
41 * Structure to store ovrelay index for EVPN type-5 route
42 * This structure stores ESI and Gateway IP overlay index.
43 * MAC overlay index is stored in the RMAC attribute.
44 */
d62a17ae 45struct bgp_route_evpn {
9c97bc44
AD
46 enum overlay_index_type type;
47 esi_t eth_s_id;
d62a17ae 48 union gw_addr gw_ip;
7ef5a232
PG
49};
50
0a50c248 51extern bool str2esi(const char *str, esi_t *id);
212f5cbc
PG
52extern char *ecom_mac2str(char *ecom_mac);
53
d62a17ae 54extern void bgp_add_routermac_ecom(struct attr *attr,
55 struct ethaddr *routermac);
4d0e6ece 56extern int bgp_build_evpn_prefix(int type, uint32_t eth_tag,
d62a17ae 57 struct prefix *dst);
eee353c5 58extern bool bgp_attr_rmac(struct attr *attr, struct ethaddr *rmac);
d7c0a89a
QY
59extern uint32_t bgp_attr_mac_mobility_seqnum(struct attr *attr,
60 uint8_t *sticky);
ead40654 61extern uint8_t bgp_attr_default_gw(struct attr *attr);
128ea8ab 62
7904e9fd
AK
63extern void bgp_attr_evpn_na_flag(struct attr *attr, uint8_t *router_flag,
64 bool *proxy);
74e2bd89 65extern uint16_t bgp_attr_df_pref_from_ec(struct attr *attr, uint8_t *alg);
68e33151 66
c6ec0c74
KA
67extern bool is_zero_gw_ip(const union gw_addr *gw_ip, afi_t afi);
68
d62a17ae 69#endif /* _QUAGGA_BGP_ATTR_EVPN_H */