diff options
author | vivek <vivek@cumulusnetworks.com> | 2017-05-15 21:33:59 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-07-12 18:34:32 +0200 |
commit | 8557760ca8d05af9864a02bc2f4a244d02adf10c (patch) | |
tree | 5afc01ed898477a1177d99acd732054cbe6006ea /bgpd/bgp_mplsvpn.h | |
parent | bgpd: Refine extended community handling (diff) | |
download | frr-8557760ca8d05af9864a02bc2f4a244d02adf10c.tar.xz frr-8557760ca8d05af9864a02bc2f4a244d02adf10c.zip |
bgpd: Separate out RD handling functions
BGP Route Distinguisher (RD) handling is common for different flavors
of BGP VPNs such as BGP/MPLS IP VPNs (RFC 4364) and BGP EVPNs (RFC 7432).
Separate out the RD handling functions into its own files.
Note: No functional change introduced with this commit.
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_mplsvpn.h')
-rw-r--r-- | bgpd/bgp_mplsvpn.h | 46 |
1 files changed, 2 insertions, 44 deletions
diff --git a/bgpd/bgp_mplsvpn.h b/bgpd/bgp_mplsvpn.h index 4ba4597d0..eeb2f63ff 100644 --- a/bgpd/bgp_mplsvpn.h +++ b/bgpd/bgp_mplsvpn.h @@ -1,7 +1,7 @@ /* MPLS-VPN * Copyright (C) 2000 Kunihiro Ishiguro <kunihiro@zebra.org> * - * This file is part of GNU Zebra. + * This file is part of GxNU Zebra. * * GNU Zebra is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -22,15 +22,7 @@ #define _QUAGGA_BGP_MPLSVPN_H #include "bgpd/bgp_route.h" - -#define RD_TYPE_AS 0 -#define RD_TYPE_IP 1 -#define RD_TYPE_AS4 2 -#if ENABLE_BGP_VNC -#define RD_TYPE_VNC_ETH 0xff00 /* VNC L2VPN */ -#endif - -#define RD_ADDRSTRLEN 28 +#include "bgpd/bgp_rd.h" #ifdef MPLS_LABEL_MAX # undef MPLS_LABEL_MAX @@ -74,44 +66,10 @@ typedef enum { #define V4_HEADER_OVERLAY \ " Network Next Hop EthTag Overlay Index RouterMac" -struct rd_as -{ - u_int16_t type; - as_t as; - u_int32_t val; -}; - -struct rd_ip -{ - u_int16_t type; - struct in_addr ip; - u_int16_t val; -}; - -#if ENABLE_BGP_VNC -struct rd_vnc_eth -{ - u_int16_t type; - uint8_t local_nve_id; - struct ethaddr macaddr; -}; -#endif - -extern u_int16_t decode_rd_type (u_char *); -extern void encode_rd_type (u_int16_t, u_char *); extern void bgp_mplsvpn_init (void); extern int bgp_nlri_parse_vpn (struct peer *, struct attr *, struct bgp_nlri *); extern u_int32_t decode_label (mpls_label_t *); extern void encode_label(mpls_label_t, mpls_label_t *); -extern void decode_rd_as (u_char *, struct rd_as *); -extern void decode_rd_as4 (u_char *, struct rd_as *); -extern void decode_rd_ip (u_char *, struct rd_ip *); -#if ENABLE_BGP_VNC -extern void -decode_rd_vnc_eth (u_char *pnt, struct rd_vnc_eth *rd_vnc_eth); -#endif -extern int str2prefix_rd (const char *, struct prefix_rd *); -extern char *prefix_rd2str (struct prefix_rd *, char *, size_t); extern int argv_find_and_parse_vpnvx(struct cmd_token **argv, int argc, int *index, afi_t *afi); |