]> git.proxmox.com Git - mirror_frr.git/blob - bgpd/bgp_attr_evpn.h
Merge pull request #12795 from pguibert6WIND/vpnv6_nexthop_encoding
[mirror_frr.git] / bgpd / bgp_attr_evpn.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /* E-VPN attribute handling structure file
3 * Copyright (C) 2016 6WIND
4 */
5
6 #ifndef _QUAGGA_BGP_ATTR_EVPN_H
7 #define _QUAGGA_BGP_ATTR_EVPN_H
8
9 #define MAX_ET 0xffffffff
10
11 struct attr;
12
13 enum overlay_index_type {
14 OVERLAY_INDEX_TYPE_NONE,
15 OVERLAY_INDEX_GATEWAY_IP,
16 OVERLAY_INDEX_ESI,
17 OVERLAY_INDEX_MAC,
18 };
19
20 /*
21 * Structure to store ovrelay index for EVPN type-5 route
22 * This structure stores ESI and Gateway IP overlay index.
23 * MAC overlay index is stored in the RMAC attribute.
24 */
25 struct bgp_route_evpn {
26 enum overlay_index_type type;
27 esi_t eth_s_id;
28 struct ipaddr gw_ip;
29 };
30
31 extern bool str2esi(const char *str, esi_t *id);
32 extern char *ecom_mac2str(char *ecom_mac);
33
34 extern void bgp_add_routermac_ecom(struct attr *attr,
35 struct ethaddr *routermac);
36 extern int bgp_build_evpn_prefix(int type, uint32_t eth_tag,
37 struct prefix *dst);
38 extern bool bgp_attr_rmac(struct attr *attr, struct ethaddr *rmac);
39 extern uint32_t bgp_attr_mac_mobility_seqnum(struct attr *attr,
40 uint8_t *sticky);
41 extern uint8_t bgp_attr_default_gw(struct attr *attr);
42
43 extern void bgp_attr_evpn_na_flag(struct attr *attr, uint8_t *router_flag,
44 bool *proxy);
45 extern uint16_t bgp_attr_df_pref_from_ec(struct attr *attr, uint8_t *alg);
46
47
48 extern bool bgp_route_evpn_same(const struct bgp_route_evpn *e1,
49 const struct bgp_route_evpn *e2);
50 #endif /* _QUAGGA_BGP_ATTR_EVPN_H */