]> git.proxmox.com Git - mirror_frr.git/blame - bgpd/bgp_mplsvpn.h
configure: add enable_old_vpn_commands configuration param
[mirror_frr.git] / bgpd / bgp_mplsvpn.h
CommitLineData
718e3744 1/* MPLS-VPN
2 Copyright (C) 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
3
4This file is part of GNU Zebra.
5
6GNU Zebra is free software; you can redistribute it and/or modify it
7under the terms of the GNU General Public License as published by the
8Free Software Foundation; either version 2, or (at your option) any
9later version.
10
11GNU Zebra is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Zebra; see the file COPYING. If not, write to the Free
18Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1902111-1307, USA. */
20
00d252cb 21#ifndef _QUAGGA_BGP_MPLSVPN_H
22#define _QUAGGA_BGP_MPLSVPN_H
23
718e3744 24#define RD_TYPE_AS 0
25#define RD_TYPE_IP 1
fe770c88 26#define RD_TYPE_AS4 2
65efcfce
LB
27#if ENABLE_BGP_VNC
28#define RD_TYPE_VNC_ETH 0xff00 /* VNC L2VPN */
29#endif
718e3744 30
31#define RD_ADDRSTRLEN 28
32
65efcfce
LB
33typedef enum {
34 MPLS_LABEL_IPV4_EXPLICIT_NULL = 0, /* [RFC3032] */
35 MPLS_LABEL_ROUTER_ALERT = 1, /* [RFC3032] */
36 MPLS_LABEL_IPV6_EXPLICIT_NULL = 2, /* [RFC3032] */
37 MPLS_LABEL_IMPLICIT_NULL = 3, /* [RFC3032] */
38 MPLS_LABEL_UNASSIGNED4 = 4,
39 MPLS_LABEL_UNASSIGNED5 = 5,
40 MPLS_LABEL_UNASSIGNED6 = 6,
41 MPLS_LABEL_ELI = 7, /* Entropy Indicator [RFC6790] */
42 MPLS_LABEL_UNASSIGNED8 = 8,
43 MPLS_LABEL_UNASSIGNED9 = 9,
44 MPLS_LABEL_UNASSIGNED10 = 10,
45 MPLS_LABEL_UNASSIGNED11 = 11,
46 MPLS_LABEL_GAL = 13, /* [RFC5586] */
47 MPLS_LABEL_OAM_ALERT = 14, /* [RFC3429] */
48 MPLS_LABEL_EXTENSION = 15 /* [RFC7274] */
49} mpls_special_label_t;
50
51#define MPLS_LABEL_IS_SPECIAL(label) \
52 ((label) <= MPLS_LABEL_EXTENSION)
53#define MPLS_LABEL_IS_NULL(label) \
54 ((label) == MPLS_LABEL_IPV4_EXPLICIT_NULL || \
55 (label) == MPLS_LABEL_IPV6_EXPLICIT_NULL || \
56 (label) == MPLS_LABEL_IMPLICIT_NULL)
57
718e3744 58struct rd_as
59{
60 u_int16_t type;
61 as_t as;
62 u_int32_t val;
63};
64
65struct rd_ip
66{
67 u_int16_t type;
68 struct in_addr ip;
69 u_int16_t val;
70};
71
65efcfce
LB
72#if ENABLE_BGP_VNC
73struct rd_vnc_eth
74{
75 u_int16_t type;
76 uint8_t local_nve_id;
77 struct ethaddr macaddr;
78};
79#endif
80
1a39c60a 81extern u_int16_t decode_rd_type (u_char *);
65efcfce 82extern void encode_rd_type (u_int16_t, u_char *);
94f2b392 83extern void bgp_mplsvpn_init (void);
945c8fe9 84extern int bgp_nlri_parse_vpn (struct peer *, struct attr *, struct bgp_nlri *);
94f2b392 85extern u_int32_t decode_label (u_char *);
1a39c60a
LB
86extern void encode_label(u_int32_t, u_char *);
87extern void decode_rd_as (u_char *, struct rd_as *);
88extern void decode_rd_as4 (u_char *, struct rd_as *);
89extern void decode_rd_ip (u_char *, struct rd_ip *);
65efcfce
LB
90#if ENABLE_BGP_VNC
91extern void decode_vnc_eth (u_char *, struct rd_vnc_eth *);
92#endif
94f2b392 93extern int str2prefix_rd (const char *, struct prefix_rd *);
94extern int str2tag (const char *, u_char *);
95extern char *prefix_rd2str (struct prefix_rd *, char *, size_t);
00d252cb 96
97#endif /* _QUAGGA_BGP_MPLSVPN_H */