]> git.proxmox.com Git - mirror_frr.git/blame - bgpd/bgp_mplsvpn.h
*: reindent
[mirror_frr.git] / bgpd / bgp_mplsvpn.h
CommitLineData
718e3744 1/* MPLS-VPN
896014f4
DL
2 * Copyright (C) 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
3 *
8557760c 4 * This file is part of GxNU Zebra.
896014f4
DL
5 *
6 * GNU Zebra 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 * GNU Zebra 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 */
718e3744 20
00d252cb 21#ifndef _QUAGGA_BGP_MPLSVPN_H
22#define _QUAGGA_BGP_MPLSVPN_H
23
4f280b15 24#include "bgpd/bgp_route.h"
8557760c 25#include "bgpd/bgp_rd.h"
718e3744 26
5ff06872 27#ifdef MPLS_LABEL_MAX
d62a17ae 28#undef MPLS_LABEL_MAX
5ff06872
LB
29#endif
30
65efcfce 31typedef enum {
d62a17ae 32 MPLS_LABEL_IPV4_EXPLICIT_NULL = 0, /* [RFC3032] */
33 MPLS_LABEL_ROUTER_ALERT = 1, /* [RFC3032] */
34 MPLS_LABEL_IPV6_EXPLICIT_NULL = 2, /* [RFC3032] */
35 MPLS_LABEL_IMPLICIT_NULL = 3, /* [RFC3032] */
36 MPLS_LABEL_UNASSIGNED4 = 4,
37 MPLS_LABEL_UNASSIGNED5 = 5,
38 MPLS_LABEL_UNASSIGNED6 = 6,
39 MPLS_LABEL_ELI = 7, /* Entropy Indicator [RFC6790] */
40 MPLS_LABEL_UNASSIGNED8 = 8,
41 MPLS_LABEL_UNASSIGNED9 = 9,
42 MPLS_LABEL_UNASSIGNED10 = 10,
43 MPLS_LABEL_UNASSIGNED11 = 11,
44 MPLS_LABEL_GAL = 13, /* [RFC5586] */
45 MPLS_LABEL_OAM_ALERT = 14, /* [RFC3429] */
46 MPLS_LABEL_EXTENSION = 15, /* [RFC7274] */
47 MPLS_LABEL_MAX = 1048575,
48 MPLS_LABEL_ILLEGAL = 0xFFFFFFFF /* for internal use only */
65efcfce
LB
49} mpls_special_label_t;
50
d62a17ae 51#define MPLS_LABEL_IS_SPECIAL(label) ((label) <= MPLS_LABEL_EXTENSION)
52#define MPLS_LABEL_IS_NULL(label) \
53 ((label) == MPLS_LABEL_IPV4_EXPLICIT_NULL \
54 || (label) == MPLS_LABEL_IPV6_EXPLICIT_NULL \
55 || (label) == MPLS_LABEL_IMPLICIT_NULL)
65efcfce 56
d62a17ae 57#define BGP_VPNVX_HELP_STR \
58 "Address Family\n" \
59 "Address Family\n"
d6902373 60
d62a17ae 61#define V4_HEADER \
62 " Network Next Hop Metric LocPrf Weight Path\n"
63#define V4_HEADER_TAG " Network Next Hop In tag/Out tag\n"
64#define V4_HEADER_OVERLAY \
65 " Network Next Hop EthTag Overlay Index RouterMac\n"
96ade3ed 66
d62a17ae 67extern void bgp_mplsvpn_init(void);
68extern int bgp_nlri_parse_vpn(struct peer *, struct attr *, struct bgp_nlri *);
69extern u_int32_t decode_label(mpls_label_t *);
9bedbb1e 70extern void encode_label(mpls_label_t, mpls_label_t *);
00d252cb 71
d62a17ae 72extern int argv_find_and_parse_vpnvx(struct cmd_token **argv, int argc,
73 int *index, afi_t *afi);
74extern int bgp_show_mpls_vpn(struct vty *vty, afi_t afi, struct prefix_rd *prd,
75 enum bgp_show_type type, void *output_arg,
76 int tags, u_char use_json);
d6902373 77
00d252cb 78#endif /* _QUAGGA_BGP_MPLSVPN_H */