]> git.proxmox.com Git - mirror_frr.git/blob - bgpd/bgp_attr_evpn.h
Merge pull request #809 from donaldsharp/evpn_plus_struct_attr
[mirror_frr.git] / bgpd / bgp_attr_evpn.h
1 /* E-VPN attribute handling structure file
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 */
20
21 #ifndef _QUAGGA_BGP_ATTR_EVPN_H
22 #define _QUAGGA_BGP_ATTR_EVPN_H
23
24 /* value of first byte of ESI */
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
32
33 #define MAX_ESI {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}
34 #define ESI_LEN 10
35
36 #define MAX_ET 0xffffffff
37
38 u_long eth_tag_id;
39 struct attr;
40
41 struct eth_segment_id
42 {
43 u_char val[ESI_LEN];
44 };
45
46 union gw_addr
47 {
48 struct in_addr ipv4;
49 struct in6_addr ipv6;
50 };
51
52 struct bgp_route_evpn
53 {
54 struct eth_segment_id eth_s_id;
55 union gw_addr gw_ip;
56 };
57
58 extern int str2esi(const char *str, struct eth_segment_id *id);
59 extern char *esi2str(struct eth_segment_id *id);
60 extern char *ecom_mac2str(char *ecom_mac);
61
62 extern void bgp_add_routermac_ecom(struct attr *attr, struct ethaddr *routermac);
63 extern int bgp_build_evpn_prefix(int type, uint32_t eth_tag,
64 struct prefix *dst);
65
66 extern u_int32_t
67 bgp_attr_mac_mobility_seqnum (struct attr *attr, u_char *sticky);
68
69 #endif /* _QUAGGA_BGP_ATTR_EVPN_H */