]>
Commit | Line | Data |
---|---|---|
acddc0ed | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
212f5cbc | 2 | /* E-VPN attribute handling structure file |
896014f4 | 3 | * Copyright (C) 2016 6WIND |
896014f4 | 4 | */ |
212f5cbc PG |
5 | |
6 | #ifndef _QUAGGA_BGP_ATTR_EVPN_H | |
7 | #define _QUAGGA_BGP_ATTR_EVPN_H | |
8 | ||
212f5cbc | 9 | #define MAX_ET 0xffffffff |
128ea8ab | 10 | |
dfa42ea3 | 11 | struct attr; |
212f5cbc | 12 | |
9c97bc44 AD |
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 | */ | |
d62a17ae | 25 | struct bgp_route_evpn { |
9c97bc44 AD |
26 | enum overlay_index_type type; |
27 | esi_t eth_s_id; | |
860e740b | 28 | struct ipaddr gw_ip; |
7ef5a232 PG |
29 | }; |
30 | ||
0a50c248 | 31 | extern bool str2esi(const char *str, esi_t *id); |
212f5cbc PG |
32 | extern char *ecom_mac2str(char *ecom_mac); |
33 | ||
d62a17ae | 34 | extern void bgp_add_routermac_ecom(struct attr *attr, |
35 | struct ethaddr *routermac); | |
4d0e6ece | 36 | extern int bgp_build_evpn_prefix(int type, uint32_t eth_tag, |
d62a17ae | 37 | struct prefix *dst); |
eee353c5 | 38 | extern bool bgp_attr_rmac(struct attr *attr, struct ethaddr *rmac); |
d7c0a89a QY |
39 | extern uint32_t bgp_attr_mac_mobility_seqnum(struct attr *attr, |
40 | uint8_t *sticky); | |
ead40654 | 41 | extern uint8_t bgp_attr_default_gw(struct attr *attr); |
128ea8ab | 42 | |
7904e9fd AK |
43 | extern void bgp_attr_evpn_na_flag(struct attr *attr, uint8_t *router_flag, |
44 | bool *proxy); | |
74e2bd89 | 45 | extern uint16_t bgp_attr_df_pref_from_ec(struct attr *attr, uint8_t *alg); |
68e33151 | 46 | |
761cc919 IS |
47 | |
48 | extern bool bgp_route_evpn_same(const struct bgp_route_evpn *e1, | |
49 | const struct bgp_route_evpn *e2); | |
d62a17ae | 50 | #endif /* _QUAGGA_BGP_ATTR_EVPN_H */ |