]> git.proxmox.com Git - mirror_frr.git/blame - bgpd/bgp_evpn.h
bgpd: follow AFI/SAFI style for advertising/withdrawing type-5 routes
[mirror_frr.git] / bgpd / bgp_evpn.h
CommitLineData
7ef5a232 1/* E-VPN header for packet handling
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 */
7ef5a232
PG
20
21#ifndef _QUAGGA_BGP_EVPN_H
22#define _QUAGGA_BGP_EVPN_H
23
128ea8ab 24#include "vxlan.h"
94c2f693 25#include "bgpd.h"
7ef5a232 26
520d5d76 27#define EVPN_ROUTE_STRLEN 200 /* Must be >> MAC + IPv6 strings. */
28
94c2f693
MK
29static inline int is_evpn_enabled(void)
30{
31 struct bgp *bgp = NULL;
32
33 bgp = bgp_get_default();
34 return bgp ? bgp->advertise_all_vni : 0;
35}
36
053905d2
MK
37extern void bgp_evpn_withdraw_type5_routes(struct bgp *bgp_vrf, afi_t afi,
38 safi_t safi);
39extern void bgp_evpn_advertise_type5_routes(struct bgp *bgp_vrf, afi_t afi,
40 safi_t safi);
10ebe1ab 41extern void bgp_evpn_vrf_delete(struct bgp *);
d62a17ae 42extern void bgp_evpn_handle_router_id_update(struct bgp *bgp, int withdraw);
43extern char *bgp_evpn_label2str(mpls_label_t *label, char *buf, int len);
44extern char *bgp_evpn_route2str(struct prefix_evpn *p, char *buf, int len);
b682f6de 45extern void bgp_evpn_route2json(struct prefix_evpn *p, json_object *json);
d62a17ae 46extern void bgp_evpn_encode_prefix(struct stream *s, struct prefix *p,
47 struct prefix_rd *prd, mpls_label_t *label,
48 struct attr *attr, int addpath_encode,
49 u_int32_t addpath_tx_id);
128ea8ab 50extern int bgp_nlri_parse_evpn(struct peer *peer, struct attr *attr,
51 struct bgp_nlri *packet, int withdraw);
d62a17ae 52extern int bgp_evpn_import_route(struct bgp *bgp, afi_t afi, safi_t safi,
53 struct prefix *p, struct bgp_info *ri);
54extern int bgp_evpn_unimport_route(struct bgp *bgp, afi_t afi, safi_t safi,
55 struct prefix *p, struct bgp_info *ri);
db0e1937 56extern int bgp_filter_evpn_routes_upon_martian_nh_change(struct bgp *bgp);
d62a17ae 57extern int bgp_evpn_local_macip_del(struct bgp *bgp, vni_t vni,
58 struct ethaddr *mac, struct ipaddr *ip);
59extern int bgp_evpn_local_macip_add(struct bgp *bgp, vni_t vni,
60 struct ethaddr *mac, struct ipaddr *ip,
1a98c087 61 u_char flags);
b67a60d2 62extern int bgp_evpn_local_l3vni_add(vni_t, vrf_id_t, struct ethaddr *,
63 struct in_addr originator_ip);
fe1dc5a3 64extern int bgp_evpn_local_l3vni_del(vni_t, vrf_id_t);
d62a17ae 65extern int bgp_evpn_local_vni_del(struct bgp *bgp, vni_t vni);
66extern int bgp_evpn_local_vni_add(struct bgp *bgp, vni_t vni,
29c53922
MK
67 struct in_addr originator_ip,
68 vrf_id_t tenant_vrf_id);
d62a17ae 69extern void bgp_evpn_cleanup_on_disable(struct bgp *bgp);
70extern void bgp_evpn_cleanup(struct bgp *bgp);
71extern void bgp_evpn_init(struct bgp *bgp);
14c1a7bf 72
128ea8ab 73#endif /* _QUAGGA_BGP_EVPN_H */