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