diff options
| author | Lou Berger <lberger@labn.net> | 2017-02-17 12:18:08 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-17 12:18:08 -0500 |
| commit | bac515c64c89ccbb8a22fa40bd595dd2999404ee (patch) | |
| tree | 308e52e33bc7b14eda9ab521b71f90a3356b6a46 /bgpd/bgp_debug.c | |
| parent | 9960254b7c3adacbcba47915ce5777466b2ee9aa (diff) | |
| parent | f47195ae584424123915172d18bef2ef8ec6179e (diff) | |
Merge pull request #103 from pguibert6WIND/frr_6wind_evpn_5
Provide EVPN basic support on master branch + EVPN Route Target 5 Support (V2)
Diffstat (limited to 'bgpd/bgp_debug.c')
| -rw-r--r-- | bgpd/bgp_debug.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c index ab05878210..e1e7cb1d5b 100644 --- a/bgpd/bgp_debug.c +++ b/bgpd/bgp_debug.c @@ -38,6 +38,9 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #include "bgpd/bgp_debug.h" #include "bgpd/bgp_community.h" #include "bgpd/bgp_updgrp.h" +#include "bgpd/bgp_mplsvpn.h" + +#define BGP_ADDPATH_STR 20 unsigned long conf_bgp_debug_as4; unsigned long conf_bgp_debug_neighbor_events; @@ -2086,3 +2089,31 @@ bgp_debug_zebra (struct prefix *p) return 0; } + +const char * +bgp_debug_rdpfxpath2str (struct prefix_rd *prd, union prefixconstptr pu, + int addpath_valid, u_int32_t addpath_id, + char *str, int size) +{ + char rd_buf[RD_ADDRSTRLEN]; + char pfx_buf[PREFIX_STRLEN]; + char pathid_buf[BGP_ADDPATH_STR]; + + if (size < BGP_PRD_PATH_STRLEN) + return NULL; + + /* Note: Path-id is created by default, but only included in update sometimes. */ + pathid_buf[0] = '\0'; + if (addpath_valid) + sprintf(pathid_buf, " with addpath ID %d", addpath_id); + + if (prd) + snprintf (str, size, "RD %s %s%s", + prefix_rd2str(prd, rd_buf, sizeof (rd_buf)), + prefix2str (pu, pfx_buf, sizeof (pfx_buf)), pathid_buf); + else + snprintf (str, size, "%s%s", + prefix2str (pu, pfx_buf, sizeof (pfx_buf)), pathid_buf); + + return str; +} |
