bgpd vnc: Add 'debug bgp vnc verbose' target

all vnc debug logging is now covered by a 'debug bgp vnc' target

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
Lou Berger 2016-12-07 15:02:55 -05:00 committed by David Lamparter
parent 6228a3b874
commit a3b55c2500
16 changed files with 578 additions and 551 deletions

View File

@ -45,6 +45,7 @@
#include "bgpd/rfapi/vnc_export_bgp_p.h" #include "bgpd/rfapi/vnc_export_bgp_p.h"
#include "bgpd/rfapi/rfapi_vty.h" #include "bgpd/rfapi/rfapi_vty.h"
#include "bgpd/rfapi/vnc_import_bgp.h" #include "bgpd/rfapi/vnc_import_bgp.h"
#include "bgpd/rfapi/vnc_debug.h"
#if ENABLE_BGP_VNC #if ENABLE_BGP_VNC
@ -184,12 +185,12 @@ bgp_rfapi_cfg_match_group (
char buf[BUFSIZ]; char buf[BUFSIZ];
prefix2str (vn, buf, BUFSIZ); prefix2str (vn, buf, BUFSIZ);
zlog_debug ("%s: vn prefix: %s", __func__, buf); vnc_zlog_debug_verbose ("%s: vn prefix: %s", __func__, buf);
prefix2str (un, buf, BUFSIZ); prefix2str (un, buf, BUFSIZ);
zlog_debug ("%s: un prefix: %s", __func__, buf); vnc_zlog_debug_verbose ("%s: un prefix: %s", __func__, buf);
zlog_debug ("%s: rn_vn=%p, rn_un=%p, rfg_vn=%p, rfg_un=%p", vnc_zlog_debug_verbose ("%s: rn_vn=%p, rn_un=%p, rfg_vn=%p, rfg_un=%p",
__func__, rn_vn, rn_un, rfg_vn, rfg_un); __func__, rn_vn, rn_un, rfg_vn, rfg_un);
} }
#endif #endif
@ -216,7 +217,7 @@ bgp_rfapi_cfg_match_group (
return rfg; return rfg;
} }
} }
zlog_debug ("%s: shouldn't happen, returning NULL when un and vn match", vnc_zlog_debug_verbose ("%s: shouldn't happen, returning NULL when un and vn match",
__func__); __func__);
return NULL; /* shouldn't happen */ return NULL; /* shouldn't happen */
} }
@ -774,7 +775,7 @@ vnc_redistribute_prechange (struct bgp *bgp)
afi_t afi; afi_t afi;
int type; int type;
zlog_debug ("%s: entry", __func__); vnc_zlog_debug_verbose ("%s: entry", __func__);
memset (redist_was_enabled, 0, sizeof (redist_was_enabled)); memset (redist_was_enabled, 0, sizeof (redist_was_enabled));
/* /*
@ -794,7 +795,7 @@ vnc_redistribute_prechange (struct bgp *bgp)
} }
} }
} }
zlog_debug ("%s: return", __func__); vnc_zlog_debug_verbose ("%s: return", __func__);
} }
static void static void
@ -803,7 +804,7 @@ vnc_redistribute_postchange (struct bgp *bgp)
afi_t afi; afi_t afi;
int type; int type;
zlog_debug ("%s: entry", __func__); vnc_zlog_debug_verbose ("%s: entry", __func__);
/* /*
* If we turned off redistribution above, turn it back on. Doing so * If we turned off redistribution above, turn it back on. Doing so
* will tell zebra to resend the routes to us * will tell zebra to resend the routes to us
@ -818,7 +819,7 @@ vnc_redistribute_postchange (struct bgp *bgp)
} }
} }
} }
zlog_debug ("%s: return", __func__); vnc_zlog_debug_verbose ("%s: return", __func__);
} }
DEFUN (vnc_redistribute_rh_roo_localadmin, DEFUN (vnc_redistribute_rh_roo_localadmin,
@ -1797,12 +1798,12 @@ DEFUN (vnc_export_nvegroup,
listnode_add (bgp->rfapi_cfg->rfg_export_direct_bgp_l, rfgn); listnode_add (bgp->rfapi_cfg->rfg_export_direct_bgp_l, rfgn);
zlog_debug ("%s: testing rfg_new", __func__); vnc_zlog_debug_verbose ("%s: testing rfg_new", __func__);
if (rfg_new) if (rfg_new)
{ {
zlog_debug ("%s: testing bgp grp mode enabled", __func__); vnc_zlog_debug_verbose ("%s: testing bgp grp mode enabled", __func__);
if (VNC_EXPORT_BGP_GRP_ENABLED (bgp->rfapi_cfg)) if (VNC_EXPORT_BGP_GRP_ENABLED (bgp->rfapi_cfg))
zlog_debug ("%s: calling vnc_direct_bgp_add_group", __func__); vnc_zlog_debug_verbose ("%s: calling vnc_direct_bgp_add_group", __func__);
vnc_direct_bgp_add_group (bgp, rfg_new); vnc_direct_bgp_add_group (bgp, rfg_new);
} }
@ -1883,7 +1884,7 @@ DEFUN (vnc_no_export_nvegroup,
if (rfgn->name && !strcmp (rfgn->name, argv[1])) if (rfgn->name && !strcmp (rfgn->name, argv[1]))
{ {
zlog_debug ("%s: matched \"%s\"", __func__, rfgn->name); vnc_zlog_debug_verbose ("%s: matched \"%s\"", __func__, rfgn->name);
if (rfgn->rfg) if (rfgn->rfg)
vnc_direct_bgp_del_group (bgp, rfgn->rfg); vnc_direct_bgp_del_group (bgp, rfgn->rfg);
free (rfgn->name); free (rfgn->name);
@ -1900,7 +1901,7 @@ DEFUN (vnc_no_export_nvegroup,
node, nnode, rfgn)) node, nnode, rfgn))
{ {
zlog_debug ("does rfg \"%s\" match?", rfgn->name); vnc_zlog_debug_verbose ("does rfg \"%s\" match?", rfgn->name);
if (rfgn->name && !strcmp (rfgn->name, argv[1])) if (rfgn->name && !strcmp (rfgn->name, argv[1]))
{ {
if (rfgn->rfg) if (rfgn->rfg)
@ -2410,13 +2411,13 @@ vnc_prefix_list_update (struct bgp *bgp)
if (!bgp) if (!bgp)
{ {
zlog_debug ("%s: No BGP process is configured", __func__); vnc_zlog_debug_verbose ("%s: No BGP process is configured", __func__);
return; return;
} }
if (!(hc = bgp->rfapi_cfg)) if (!(hc = bgp->rfapi_cfg))
{ {
zlog_debug ("%s: rfapi not configured", __func__); vnc_zlog_debug_verbose ("%s: rfapi not configured", __func__);
return; return;
} }
@ -2498,17 +2499,17 @@ vnc_routemap_update (struct bgp *bgp, const char *unused)
struct rfapi_cfg *hc; struct rfapi_cfg *hc;
int i; int i;
zlog_debug ("%s(arg=%s)", __func__, unused); vnc_zlog_debug_verbose ("%s(arg=%s)", __func__, unused);
if (!bgp) if (!bgp)
{ {
zlog_debug ("%s: No BGP process is configured", __func__); vnc_zlog_debug_verbose ("%s: No BGP process is configured", __func__);
return; return;
} }
if (!(hc = bgp->rfapi_cfg)) if (!(hc = bgp->rfapi_cfg))
{ {
zlog_debug ("%s: rfapi not configured", __func__); vnc_zlog_debug_verbose ("%s: rfapi not configured", __func__);
return; return;
} }
@ -2573,7 +2574,7 @@ vnc_routemap_update (struct bgp *bgp, const char *unused)
vnc_redistribute_prechange (bgp); vnc_redistribute_prechange (bgp);
vnc_redistribute_postchange (bgp); vnc_redistribute_postchange (bgp);
zlog_debug ("%s done", __func__); vnc_zlog_debug_verbose ("%s done", __func__);
} }
static void static void
@ -2583,14 +2584,14 @@ vnc_routemap_event (route_map_event_t type, /* ignored */
struct listnode *mnode, *mnnode; struct listnode *mnode, *mnnode;
struct bgp *bgp; struct bgp *bgp;
zlog_debug ("%s(event type=%d)", __func__, type); vnc_zlog_debug_verbose ("%s(event type=%d)", __func__, type);
if (bm->bgp == NULL) /* may be called during cleanup */ if (bm->bgp == NULL) /* may be called during cleanup */
return; return;
for (ALL_LIST_ELEMENTS (bm->bgp, mnode, mnnode, bgp)) for (ALL_LIST_ELEMENTS (bm->bgp, mnode, mnnode, bgp))
vnc_routemap_update (bgp, rmap_name); vnc_routemap_update (bgp, rmap_name);
zlog_debug ("%s: done", __func__); vnc_zlog_debug_verbose ("%s: done", __func__);
} }
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
@ -2693,7 +2694,7 @@ DEFUN (vnc_nve_group,
node, nnode, rfgn)) node, nnode, rfgn))
{ {
zlog_debug ("%s: ezport zebra: checking if \"%s\" == \"%s\"", vnc_zlog_debug_verbose ("%s: ezport zebra: checking if \"%s\" == \"%s\"",
__func__, rfgn->name, rfg->name); __func__, rfgn->name, rfg->name);
if (!strcmp (rfgn->name, rfg->name)) if (!strcmp (rfgn->name, rfg->name))
{ {
@ -3216,7 +3217,7 @@ DEFUN (vnc_nve_group_rt_both,
if (is_export_zebra) if (is_export_zebra)
{ {
zlog_debug ("%s: is_export_zebra", __func__); vnc_zlog_debug_verbose ("%s: is_export_zebra", __func__);
vnc_zebra_del_group (bgp, rfg); vnc_zebra_del_group (bgp, rfg);
} }

View File

@ -409,14 +409,14 @@ del_vnc_route (
} }
bn = bgp_afi_node_get (bgp->rib[afi][safi], afi, safi, p, prd); bn = bgp_afi_node_get (bgp->rib[afi][safi], afi, safi, p, prd);
zlog_debug vnc_zlog_debug_verbose
("%s: peer=%p, prefix=%s, prd=%s afi=%d, safi=%d bn=%p, bn->info=%p", ("%s: peer=%p, prefix=%s, prd=%s afi=%d, safi=%d bn=%p, bn->info=%p",
__func__, peer, buf, buf2, afi, safi, bn, (bn ? bn->info : NULL)); __func__, peer, buf, buf2, afi, safi, bn, (bn ? bn->info : NULL));
for (bi = (bn ? bn->info : NULL); bi; bi = bi->next) for (bi = (bn ? bn->info : NULL); bi; bi = bi->next)
{ {
zlog_debug vnc_zlog_debug_verbose
("%s: trying bi=%p, bi->peer=%p, bi->type=%d, bi->sub_type=%d, bi->extra->vnc.export.rfapi_handle=%p", ("%s: trying bi=%p, bi->peer=%p, bi->type=%d, bi->sub_type=%d, bi->extra->vnc.export.rfapi_handle=%p",
__func__, bi, bi->peer, bi->type, bi->sub_type, __func__, bi, bi->peer, bi->type, bi->sub_type,
(bi->extra ? bi->extra->vnc.export.rfapi_handle : NULL)); (bi->extra ? bi->extra->vnc.export.rfapi_handle : NULL));
@ -427,7 +427,7 @@ del_vnc_route (
bi->extra && bi->extra->vnc.export.rfapi_handle == (void *) rfd) bi->extra && bi->extra->vnc.export.rfapi_handle == (void *) rfd)
{ {
zlog_debug ("%s: matched it", __func__); vnc_zlog_debug_verbose ("%s: matched it", __func__);
break; break;
} }
@ -445,7 +445,7 @@ del_vnc_route (
/* /*
* no local nexthops * no local nexthops
*/ */
zlog_debug ("%s: lnh list already empty at prefix %s", vnc_zlog_debug_verbose ("%s: lnh list already empty at prefix %s",
__func__, buf); __func__, buf);
goto done; goto done;
} }
@ -475,7 +475,7 @@ del_vnc_route (
} }
else else
{ {
zlog_debug ("%s: desired lnh not found %s", __func__, buf); vnc_zlog_debug_verbose ("%s: desired lnh not found %s", __func__, buf);
} }
goto done; goto done;
} }
@ -494,7 +494,7 @@ del_vnc_route (
prefix2str (p, buf, BUFSIZ); prefix2str (p, buf, BUFSIZ);
buf[BUFSIZ - 1] = 0; /* guarantee NUL-terminated */ buf[BUFSIZ - 1] = 0; /* guarantee NUL-terminated */
zlog_debug ("%s: Found route (safi=%d) to delete at prefix %s", vnc_zlog_debug_verbose ("%s: Found route (safi=%d) to delete at prefix %s",
__func__, safi, buf); __func__, safi, buf);
if (safi == SAFI_MPLS_VPN) if (safi == SAFI_MPLS_VPN)
@ -529,7 +529,7 @@ del_vnc_route (
} }
else else
{ {
zlog_debug ("%s: Couldn't find route (safi=%d) at prefix %s", vnc_zlog_debug_verbose ("%s: Couldn't find route (safi=%d) at prefix %s",
__func__, safi, buf); __func__, safi, buf);
} }
done: done:
@ -657,7 +657,7 @@ add_vnc_route (
* Encap mode not enabled. UN addresses will be communicated * Encap mode not enabled. UN addresses will be communicated
* via VNC Tunnel subtlv instead. * via VNC Tunnel subtlv instead.
*/ */
zlog_debug ("%s: encap mode not enabled, not adding SAFI_ENCAP route", vnc_zlog_debug_verbose ("%s: encap mode not enabled, not adding SAFI_ENCAP route",
__func__); __func__);
return; return;
} }
@ -668,7 +668,7 @@ add_vnc_route (
if (rfapiRaddr2Qprefix (nexthop, &pfx_buf)) if (rfapiRaddr2Qprefix (nexthop, &pfx_buf))
{ {
zlog_debug vnc_zlog_debug_verbose
("%s: can't set pfx to vn addr, not adding SAFI_MPLS_VPN route", ("%s: can't set pfx to vn addr, not adding SAFI_MPLS_VPN route",
__func__); __func__);
return; return;
@ -702,7 +702,7 @@ add_vnc_route (
afi = family2afi (p->family); afi = family2afi (p->family);
assert (afi == AFI_IP || afi == AFI_IP6); assert (afi == AFI_IP || afi == AFI_IP6);
zlog_debug ("%s: afi=%s, safi=%s", __func__, afi2str (afi), vnc_zlog_debug_verbose ("%s: afi=%s, safi=%s", __func__, afi2str (afi),
safi2str (safi)); safi2str (safi));
/* Make default attribute. Produces already-interned attr.aspath */ /* Make default attribute. Produces already-interned attr.aspath */
@ -763,7 +763,7 @@ add_vnc_route (
if (safi == SAFI_ENCAP) if (safi == SAFI_ENCAP)
{ {
/* Encap SAFI not used with MPLS */ /* Encap SAFI not used with MPLS */
zlog_debug ("%s: mpls tunnel type, encap safi omitted", __func__); vnc_zlog_debug_verbose ("%s: mpls tunnel type, encap safi omitted", __func__);
aspath_unintern (&attr.aspath); /* Unintern original. */ aspath_unintern (&attr.aspath); /* Unintern original. */
bgp_attr_extra_free (&attr); bgp_attr_extra_free (&attr);
return; return;
@ -820,7 +820,7 @@ add_vnc_route (
lt = htonl (*lifetime); lt = htonl (*lifetime);
memcpy (encaptlv->value, &lt, 4); memcpy (encaptlv->value, &lt, 4);
attr.extra->vnc_subtlvs = encaptlv; attr.extra->vnc_subtlvs = encaptlv;
zlog_debug ("%s: set Encap Attr Prefix Lifetime to %d", vnc_zlog_debug_verbose ("%s: set Encap Attr Prefix Lifetime to %d",
__func__, *lifetime); __func__, *lifetime);
} }
@ -936,7 +936,7 @@ add_vnc_route (
ecommunity_free (&attr.extra->ecommunity); ecommunity_free (&attr.extra->ecommunity);
attr.extra->ecommunity = NULL; attr.extra->ecommunity = NULL;
} }
zlog_debug ("%s: attr.extra->ecommunity=%p", __func__, vnc_zlog_debug_verbose ("%s: attr.extra->ecommunity=%p", __func__,
attr.extra->ecommunity); attr.extra->ecommunity);
@ -1088,7 +1088,7 @@ add_vnc_route (
bgp_attr_unintern (&new_attr); bgp_attr_unintern (&new_attr);
bgp_unlock_node (bn); bgp_unlock_node (bn);
zlog_info ("%s: Found route (safi=%d) at prefix %s, no change", vnc_zlog_debug_any ("%s: Found route (safi=%d) at prefix %s, no change",
__func__, safi, buf); __func__, safi, buf);
goto done; goto done;
@ -1145,7 +1145,7 @@ add_vnc_route (
bgp_process (bgp, bn, afi, safi); bgp_process (bgp, bn, afi, safi);
bgp_unlock_node (bn); bgp_unlock_node (bn);
zlog_info ("%s: Found route (safi=%d) at prefix %s, changed attr", vnc_zlog_debug_any ("%s: Found route (safi=%d) at prefix %s, changed attr",
__func__, safi, buf); __func__, safi, buf);
goto done; goto done;
@ -1167,8 +1167,12 @@ add_vnc_route (
encode_label (label_val, new->extra->tag); encode_label (label_val, new->extra->tag);
/* debug */ /* debug */
zlog_debug ("%s: printing BI", __func__);
rfapiPrintBi (NULL, new); if (VNC_DEBUG(VERBOSE))
{
vnc_zlog_debug_verbose ("%s: printing BI", __func__);
rfapiPrintBi (NULL, new);
}
bgp_aggregate_increment (bgp, p, new, afi, safi); bgp_aggregate_increment (bgp, p, new, afi, safi);
bgp_info_add (bn, new); bgp_info_add (bn, new);
@ -1192,7 +1196,7 @@ add_vnc_route (
bgp_unlock_node (bn); bgp_unlock_node (bn);
bgp_process (bgp, bn, afi, safi); bgp_process (bgp, bn, afi, safi);
zlog_info ("%s: Added route (safi=%s) at prefix %s (bn=%p, prd=%s)", vnc_zlog_debug_any ("%s: Added route (safi=%s) at prefix %s (bn=%p, prd=%s)",
__func__, safi2str (safi), buf, bn, buf2); __func__, safi2str (safi), buf, bn, buf2);
done: done:
@ -1200,7 +1204,7 @@ done:
rfapiProcessUpdate (rfd->peer, rfapiProcessUpdate (rfd->peer,
rfd, rfd,
p, prd, new_attr, afi, safi, type, sub_type, &label_val); p, prd, new_attr, afi, safi, type, sub_type, &label_val);
zlog_debug ("%s: looped back import route (safi=%d)", __func__, safi); vnc_zlog_debug_verbose ("%s: looped back import route (safi=%d)", __func__, safi);
} }
uint32_t uint32_t
@ -1604,23 +1608,23 @@ rfapi_query_inner (
/* preemptive */ /* preemptive */
if (!bgp) if (!bgp)
{ {
zlog_debug ("%s: No BGP instance, returning ENXIO", __func__); vnc_zlog_debug_verbose ("%s: No BGP instance, returning ENXIO", __func__);
return ENXIO; return ENXIO;
} }
if (!bgp->rfapi) if (!bgp->rfapi)
{ {
zlog_debug ("%s: No RFAPI instance, returning ENXIO", __func__); vnc_zlog_debug_verbose ("%s: No RFAPI instance, returning ENXIO", __func__);
return ENXIO; return ENXIO;
} }
if (bgp->rfapi->flags & RFAPI_INCALLBACK) if (bgp->rfapi->flags & RFAPI_INCALLBACK)
{ {
zlog_debug ("%s: Called during calback, returning EDEADLK", __func__); vnc_zlog_debug_verbose ("%s: Called during calback, returning EDEADLK", __func__);
return EDEADLK; return EDEADLK;
} }
if (!is_valid_rfd (rfd)) if (!is_valid_rfd (rfd))
{ {
zlog_debug ("%s: invalid handle, returning EBADF", __func__); vnc_zlog_debug_verbose ("%s: invalid handle, returning EBADF", __func__);
return EBADF; return EBADF;
} }
@ -1667,7 +1671,7 @@ rfapi_query_inner (
prefix2str (&p, buf, BUFSIZ); prefix2str (&p, buf, BUFSIZ);
buf[BUFSIZ - 1] = 0; /* guarantee NUL-terminated */ buf[BUFSIZ - 1] = 0; /* guarantee NUL-terminated */
zlog_debug ("%s(rfd=%p, target=%s, ppNextHop=%p)", vnc_zlog_debug_verbose ("%s(rfd=%p, target=%s, ppNextHop=%p)",
__func__, rfd, buf, ppNextHopEntry); __func__, rfd, buf, ppNextHopEntry);
} }
@ -1753,7 +1757,7 @@ rfapi_query_inner (
if (RFAPI_0_PREFIX (&p)) if (RFAPI_0_PREFIX (&p))
{ {
zlog_debug ("%s: 0-prefix", __func__); vnc_zlog_debug_verbose ("%s: 0-prefix", __func__);
/* /*
* Generate nexthop list for caller * Generate nexthop list for caller
@ -1784,7 +1788,7 @@ rfapi_query_inner (
if (!rn->info) if (!rn->info)
{ {
route_unlock_node (rn); route_unlock_node (rn);
zlog_debug ("%s: VPN route not found, returning ENOENT", __func__); vnc_zlog_debug_verbose ("%s: VPN route not found, returning ENOENT", __func__);
return ENOENT; return ENOENT;
} }
@ -1835,7 +1839,7 @@ done:
if (!pNHE) if (!pNHE)
{ {
zlog_debug ("%s: NO NHEs, returning ENOENT", __func__); vnc_zlog_debug_verbose ("%s: NO NHEs, returning ENOENT", __func__);
return ENOENT; return ENOENT;
} }
@ -1856,7 +1860,7 @@ done:
rfapi_free_next_hop_list (pNHE); rfapi_free_next_hop_list (pNHE);
} }
zlog_debug ("%s: success", __func__); vnc_zlog_debug_verbose ("%s: success", __func__);
return 0; return 0;
} }
@ -1998,7 +2002,7 @@ rfapi_open (
{ {
char buf[2][INET_ADDRSTRLEN]; char buf[2][INET_ADDRSTRLEN];
zlog_debug ("%s: VN=%s UN=%s", __func__, vnc_zlog_debug_verbose ("%s: VN=%s UN=%s", __func__,
rfapiRfapiIpAddr2Str (vn, buf[0], INET_ADDRSTRLEN), rfapiRfapiIpAddr2Str (vn, buf[0], INET_ADDRSTRLEN),
rfapiRfapiIpAddr2Str (un, buf[1], INET_ADDRSTRLEN)); rfapiRfapiIpAddr2Str (un, buf[1], INET_ADDRSTRLEN));
} }
@ -2135,7 +2139,7 @@ rfapi_open (
rfapiRfapiIpAddr2Str (vn, buf_vn, BUFSIZ); rfapiRfapiIpAddr2Str (vn, buf_vn, BUFSIZ);
rfapiRfapiIpAddr2Str (un, buf_un, BUFSIZ); rfapiRfapiIpAddr2Str (un, buf_un, BUFSIZ);
zlog_debug ("%s: new HD with VN=%s UN=%s cookie=%p", vnc_zlog_debug_verbose ("%s: new HD with VN=%s UN=%s cookie=%p",
__func__, buf_vn, buf_un, userdata); __func__, buf_vn, buf_un, userdata);
} }
@ -2290,7 +2294,7 @@ rfapi_close_inner (struct rfapi_descriptor *rfd, struct bgp *bgp)
*/ */
if (rfd->peer) if (rfd->peer)
{ {
zlog_debug ("%s: calling peer_delete(%p), #%d", vnc_zlog_debug_verbose ("%s: calling peer_delete(%p), #%d",
__func__, rfd->peer, rfd->peer->lock); __func__, rfd->peer, rfd->peer->lock);
peer_delete (rfd->peer); peer_delete (rfd->peer);
} }
@ -2308,7 +2312,7 @@ rfapi_close (void *handle)
struct bgp *bgp; struct bgp *bgp;
struct rfapi *h; struct rfapi *h;
zlog_debug ("%s: rfd=%p", __func__, rfd); vnc_zlog_debug_verbose ("%s: rfd=%p", __func__, rfd);
#if RFAPI_WHO_IS_CALLING_ME #if RFAPI_WHO_IS_CALLING_ME
#ifdef HAVE_GLIBC_BACKTRACE #ifdef HAVE_GLIBC_BACKTRACE
@ -2323,7 +2327,7 @@ rfapi_close (void *handle)
syms = backtrace_symbols (buf, size); syms = backtrace_symbols (buf, size);
for (i = 0; i < size && i < RFAPI_DEBUG_BACKTRACE_NENTRIES; ++i) for (i = 0; i < size && i < RFAPI_DEBUG_BACKTRACE_NENTRIES; ++i)
{ {
zlog_debug ("backtrace[%2d]: %s", i, syms[i]); vnc_zlog_debug_verbose ("backtrace[%2d]: %s", i, syms[i]);
} }
free (syms); free (syms);
} }
@ -2350,7 +2354,7 @@ rfapi_close (void *handle)
if (!CHECK_FLAG (rfd->flags, RFAPI_HD_FLAG_CLOSING_ADMINISTRATIVELY)) if (!CHECK_FLAG (rfd->flags, RFAPI_HD_FLAG_CLOSING_ADMINISTRATIVELY))
{ {
work_queue_add (h->deferred_close_q, handle); work_queue_add (h->deferred_close_q, handle);
zlog_debug ("%s: added handle %p to deferred close queue", vnc_zlog_debug_verbose ("%s: added handle %p to deferred close queue",
__func__, handle); __func__, handle);
} }
return 0; return 0;
@ -2359,11 +2363,11 @@ rfapi_close (void *handle)
if (CHECK_FLAG (rfd->flags, RFAPI_HD_FLAG_CLOSING_ADMINISTRATIVELY)) if (CHECK_FLAG (rfd->flags, RFAPI_HD_FLAG_CLOSING_ADMINISTRATIVELY))
{ {
zlog_debug ("%s administrative close rfd=%p", __func__, rfd); vnc_zlog_debug_verbose ("%s administrative close rfd=%p", __func__, rfd);
if (h && h->rfp_methods.close_cb) if (h && h->rfp_methods.close_cb)
{ {
zlog_debug ("%s calling close callback rfd=%p", __func__, rfd); vnc_zlog_debug_verbose ("%s calling close callback rfd=%p", __func__, rfd);
/* /*
* call the callback fairly early so that it can still lookup un/vn * call the callback fairly early so that it can still lookup un/vn
@ -2575,7 +2579,7 @@ rfapi_register (
prefix2str (&p, buf, BUFSIZ); prefix2str (&p, buf, BUFSIZ);
buf[BUFSIZ - 1] = 0; /* guarantee NUL-terminated */ buf[BUFSIZ - 1] = 0; /* guarantee NUL-terminated */
zlog_debug vnc_zlog_debug_verbose
("%s(rfd=%p, pfx=%s, lifetime=%d, opts_un=%p, opts_vn=%p, action=%s)", ("%s(rfd=%p, pfx=%s, lifetime=%d, opts_un=%p, opts_vn=%p, action=%s)",
__func__, rfd, buf, lifetime, options_un, options_vn, action_str); __func__, rfd, buf, lifetime, options_un, options_vn, action_str);
} }
@ -2588,12 +2592,12 @@ rfapi_register (
bgp = rfd->bgp; bgp = rfd->bgp;
if (!bgp) if (!bgp)
{ {
zlog_debug ("%s: no BGP instance: returning ENXIO", __func__); vnc_zlog_debug_verbose ("%s: no BGP instance: returning ENXIO", __func__);
return ENXIO; return ENXIO;
} }
if (!bgp->rfapi) if (!bgp->rfapi)
{ {
zlog_debug ("%s: no RFAPI instance: returning ENXIO", __func__); vnc_zlog_debug_verbose ("%s: no RFAPI instance: returning ENXIO", __func__);
return ENXIO; return ENXIO;
} }
if (!rfd->rfg) if (!rfd->rfg)
@ -2602,7 +2606,7 @@ rfapi_register (
{ {
++bgp->rfapi->stat.count_registrations_failed; ++bgp->rfapi->stat.count_registrations_failed;
} }
zlog_debug ("%s: rfd=%p, no RF GRP instance: returning ESTALE", vnc_zlog_debug_verbose ("%s: rfd=%p, no RF GRP instance: returning ESTALE",
__func__, rfd); __func__, rfd);
return ESTALE; return ESTALE;
} }
@ -2613,7 +2617,7 @@ rfapi_register (
{ {
++bgp->rfapi->stat.count_registrations_failed; ++bgp->rfapi->stat.count_registrations_failed;
} }
zlog_debug ("%s: in callback: returning EDEADLK", __func__); vnc_zlog_debug_verbose ("%s: in callback: returning EDEADLK", __func__);
return EDEADLK; return EDEADLK;
} }
@ -2623,7 +2627,7 @@ rfapi_register (
{ {
++bgp->rfapi->stat.count_registrations_failed; ++bgp->rfapi->stat.count_registrations_failed;
} }
zlog_debug ("%s: invalid handle: returning EBADF", __func__); vnc_zlog_debug_verbose ("%s: invalid handle: returning EBADF", __func__);
return EBADF; return EBADF;
} }
@ -2647,7 +2651,7 @@ rfapi_register (
{ {
if (!pfx_mac) if (!pfx_mac)
{ {
zlog_debug ("%s: missing mac addr that is required for host 0 pfx", vnc_zlog_debug_verbose ("%s: missing mac addr that is required for host 0 pfx",
__func__); __func__);
if (RFAPI_REGISTER_ADD == action) if (RFAPI_REGISTER_ADD == action)
{ {
@ -2657,7 +2661,7 @@ rfapi_register (
} }
if (rfapiRaddr2Qprefix (&rfd->vn_addr, &pfx_vn_buf)) if (rfapiRaddr2Qprefix (&rfd->vn_addr, &pfx_vn_buf))
{ {
zlog_debug ("%s: handle has bad vn_addr: returning EBADF", vnc_zlog_debug_verbose ("%s: handle has bad vn_addr: returning EBADF",
__func__); __func__);
if (RFAPI_REGISTER_ADD == action) if (RFAPI_REGISTER_ADD == action)
{ {
@ -2804,14 +2808,14 @@ rfapi_register (
adv_tunnel = 1; adv_tunnel = 1;
} }
zlog_debug ("%s: adv_tunnel = %d", __func__, adv_tunnel); vnc_zlog_debug_verbose ("%s: adv_tunnel = %d", __func__, adv_tunnel);
if (adv_tunnel) if (adv_tunnel)
{ {
zlog_debug ("%s: announcing tunnel route", __func__); vnc_zlog_debug_verbose ("%s: announcing tunnel route", __func__);
rfapiTunnelRouteAnnounce (bgp, rfd, &rfd->max_prefix_lifetime); rfapiTunnelRouteAnnounce (bgp, rfd, &rfd->max_prefix_lifetime);
} }
zlog_debug ("%s: calling add_vnc_route", __func__); vnc_zlog_debug_verbose ("%s: calling add_vnc_route", __func__);
local_pref = rfp_cost_to_localpref (prefix->cost); local_pref = rfp_cost_to_localpref (prefix->cost);
@ -2873,7 +2877,7 @@ rfapi_register (
ecommunity_free (&rtlist); /* sets rtlist = NULL */ ecommunity_free (&rtlist); /* sets rtlist = NULL */
} }
zlog_debug ("%s: success", __func__); vnc_zlog_debug_verbose ("%s: success", __func__);
return 0; return 0;
} }
@ -3993,11 +3997,11 @@ rfapi_delete (struct bgp *bgp)
int int
rfapi_set_autord_from_vn (struct prefix_rd *rd, struct rfapi_ip_addr *vn) rfapi_set_autord_from_vn (struct prefix_rd *rd, struct rfapi_ip_addr *vn)
{ {
zlog_debug ("%s: auto-assigning RD", __func__); vnc_zlog_debug_verbose ("%s: auto-assigning RD", __func__);
if (vn->addr_family != AF_INET if (vn->addr_family != AF_INET
&& vn->addr_family != AF_INET6) && vn->addr_family != AF_INET6)
{ {
zlog_debug ("%s: can't auto-assign RD, VN addr family is not IPv4" vnc_zlog_debug_verbose ("%s: can't auto-assign RD, VN addr family is not IPv4"
"|v6" "|v6"
, __func__); , __func__);
return EAFNOSUPPORT; return EAFNOSUPPORT;
@ -4018,7 +4022,7 @@ rfapi_set_autord_from_vn (struct prefix_rd *rd, struct rfapi_ip_addr *vn)
buf[0] = 0; buf[0] = 0;
prefix_rd2str (rd, buf, BUFSIZ); prefix_rd2str (rd, buf, BUFSIZ);
buf[BUFSIZ - 1] = 0; buf[BUFSIZ - 1] = 0;
zlog_debug ("%s: auto-RD is set to %s", __func__, buf); vnc_zlog_debug_verbose ("%s: auto-RD is set to %s", __func__, buf);
} }
return 0; return 0;
} }
@ -4091,7 +4095,7 @@ rfapi_rfp_get_or_init_group_config_default (
if (rfc->default_rfp_cfg == NULL && size > 0) if (rfc->default_rfp_cfg == NULL && size > 0)
{ {
rfc->default_rfp_cfg = XCALLOC (MTYPE_RFAPI_RFP_GROUP_CFG, size); rfc->default_rfp_cfg = XCALLOC (MTYPE_RFAPI_RFP_GROUP_CFG, size);
zlog_debug ("%s: allocated, size=%d", __func__, size); vnc_zlog_debug_verbose ("%s: allocated, size=%d", __func__, size);
} }
return rfc->default_rfp_cfg; return rfc->default_rfp_cfg;
@ -4116,7 +4120,7 @@ rfapi_rfp_get_or_init_group_config_nve (
if (rfg->rfp_cfg == NULL && size > 0) if (rfg->rfp_cfg == NULL && size > 0)
{ {
rfg->rfp_cfg = XCALLOC (MTYPE_RFAPI_RFP_GROUP_CFG, size); rfg->rfp_cfg = XCALLOC (MTYPE_RFAPI_RFP_GROUP_CFG, size);
zlog_debug ("%s: allocated, size=%d", __func__, size); vnc_zlog_debug_verbose ("%s: allocated, size=%d", __func__, size);
} }
return rfg->rfp_cfg; return rfg->rfp_cfg;
@ -4140,7 +4144,7 @@ rfapi_rfp_get_or_init_group_config_l2 (
if (rfg->rfp_cfg == NULL && size > 0) if (rfg->rfp_cfg == NULL && size > 0)
{ {
rfg->rfp_cfg = XCALLOC (MTYPE_RFAPI_RFP_GROUP_CFG, size); rfg->rfp_cfg = XCALLOC (MTYPE_RFAPI_RFP_GROUP_CFG, size);
zlog_debug ("%s: allocated, size=%d", __func__, size); vnc_zlog_debug_verbose ("%s: allocated, size=%d", __func__, size);
} }
return rfg->rfp_cfg; return rfg->rfp_cfg;
@ -4378,7 +4382,7 @@ rfapi_rfp_get_l2_group_config_ptr_lni (
(search_cb == NULL || !search_cb (criteria, rfg->rfp_cfg))) (search_cb == NULL || !search_cb (criteria, rfg->rfp_cfg)))
{ {
if (rfg->rfp_cfg == NULL) if (rfg->rfp_cfg == NULL)
zlog_debug ("%s: returning rfp group config for lni=0", __func__); vnc_zlog_debug_verbose ("%s: returning rfp group config for lni=0", __func__);
return rfg->rfp_cfg; return rfg->rfp_cfg;
} }
} }

View File

@ -56,6 +56,7 @@
#include "bgpd/rfapi/rfapi_rib.h" #include "bgpd/rfapi/rfapi_rib.h"
#include "bgpd/rfapi/rfapi_ap.h" #include "bgpd/rfapi/rfapi_ap.h"
#include "bgpd/rfapi/vnc_debug.h"
/* /*
* Per-NVE Advertised prefixes * Per-NVE Advertised prefixes
@ -240,7 +241,7 @@ rfapiApWithdrawAll (struct bgp *bgp, struct rfapi_descriptor *rfd)
/* /*
* Bad: it means we can't delete the route * Bad: it means we can't delete the route
*/ */
zlog_debug ("%s: BAD: handle has bad vn_addr: skipping", vnc_zlog_debug_verbose ("%s: BAD: handle has bad vn_addr: skipping",
__func__); __func__);
continue; continue;
} }
@ -264,12 +265,12 @@ rfapiApAdjustLifetimeStats (
int find_max = 0; int find_max = 0;
int find_min = 0; int find_min = 0;
zlog_debug ("%s: rfd=%p, pOldLife=%p, pNewLife=%p", vnc_zlog_debug_verbose ("%s: rfd=%p, pOldLife=%p, pNewLife=%p",
__func__, rfd, old_lifetime, new_lifetime); __func__, rfd, old_lifetime, new_lifetime);
if (old_lifetime) if (old_lifetime)
zlog_debug ("%s: OldLife=%d", __func__, *old_lifetime); vnc_zlog_debug_verbose ("%s: OldLife=%d", __func__, *old_lifetime);
if (new_lifetime) if (new_lifetime)
zlog_debug ("%s: NewLife=%d", __func__, *new_lifetime); vnc_zlog_debug_verbose ("%s: NewLife=%d", __func__, *new_lifetime);
if (new_lifetime) if (new_lifetime)
{ {
@ -407,7 +408,7 @@ rfapiApAdjustLifetimeStats (
struct rfapi_adb *adb; struct rfapi_adb *adb;
int rc; int rc;
zlog_debug ("%s: walking to find new min/max", __func__); vnc_zlog_debug_verbose ("%s: walking to find new min/max", __func__);
cursor = NULL; cursor = NULL;
for (rc = skiplist_next (rfd->advertised.ipN_by_prefix, for (rc = skiplist_next (rfd->advertised.ipN_by_prefix,
@ -454,7 +455,7 @@ rfapiApAdjustLifetimeStats (
rfd->min_prefix_lifetime = min; rfd->min_prefix_lifetime = min;
} }
zlog_debug ("%s: returning advertise=%d, min=%d, max=%d", vnc_zlog_debug_verbose ("%s: returning advertise=%d, min=%d, max=%d",
__func__, advertise, rfd->min_prefix_lifetime, __func__, advertise, rfd->min_prefix_lifetime,
rfd->max_prefix_lifetime); rfd->max_prefix_lifetime);

View File

@ -34,6 +34,7 @@
#include "bgpd/rfapi/rfapi.h" #include "bgpd/rfapi/rfapi.h"
#include "bgpd/rfapi/rfapi_private.h" #include "bgpd/rfapi/rfapi_private.h"
#include "bgpd/rfapi/rfapi_descriptor_rfp_utils.h" #include "bgpd/rfapi/rfapi_descriptor_rfp_utils.h"
#include "bgpd/rfapi/vnc_debug.h"
void * void *
@ -41,7 +42,7 @@ rfapi_create_generic (struct rfapi_ip_addr *vn, struct rfapi_ip_addr *un)
{ {
struct rfapi_descriptor *rfd; struct rfapi_descriptor *rfd;
rfd = XCALLOC (MTYPE_RFAPI_DESC, sizeof (struct rfapi_descriptor)); rfd = XCALLOC (MTYPE_RFAPI_DESC, sizeof (struct rfapi_descriptor));
zlog_debug ("%s: rfd=%p", __func__, rfd); vnc_zlog_debug_verbose ("%s: rfd=%p", __func__, rfd);
rfd->vn_addr = *vn; rfd->vn_addr = *vn;
rfd->un_addr = *un; rfd->un_addr = *un;
return (void *) rfd; return (void *) rfd;

View File

@ -36,6 +36,7 @@
#include "bgpd/rfapi/rfapi_monitor.h" #include "bgpd/rfapi/rfapi_monitor.h"
#include "bgpd/rfapi/rfapi_vty.h" #include "bgpd/rfapi/rfapi_vty.h"
#include "bgpd/rfapi/bgp_rfapi_cfg.h" #include "bgpd/rfapi/bgp_rfapi_cfg.h"
#include "bgpd/rfapi/vnc_debug.h"
static void static void
rfapi_add_endpoint_address_to_subtlv ( rfapi_add_endpoint_address_to_subtlv (
@ -249,7 +250,7 @@ rfapi_encap_tlv_to_un_option (struct attr *attr)
break; break;
default: default:
zlog_debug ("%s: unknown tunnel type %d", vnc_zlog_debug_verbose ("%s: unknown tunnel type %d",
__func__, attre->encap_tunneltype); __func__, attre->encap_tunneltype);
rc = -1; rc = -1;
break; break;

View File

@ -113,7 +113,7 @@ rfapiDebugBacktrace (void)
for (i = 0; i < size && i < RFAPI_DEBUG_BACKTRACE_NENTRIES; ++i) for (i = 0; i < size && i < RFAPI_DEBUG_BACKTRACE_NENTRIES; ++i)
{ {
zlog_debug ("backtrace[%2lu]: %s", i, syms[i]); vnc_zlog_debug_verbose ("backtrace[%2lu]: %s", i, syms[i]);
} }
free (syms); free (syms);
@ -191,19 +191,19 @@ rfapiCheckRouteCount ()
if (it->holddown_count[afi] != holddown_count) if (it->holddown_count[afi] != holddown_count)
{ {
zlog_debug ("%s: it->holddown_count %d != holddown_count %d", vnc_zlog_debug_verbose ("%s: it->holddown_count %d != holddown_count %d",
__func__, it->holddown_count[afi], holddown_count); __func__, it->holddown_count[afi], holddown_count);
assert (0); assert (0);
} }
if (it->remote_count[afi] != remote_count) if (it->remote_count[afi] != remote_count)
{ {
zlog_debug ("%s: it->remote_count %d != remote_count %d", vnc_zlog_debug_verbose ("%s: it->remote_count %d != remote_count %d",
__func__, it->remote_count[afi], remote_count); __func__, it->remote_count[afi], remote_count);
assert (0); assert (0);
} }
if (it->imported_count[afi] != imported_count) if (it->imported_count[afi] != imported_count)
{ {
zlog_debug ("%s: it->imported_count %d != imported_count %d", vnc_zlog_debug_verbose ("%s: it->imported_count %d != imported_count %d",
__func__, it->imported_count[afi], imported_count); __func__, it->imported_count[afi], imported_count);
assert (0); assert (0);
} }
@ -280,7 +280,7 @@ rfapiCheckRefcount (struct route_node *rn, safi_t safi, int lockoffset)
if (count_bi + count_monitor + lockoffset != rn->lock) if (count_bi + count_monitor + lockoffset != rn->lock)
{ {
zlog_debug vnc_zlog_debug_verbose
("%s: count_bi=%d, count_monitor=%d, lockoffset=%d, rn->lock=%d", ("%s: count_bi=%d, count_monitor=%d, lockoffset=%d, rn->lock=%d",
__func__, count_bi, count_monitor, lockoffset, rn->lock); __func__, count_bi, count_monitor, lockoffset, rn->lock);
assert (0); assert (0);
@ -299,7 +299,7 @@ rfapi_deferred_close_workfunc (struct work_queue *q, void *data)
assert (!(h->flags & RFAPI_INCALLBACK)); assert (!(h->flags & RFAPI_INCALLBACK));
rfapi_close (rfd); rfapi_close (rfd);
zlog_debug ("%s: completed deferred close on handle %p", __func__, rfd); vnc_zlog_debug_verbose ("%s: completed deferred close on handle %p", __func__, rfd);
return WQ_SUCCESS; return WQ_SUCCESS;
} }
@ -499,7 +499,7 @@ rfapiGetUnAddrOfVpnBi (struct bgp_info *bi, struct prefix *p)
if (p) if (p)
p->family = 0; p->family = 0;
#if DEBUG_ENCAP_MONITOR #if DEBUG_ENCAP_MONITOR
zlog_debug ("%s: bi->extra->vnc.import.un_family is 0, no UN addr", vnc_zlog_debug_verbose ("%s: bi->extra->vnc.import.un_family is 0, no UN addr",
__func__); __func__);
#endif #endif
break; break;
@ -561,7 +561,7 @@ rfapiBgpInfoFree (struct bgp_info *goner)
if (goner->peer) if (goner->peer)
{ {
zlog_debug ("%s: calling peer_unlock(%p), #%d", vnc_zlog_debug_verbose ("%s: calling peer_unlock(%p), #%d",
__func__, goner->peer, goner->peer->lock); __func__, goner->peer, goner->peer->lock);
peer_unlock (goner->peer); peer_unlock (goner->peer);
} }
@ -676,7 +676,7 @@ rfapiMonitorMoveShorter (struct route_node *original_vpn_node, int lockoffset)
prefix2str (&original_vpn_node->p, buf, BUFSIZ); prefix2str (&original_vpn_node->p, buf, BUFSIZ);
buf[BUFSIZ - 1] = 0; buf[BUFSIZ - 1] = 0;
zlog_debug ("%s: called with node pfx=%s", __func__, buf); vnc_zlog_debug_verbose ("%s: called with node pfx=%s", __func__, buf);
} }
#endif #endif
@ -692,7 +692,7 @@ rfapiMonitorMoveShorter (struct route_node *original_vpn_node, int lockoffset)
if (!rfapiGetUnAddrOfVpnBi (bi, &pfx)) if (!rfapiGetUnAddrOfVpnBi (bi, &pfx))
{ {
#if DEBUG_MONITOR_MOVE_SHORTER #if DEBUG_MONITOR_MOVE_SHORTER
zlog_debug ("%s: have valid UN at original node, no change", vnc_zlog_debug_verbose ("%s: have valid UN at original node, no change",
__func__); __func__);
#endif #endif
return NULL; return NULL;
@ -822,7 +822,7 @@ rfapiMonitorMoveShorter (struct route_node *original_vpn_node, int lockoffset)
prefix2str (&par->p, buf, BUFSIZ); prefix2str (&par->p, buf, BUFSIZ);
buf[BUFSIZ - 1] = 0; buf[BUFSIZ - 1] = 0;
zlog_debug ("%s: moved to node pfx=%s", __func__, buf); vnc_zlog_debug_verbose ("%s: moved to node pfx=%s", __func__, buf);
} }
#endif #endif
@ -856,7 +856,7 @@ rfapiMonitorMoveLonger (struct route_node *new_vpn_node)
if (!bi) if (!bi)
{ {
zlog_debug ("%s: no valid routes at node %p, so not attempting moves", vnc_zlog_debug_verbose ("%s: no valid routes at node %p, so not attempting moves",
__func__, new_vpn_node); __func__, new_vpn_node);
return; return;
} }
@ -872,7 +872,7 @@ rfapiMonitorMoveLonger (struct route_node *new_vpn_node)
if (!par) if (!par)
{ {
zlog_debug ("%s: no parent nodes with monitors, done", __func__); vnc_zlog_debug_verbose ("%s: no parent nodes with monitors, done", __func__);
return; return;
} }
@ -1089,7 +1089,7 @@ rfapiEcommunitiesIntersect (struct ecommunity *e1, struct ecommunity *e2)
char *s1, *s2; char *s1, *s2;
s1 = ecommunity_ecom2str (e1, ECOMMUNITY_FORMAT_DISPLAY); s1 = ecommunity_ecom2str (e1, ECOMMUNITY_FORMAT_DISPLAY);
s2 = ecommunity_ecom2str (e2, ECOMMUNITY_FORMAT_DISPLAY); s2 = ecommunity_ecom2str (e2, ECOMMUNITY_FORMAT_DISPLAY);
zlog_debug ("%s: e1[%s], e2[%s]", __func__, s1, s2); vnc_zlog_debug_verbose ("%s: e1[%s], e2[%s]", __func__, s1, s2);
XFREE (MTYPE_ECOMMUNITY_STR, s1); XFREE (MTYPE_ECOMMUNITY_STR, s1);
XFREE (MTYPE_ECOMMUNITY_STR, s2); XFREE (MTYPE_ECOMMUNITY_STR, s2);
} }
@ -1350,7 +1350,7 @@ rfapiRouteInfo2NextHopEntry (
int have_vnc_tunnel_un = 0; int have_vnc_tunnel_un = 0;
#if DEBUG_ENCAP_MONITOR #if DEBUG_ENCAP_MONITOR
zlog_debug ("%s: entry, bi %p, rn %p", __func__, bi, rn); vnc_zlog_debug_verbose ("%s: entry, bi %p, rn %p", __func__, bi, rn);
#endif #endif
new = XCALLOC (MTYPE_RFAPI_NEXTHOP, sizeof (struct rfapi_next_hop_entry)); new = XCALLOC (MTYPE_RFAPI_NEXTHOP, sizeof (struct rfapi_next_hop_entry));
@ -1501,7 +1501,7 @@ rfapiRouteInfo2NextHopEntry (
new->un_options = rfapi_encap_tlv_to_un_option (bi->attr); new->un_options = rfapi_encap_tlv_to_un_option (bi->attr);
#if DEBUG_ENCAP_MONITOR #if DEBUG_ENCAP_MONITOR
zlog_debug ("%s: line %d: have_vnc_tunnel_un=%d", vnc_zlog_debug_verbose ("%s: line %d: have_vnc_tunnel_un=%d",
__func__, __LINE__, have_vnc_tunnel_un); __func__, __LINE__, have_vnc_tunnel_un);
#endif #endif
@ -1561,7 +1561,7 @@ rfapiDumpNode (struct route_node *rn)
{ {
struct bgp_info *bi; struct bgp_info *bi;
zlog_debug ("%s: rn=%p", __func__, rn); vnc_zlog_debug_verbose ("%s: rn=%p", __func__, rn);
for (bi = rn->info; bi; bi = bi->next) for (bi = rn->info; bi; bi = bi->next)
{ {
struct prefix pfx; struct prefix pfx;
@ -1578,7 +1578,7 @@ rfapiDumpNode (struct route_node *rn)
nr = 0; nr = 0;
} }
zlog_debug (" bi=%p, nr=%d, flags=0x%x, extra=%p, ctrc=%d", vnc_zlog_debug_verbose (" bi=%p, nr=%d, flags=0x%x, extra=%p, ctrc=%d",
bi, nr, bi->flags, bi->extra, ctrc); bi, nr, bi->flags, bi->extra, ctrc);
} }
} }
@ -1622,7 +1622,7 @@ rfapiNhlAddNodeRoutes (
if (removed && !CHECK_FLAG (bi->flags, BGP_INFO_REMOVED)) if (removed && !CHECK_FLAG (bi->flags, BGP_INFO_REMOVED))
{ {
#if DEBUG_RETURNED_NHL #if DEBUG_RETURNED_NHL
zlog_debug ("%s: want holddown, this route not holddown, skip", vnc_zlog_debug_verbose ("%s: want holddown, this route not holddown, skip",
__func__); __func__);
#endif #endif
continue; continue;
@ -1662,7 +1662,7 @@ rfapiNhlAddNodeRoutes (
prefix2str (&pfx_vn, buf, BUFSIZ); prefix2str (&pfx_vn, buf, BUFSIZ);
buf[BUFSIZ - 1] = 0; /* guarantee NUL-terminated */ buf[BUFSIZ - 1] = 0; /* guarantee NUL-terminated */
zlog_debug ("%s: already put VN/nexthop %s, skip", __func__, buf); vnc_zlog_debug_verbose ("%s: already put VN/nexthop %s, skip", __func__, buf);
#endif #endif
continue; continue;
} }
@ -1670,7 +1670,7 @@ rfapiNhlAddNodeRoutes (
if (rfapiGetUnAddrOfVpnBi (bi, &pfx_un)) if (rfapiGetUnAddrOfVpnBi (bi, &pfx_un))
{ {
#if DEBUG_ENCAP_MONITOR #if DEBUG_ENCAP_MONITOR
zlog_debug ("%s: failed to get UN address of this VPN bi", vnc_zlog_debug_verbose ("%s: failed to get UN address of this VPN bi",
__func__); __func__);
#endif #endif
continue; continue;
@ -1832,7 +1832,7 @@ rfapiRouteNode2NextHopList (
prefix2str (&rn->p, buf, BUFSIZ); prefix2str (&rn->p, buf, BUFSIZ);
buf[BUFSIZ - 1] = 0; buf[BUFSIZ - 1] = 0;
zlog_debug ("%s: called with node pfx=%s", __func__, buf); vnc_zlog_debug_verbose ("%s: called with node pfx=%s", __func__, buf);
} }
rfapiDebugBacktrace (); rfapiDebugBacktrace ();
#endif #endif
@ -1854,7 +1854,7 @@ rfapiRouteNode2NextHopList (
{ {
count += rfapiNhlAddSubtree (rn, lifetime, &answer, &last, NULL, count += rfapiNhlAddSubtree (rn, lifetime, &answer, &last, NULL,
exclude_vnaddr, rfd_rib_table, pfx_target_original); exclude_vnaddr, rfd_rib_table, pfx_target_original);
zlog_debug ("%s: %d nexthops, answer=%p", __func__, count, answer); vnc_zlog_debug_verbose ("%s: %d nexthops, answer=%p", __func__, count, answer);
#if DEBUG_RETURNED_NHL #if DEBUG_RETURNED_NHL
rfapiPrintNhl (NULL, answer); rfapiPrintNhl (NULL, answer);
#endif #endif
@ -1911,7 +1911,7 @@ rfapiRouteNode2NextHopList (
exclude_vnaddr, rfd_rib_table, pfx_target_original); exclude_vnaddr, rfd_rib_table, pfx_target_original);
} }
zlog_debug ("%s: %d nexthops, answer=%p", __func__, count, answer); vnc_zlog_debug_verbose ("%s: %d nexthops, answer=%p", __func__, count, answer);
#if DEBUG_RETURNED_NHL #if DEBUG_RETURNED_NHL
rfapiPrintNhl (NULL, answer); rfapiPrintNhl (NULL, answer);
#endif #endif
@ -1960,7 +1960,7 @@ rfapiRouteTable2NextHopList (
} }
} }
zlog_debug ("%s: returning %d routes", __func__, count); vnc_zlog_debug_verbose ("%s: returning %d routes", __func__, count);
return biglist; return biglist;
} }
@ -1984,14 +1984,14 @@ rfapiEthRouteNode2NextHopList (
NULL, rib_rn, pfx_target_original); NULL, rib_rn, pfx_target_original);
#if DEBUG_ENCAP_MONITOR #if DEBUG_ENCAP_MONITOR
zlog_debug ("%s: node %p: %d non-holddown routes", __func__, rn, count); vnc_zlog_debug_verbose ("%s: node %p: %d non-holddown routes", __func__, rn, count);
#endif #endif
if (!count) if (!count)
{ {
count = rfapiNhlAddNodeRoutes (rn, rprefix, lifetime, 1, &answer, &last, count = rfapiNhlAddNodeRoutes (rn, rprefix, lifetime, 1, &answer, &last,
exclude_vnaddr, rib_rn, pfx_target_original); exclude_vnaddr, rib_rn, pfx_target_original);
zlog_debug ("%s: node %p: %d holddown routes", __func__, rn, count); vnc_zlog_debug_verbose ("%s: node %p: %d holddown routes", __func__, rn, count);
} }
if (rib_rn) if (rib_rn)
@ -2055,7 +2055,7 @@ rfapiEthRouteTable2NextHopList (
} }
} }
zlog_debug ("%s: returning %d routes", __func__, count); vnc_zlog_debug_verbose ("%s: returning %d routes", __func__, count);
return biglist; return biglist;
} }
@ -2078,8 +2078,8 @@ rfapiBgpInfoAttachSorted (
if (VNC_DEBUG(IMPORT_BI_ATTACH)) if (VNC_DEBUG(IMPORT_BI_ATTACH))
{ {
zlog_debug ("%s: info_new->peer=%p", __func__, info_new->peer); vnc_zlog_debug_verbose ("%s: info_new->peer=%p", __func__, info_new->peer);
zlog_debug ("%s: info_new->peer->su_remote=%p", __func__, vnc_zlog_debug_verbose ("%s: info_new->peer->su_remote=%p", __func__,
info_new->peer->su_remote); info_new->peer->su_remote);
} }
@ -2093,7 +2093,7 @@ rfapiBgpInfoAttachSorted (
break; break;
} }
} }
zlog_debug ("%s: prev=%p, next=%p", __func__, prev, next); vnc_zlog_debug_verbose ("%s: prev=%p, next=%p", __func__, prev, next);
if (prev) if (prev)
{ {
prev->next = info_new; prev->next = info_new;
@ -2222,7 +2222,7 @@ rfapiItBiIndexAdd (
{ {
char buf[BUFSIZ]; char buf[BUFSIZ];
prefix_rd2str (&bi->extra->vnc.import.rd, buf, BUFSIZ); prefix_rd2str (&bi->extra->vnc.import.rd, buf, BUFSIZ);
zlog_debug ("%s: bi %p, peer %p, rd %s", __func__, bi, bi->peer, buf); vnc_zlog_debug_verbose ("%s: bi %p, peer %p, rd %s", __func__, bi, bi->peer, buf);
} }
sl = RFAPI_RDINDEX_W_ALLOC (rn); sl = RFAPI_RDINDEX_W_ALLOC (rn);
@ -2277,7 +2277,7 @@ rfapiItBiIndexDump (struct route_node *rn)
buf_aux_pfx[BUFSIZ - 1] = 0; buf_aux_pfx[BUFSIZ - 1] = 0;
} }
zlog_debug ("bi %p, peer %p, rd %s, aux_prefix %s", k, k->peer, buf, vnc_zlog_debug_verbose ("bi %p, peer %p, rd %s, aux_prefix %s", k, k->peer, buf,
buf_aux_pfx); buf_aux_pfx);
} }
} }
@ -2315,7 +2315,7 @@ rfapiItBiIndexSearch (
buf_aux_pfx[BUFSIZ - 1] = 0; buf_aux_pfx[BUFSIZ - 1] = 0;
} }
zlog_debug ("%s want prd=%s, peer=%p, aux_prefix=%s", vnc_zlog_debug_verbose ("%s want prd=%s, peer=%p, aux_prefix=%s",
__func__, buf, peer, buf_aux_pfx); __func__, buf, peer, buf_aux_pfx);
rfapiItBiIndexDump (rn); rfapiItBiIndexDump (rn);
} }
@ -2325,7 +2325,7 @@ rfapiItBiIndexSearch (
if (sl->count < 3) if (sl->count < 3)
{ {
#if DEBUG_BI_SEARCH #if DEBUG_BI_SEARCH
zlog_debug ("%s: short list algorithm", __func__); vnc_zlog_debug_verbose ("%s: short list algorithm", __func__);
#endif #endif
/* if short list, linear search might be faster */ /* if short list, linear search might be faster */
for (bi_result = rn->info; bi_result; bi_result = bi_result->next) for (bi_result = rn->info; bi_result; bi_result = bi_result->next)
@ -2334,7 +2334,7 @@ rfapiItBiIndexSearch (
{ {
char buf[BUFSIZ]; char buf[BUFSIZ];
prefix_rd2str (&bi_result->extra->vnc.import.rd, buf, BUFSIZ); prefix_rd2str (&bi_result->extra->vnc.import.rd, buf, BUFSIZ);
zlog_debug ("%s: bi has prd=%s, peer=%p", __func__, vnc_zlog_debug_verbose ("%s: bi has prd=%s, peer=%p", __func__,
buf, bi_result->peer); buf, bi_result->peer);
} }
#endif #endif
@ -2344,7 +2344,7 @@ rfapiItBiIndexSearch (
{ {
#if DEBUG_BI_SEARCH #if DEBUG_BI_SEARCH
zlog_debug ("%s: peer and RD same, doing aux_prefix check", vnc_zlog_debug_verbose ("%s: peer and RD same, doing aux_prefix check",
__func__); __func__);
#endif #endif
if (!aux_prefix || if (!aux_prefix ||
@ -2353,7 +2353,7 @@ rfapiItBiIndexSearch (
{ {
#if DEBUG_BI_SEARCH #if DEBUG_BI_SEARCH
zlog_debug ("%s: match", __func__); vnc_zlog_debug_verbose ("%s: match", __func__);
#endif #endif
break; break;
} }
@ -2382,13 +2382,13 @@ rfapiItBiIndexSearch (
if (rc) if (rc)
{ {
#if DEBUG_BI_SEARCH #if DEBUG_BI_SEARCH
zlog_debug ("%s: no match", __func__); vnc_zlog_debug_verbose ("%s: no match", __func__);
#endif #endif
return NULL; return NULL;
} }
#if DEBUG_BI_SEARCH #if DEBUG_BI_SEARCH
zlog_debug ("%s: matched bi=%p", __func__, bi_result); vnc_zlog_debug_verbose ("%s: matched bi=%p", __func__, bi_result);
#endif #endif
return bi_result; return bi_result;
@ -2405,7 +2405,7 @@ rfapiItBiIndexDel (
{ {
char buf[BUFSIZ]; char buf[BUFSIZ];
prefix_rd2str (&bi->extra->vnc.import.rd, buf, BUFSIZ); prefix_rd2str (&bi->extra->vnc.import.rd, buf, BUFSIZ);
zlog_debug ("%s: bi %p, peer %p, rd %s", __func__, bi, bi->peer, buf); vnc_zlog_debug_verbose ("%s: bi %p, peer %p, rd %s", __func__, bi, bi->peer, buf);
} }
sl = RFAPI_RDINDEX (rn); sl = RFAPI_RDINDEX (rn);
@ -2459,7 +2459,7 @@ rfapiMonitorEncapAdd (
/* for easy lookup when deleting vpn route */ /* for easy lookup when deleting vpn route */
vpn_bi->extra->vnc.import.hme = m; vpn_bi->extra->vnc.import.hme = m;
zlog_debug vnc_zlog_debug_verbose
("%s: it=%p, vpn_bi=%p, afi=%d, encap rn=%p, setting vpn_bi->extra->vnc.import.hme=%p", ("%s: it=%p, vpn_bi=%p, afi=%d, encap rn=%p, setting vpn_bi->extra->vnc.import.hme=%p",
__func__, import_table, vpn_bi, afi, rn, m); __func__, import_table, vpn_bi, afi, rn, m);
@ -2472,7 +2472,7 @@ rfapiMonitorEncapDelete (struct bgp_info *vpn_bi)
/* /*
* Remove encap monitor * Remove encap monitor
*/ */
zlog_debug ("%s: vpn_bi=%p", __func__, vpn_bi); vnc_zlog_debug_verbose ("%s: vpn_bi=%p", __func__, vpn_bi);
if (vpn_bi->extra) if (vpn_bi->extra)
{ {
struct rfapi_monitor_encap *hme = vpn_bi->extra->vnc.import.hme; struct rfapi_monitor_encap *hme = vpn_bi->extra->vnc.import.hme;
@ -2480,7 +2480,7 @@ rfapiMonitorEncapDelete (struct bgp_info *vpn_bi)
if (hme) if (hme)
{ {
zlog_debug ("%s: hme=%p", __func__, hme); vnc_zlog_debug_verbose ("%s: hme=%p", __func__, hme);
/* Refcount checking takes too long here */ /* Refcount checking takes too long here */
//RFAPI_CHECK_REFCOUNT(hme->rn, SAFI_ENCAP, 0); //RFAPI_CHECK_REFCOUNT(hme->rn, SAFI_ENCAP, 0);
@ -2527,7 +2527,7 @@ rfapiWithdrawTimerVPN (struct thread *t)
{ {
char buf[BUFSIZ]; char buf[BUFSIZ];
zlog_debug ("%s: removing bi %p at prefix %s/%d", vnc_zlog_debug_verbose ("%s: removing bi %p at prefix %s/%d",
__func__, __func__,
bi, bi,
rfapi_ntop (wcb->node->p.family, &wcb->node->p.u.prefix, buf, rfapi_ntop (wcb->node->p.family, &wcb->node->p.u.prefix, buf,
@ -2576,7 +2576,7 @@ rfapiWithdrawTimerVPN (struct thread *t)
} }
} }
zlog_debug ("%s: has_valid_duplicate=%d", __func__, vnc_zlog_debug_verbose ("%s: has_valid_duplicate=%d", __func__,
has_valid_duplicate); has_valid_duplicate);
if (!has_valid_duplicate) if (!has_valid_duplicate)
@ -2593,7 +2593,7 @@ rfapiWithdrawTimerVPN (struct thread *t)
*/ */
if (!RFAPI_MONITOR_VPN (wcb->node)) if (!RFAPI_MONITOR_VPN (wcb->node))
{ {
zlog_debug ("%s: no VPN monitors at this node", __func__); vnc_zlog_debug_verbose ("%s: no VPN monitors at this node", __func__);
goto done; goto done;
} }
@ -2666,7 +2666,7 @@ rfapiNexthop2Prefix (struct attr *attr, struct prefix *p)
break; break;
default: default:
zlog_debug ("%s: Family is unknown = %d", vnc_zlog_debug_verbose ("%s: Family is unknown = %d",
__func__, p->family); __func__, p->family);
} }
} }
@ -2691,7 +2691,7 @@ rfapiAttrNexthopAddrDifferent (struct prefix *p1, struct prefix *p2)
{ {
if (!p1 || !p2) if (!p1 || !p2)
{ {
zlog_debug ("%s: p1 or p2 is NULL", __func__); vnc_zlog_debug_verbose ("%s: p1 or p2 is NULL", __func__);
return 1; return 1;
} }
@ -2751,10 +2751,10 @@ rfapiCopyUnEncap2VPN (struct bgp_info *encap_bi, struct bgp_info *vpn_bi)
/* /*
* instrumentation to debug segfault of 091127 * instrumentation to debug segfault of 091127
*/ */
zlog_debug ("%s: vpn_bi=%p", __func__, vpn_bi); vnc_zlog_debug_verbose ("%s: vpn_bi=%p", __func__, vpn_bi);
if (vpn_bi) if (vpn_bi)
{ {
zlog_debug ("%s: vpn_bi->extra=%p", __func__, vpn_bi->extra); vnc_zlog_debug_verbose ("%s: vpn_bi->extra=%p", __func__, vpn_bi->extra);
} }
vpn_bi->extra->vnc.import.un_family = AF_INET; vpn_bi->extra->vnc.import.un_family = AF_INET;
@ -2941,12 +2941,12 @@ rfapiBiStartWithdrawTimer (
* should already have a timer set up to * should already have a timer set up to
* delete it. * delete it.
*/ */
zlog_debug ("%s: already being withdrawn, do nothing", __func__); vnc_zlog_debug_verbose ("%s: already being withdrawn, do nothing", __func__);
return; return;
} }
rfapiGetVncLifetime (bi->attr, &lifetime); rfapiGetVncLifetime (bi->attr, &lifetime);
zlog_debug ("%s: VNC lifetime is %u", __func__, lifetime); vnc_zlog_debug_verbose ("%s: VNC lifetime is %u", __func__, lifetime);
/* /*
* withdrawn routes get to hang around for a while * withdrawn routes get to hang around for a while
@ -2955,7 +2955,7 @@ rfapiBiStartWithdrawTimer (
/* set timer to remove the route later */ /* set timer to remove the route later */
lifetime = rfapiGetHolddownFromLifetime (lifetime); lifetime = rfapiGetHolddownFromLifetime (lifetime);
zlog_debug ("%s: using timeout %u", __func__, lifetime); vnc_zlog_debug_verbose ("%s: using timeout %u", __func__, lifetime);
/* /*
* Stash import_table, node, and info for use by timer * Stash import_table, node, and info for use by timer
@ -2967,10 +2967,13 @@ rfapiBiStartWithdrawTimer (
wcb->info = bi; wcb->info = bi;
wcb->import_table = import_table; wcb->import_table = import_table;
zlog_debug if (VNC_DEBUG(VERBOSE))
("%s: wcb values: node=%p, info=%p, import_table=%p (bi follows)", {
__func__, wcb->node, wcb->info, wcb->import_table); vnc_zlog_debug_verbose
rfapiPrintBi (NULL, bi); ("%s: wcb values: node=%p, info=%p, import_table=%p (bi follows)",
__func__, wcb->node, wcb->info, wcb->import_table);
rfapiPrintBi (NULL, bi);
}
assert (bi->extra); assert (bi->extra);
@ -3059,7 +3062,7 @@ rfapiGetNexthop (struct attr *attr, struct prefix *prefix)
prefix->u.prefix6 = attr->extra->mp_nexthop_global; prefix->u.prefix6 = attr->extra->mp_nexthop_global;
break; break;
default: default:
zlog_debug ("%s: unknown attr->extra->mp_nexthop_len %d", __func__, vnc_zlog_debug_verbose ("%s: unknown attr->extra->mp_nexthop_len %d", __func__,
attr->extra->mp_nexthop_len); attr->extra->mp_nexthop_len);
return EINVAL; return EINVAL;
} }
@ -3117,7 +3120,7 @@ rfapiBgpInfoFilteredImportEncap (
break; break;
} }
zlog_debug ("%s: entry: %s: prefix %s/%d", __func__, vnc_zlog_debug_verbose ("%s: entry: %s: prefix %s/%d", __func__,
action_str, action_str,
inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ), p->prefixlen); inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ), p->prefixlen);
@ -3134,14 +3137,14 @@ rfapiBgpInfoFilteredImportEncap (
if (!attr || !attr->extra || !attr->extra->ecommunity) if (!attr || !attr->extra || !attr->extra->ecommunity)
{ {
zlog_debug ("%s: attr, extra, or ecommunity missing, not importing", vnc_zlog_debug_verbose ("%s: attr, extra, or ecommunity missing, not importing",
__func__); __func__);
return; return;
} }
#if RFAPI_REQUIRE_ENCAP_BEEC #if RFAPI_REQUIRE_ENCAP_BEEC
if (!rfapiEcommunitiesMatchBeec (attr->extra->ecommunity)) if (!rfapiEcommunitiesMatchBeec (attr->extra->ecommunity))
{ {
zlog_debug ("%s: it=%p: no match for BGP Encapsulation ecommunity", vnc_zlog_debug_verbose ("%s: it=%p: no match for BGP Encapsulation ecommunity",
__func__, import_table); __func__, import_table);
return; return;
} }
@ -3150,7 +3153,7 @@ rfapiBgpInfoFilteredImportEncap (
attr->extra->ecommunity)) attr->extra->ecommunity))
{ {
zlog_debug ("%s: it=%p: no ecommunity intersection", vnc_zlog_debug_verbose ("%s: it=%p: no ecommunity intersection",
__func__, import_table); __func__, import_table);
return; return;
} }
@ -3161,7 +3164,7 @@ rfapiBgpInfoFilteredImportEncap (
memset (&un_prefix, 0, sizeof (un_prefix)); /* keep valgrind happy */ memset (&un_prefix, 0, sizeof (un_prefix)); /* keep valgrind happy */
if (rfapiGetNexthop (attr, &un_prefix)) if (rfapiGetNexthop (attr, &un_prefix))
{ {
zlog_debug ("%s: missing nexthop address", __func__); vnc_zlog_debug_verbose ("%s: missing nexthop address", __func__);
return; return;
} }
} }
@ -3188,7 +3191,7 @@ rfapiBgpInfoFilteredImportEncap (
rn = route_node_lookup (rt, p); rn = route_node_lookup (rt, p);
#if DEBUG_ENCAP_MONITOR #if DEBUG_ENCAP_MONITOR
zlog_debug ("%s: initial encap lookup (it=%p) rn=%p", vnc_zlog_debug_verbose ("%s: initial encap lookup (it=%p) rn=%p",
__func__, import_table, rn); __func__, import_table, rn);
#endif #endif
@ -3215,7 +3218,7 @@ rfapiBgpInfoFilteredImportEncap (
* Does this bgp_info refer to the same route * Does this bgp_info refer to the same route
* as we are trying to add? * as we are trying to add?
*/ */
zlog_debug ("%s: comparing BI %p", __func__, bi); vnc_zlog_debug_verbose ("%s: comparing BI %p", __func__, bi);
/* /*
@ -3226,14 +3229,14 @@ rfapiBgpInfoFilteredImportEncap (
*/ */
if (!bi->extra) if (!bi->extra)
{ {
zlog_debug ("%s: no bi->extra", __func__); vnc_zlog_debug_verbose ("%s: no bi->extra", __func__);
continue; continue;
} }
if (prefix_cmp ((struct prefix *) &bi->extra->vnc.import.rd, if (prefix_cmp ((struct prefix *) &bi->extra->vnc.import.rd,
(struct prefix *) prd)) (struct prefix *) prd))
{ {
zlog_debug ("%s: prd does not match", __func__); vnc_zlog_debug_verbose ("%s: prd does not match", __func__);
continue; continue;
} }
@ -3242,18 +3245,18 @@ rfapiBgpInfoFilteredImportEncap (
*/ */
if (bi->peer != peer) if (bi->peer != peer)
{ {
zlog_debug ("%s: peer does not match", __func__); vnc_zlog_debug_verbose ("%s: peer does not match", __func__);
continue; continue;
} }
zlog_debug ("%s: found matching bi", __func__); vnc_zlog_debug_verbose ("%s: found matching bi", __func__);
/* Same route. Delete this bi, replace with new one */ /* Same route. Delete this bi, replace with new one */
if (action == FIF_ACTION_WITHDRAW) if (action == FIF_ACTION_WITHDRAW)
{ {
zlog_debug ("%s: withdrawing at prefix %s/%d", vnc_zlog_debug_verbose ("%s: withdrawing at prefix %s/%d",
__func__, __func__,
inet_ntop (rn->p.family, &rn->p.u.prefix, buf, inet_ntop (rn->p.family, &rn->p.u.prefix, buf,
BUFSIZ), rn->p.prefixlen); BUFSIZ), rn->p.prefixlen);
@ -3265,7 +3268,7 @@ rfapiBgpInfoFilteredImportEncap (
} }
else else
{ {
zlog_debug ("%s: %s at prefix %s/%d", vnc_zlog_debug_verbose ("%s: %s at prefix %s/%d",
__func__, __func__,
((action == ((action ==
FIF_ACTION_KILL) ? "killing" : "replacing"), FIF_ACTION_KILL) ? "killing" : "replacing"),
@ -3339,7 +3342,7 @@ rfapiBgpInfoFilteredImportEncap (
rn = route_node_get (rt, p); rn = route_node_get (rt, p);
} }
zlog_debug ("%s: (afi=%d, rn=%p) inserting at prefix %s/%d", vnc_zlog_debug_verbose ("%s: (afi=%d, rn=%p) inserting at prefix %s/%d",
__func__, __func__,
afi, afi,
rn, rn,
@ -3377,7 +3380,7 @@ rfapiBgpInfoFilteredImportEncap (
if (!un_match) if (!un_match)
continue; continue;
zlog_debug ("%s: removing holddown bi matching NVE of new route", vnc_zlog_debug_verbose ("%s: removing holddown bi matching NVE of new route",
__func__); __func__);
if (bi->extra->vnc.import.timer) if (bi->extra->vnc.import.timer)
{ {
@ -3425,7 +3428,7 @@ rfapiBgpInfoFilteredImportEncap (
* iterate over the set of monitors at this ENCAP node. * iterate over the set of monitors at this ENCAP node.
*/ */
#if DEBUG_ENCAP_MONITOR #if DEBUG_ENCAP_MONITOR
zlog_debug ("%s: examining monitors at rn=%p", __func__, rn); vnc_zlog_debug_verbose ("%s: examining monitors at rn=%p", __func__, rn);
#endif #endif
for (m = RFAPI_MONITOR_ENCAP (rn); m; m = m->next) for (m = RFAPI_MONITOR_ENCAP (rn); m; m = m->next)
{ {
@ -3598,7 +3601,7 @@ rfapiBgpInfoFilteredImportVPN (
if (import_table == bgp->rfapi->it_ce) if (import_table == bgp->rfapi->it_ce)
is_it_ce = 1; is_it_ce = 1;
zlog_debug ("%s: entry: %s%s: prefix %s/%d: it %p, afi %s", __func__, vnc_zlog_debug_verbose ("%s: entry: %s%s: prefix %s/%d: it %p, afi %s", __func__,
(is_it_ce ? "CE-IT " : ""), (is_it_ce ? "CE-IT " : ""),
action_str, action_str,
rfapi_ntop (p->family, &p->u.prefix, buf, BUFSIZ), rfapi_ntop (p->family, &p->u.prefix, buf, BUFSIZ),
@ -3616,7 +3619,7 @@ rfapiBgpInfoFilteredImportVPN (
if (!attr || !attr->extra || !attr->extra->ecommunity) if (!attr || !attr->extra || !attr->extra->ecommunity)
{ {
zlog_debug ("%s: attr, extra, or ecommunity missing, not importing", vnc_zlog_debug_verbose ("%s: attr, extra, or ecommunity missing, not importing",
__func__); __func__);
return; return;
} }
@ -3625,7 +3628,7 @@ rfapiBgpInfoFilteredImportVPN (
attr->extra->ecommunity)) attr->extra->ecommunity))
{ {
zlog_debug ("%s: it=%p: no ecommunity intersection", vnc_zlog_debug_verbose ("%s: it=%p: no ecommunity intersection",
__func__, import_table); __func__, import_table);
return; return;
} }
@ -3634,7 +3637,7 @@ rfapiBgpInfoFilteredImportVPN (
if (rfapiGetNexthop (attr, &vn_prefix)) if (rfapiGetNexthop (attr, &vn_prefix))
{ {
/* missing nexthop address would be a bad, bad thing */ /* missing nexthop address would be a bad, bad thing */
zlog_debug ("%s: missing nexthop", __func__); vnc_zlog_debug_verbose ("%s: missing nexthop", __func__);
return; return;
} }
} }
@ -3664,7 +3667,7 @@ rfapiBgpInfoFilteredImportVPN (
*/ */
rn = route_node_lookup (rt, p); rn = route_node_lookup (rt, p);
zlog_debug ("%s: rn=%p", __func__, rn); vnc_zlog_debug_verbose ("%s: rn=%p", __func__, rn);
if (rn) if (rn)
{ {
@ -3694,7 +3697,7 @@ rfapiBgpInfoFilteredImportVPN (
*/ */
assert (bi->type == type); assert (bi->type == type);
zlog_debug ("%s: found matching bi", __func__); vnc_zlog_debug_verbose ("%s: found matching bi", __func__);
/* /*
* In the special CE table, withdrawals occur without holddown * In the special CE table, withdrawals occur without holddown
@ -3711,7 +3714,7 @@ rfapiBgpInfoFilteredImportVPN (
int washolddown = CHECK_FLAG (bi->flags, BGP_INFO_REMOVED); int washolddown = CHECK_FLAG (bi->flags, BGP_INFO_REMOVED);
zlog_debug ("%s: withdrawing at prefix %s/%d%s", vnc_zlog_debug_verbose ("%s: withdrawing at prefix %s/%d%s",
__func__, __func__,
rfapi_ntop (rn->p.family, &rn->p.u.prefix, buf, rfapi_ntop (rn->p.family, &rn->p.u.prefix, buf,
BUFSIZ), rn->p.prefixlen, BUFSIZ), rn->p.prefixlen,
@ -3731,7 +3734,7 @@ rfapiBgpInfoFilteredImportVPN (
} }
else else
{ {
zlog_debug ("%s: %s at prefix %s/%d", vnc_zlog_debug_verbose ("%s: %s at prefix %s/%d",
__func__, __func__,
((action == ((action ==
FIF_ACTION_KILL) ? "killing" : "replacing"), FIF_ACTION_KILL) ? "killing" : "replacing"),
@ -3825,7 +3828,7 @@ rfapiBgpInfoFilteredImportVPN (
prefix2str (&vn_prefix, buf, sizeof (buf)); prefix2str (&vn_prefix, buf, sizeof (buf));
buf[BUFSIZ - 1] = 0; buf[BUFSIZ - 1] = 0;
/* Not a big deal, just means VPN route got here first */ /* Not a big deal, just means VPN route got here first */
zlog_debug ("%s: no encap route for vn addr %s", __func__, buf); vnc_zlog_debug_verbose ("%s: no encap route for vn addr %s", __func__, buf);
info_new->extra->vnc.import.un_family = 0; info_new->extra->vnc.import.un_family = 0;
} }
@ -3850,11 +3853,11 @@ rfapiBgpInfoFilteredImportVPN (
if ((AFI_ETHER == afi) && aux_prefix) if ((AFI_ETHER == afi) && aux_prefix)
{ {
zlog_debug ("%s: setting BI's aux_prefix", __func__); vnc_zlog_debug_verbose ("%s: setting BI's aux_prefix", __func__);
info_new->extra->vnc.import.aux_prefix = *aux_prefix; info_new->extra->vnc.import.aux_prefix = *aux_prefix;
} }
zlog_debug ("%s: inserting bi %p at prefix %s/%d #%d", vnc_zlog_debug_verbose ("%s: inserting bi %p at prefix %s/%d #%d",
__func__, __func__,
info_new, info_new,
rfapi_ntop (rn->p.family, &rn->p.u.prefix, buf, BUFSIZ), rfapi_ntop (rn->p.family, &rn->p.u.prefix, buf, BUFSIZ),
@ -3875,8 +3878,11 @@ rfapiBgpInfoFilteredImportVPN (
if (import_table == bgp->rfapi->it_ce) if (import_table == bgp->rfapi->it_ce)
vnc_direct_bgp_add_route_ce (bgp, rn, info_new); vnc_direct_bgp_add_route_ce (bgp, rn, info_new);
zlog_debug ("%s: showing IT node", __func__); if (VNC_DEBUG(VERBOSE))
rfapiShowItNode (NULL, rn); /* debug */ {
vnc_zlog_debug_verbose ("%s: showing IT node", __func__);
rfapiShowItNode (NULL, rn); /* debug */
}
rfapiMonitorEncapAdd (import_table, &vn_prefix, rn, info_new); rfapiMonitorEncapAdd (import_table, &vn_prefix, rn, info_new);
@ -3970,7 +3976,7 @@ rfapiBgpInfoFilteredImportVPN (
if (!un_match & !remote_peer_match) if (!un_match & !remote_peer_match)
continue; continue;
zlog_debug ("%s: removing holddown bi matching NVE of new route", vnc_zlog_debug_verbose ("%s: removing holddown bi matching NVE of new route",
__func__); __func__);
if (bi->extra->vnc.import.timer) if (bi->extra->vnc.import.timer)
{ {
@ -4100,7 +4106,7 @@ rfapiProcessUpdate (
*/ */
rc = rfapiEcommunityGetLNI (attr->extra->ecommunity, &lni); rc = rfapiEcommunityGetLNI (attr->extra->ecommunity, &lni);
zlog_debug vnc_zlog_debug_verbose
("%s: rfapiEcommunityGetLNI returned %d, lni=%d, attr=%p, attr->extra=%p", ("%s: rfapiEcommunityGetLNI returned %d, lni=%d, attr=%p, attr->extra=%p",
__func__, rc, lni, attr, attr->extra); __func__, rc, lni, attr, attr->extra);
if (attr && attr->extra && !rc) if (attr && attr->extra && !rc)
@ -4226,7 +4232,7 @@ rfapiProcessWithdraw (
{ {
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug vnc_zlog_debug_verbose
("%s: calling rfapiBgpInfoFilteredImportVPN(it=%p, afi=AFI_ETHER)", ("%s: calling rfapiBgpInfoFilteredImportVPN(it=%p, afi=AFI_ETHER)",
__func__, it); __func__, it);
#endif #endif
@ -4608,7 +4614,7 @@ rfapiImportTableRefAdd (struct bgp *bgp, struct ecommunity *rt_import_list)
break; break;
} }
zlog_debug ("%s: matched it=%p", __func__, it); vnc_zlog_debug_verbose ("%s: matched it=%p", __func__, it);
if (!it) if (!it)
{ {
@ -4696,7 +4702,7 @@ rfapiDeleteRemotePrefixesIt (
buf_pfx[1] = 0; buf_pfx[1] = 0;
} }
zlog_debug ("%s: entry, p=%s, delete_active=%d, delete_holddown=%d", vnc_zlog_debug_verbose ("%s: entry, p=%s, delete_active=%d, delete_holddown=%d",
__func__, buf_pfx, delete_active, delete_holddown); __func__, buf_pfx, delete_active, delete_holddown);
} }
#endif #endif
@ -4716,7 +4722,7 @@ rfapiDeleteRemotePrefixesIt (
if (!rt) if (!rt)
continue; continue;
zlog_debug ("%s: scanning rt for afi=%d", __func__, afi); vnc_zlog_debug_verbose ("%s: scanning rt for afi=%d", __func__, afi);
for (rn = route_top (rt); rn; rn = route_next (rn)) for (rn = route_top (rt); rn; rn = route_next (rn))
{ {
@ -4730,7 +4736,7 @@ rfapiDeleteRemotePrefixesIt (
prefix2str (p, p1line, BUFSIZ); prefix2str (p, p1line, BUFSIZ);
prefix2str (&rn->p, p2line, BUFSIZ); prefix2str (&rn->p, p2line, BUFSIZ);
zlog_debug ("%s: want %s, have %s", __func__, p1line, p2line); vnc_zlog_debug_any ("%s: want %s, have %s", __func__, p1line, p2line);
} }
if (p && prefix_cmp (p, &rn->p)) if (p && prefix_cmp (p, &rn->p))
@ -4739,7 +4745,7 @@ rfapiDeleteRemotePrefixesIt (
{ {
char buf_pfx[BUFSIZ]; char buf_pfx[BUFSIZ];
prefix2str (&rn->p, buf_pfx, BUFSIZ); prefix2str (&rn->p, buf_pfx, BUFSIZ);
zlog_debug ("%s: rn pfx=%s", __func__, buf_pfx); vnc_zlog_debug_verbose ("%s: rn pfx=%s", __func__, buf_pfx);
} }
/* TBD is this valid for afi == AFI_ETHER? */ /* TBD is this valid for afi == AFI_ETHER? */
@ -4755,7 +4761,7 @@ rfapiDeleteRemotePrefixesIt (
int qct_valid = 0; int qct_valid = 0;
int is_active = 0; int is_active = 0;
zlog_debug ("%s: examining bi %p", __func__, bi); vnc_zlog_debug_verbose ("%s: examining bi %p", __func__, bi);
if (bi->attr) if (bi->attr)
{ {
@ -4767,7 +4773,7 @@ rfapiDeleteRemotePrefixesIt (
if (!qpt_valid || !prefix_match (vn, &qpt)) if (!qpt_valid || !prefix_match (vn, &qpt))
{ {
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug vnc_zlog_debug_verbose
("%s: continue at vn && !qpt_valid || !prefix_match(vn, &qpt)", ("%s: continue at vn && !qpt_valid || !prefix_match(vn, &qpt)",
__func__); __func__);
#endif #endif
@ -4783,7 +4789,7 @@ rfapiDeleteRemotePrefixesIt (
if (!qct_valid || !prefix_match (un, &qct)) if (!qct_valid || !prefix_match (un, &qct))
{ {
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug vnc_zlog_debug_verbose
("%s: continue at un && !qct_valid || !prefix_match(un, &qct)", ("%s: continue at un && !qct_valid || !prefix_match(un, &qct)",
__func__); __func__);
#endif #endif
@ -4824,7 +4830,7 @@ rfapiDeleteRemotePrefixesIt (
is_active = 1; is_active = 1;
} }
zlog_debug vnc_zlog_debug_verbose
("%s: deleting bi %p (qct_valid=%d, qpt_valid=%d, delete_holddown=%d, delete_active=%d)", ("%s: deleting bi %p (qct_valid=%d, qpt_valid=%d, delete_holddown=%d, delete_active=%d)",
__func__, bi, qct_valid, qpt_valid, delete_holddown, __func__, bi, qct_valid, qpt_valid, delete_holddown,
delete_active); delete_active);
@ -4867,7 +4873,7 @@ rfapiDeleteRemotePrefixesIt (
it->holddown_count[afi] += 1; it->holddown_count[afi] += 1;
rfapiExpireVpnNow (it, rn, bi, 1); rfapiExpireVpnNow (it, rn, bi, 1);
zlog_debug ("%s: incrementing count (is_active=%d)", vnc_zlog_debug_verbose ("%s: incrementing count (is_active=%d)",
__func__, is_active); __func__, is_active);
if (is_active) if (is_active)
@ -4947,7 +4953,7 @@ rfapiDeleteRemotePrefixes (
for (it = h->imports; it; it = it->next) for (it = h->imports; it; it = it->next)
{ {
zlog_debug vnc_zlog_debug_verbose
("%s: calling rfapiDeleteRemotePrefixesIt() on (IP) import %p", ("%s: calling rfapiDeleteRemotePrefixesIt() on (IP) import %p",
__func__, it); __func__, it);
@ -4982,7 +4988,7 @@ rfapiDeleteRemotePrefixes (
rc = skiplist_next (h->import_mac, NULL, (void **) &it, &cursor)) rc = skiplist_next (h->import_mac, NULL, (void **) &it, &cursor))
{ {
zlog_debug vnc_zlog_debug_verbose
("%s: calling rfapiDeleteRemotePrefixesIt() on import_mac %p", ("%s: calling rfapiDeleteRemotePrefixesIt() on import_mac %p",
__func__, it); __func__, it);

View File

@ -49,6 +49,7 @@
#include "bgpd/rfapi/rfapi_monitor.h" #include "bgpd/rfapi/rfapi_monitor.h"
#include "bgpd/rfapi/rfapi_vty.h" #include "bgpd/rfapi/rfapi_vty.h"
#include "bgpd/rfapi/rfapi_rib.h" #include "bgpd/rfapi/rfapi_rib.h"
#include "bgpd/rfapi/vnc_debug.h"
#define DEBUG_L2_EXTRA 0 #define DEBUG_L2_EXTRA 0
#define DEBUG_DUP_CHECK 0 #define DEBUG_DUP_CHECK 0
@ -92,7 +93,7 @@ rfapiMonitorEthSlCheck(
sl = RFAPI_MONITOR_ETH(rn); sl = RFAPI_MONITOR_ETH(rn);
if (sl || sl_saved) if (sl || sl_saved)
{ {
zlog_debug("%s[%s%s]: rn=%p, rn->lock=%d, old sl=%p, new sl=%p", vnc_zlog_debug_verbose("%s[%s%s]: rn=%p, rn->lock=%d, old sl=%p, new sl=%p",
__func__, (tag1? tag1: ""), (tag2? tag2: ""), rn, rn->lock, __func__, (tag1? tag1: ""), (tag2? tag2: ""), rn, rn->lock,
sl_saved, sl); sl_saved, sl);
sl_saved = sl; sl_saved = sl;
@ -450,7 +451,7 @@ rfapiMonitorAttachImport (struct rfapi_descriptor *rfd,
m->next = rfd->import_table->vpn0_queries[afi]; m->next = rfd->import_table->vpn0_queries[afi];
rfd->import_table->vpn0_queries[afi] = m; rfd->import_table->vpn0_queries[afi] = m;
zlog_debug ("%s: attached monitor %p to vpn0 list", __func__, m); vnc_zlog_debug_verbose ("%s: attached monitor %p to vpn0 list", __func__, m);
return NULL; return NULL;
} }
@ -462,7 +463,7 @@ rfapiMonitorAttachImport (struct rfapi_descriptor *rfd,
m->next = RFAPI_MONITOR_VPN (rn); m->next = RFAPI_MONITOR_VPN (rn);
RFAPI_MONITOR_VPN_W_ALLOC (rn) = m; RFAPI_MONITOR_VPN_W_ALLOC (rn) = m;
RFAPI_CHECK_REFCOUNT (rn, SAFI_MPLS_VPN, 0); RFAPI_CHECK_REFCOUNT (rn, SAFI_MPLS_VPN, 0);
zlog_debug ("%s: attached monitor %p to rn %p", __func__, m, rn); vnc_zlog_debug_verbose ("%s: attached monitor %p to rn %p", __func__, m, rn);
return rn; return rn;
} }
@ -707,7 +708,7 @@ rfapiMonitorDelHd (struct rfapi_descriptor *rfd)
struct bgp *bgp; struct bgp *bgp;
int count = 0; int count = 0;
zlog_debug ("%s: entry rfd=%p", __func__, rfd); vnc_zlog_debug_verbose ("%s: entry rfd=%p", __func__, rfd);
bgp = bgp_get_default (); bgp = bgp_get_default ();
@ -758,7 +759,7 @@ rfapiMonitorDelHd (struct rfapi_descriptor *rfd)
else else
{ {
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug vnc_zlog_debug_verbose
("%s: callbacks disabled, not attempting to detach mon_eth %p", ("%s: callbacks disabled, not attempting to detach mon_eth %p",
__func__, mon_eth); __func__, mon_eth);
#endif #endif
@ -776,7 +777,7 @@ rfapiMonitorDelHd (struct rfapi_descriptor *rfd)
rc = skiplist_delete (rfd->mon_eth, mon_eth, mon_eth); rc = skiplist_delete (rfd->mon_eth, mon_eth, mon_eth);
assert (!rc); assert (!rc);
zlog_debug ("%s: freeing mon_eth %p", __func__, mon_eth); vnc_zlog_debug_verbose ("%s: freeing mon_eth %p", __func__, mon_eth);
XFREE (MTYPE_RFAPI_MONITOR_ETH, mon_eth); XFREE (MTYPE_RFAPI_MONITOR_ETH, mon_eth);
++count; ++count;
@ -847,7 +848,7 @@ rfapiMonitorTimerRestart (struct rfapi_monitor_vpn *m)
{ {
char buf[BUFSIZ]; char buf[BUFSIZ];
zlog_debug ("%s: target %s life %u", __func__, vnc_zlog_debug_verbose ("%s: target %s life %u", __func__,
rfapi_ntop (m->p.family, m->p.u.val, buf, BUFSIZ), rfapi_ntop (m->p.family, m->p.u.val, buf, BUFSIZ),
m->rfd->response_lifetime); m->rfd->response_lifetime);
} }
@ -936,7 +937,7 @@ rfapiMonitorItNodeChanged (
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
prefix2str (&it_node->p, buf_prefix, BUFSIZ); prefix2str (&it_node->p, buf_prefix, BUFSIZ);
zlog_debug ("%s: it=%p, it_node=%p, it_node->prefix=%s", vnc_zlog_debug_verbose ("%s: it=%p, it_node=%p, it_node->prefix=%s",
__func__, import_table, it_node, buf_prefix); __func__, import_table, it_node, buf_prefix);
#endif #endif
@ -1021,7 +1022,7 @@ rfapiMonitorItNodeChanged (
prefix2str (&m->node->p, buf_attach_pfx, BUFSIZ); prefix2str (&m->node->p, buf_attach_pfx, BUFSIZ);
prefix2str (&m->p, buf_target_pfx, BUFSIZ); prefix2str (&m->p, buf_target_pfx, BUFSIZ);
zlog_debug vnc_zlog_debug_verbose
("%s: update rfd %p attached to pfx %s (targ=%s)", ("%s: update rfd %p attached to pfx %s (targ=%s)",
__func__, m->rfd, buf_attach_pfx, buf_target_pfx); __func__, m->rfd, buf_attach_pfx, buf_target_pfx);
} }
@ -1048,13 +1049,13 @@ rfapiMonitorItNodeChanged (
struct rfapi_monitor_eth *e; struct rfapi_monitor_eth *e;
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: checking L2 all-routes monitors", __func__); vnc_zlog_debug_verbose ("%s: checking L2 all-routes monitors", __func__);
#endif #endif
for (e = import_table->eth0_queries; e; e = e->next) for (e = import_table->eth0_queries; e; e = e->next)
{ {
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: checking eth0 mon=%p", __func__, e); vnc_zlog_debug_verbose ("%s: checking eth0 mon=%p", __func__, e);
#endif #endif
if (skiplist_search (nves_seen, e->rfd, NULL)) if (skiplist_search (nves_seen, e->rfd, NULL))
{ {
@ -1067,7 +1068,7 @@ rfapiMonitorItNodeChanged (
* update its RIB * update its RIB
*/ */
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: found L2 all-routes monitor %p", __func__, e); vnc_zlog_debug_verbose ("%s: found L2 all-routes monitor %p", __func__, e);
#endif #endif
rfapiRibUpdatePendingNode (bgp, e->rfd, import_table, it_node, rfapiRibUpdatePendingNode (bgp, e->rfd, import_table, it_node,
e->rfd->response_lifetime); e->rfd->response_lifetime);
@ -1127,7 +1128,7 @@ rfapiMonitorMovedUp (
*/ */
if (!new_node->parent && !new_node->info) if (!new_node->parent && !new_node->info)
{ {
zlog_debug ("%s: new monitor at 0/0 and no routes, no updates", vnc_zlog_debug_verbose ("%s: new monitor at 0/0 and no routes, no updates",
__func__); __func__);
return; return;
} }
@ -1178,7 +1179,7 @@ rfapiMonitorEthTimerRestart (struct rfapi_monitor_eth *m)
{ {
char buf[BUFSIZ]; char buf[BUFSIZ];
zlog_debug ("%s: target %s life %u", __func__, vnc_zlog_debug_verbose ("%s: target %s life %u", __func__,
rfapiEthAddr2Str (&m->macaddr, buf, BUFSIZ), rfapiEthAddr2Str (&m->macaddr, buf, BUFSIZ),
m->rfd->response_lifetime); m->rfd->response_lifetime);
} }
@ -1221,7 +1222,7 @@ rfapiMonitorEthAttachImport (
struct skiplist *sl; struct skiplist *sl;
int rc; int rc;
zlog_debug ("%s: it=%p", __func__, it); vnc_zlog_debug_verbose ("%s: it=%p", __func__, it);
rfapiMonitorCheckAttachAllowed (); rfapiMonitorCheckAttachAllowed ();
@ -1233,7 +1234,7 @@ rfapiMonitorEthAttachImport (
mon->next = it->eth0_queries; mon->next = it->eth0_queries;
it->eth0_queries = mon; it->eth0_queries = mon;
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: attached monitor %p to eth0 list", __func__, mon); vnc_zlog_debug_verbose ("%s: attached monitor %p to eth0 list", __func__, mon);
#endif #endif
return; return;
} }
@ -1241,7 +1242,7 @@ rfapiMonitorEthAttachImport (
if (rn == NULL) if (rn == NULL)
{ {
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: rn is null!", __func__); vnc_zlog_debug_verbose ("%s: rn is null!", __func__);
#endif #endif
return; return;
} }
@ -1257,7 +1258,7 @@ rfapiMonitorEthAttachImport (
} }
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: rn=%p, rn->lock=%d, sl=%p, attaching eth mon %p", vnc_zlog_debug_verbose ("%s: rn=%p, rn->lock=%d, sl=%p, attaching eth mon %p",
__func__, rn, rn->lock, sl, mon); __func__, rn, rn->lock, sl, mon);
#endif #endif
@ -1349,7 +1350,7 @@ rfapiMonitorEthDetachImport (
} }
} }
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: it=%p, LNI=%d, detached eth0 mon %p", vnc_zlog_debug_verbose ("%s: it=%p, LNI=%d, detached eth0 mon %p",
__func__, it, mon->logical_net_id, mon); __func__, it, mon->logical_net_id, mon);
#endif #endif
return; return;
@ -1373,7 +1374,7 @@ rfapiMonitorEthDetachImport (
*/ */
sl = RFAPI_MONITOR_ETH (rn); sl = RFAPI_MONITOR_ETH (rn);
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: it=%p, rn=%p, rn->lock=%d, sl=%p, pfx=%s, LNI=%d, detaching eth mon %p", vnc_zlog_debug_verbose ("%s: it=%p, rn=%p, rn->lock=%d, sl=%p, pfx=%s, LNI=%d, detaching eth mon %p",
__func__, it, rn, rn->lock, sl, buf_prefix, mon->logical_net_id, mon); __func__, it, rn, rn->lock, sl, buf_prefix, mon->logical_net_id, mon);
#endif #endif
assert (sl); assert (sl);
@ -1434,7 +1435,7 @@ rfapiMonitorEthAdd (
{ {
char buf[BUFSIZ]; char buf[BUFSIZ];
zlog_debug ("%s: LNI=%d: rfd=%p, pfx=%s", vnc_zlog_debug_verbose ("%s: LNI=%d: rfd=%p, pfx=%s",
__func__, logical_net_id, rfd, __func__, logical_net_id, rfd,
rfapi_ntop (pfx_mac_buf.family, pfx_mac_buf.u.val, buf, rfapi_ntop (pfx_mac_buf.family, pfx_mac_buf.u.val, buf,
BUFSIZ)); BUFSIZ));
@ -1451,7 +1452,7 @@ rfapiMonitorEthAdd (
* Found monitor - we have seen this query before * Found monitor - we have seen this query before
* restart timer * restart timer
*/ */
zlog_debug ("%s: already present in rfd->mon_eth, not adding", vnc_zlog_debug_verbose ("%s: already present in rfd->mon_eth, not adding",
__func__); __func__);
rfapiMonitorEthTimerRestart (val); rfapiMonitorEthTimerRestart (val);
return rn; return rn;
@ -1470,7 +1471,7 @@ rfapiMonitorEthAdd (
rc = skiplist_insert (rfd->mon_eth, val, val); rc = skiplist_insert (rfd->mon_eth, val, val);
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: inserted rfd=%p mon_eth=%p, rc=%d", __func__, rfd, val, vnc_zlog_debug_verbose ("%s: inserted rfd=%p mon_eth=%p, rc=%d", __func__, rfd, val,
rc); rc);
#endif #endif
@ -1485,7 +1486,7 @@ rfapiMonitorEthAdd (
* callbacks turned off, so don't attach monitor to import table * callbacks turned off, so don't attach monitor to import table
*/ */
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug vnc_zlog_debug_verbose
("%s: callbacks turned off, not attaching mon_eth %p to import table", ("%s: callbacks turned off, not attaching mon_eth %p to import table",
__func__, val); __func__, val);
#endif #endif
@ -1511,7 +1512,7 @@ rfapiMonitorEthDel (
struct rfapi_monitor_eth mon_buf; struct rfapi_monitor_eth mon_buf;
int rc; int rc;
zlog_debug ("%s: entry rfd=%p", __func__, rfd); vnc_zlog_debug_verbose ("%s: entry rfd=%p", __func__, rfd);
assert (rfd->mon_eth); assert (rfd->mon_eth);
@ -1543,7 +1544,7 @@ rfapiMonitorEthDel (
assert (!rc); assert (!rc);
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: freeing mon_eth %p", __func__, val); vnc_zlog_debug_verbose ("%s: freeing mon_eth %p", __func__, val);
#endif #endif
XFREE (MTYPE_RFAPI_MONITOR_ETH, val); XFREE (MTYPE_RFAPI_MONITOR_ETH, val);
@ -1573,7 +1574,7 @@ rfapiMonitorCallbacksOff (struct bgp *bgp)
bgp->rfapi_cfg->flags |= BGP_VNC_CONFIG_CALLBACK_DISABLE; bgp->rfapi_cfg->flags |= BGP_VNC_CONFIG_CALLBACK_DISABLE;
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: turned off callbacks", __func__); vnc_zlog_debug_verbose ("%s: turned off callbacks", __func__);
#endif #endif
if (h == NULL) if (h == NULL)
@ -1656,7 +1657,7 @@ rfapiMonitorCallbacksOff (struct bgp *bgp)
for (e = it->eth0_queries; e; e = enext) for (e = it->eth0_queries; e; e = enext)
{ {
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: detaching eth0 mon %p", __func__, e); vnc_zlog_debug_verbose ("%s: detaching eth0 mon %p", __func__, e);
#endif #endif
enext = e->next; enext = e->next;
e->next = NULL; /* gratuitous safeness */ e->next = NULL; /* gratuitous safeness */
@ -1684,7 +1685,7 @@ rfapiMonitorCallbacksOn (struct bgp *bgp)
} }
bgp->rfapi_cfg->flags &= ~BGP_VNC_CONFIG_CALLBACK_DISABLE; bgp->rfapi_cfg->flags &= ~BGP_VNC_CONFIG_CALLBACK_DISABLE;
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: turned on callbacks", __func__); vnc_zlog_debug_verbose ("%s: turned on callbacks", __func__);
#endif #endif
if (bgp->rfapi == NULL) if (bgp->rfapi == NULL)
return; return;

View File

@ -38,6 +38,7 @@
#include "bgpd/rfapi/rfapi_private.h" #include "bgpd/rfapi/rfapi_private.h"
#include "bgpd/rfapi/rfapi_nve_addr.h" #include "bgpd/rfapi/rfapi_nve_addr.h"
#include "bgpd/rfapi/rfapi_vty.h" #include "bgpd/rfapi/rfapi_vty.h"
#include "bgpd/rfapi/vnc_debug.h"
#define DEBUG_NVE_ADDR 0 #define DEBUG_NVE_ADDR 0
@ -54,7 +55,7 @@ logdifferent (const char *tag,
rfapiNveAddr2Str (a, a_str, BUFSIZ); rfapiNveAddr2Str (a, a_str, BUFSIZ);
rfapiNveAddr2Str (b, b_str, BUFSIZ); rfapiNveAddr2Str (b, b_str, BUFSIZ);
zlog_debug ("%s: [%s] [%s]", tag, a_str, b_str); vnc_zlog_debug_verbose ("%s: [%s] [%s]", tag, a_str, b_str);
} }
#endif #endif
@ -69,14 +70,14 @@ rfapi_nve_addr_cmp (void *k1, void *k2)
if (!a || !b) if (!a || !b)
{ {
#if DEBUG_NVE_ADDR #if DEBUG_NVE_ADDR
zlog_debug ("%s: missing address a=%p b=%p", __func__, a, b); vnc_zlog_debug_verbose ("%s: missing address a=%p b=%p", __func__, a, b);
#endif #endif
return (a - b); return (a - b);
} }
if (a->un.addr_family != b->un.addr_family) if (a->un.addr_family != b->un.addr_family)
{ {
#if DEBUG_NVE_ADDR #if DEBUG_NVE_ADDR
zlog_debug ("diff: UN addr fam a->un.af=%d, b->un.af=%d", vnc_zlog_debug_verbose ("diff: UN addr fam a->un.af=%d, b->un.af=%d",
a->un.addr_family, b->un.addr_family); a->un.addr_family, b->un.addr_family);
#endif #endif
return (a->un.addr_family - b->un.addr_family); return (a->un.addr_family - b->un.addr_family);
@ -110,7 +111,7 @@ rfapi_nve_addr_cmp (void *k1, void *k2)
if (a->vn.addr_family != b->vn.addr_family) if (a->vn.addr_family != b->vn.addr_family)
{ {
#if DEBUG_NVE_ADDR #if DEBUG_NVE_ADDR
zlog_debug ("diff: pT addr fam a->vn.af=%d, b->vn.af=%d", vnc_zlog_debug_verbose ("diff: pT addr fam a->vn.af=%d, b->vn.af=%d",
a->vn.addr_family, b->vn.addr_family); a->vn.addr_family, b->vn.addr_family);
#endif #endif
return (a->vn.addr_family - b->vn.addr_family); return (a->vn.addr_family - b->vn.addr_family);

View File

@ -50,6 +50,7 @@
#include "bgpd/rfapi/rfapi_rib.h" #include "bgpd/rfapi/rfapi_rib.h"
#include "bgpd/rfapi/rfapi_monitor.h" #include "bgpd/rfapi/rfapi_monitor.h"
#include "bgpd/rfapi/rfapi_encap_tlv.h" #include "bgpd/rfapi/rfapi_encap_tlv.h"
#include "bgpd/rfapi/vnc_debug.h"
#define DEBUG_PROCESS_PENDING_NODE 0 #define DEBUG_PROCESS_PENDING_NODE 0
#define DEBUG_PENDING_DELETE_ROUTE 0 #define DEBUG_PENDING_DELETE_ROUTE 0
@ -208,7 +209,7 @@ rfapiRibCheckCounts (
{ {
if (pfx_active != rfd->rib_prefix_count) if (pfx_active != rfd->rib_prefix_count)
{ {
zlog_debug ("%s: rfd %p actual pfx count %u != running %u", vnc_zlog_debug_verbose ("%s: rfd %p actual pfx count %u != running %u",
__func__, rfd, pfx_active, rfd->rib_prefix_count); __func__, rfd, pfx_active, rfd->rib_prefix_count);
assert (0); assert (0);
} }
@ -219,7 +220,7 @@ rfapiRibCheckCounts (
{ {
if (t_pfx_active != bgp->rfapi->rib_prefix_count_total) if (t_pfx_active != bgp->rfapi->rib_prefix_count_total)
{ {
zlog_debug ("%s: actual total pfx count %u != running %u", vnc_zlog_debug_verbose ("%s: actual total pfx count %u != running %u",
__func__, t_pfx_active, __func__, t_pfx_active,
bgp->rfapi->rib_prefix_count_total); bgp->rfapi->rib_prefix_count_total);
assert (0); assert (0);
@ -397,7 +398,7 @@ rfapiRibStartTimer (
} }
prefix2str (&rn->p, buf_prefix, BUFSIZ); prefix2str (&rn->p, buf_prefix, BUFSIZ);
zlog_debug ("%s: rfd %p pfx %s life %u", __func__, rfd, buf_prefix, vnc_zlog_debug_verbose ("%s: rfd %p pfx %s life %u", __func__, rfd, buf_prefix,
ri->lifetime); ri->lifetime);
ri->timer = thread_add_timer (bm->master, rfapiRibExpireTimer, ri->timer = thread_add_timer (bm->master, rfapiRibExpireTimer,
tcb, ri->lifetime); tcb, ri->lifetime);
@ -501,7 +502,7 @@ rfapiRibClear (struct rfapi_descriptor *rfd)
afi_t afi; afi_t afi;
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: rfd=%p", __func__, rfd); vnc_zlog_debug_verbose ("%s: rfd=%p", __func__, rfd);
#endif #endif
for (afi = AFI_IP; afi < AFI_MAX; ++afi) for (afi = AFI_IP; afi < AFI_MAX; ++afi)
@ -890,7 +891,7 @@ process_pending_node (
assert (pn); assert (pn);
prefix2str (&pn->p, buf_prefix, BUFSIZ); prefix2str (&pn->p, buf_prefix, BUFSIZ);
zlog_debug ("%s: afi=%d, %s pn->info=%p", vnc_zlog_debug_verbose ("%s: afi=%d, %s pn->info=%p",
__func__, afi, buf_prefix, pn->info); __func__, afi, buf_prefix, pn->info);
if (AFI_ETHER != afi) if (AFI_ETHER != afi)
@ -934,7 +935,7 @@ process_pending_node (
*/ */
if (lPendCost == (struct list *) 1) if (lPendCost == (struct list *) 1)
{ {
zlog_debug ("%s: lPendCost=1 => delete all", __func__); vnc_zlog_debug_verbose ("%s: lPendCost=1 => delete all", __func__);
if (slRibPt && !skiplist_empty (slRibPt)) if (slRibPt && !skiplist_empty (slRibPt))
{ {
delete_list = list_new (); delete_list = list_new ();
@ -945,7 +946,7 @@ process_pending_node (
char buf2[BUFSIZ]; char buf2[BUFSIZ];
listnode_add (delete_list, ri); listnode_add (delete_list, ri);
zlog_debug ("%s: after listnode_add, delete_list->count=%d", vnc_zlog_debug_verbose ("%s: after listnode_add, delete_list->count=%d",
__func__, delete_list->count); __func__, delete_list->count);
rfapiFreeBgpTeaOptionChain (ri->tea_options); rfapiFreeBgpTeaOptionChain (ri->tea_options);
ri->tea_options = NULL; ri->tea_options = NULL;
@ -962,7 +963,7 @@ process_pending_node (
prefix2str (&ri->rk.vn, buf, BUFSIZ); prefix2str (&ri->rk.vn, buf, BUFSIZ);
prefix2str (&ri->un, buf2, BUFSIZ); prefix2str (&ri->un, buf2, BUFSIZ);
zlog_debug vnc_zlog_debug_verbose
("%s: put dl pfx=%s vn=%s un=%s cost=%d life=%d vn_options=%p", ("%s: put dl pfx=%s vn=%s un=%s cost=%d life=%d vn_options=%p",
__func__, buf_prefix, buf, buf2, ri->cost, ri->lifetime, __func__, buf_prefix, buf, buf2, ri->cost, ri->lifetime,
ri->vn_options); ri->vn_options);
@ -1011,7 +1012,7 @@ process_pending_node (
return; return;
} }
zlog_debug ("%s: lPendCost->count=%d, slRibPt->count=%d", vnc_zlog_debug_verbose ("%s: lPendCost->count=%d, slRibPt->count=%d",
__func__, __func__,
(lPendCost ? (int) lPendCost->count : -1), (lPendCost ? (int) lPendCost->count : -1),
(slRibPt ? (int) slRibPt->count : -1)); (slRibPt ? (int) slRibPt->count : -1));
@ -1056,7 +1057,7 @@ process_pending_node (
#if DEBUG_PROCESS_PENDING_NODE #if DEBUG_PROCESS_PENDING_NODE
/* deleted from slRibPt below, after we're done iterating */ /* deleted from slRibPt below, after we're done iterating */
zlog_debug vnc_zlog_debug_verbose
("%s: slRibPt ri %p not matched in pending list, delete", ("%s: slRibPt ri %p not matched in pending list, delete",
__func__, ori); __func__, ori);
#endif #endif
@ -1081,7 +1082,7 @@ process_pending_node (
} }
} }
#if DEBUG_PROCESS_PENDING_NODE #if DEBUG_PROCESS_PENDING_NODE
zlog_debug ("%s: slRibPt ri %p matched in pending list, %s", vnc_zlog_debug_verbose ("%s: slRibPt ri %p matched in pending list, %s",
__func__, ori, __func__, ori,
(same ? "same info" : "different info")); (same ? "same info" : "different info"));
#endif #endif
@ -1094,7 +1095,7 @@ process_pending_node (
{ {
for (ALL_LIST_ELEMENTS_RO (delete_list, node, ri)) for (ALL_LIST_ELEMENTS_RO (delete_list, node, ri))
{ {
zlog_debug ("%s: deleting ri %p from slRibPt", __func__, ri); vnc_zlog_debug_verbose ("%s: deleting ri %p from slRibPt", __func__, ri);
assert (!skiplist_delete (slRibPt, &ri->rk, NULL)); assert (!skiplist_delete (slRibPt, &ri->rk, NULL));
} }
if (skiplist_empty (slRibPt)) if (skiplist_empty (slRibPt))
@ -1138,7 +1139,7 @@ process_pending_node (
rfapiFreeRfapiUnOptionChain (ori->un_options); rfapiFreeRfapiUnOptionChain (ori->un_options);
ori->un_options = rfapiUnOptionsDup (ri->un_options); ori->un_options = rfapiUnOptionsDup (ri->un_options);
zlog_debug vnc_zlog_debug_verbose
("%s: matched lPendCost item %p in slRibPt, rewrote", ("%s: matched lPendCost item %p in slRibPt, rewrote",
__func__, ri); __func__, ri);
@ -1173,7 +1174,7 @@ process_pending_node (
buf_rd[0] = 0; buf_rd[0] = 0;
#endif #endif
zlog_debug ("%s: nomatch lPendCost item %p in slRibPt, added (rd=%s)", vnc_zlog_debug_verbose ("%s: nomatch lPendCost item %p in slRibPt, added (rd=%s)",
__func__, ri, buf_rd); __func__, ri, buf_rd);
} }
@ -1201,8 +1202,8 @@ callback:
char buf[BUFSIZ]; char buf[BUFSIZ];
char buf2[BUFSIZ]; char buf2[BUFSIZ];
zlog_debug ("%s: lPendCost->count now %d", __func__, lPendCost->count); vnc_zlog_debug_verbose ("%s: lPendCost->count now %d", __func__, lPendCost->count);
zlog_debug ("%s: For prefix %s (a)", __func__, buf_prefix); vnc_zlog_debug_verbose ("%s: For prefix %s (a)", __func__, buf_prefix);
printedprefix = 1; printedprefix = 1;
for (ALL_LIST_ELEMENTS (lPendCost, node, nnode, ri)) for (ALL_LIST_ELEMENTS (lPendCost, node, nnode, ri))
@ -1267,7 +1268,7 @@ callback:
rfapiRfapiIpAddr2Str (&new->vn_address, buf, BUFSIZ); rfapiRfapiIpAddr2Str (&new->vn_address, buf, BUFSIZ);
rfapiRfapiIpAddr2Str (&new->un_address, buf2, BUFSIZ); rfapiRfapiIpAddr2Str (&new->un_address, buf2, BUFSIZ);
zlog_debug ("%s: add vn=%s un=%s cost=%d life=%d", __func__, vnc_zlog_debug_verbose ("%s: add vn=%s un=%s cost=%d life=%d", __func__,
buf, buf2, new->prefix.cost, new->lifetime); buf, buf2, new->prefix.cost, new->lifetime);
} }
} }
@ -1282,10 +1283,10 @@ callback:
if (!printedprefix) if (!printedprefix)
{ {
zlog_debug ("%s: For prefix %s (d)", __func__, buf_prefix); vnc_zlog_debug_verbose ("%s: For prefix %s (d)", __func__, buf_prefix);
printedprefix = 1; printedprefix = 1;
} }
zlog_debug ("%s: delete_list has %d elements", vnc_zlog_debug_verbose ("%s: delete_list has %d elements",
__func__, delete_list->count); __func__, delete_list->count);
RFAPI_RIB_CHECK_COUNTS (0, delete_list->count); RFAPI_RIB_CHECK_COUNTS (0, delete_list->count);
@ -1342,7 +1343,7 @@ callback:
rfapiRfapiIpAddr2Str (&new->vn_address, buf, BUFSIZ); rfapiRfapiIpAddr2Str (&new->vn_address, buf, BUFSIZ);
rfapiRfapiIpAddr2Str (&new->un_address, buf2, BUFSIZ); rfapiRfapiIpAddr2Str (&new->un_address, buf2, BUFSIZ);
zlog_debug ("%s: DEL vn=%s un=%s cost=%d life=%d", __func__, vnc_zlog_debug_verbose ("%s: DEL vn=%s un=%s cost=%d life=%d", __func__,
buf, buf2, new->prefix.cost, new->lifetime); buf, buf2, new->prefix.cost, new->lifetime);
RFAPI_RIB_CHECK_COUNTS (0, delete_list->count); RFAPI_RIB_CHECK_COUNTS (0, delete_list->count);
@ -1401,7 +1402,7 @@ callback:
{ {
char buf_rd[BUFSIZ]; char buf_rd[BUFSIZ];
prefix_rd2str(&ri->rk.rd, buf_rd, sizeof(buf_rd)); prefix_rd2str(&ri->rk.rd, buf_rd, sizeof(buf_rd));
zlog_debug("%s: move route to recently deleted list, rd=%s", vnc_zlog_debug_verbose("%s: move route to recently deleted list, rd=%s",
__func__, buf_rd); __func__, buf_rd);
} }
#endif #endif
@ -1422,7 +1423,7 @@ callback:
} }
else else
{ {
zlog_debug ("%s: response removal disabled, omitting removals", vnc_zlog_debug_verbose ("%s: response removal disabled, omitting removals",
__func__); __func__);
} }
@ -1490,7 +1491,7 @@ rib_do_callback_onepass (struct rfapi_descriptor *rfd, afi_t afi)
struct route_node *rn; struct route_node *rn;
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: rfd=%p, afi=%d", __func__, rfd, afi); vnc_zlog_debug_verbose ("%s: rfd=%p, afi=%d", __func__, rfd, afi);
#endif #endif
if (!rfd->rib_pending[afi]) if (!rfd->rib_pending[afi])
@ -1508,7 +1509,7 @@ rib_do_callback_onepass (struct rfapi_descriptor *rfd, afi_t afi)
rfapi_response_cb_t *f; rfapi_response_cb_t *f;
#if DEBUG_NHL #if DEBUG_NHL
zlog_debug ("%s: response callback NHL follows:", __func__); vnc_zlog_debug_verbose ("%s: response callback NHL follows:", __func__);
rfapiPrintNhl (NULL, head); rfapiPrintNhl (NULL, head);
#endif #endif
@ -1518,7 +1519,7 @@ rib_do_callback_onepass (struct rfapi_descriptor *rfd, afi_t afi)
f = bgp->rfapi->rfp_methods.response_cb; f = bgp->rfapi->rfp_methods.response_cb;
bgp->rfapi->flags |= RFAPI_INCALLBACK; bgp->rfapi->flags |= RFAPI_INCALLBACK;
zlog_debug ("%s: invoking updated response callback", __func__); vnc_zlog_debug_verbose ("%s: invoking updated response callback", __func__);
(*f) (head, rfd->cookie); (*f) (head, rfd->cookie);
bgp->rfapi->flags &= ~RFAPI_INCALLBACK; bgp->rfapi->flags &= ~RFAPI_INCALLBACK;
++bgp->rfapi->response_updated_count; ++bgp->rfapi->response_updated_count;
@ -1602,24 +1603,24 @@ rfapiRibUpdatePendingNode (
int count = 0; int count = 0;
char buf[BUFSIZ]; char buf[BUFSIZ];
zlog_debug ("%s: entry", __func__); vnc_zlog_debug_verbose ("%s: entry", __func__);
if (CHECK_FLAG (bgp->rfapi_cfg->flags, BGP_VNC_CONFIG_CALLBACK_DISABLE)) if (CHECK_FLAG (bgp->rfapi_cfg->flags, BGP_VNC_CONFIG_CALLBACK_DISABLE))
return; return;
zlog_debug ("%s: callbacks are not disabled", __func__); vnc_zlog_debug_verbose ("%s: callbacks are not disabled", __func__);
RFAPI_RIB_CHECK_COUNTS (1, 0); RFAPI_RIB_CHECK_COUNTS (1, 0);
prefix = &it_node->p; prefix = &it_node->p;
afi = family2afi (prefix->family); afi = family2afi (prefix->family);
prefix2str (prefix, buf, BUFSIZ); prefix2str (prefix, buf, BUFSIZ);
zlog_debug ("%s: prefix=%s", __func__, buf); vnc_zlog_debug_verbose ("%s: prefix=%s", __func__, buf);
pn = route_node_get (rfd->rib_pending[afi], prefix); pn = route_node_get (rfd->rib_pending[afi], prefix);
assert (pn); assert (pn);
zlog_debug ("%s: pn->info=%p, pn->aggregate=%p", __func__, pn->info, vnc_zlog_debug_verbose ("%s: pn->info=%p, pn->aggregate=%p", __func__, pn->info,
pn->aggregate); pn->aggregate);
if (pn->aggregate) if (pn->aggregate)
@ -1835,7 +1836,7 @@ rfapiRibFTDFilterRecentPrefix(
char buf_pfx[BUFSIZ]; char buf_pfx[BUFSIZ];
prefix2str(&it_rn->p, buf_pfx, BUFSIZ); prefix2str(&it_rn->p, buf_pfx, BUFSIZ);
zlog_debug("%s: prefix %s", __func__, buf_pfx); vnc_zlog_debug_verbose("%s: prefix %s", __func__, buf_pfx);
} }
#endif #endif
@ -1845,7 +1846,7 @@ rfapiRibFTDFilterRecentPrefix(
if (prefix_match (&it_rn->p, pfx_target_original)) if (prefix_match (&it_rn->p, pfx_target_original))
{ {
#if DEBUG_FTD_FILTER_RECENT #if DEBUG_FTD_FILTER_RECENT
zlog_debug("%s: prefix covers target, allowed", __func__); vnc_zlog_debug_verbose("%s: prefix covers target, allowed", __func__);
#endif #endif
return 0; return 0;
} }
@ -1859,7 +1860,7 @@ rfapiRibFTDFilterRecentPrefix(
route_unlock_node (trn); route_unlock_node (trn);
#if DEBUG_FTD_FILTER_RECENT #if DEBUG_FTD_FILTER_RECENT
zlog_debug("%s: last sent time %lu, last allowed time %lu", vnc_zlog_debug_verbose("%s: last sent time %lu, last allowed time %lu",
__func__, prefix_time, rfd->ftd_last_allowed_time); __func__, prefix_time, rfd->ftd_last_allowed_time);
#endif #endif
@ -1893,7 +1894,7 @@ rfapiRibPreload (
struct rfapi_next_hop_entry *tail = NULL; struct rfapi_next_hop_entry *tail = NULL;
time_t new_last_sent_time; time_t new_last_sent_time;
zlog_debug ("%s: loading response=%p, use_eth_resolution=%d", vnc_zlog_debug_verbose ("%s: loading response=%p, use_eth_resolution=%d",
__func__, response, use_eth_resolution); __func__, response, use_eth_resolution);
new_last_sent_time = rfapi_time (NULL); new_last_sent_time = rfapi_time (NULL);
@ -1919,7 +1920,7 @@ rfapiRibPreload (
/* /*
* weird, shouldn't happen * weird, shouldn't happen
*/ */
zlog_debug vnc_zlog_debug_verbose
("%s: got nhp->lifetime == RFAPI_REMOVE_RESPONSE_LIFETIME", ("%s: got nhp->lifetime == RFAPI_REMOVE_RESPONSE_LIFETIME",
__func__); __func__);
continue; continue;
@ -1949,7 +1950,7 @@ rfapiRibPreload (
/* /*
* not supposed to happen * not supposed to happen
*/ */
zlog_debug ("%s: missing L2 info", __func__); vnc_zlog_debug_verbose ("%s: missing L2 info", __func__);
continue; continue;
} }
@ -2019,11 +2020,11 @@ rfapiRibPreload (
{ {
} }
zlog_debug ("%s: rk.vn=%s rk.aux_prefix=%s", vnc_zlog_debug_verbose ("%s: rk.vn=%s rk.aux_prefix=%s",
__func__, str_vn, __func__, str_vn,
(rk.aux_prefix.family ? str_aux_prefix : "-")); (rk.aux_prefix.family ? str_aux_prefix : "-"));
} }
zlog_debug ("%s: RIB skiplist for this prefix follows", __func__); vnc_zlog_debug_verbose ("%s: RIB skiplist for this prefix follows", __func__);
rfapiRibShowRibSl (NULL, &rn->p, (struct skiplist *) rn->info); rfapiRibShowRibSl (NULL, &rn->p, (struct skiplist *) rn->info);
#endif #endif
@ -2039,7 +2040,7 @@ rfapiRibPreload (
ri->vn_options = NULL; ri->vn_options = NULL;
#if DEBUG_NHL #if DEBUG_NHL
zlog_debug ("%s: found in RIB", __func__); vnc_zlog_debug_verbose ("%s: found in RIB", __func__);
#endif #endif
/* /*
@ -2051,7 +2052,7 @@ rfapiRibPreload (
{ {
#if DEBUG_NHL #if DEBUG_NHL
zlog_debug ("%s: allowed due to counter/timestamp diff", vnc_zlog_debug_verbose ("%s: allowed due to counter/timestamp diff",
__func__); __func__);
#endif #endif
allowed = 1; allowed = 1;
@ -2062,7 +2063,7 @@ rfapiRibPreload (
{ {
#if DEBUG_NHL #if DEBUG_NHL
zlog_debug ("%s: allowed due to not yet in RIB", __func__); vnc_zlog_debug_verbose ("%s: allowed due to not yet in RIB", __func__);
#endif #endif
/* not found: add new route to RIB */ /* not found: add new route to RIB */
ri = rfapi_info_new (); ri = rfapi_info_new ();
@ -2110,7 +2111,7 @@ rfapiRibPreload (
prefix2str (&pfx, str_pfx, BUFSIZ); prefix2str (&pfx, str_pfx, BUFSIZ);
prefix2str (&rk.vn, str_pfx_vn, BUFSIZ); prefix2str (&rk.vn, str_pfx_vn, BUFSIZ);
zlog_debug vnc_zlog_debug_verbose
("%s: added pfx=%s nh[vn]=%s, cost=%u, lifetime=%u, allowed=%d", ("%s: added pfx=%s nh[vn]=%s, cost=%u, lifetime=%u, allowed=%d",
__func__, str_pfx, str_pfx_vn, nhp->prefix.cost, nhp->lifetime, __func__, str_pfx, str_pfx_vn, nhp->prefix.cost, nhp->lifetime,
allowed); allowed);
@ -2155,7 +2156,7 @@ rfapiRibPendingDeleteRoute (
char buf[BUFSIZ]; char buf[BUFSIZ];
prefix2str (&it_node->p, buf, BUFSIZ); prefix2str (&it_node->p, buf, BUFSIZ);
zlog_debug ("%s: entry, it=%p, afi=%d, it_node=%p, pfx=%s", vnc_zlog_debug_verbose ("%s: entry, it=%p, afi=%d, it_node=%p, pfx=%s",
__func__, it, afi, it_node, buf); __func__, it, afi, it_node, buf);
if (AFI_ETHER == afi) if (AFI_ETHER == afi)
@ -2176,7 +2177,7 @@ rfapiRibPendingDeleteRoute (
if ((sl = RFAPI_MONITOR_ETH (it_node))) if ((sl = RFAPI_MONITOR_ETH (it_node)))
{ {
zlog_debug ("%s: route-specific skiplist: %p", __func__, sl); vnc_zlog_debug_verbose ("%s: route-specific skiplist: %p", __func__, sl);
for (cursor = NULL, rc = for (cursor = NULL, rc =
skiplist_next (sl, NULL, (void **) &m, (void **) &cursor); !rc; skiplist_next (sl, NULL, (void **) &m, (void **) &cursor); !rc;
@ -2184,7 +2185,7 @@ rfapiRibPendingDeleteRoute (
{ {
#if DEBUG_PENDING_DELETE_ROUTE #if DEBUG_PENDING_DELETE_ROUTE
zlog_debug ("%s: eth monitor rfd=%p", __func__, m->rfd); vnc_zlog_debug_verbose ("%s: eth monitor rfd=%p", __func__, m->rfd);
#endif #endif
/* /*
* If we have already sent a route with this prefix to this * If we have already sent a route with this prefix to this
@ -2205,7 +2206,7 @@ rfapiRibPendingDeleteRoute (
for (m = it->eth0_queries; m; m = m->next) for (m = it->eth0_queries; m; m = m->next)
{ {
#if DEBUG_PENDING_DELETE_ROUTE #if DEBUG_PENDING_DELETE_ROUTE
zlog_debug ("%s: eth0 monitor rfd=%p", __func__, m->rfd); vnc_zlog_debug_verbose ("%s: eth0 monitor rfd=%p", __func__, m->rfd);
#endif #endif
/* /*
* If we have already sent a route with this prefix to this * If we have already sent a route with this prefix to this
@ -2229,13 +2230,13 @@ rfapiRibPendingDeleteRoute (
struct route_node *rn; struct route_node *rn;
zlog_debug ("%s: comparing rfd(%p)->import_table=%p to it=%p", vnc_zlog_debug_verbose ("%s: comparing rfd(%p)->import_table=%p to it=%p",
__func__, rfd, rfd->import_table, it); __func__, rfd, rfd->import_table, it);
if (rfd->import_table != it) if (rfd->import_table != it)
continue; continue;
zlog_debug ("%s: matched rfd %p", __func__, rfd); vnc_zlog_debug_verbose ("%s: matched rfd %p", __func__, rfd);
/* /*
* If we have sent a response to this NVE with this prefix * If we have sent a response to this NVE with this prefix

View File

@ -1070,7 +1070,7 @@ rfapiShowVncQueries (void *stream, struct prefix *pfx_match)
++queries_total; ++queries_total;
zlog_debug ("%s: checking rfd=%p mon_eth=%p", __func__, rfd, vnc_zlog_debug_verbose ("%s: checking rfd=%p mon_eth=%p", __func__, rfd,
mon_eth); mon_eth);
memset ((void *) &pfx_mac, 0, sizeof (struct prefix)); memset ((void *) &pfx_mac, 0, sizeof (struct prefix));
@ -2448,7 +2448,7 @@ register_add (
++opt_next; ++opt_next;
} }
zlog_debug vnc_zlog_debug_verbose
("%s: vn=%s, un=%s, prefix=%s, cost=%s, lifetime=%s, lnh=%s", ("%s: vn=%s, un=%s, prefix=%s, cost=%s, lifetime=%s, lnh=%s",
__func__, arg_vn, arg_un, arg_prefix, __func__, arg_vn, arg_un, arg_prefix,
(arg_cost ? arg_cost : "NULL"), (arg_cost ? arg_cost : "NULL"),
@ -2504,7 +2504,7 @@ register_add (
struct rfapi_next_hop_entry *tail = NULL; struct rfapi_next_hop_entry *tail = NULL;
struct rfapi_vn_option *vn_opt_new; struct rfapi_vn_option *vn_opt_new;
zlog_debug ("%s: rfapi_register succeeded, returning 0", __func__); vnc_zlog_debug_verbose ("%s: rfapi_register succeeded, returning 0", __func__);
if (h->rfp_methods.local_cb) if (h->rfp_methods.local_cb)
{ {
@ -2525,7 +2525,7 @@ register_add (
return 0; return 0;
} }
zlog_debug ("%s: rfapi_register failed", __func__); vnc_zlog_debug_verbose ("%s: rfapi_register failed", __func__);
vty_out (vty, "%s", VTY_NEWLINE); vty_out (vty, "%s", VTY_NEWLINE);
vty_out (vty, "Registration failed.%s", VTY_NEWLINE); vty_out (vty, "Registration failed.%s", VTY_NEWLINE);
vty_out (vty, vty_out (vty,
@ -2534,7 +2534,7 @@ register_add (
return CMD_WARNING; return CMD_WARNING;
fail: fail:
zlog_debug ("%s: fail, rc=%d", __func__, rc); vnc_zlog_debug_verbose ("%s: fail, rc=%d", __func__, rc);
return rc; return rc;
} }
@ -3284,7 +3284,7 @@ rfapiDeleteLocalPrefixes (struct rfapi_local_reg_delete_arg *cda)
struct rfapi_cfg *rfapi_cfg; struct rfapi_cfg *rfapi_cfg;
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: entry", __func__); vnc_zlog_debug_verbose ("%s: entry", __func__);
#endif #endif
if (!bgp_default) if (!bgp_default)
@ -3306,7 +3306,7 @@ rfapiDeleteLocalPrefixes (struct rfapi_local_reg_delete_arg *cda)
} }
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: starting descriptor loop", __func__); vnc_zlog_debug_verbose ("%s: starting descriptor loop", __func__);
#endif #endif
for (ALL_LIST_ELEMENTS_RO (&h->descriptors, node, rfd)) for (ALL_LIST_ELEMENTS_RO (&h->descriptors, node, rfd))
@ -3318,7 +3318,7 @@ rfapiDeleteLocalPrefixes (struct rfapi_local_reg_delete_arg *cda)
struct nve_addr *hap; struct nve_addr *hap;
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: rfd=%p", __func__, rfd); vnc_zlog_debug_verbose ("%s: rfd=%p", __func__, rfd);
#endif #endif
/* /*
@ -3330,7 +3330,7 @@ rfapiDeleteLocalPrefixes (struct rfapi_local_reg_delete_arg *cda)
continue; continue;
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: un, vn match", __func__); vnc_zlog_debug_verbose ("%s: un, vn match", __func__);
#endif #endif
/* /*
@ -3373,7 +3373,7 @@ rfapiDeleteLocalPrefixes (struct rfapi_local_reg_delete_arg *cda)
if (!prefix_same (pPrefix, &adb->prefix_ip)) if (!prefix_same (pPrefix, &adb->prefix_ip))
{ {
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: adb=%p, prefix doesn't match, skipping", vnc_zlog_debug_verbose ("%s: adb=%p, prefix doesn't match, skipping",
__func__, adb); __func__, adb);
#endif #endif
continue; continue;
@ -3386,7 +3386,7 @@ rfapiDeleteLocalPrefixes (struct rfapi_local_reg_delete_arg *cda)
adb->prefix_eth.u.prefix_eth.octet, ETHER_ADDR_LEN)) adb->prefix_eth.u.prefix_eth.octet, ETHER_ADDR_LEN))
{ {
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: adb=%p, macaddr doesn't match, skipping", vnc_zlog_debug_verbose ("%s: adb=%p, macaddr doesn't match, skipping",
__func__, adb); __func__, adb);
#endif #endif
continue; continue;
@ -3398,7 +3398,7 @@ rfapiDeleteLocalPrefixes (struct rfapi_local_reg_delete_arg *cda)
if (cda->l2o.o.logical_net_id != adb->l2o.logical_net_id) if (cda->l2o.o.logical_net_id != adb->l2o.logical_net_id)
{ {
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: adb=%p, LNI doesn't match, skipping", vnc_zlog_debug_verbose ("%s: adb=%p, LNI doesn't match, skipping",
__func__, adb); __func__, adb);
#endif #endif
continue; continue;
@ -3406,7 +3406,7 @@ rfapiDeleteLocalPrefixes (struct rfapi_local_reg_delete_arg *cda)
} }
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: ipN adding adb %p to delete list", __func__, vnc_zlog_debug_verbose ("%s: ipN adding adb %p to delete list", __func__,
adb); adb);
#endif #endif
@ -3455,7 +3455,7 @@ rfapiDeleteLocalPrefixes (struct rfapi_local_reg_delete_arg *cda)
} }
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: ipN killing reg from adb %p ", __func__, adb); vnc_zlog_debug_verbose ("%s: ipN killing reg from adb %p ", __func__, adb);
#endif #endif
rc = rfapi_register (rfd, &rp, 0, NULL, pVn, RFAPI_REGISTER_KILL); rc = rfapi_register (rfd, &rp, 0, NULL, pVn, RFAPI_REGISTER_KILL);
@ -3509,7 +3509,7 @@ rfapiDeleteLocalPrefixes (struct rfapi_local_reg_delete_arg *cda)
} }
} }
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: ip0 adding adb %p to delete list", vnc_zlog_debug_verbose ("%s: ip0 adding adb %p to delete list",
__func__, adb); __func__, adb);
#endif #endif
listnode_add (adb_delete_list, adb); listnode_add (adb_delete_list, adb);
@ -3528,7 +3528,7 @@ rfapiDeleteLocalPrefixes (struct rfapi_local_reg_delete_arg *cda)
vn.v.l2addr = adb->l2o; vn.v.l2addr = adb->l2o;
#if DEBUG_L2_EXTRA #if DEBUG_L2_EXTRA
zlog_debug ("%s: ip0 killing reg from adb %p ", vnc_zlog_debug_verbose ("%s: ip0 killing reg from adb %p ",
__func__, adb); __func__, adb);
#endif #endif

View File

@ -47,6 +47,7 @@ struct vnc_debug vncdebug[] =
{VNC_DEBUG_EXPORT_BGP_GETCE, "export-bgp-getce"}, {VNC_DEBUG_EXPORT_BGP_GETCE, "export-bgp-getce"},
{VNC_DEBUG_EXPORT_BGP_DIRECT_ADD, "export-bgp-direct-add"}, {VNC_DEBUG_EXPORT_BGP_DIRECT_ADD, "export-bgp-direct-add"},
{VNC_DEBUG_IMPORT_BGP_ADD_ROUTE, "import-bgp-add-route"}, {VNC_DEBUG_IMPORT_BGP_ADD_ROUTE, "import-bgp-add-route"},
{VNC_DEBUG_VERBOSE, "verbose"},
}; };
#define VNC_STR "VNC information\n" #define VNC_STR "VNC information\n"
@ -56,13 +57,14 @@ struct vnc_debug vncdebug[] =
***********************************************************************/ ***********************************************************************/
DEFUN (debug_bgp_vnc, DEFUN (debug_bgp_vnc,
debug_bgp_vnc_cmd, debug_bgp_vnc_cmd,
"debug bgp vnc (rfapi-query|import-bi-attach|import-del-remote)", "debug bgp vnc (rfapi-query|import-bi-attach|import-del-remote|verbose)",
DEBUG_STR DEBUG_STR
BGP_STR BGP_STR
VNC_STR VNC_STR
"rfapi query handling\n" "rfapi query handling\n"
"import BI atachment\n" "import BI atachment\n"
"import delete remote routes\n") "import delete remote routes\n"
"verbose logging\n")
{ {
size_t i; size_t i;
@ -90,14 +92,15 @@ DEFUN (debug_bgp_vnc,
DEFUN (no_debug_bgp_vnc, DEFUN (no_debug_bgp_vnc,
no_debug_bgp_vnc_cmd, no_debug_bgp_vnc_cmd,
"no debug bgp vnc (rfapi-query|import-bi-attach|import-del-remote)", "no debug bgp vnc (rfapi-query|import-bi-attach|import-del-remote|verbose)",
NO_STR NO_STR
DEBUG_STR DEBUG_STR
BGP_STR BGP_STR
VNC_STR VNC_STR
"rfapi query handling\n" "rfapi query handling\n"
"import BI atachment\n" "import BI atachment\n"
"import delete remote routes\n") "import delete remote routes\n"
"verbose logging\n")
{ {
size_t i; size_t i;
@ -125,13 +128,14 @@ DEFUN (no_debug_bgp_vnc,
ALIAS (no_debug_bgp_vnc, ALIAS (no_debug_bgp_vnc,
undebug_bgp_vnc_cmd, undebug_bgp_vnc_cmd,
"undebug bgp vnc (rfapi-query|import-bi-attach|import-del-remote)", "undebug bgp vnc (rfapi-query|import-bi-attach|import-del-remote|verbose)",
UNDEBUG_STR UNDEBUG_STR
BGP_STR BGP_STR
VNC_STR VNC_STR
"rfapi query handling\n" "rfapi query handling\n"
"import BI atachment\n" "import BI atachment\n"
"import delete remote routes\n") "import delete remote routes\n"
"verbose logging\n")
/*********************************************************************** /***********************************************************************

View File

@ -38,8 +38,12 @@ extern unsigned long term_vnc_debug;
#define VNC_DEBUG_EXPORT_BGP_GETCE 0x00000008 #define VNC_DEBUG_EXPORT_BGP_GETCE 0x00000008
#define VNC_DEBUG_EXPORT_BGP_DIRECT_ADD 0x00000010 #define VNC_DEBUG_EXPORT_BGP_DIRECT_ADD 0x00000010
#define VNC_DEBUG_IMPORT_BGP_ADD_ROUTE 0x00000020 #define VNC_DEBUG_IMPORT_BGP_ADD_ROUTE 0x00000020
#define VNC_DEBUG_VERBOSE 0x00000040
#define VNC_DEBUG_ANY 0xFFFFFFFF
#define VNC_DEBUG(bit) (term_vnc_debug & (VNC_DEBUG_ ## bit)) #define VNC_DEBUG(bit) (term_vnc_debug & (VNC_DEBUG_ ## bit))
#define vnc_zlog_debug_verbose if (VNC_DEBUG(VERBOSE)) zlog_debug
#define vnc_zlog_debug_any if (VNC_DEBUG(ANY)) zlog_debug
extern void extern void
vnc_debug_init (void); vnc_debug_init (void);

View File

@ -152,7 +152,7 @@ getce (struct bgp *bgp, struct attr *attr, struct prefix *pfx_ce)
if (VNC_DEBUG(EXPORT_BGP_GETCE)) if (VNC_DEBUG(EXPORT_BGP_GETCE))
{ {
zlog_debug ("%s: %02x %02x %02x %02x %02x %02x %02x %02x", vnc_zlog_debug_any ("%s: %02x %02x %02x %02x %02x %02x %02x %02x",
__func__, __func__,
ecp[0], ecp[1], ecp[2], ecp[3], ecp[4], ecp[5], ecp[6], ecp[0], ecp[1], ecp[2], ecp[3], ecp[4], ecp[5], ecp[6],
ecp[7]); ecp[7]);
@ -213,7 +213,7 @@ vnc_direct_bgp_add_route_ce (
bi->sub_type != BGP_ROUTE_RFP && bi->sub_type != BGP_ROUTE_STATIC)) bi->sub_type != BGP_ROUTE_RFP && bi->sub_type != BGP_ROUTE_STATIC))
{ {
zlog_debug ("%s: wrong route type/sub_type for export, skipping", vnc_zlog_debug_verbose ("%s: wrong route type/sub_type for export, skipping",
__func__); __func__);
return; return;
} }
@ -221,20 +221,20 @@ vnc_direct_bgp_add_route_ce (
/* check bgp redist flag for vnc direct ("vpn") routes */ /* check bgp redist flag for vnc direct ("vpn") routes */
if (!bgp->redist[afi][ZEBRA_ROUTE_VNC_DIRECT]) if (!bgp->redist[afi][ZEBRA_ROUTE_VNC_DIRECT])
{ {
zlog_debug ("%s: bgp redistribution of VNC direct routes is off", vnc_zlog_debug_verbose ("%s: bgp redistribution of VNC direct routes is off",
__func__); __func__);
return; return;
} }
if (!bgp->rfapi_cfg) if (!bgp->rfapi_cfg)
{ {
zlog_debug ("%s: bgp->rfapi_cfg is NULL, skipping", __func__); vnc_zlog_debug_verbose ("%s: bgp->rfapi_cfg is NULL, skipping", __func__);
return; return;
} }
if (!VNC_EXPORT_BGP_CE_ENABLED (bgp->rfapi_cfg)) if (!VNC_EXPORT_BGP_CE_ENABLED (bgp->rfapi_cfg))
{ {
zlog_debug ("%s: export-to-bgp ce mode not enabled, skipping", vnc_zlog_debug_verbose ("%s: export-to-bgp ce mode not enabled, skipping",
__func__); __func__);
return; return;
} }
@ -247,7 +247,7 @@ vnc_direct_bgp_add_route_ce (
if (prefix_list_apply (bgp->rfapi_cfg->plist_export_bgp[afi], prefix) == if (prefix_list_apply (bgp->rfapi_cfg->plist_export_bgp[afi], prefix) ==
PREFIX_DENY) PREFIX_DENY)
{ {
zlog_debug ("%s: prefix list denied, skipping", __func__); vnc_zlog_debug_verbose ("%s: prefix list denied, skipping", __func__);
return; return;
} }
} }
@ -260,7 +260,7 @@ vnc_direct_bgp_add_route_ce (
*/ */
if (getce (bgp, attr, &ce_nexthop)) if (getce (bgp, attr, &ce_nexthop))
{ {
zlog_debug ("%s: EC has no encoded CE, skipping", __func__); vnc_zlog_debug_verbose ("%s: EC has no encoded CE, skipping", __func__);
return; return;
} }
@ -285,7 +285,7 @@ vnc_direct_bgp_add_route_ce (
ubi->peer == peer && prefix_same (&unicast_nexthop, &ce_nexthop)) ubi->peer == peer && prefix_same (&unicast_nexthop, &ce_nexthop))
{ {
zlog_debug vnc_zlog_debug_verbose
("%s: already have matching exported unicast route, skipping", ("%s: already have matching exported unicast route, skipping",
__func__); __func__);
return; return;
@ -329,7 +329,7 @@ vnc_direct_bgp_add_route_ce (
if (!prefix_same (&ce_nexthop, &post_routemap_nexthop)) if (!prefix_same (&ce_nexthop, &post_routemap_nexthop))
{ {
zlog_debug vnc_zlog_debug_verbose
("%s: route-map modification of nexthop not allowed, skipping", ("%s: route-map modification of nexthop not allowed, skipping",
__func__); __func__);
bgp_attr_unintern (&iattr); bgp_attr_unintern (&iattr);
@ -368,19 +368,19 @@ vnc_direct_bgp_del_route_ce (
/* check bgp redist flag for vnc direct ("vpn") routes */ /* check bgp redist flag for vnc direct ("vpn") routes */
if (!bgp->redist[afi][ZEBRA_ROUTE_VNC_DIRECT]) if (!bgp->redist[afi][ZEBRA_ROUTE_VNC_DIRECT])
{ {
zlog_debug ("%s: bgp redistribution of VNC direct routes is off", vnc_zlog_debug_verbose ("%s: bgp redistribution of VNC direct routes is off",
__func__); __func__);
return; return;
} }
if (!bgp->rfapi_cfg) if (!bgp->rfapi_cfg)
{ {
zlog_debug ("%s: bgp->rfapi_cfg is NULL, skipping", __func__); vnc_zlog_debug_verbose ("%s: bgp->rfapi_cfg is NULL, skipping", __func__);
return; return;
} }
if (!VNC_EXPORT_BGP_CE_ENABLED (bgp->rfapi_cfg)) if (!VNC_EXPORT_BGP_CE_ENABLED (bgp->rfapi_cfg))
{ {
zlog_debug ("%s: export-to-bgp ce mode not enabled, skipping", vnc_zlog_debug_verbose ("%s: export-to-bgp ce mode not enabled, skipping",
__func__); __func__);
return; return;
} }
@ -392,7 +392,7 @@ vnc_direct_bgp_del_route_ce (
*/ */
if (getce (bgp, bi->attr, &ce_nexthop)) if (getce (bgp, bi->attr, &ce_nexthop))
{ {
zlog_debug ("%s: EC has no encoded CE, skipping", __func__); vnc_zlog_debug_verbose ("%s: EC has no encoded CE, skipping", __func__);
return; return;
} }
@ -413,7 +413,7 @@ vnc_direct_bgp_del_route_ce (
continue; continue;
if (prefix_same (&ce, &ce_nexthop)) if (prefix_same (&ce, &ce_nexthop))
{ {
zlog_debug ("%s: still have a route via CE, not deleting unicast", vnc_zlog_debug_verbose ("%s: still have a route via CE, not deleting unicast",
__func__); __func__);
return; return;
} }
@ -437,7 +437,7 @@ vnc_direct_bgp_vpn_enable_ce (struct bgp *bgp, afi_t afi)
struct route_node *rn; struct route_node *rn;
struct bgp_info *ri; struct bgp_info *ri;
zlog_debug ("%s: entry, afi=%d", __func__, afi); vnc_zlog_debug_verbose ("%s: entry, afi=%d", __func__, afi);
if (!bgp) if (!bgp)
return; return;
@ -447,14 +447,14 @@ vnc_direct_bgp_vpn_enable_ce (struct bgp *bgp, afi_t afi)
if (!VNC_EXPORT_BGP_CE_ENABLED (bgp->rfapi_cfg)) if (!VNC_EXPORT_BGP_CE_ENABLED (bgp->rfapi_cfg))
{ {
zlog_debug ("%s: export of CE routes not enabled, skipping", __func__); vnc_zlog_debug_verbose ("%s: export of CE routes not enabled, skipping", __func__);
return; return;
} }
if (afi != AFI_IP if (afi != AFI_IP
&& afi != AFI_IP6) && afi != AFI_IP6)
{ {
zlog_debug ("%s: bad afi: %d", __func__, afi); vnc_zlog_debug_verbose ("%s: bad afi: %d", __func__, afi);
return; return;
} }
@ -473,14 +473,14 @@ vnc_direct_bgp_vpn_enable_ce (struct bgp *bgp, afi_t afi)
prefixstr[0] = 0; prefixstr[0] = 0;
inet_ntop (rn->p.family, &rn->p.u.prefix, prefixstr, BUFSIZ); inet_ntop (rn->p.family, &rn->p.u.prefix, prefixstr, BUFSIZ);
zlog_debug ("%s: checking prefix %s/%d", __func__, prefixstr, vnc_zlog_debug_verbose ("%s: checking prefix %s/%d", __func__, prefixstr,
rn->p.prefixlen); rn->p.prefixlen);
} }
for (ri = rn->info; ri; ri = ri->next) for (ri = rn->info; ri; ri = ri->next)
{ {
zlog_debug ("%s: ri->sub_type: %d", __func__, ri->sub_type); vnc_zlog_debug_verbose ("%s: ri->sub_type: %d", __func__, ri->sub_type);
if (ri->sub_type == BGP_ROUTE_NORMAL || if (ri->sub_type == BGP_ROUTE_NORMAL ||
ri->sub_type == BGP_ROUTE_RFP || ri->sub_type == BGP_ROUTE_RFP ||
@ -499,7 +499,7 @@ vnc_direct_bgp_vpn_disable_ce (struct bgp *bgp, afi_t afi)
{ {
struct bgp_node *rn; struct bgp_node *rn;
zlog_debug ("%s: entry, afi=%d", __func__, afi); vnc_zlog_debug_verbose ("%s: entry, afi=%d", __func__, afi);
if (!bgp) if (!bgp)
return; return;
@ -507,7 +507,7 @@ vnc_direct_bgp_vpn_disable_ce (struct bgp *bgp, afi_t afi)
if (afi != AFI_IP if (afi != AFI_IP
&& afi != AFI_IP6) && afi != AFI_IP6)
{ {
zlog_debug ("%s: bad afi: %d", __func__, afi); vnc_zlog_debug_verbose ("%s: bad afi: %d", __func__, afi);
return; return;
} }
@ -781,34 +781,34 @@ vnc_direct_bgp_add_prefix (
/* check bgp redist flag for vnc direct ("vpn") routes */ /* check bgp redist flag for vnc direct ("vpn") routes */
if (!bgp->redist[afi][ZEBRA_ROUTE_VNC_DIRECT]) if (!bgp->redist[afi][ZEBRA_ROUTE_VNC_DIRECT])
{ {
zlog_debug ("%s: bgp redistribution of VNC direct routes is off", vnc_zlog_debug_verbose ("%s: bgp redistribution of VNC direct routes is off",
__func__); __func__);
return; return;
} }
if (!bgp->rfapi_cfg) if (!bgp->rfapi_cfg)
{ {
zlog_debug ("%s: bgp->rfapi_cfg is NULL, skipping", __func__); vnc_zlog_debug_verbose ("%s: bgp->rfapi_cfg is NULL, skipping", __func__);
return; return;
} }
if (!VNC_EXPORT_BGP_GRP_ENABLED (bgp->rfapi_cfg)) if (!VNC_EXPORT_BGP_GRP_ENABLED (bgp->rfapi_cfg))
{ {
zlog_debug ("%s: export-to-bgp group mode not enabled, skipping", vnc_zlog_debug_verbose ("%s: export-to-bgp group mode not enabled, skipping",
__func__); __func__);
return; return;
} }
if (!listcount (bgp->rfapi_cfg->rfg_export_direct_bgp_l)) if (!listcount (bgp->rfapi_cfg->rfg_export_direct_bgp_l))
{ {
zlog_debug ("%s: no bgp-direct export nve group, skipping", __func__); vnc_zlog_debug_verbose ("%s: no bgp-direct export nve group, skipping", __func__);
return; return;
} }
bgp_attr_default_set (&attr, BGP_ORIGIN_INCOMPLETE); bgp_attr_default_set (&attr, BGP_ORIGIN_INCOMPLETE);
/* TBD set some configured med, see add_vnc_route() */ /* TBD set some configured med, see add_vnc_route() */
zlog_debug ("%s: looping over nve-groups in direct-bgp export list", vnc_zlog_debug_verbose ("%s: looping over nve-groups in direct-bgp export list",
__func__); __func__);
for (ALL_LIST_ELEMENTS (bgp->rfapi_cfg->rfg_export_direct_bgp_l, for (ALL_LIST_ELEMENTS (bgp->rfapi_cfg->rfg_export_direct_bgp_l,
@ -873,9 +873,9 @@ vnc_direct_bgp_add_prefix (
if (VNC_DEBUG(EXPORT_BGP_DIRECT_ADD)) if (VNC_DEBUG(EXPORT_BGP_DIRECT_ADD))
{ {
zlog_debug ("%s: attr follows", __func__); vnc_zlog_debug_any ("%s: attr follows", __func__);
rfapiPrintAttrPtrs (NULL, &attr); rfapiPrintAttrPtrs (NULL, &attr);
zlog_debug ("%s: hattr follows", __func__); vnc_zlog_debug_any ("%s: hattr follows", __func__);
rfapiPrintAttrPtrs (NULL, &hattr); rfapiPrintAttrPtrs (NULL, &hattr);
} }
@ -890,7 +890,7 @@ vnc_direct_bgp_add_prefix (
{ {
bgp_attr_flush (&hattr); bgp_attr_flush (&hattr);
bgp_attr_extra_free (&hattr); bgp_attr_extra_free (&hattr);
zlog_debug vnc_zlog_debug_verbose
("%s: route map says DENY, so not calling bgp_update", ("%s: route map says DENY, so not calling bgp_update",
__func__); __func__);
continue; continue;
@ -899,8 +899,8 @@ vnc_direct_bgp_add_prefix (
if (VNC_DEBUG(EXPORT_BGP_DIRECT_ADD)) if (VNC_DEBUG(EXPORT_BGP_DIRECT_ADD))
{ {
zlog_debug ("%s: hattr after route_map_apply:", __func__); vnc_zlog_debug_any ("%s: hattr after route_map_apply:", __func__);
rfapiPrintAttrPtrs (NULL, &hattr); rfapiPrintAttrPtrs (NULL, &hattr);
} }
iattr = bgp_attr_intern (&hattr); iattr = bgp_attr_intern (&hattr);
@ -944,27 +944,27 @@ vnc_direct_bgp_del_prefix (
/* check bgp redist flag for vnc direct ("vpn") routes */ /* check bgp redist flag for vnc direct ("vpn") routes */
if (!bgp->redist[afi][ZEBRA_ROUTE_VNC_DIRECT]) if (!bgp->redist[afi][ZEBRA_ROUTE_VNC_DIRECT])
{ {
zlog_debug ("%s: bgp redistribution of VNC direct routes is off", vnc_zlog_debug_verbose ("%s: bgp redistribution of VNC direct routes is off",
__func__); __func__);
return; return;
} }
if (!bgp->rfapi_cfg) if (!bgp->rfapi_cfg)
{ {
zlog_debug ("%s: bgp->rfapi_cfg is NULL, skipping", __func__); vnc_zlog_debug_verbose ("%s: bgp->rfapi_cfg is NULL, skipping", __func__);
return; return;
} }
if (!VNC_EXPORT_BGP_GRP_ENABLED (bgp->rfapi_cfg)) if (!VNC_EXPORT_BGP_GRP_ENABLED (bgp->rfapi_cfg))
{ {
zlog_debug ("%s: export-to-bgp group mode not enabled, skipping", vnc_zlog_debug_verbose ("%s: export-to-bgp group mode not enabled, skipping",
__func__); __func__);
return; return;
} }
if (!listcount (bgp->rfapi_cfg->rfg_export_direct_bgp_l)) if (!listcount (bgp->rfapi_cfg->rfg_export_direct_bgp_l))
{ {
zlog_debug ("%s: no bgp-direct export nve group, skipping", __func__); vnc_zlog_debug_verbose ("%s: no bgp-direct export nve group, skipping", __func__);
return; return;
} }
@ -1035,19 +1035,19 @@ vnc_direct_bgp_add_nve (struct bgp *bgp, struct rfapi_descriptor *rfd)
return; return;
if (!bgp->rfapi_cfg) if (!bgp->rfapi_cfg)
{ {
zlog_debug ("%s: bgp->rfapi_cfg is NULL, skipping", __func__); vnc_zlog_debug_verbose ("%s: bgp->rfapi_cfg is NULL, skipping", __func__);
return; return;
} }
if (!VNC_EXPORT_BGP_GRP_ENABLED (bgp->rfapi_cfg)) if (!VNC_EXPORT_BGP_GRP_ENABLED (bgp->rfapi_cfg))
{ {
zlog_debug ("%s: export-to-bgp group mode not enabled, skipping", vnc_zlog_debug_verbose ("%s: export-to-bgp group mode not enabled, skipping",
__func__); __func__);
return; return;
} }
if (!bgp->redist[afi][ZEBRA_ROUTE_VNC_DIRECT]) if (!bgp->redist[afi][ZEBRA_ROUTE_VNC_DIRECT])
{ {
zlog_debug ("%s: bgp redistribution of VNC direct routes is off", vnc_zlog_debug_verbose ("%s: bgp redistribution of VNC direct routes is off",
__func__); __func__);
return; return;
} }
@ -1183,19 +1183,19 @@ vnc_direct_bgp_del_nve (struct bgp *bgp, struct rfapi_descriptor *rfd)
return; return;
if (!bgp->rfapi_cfg) if (!bgp->rfapi_cfg)
{ {
zlog_debug ("%s: bgp->rfapi_cfg is NULL, skipping", __func__); vnc_zlog_debug_verbose ("%s: bgp->rfapi_cfg is NULL, skipping", __func__);
return; return;
} }
if (!VNC_EXPORT_BGP_GRP_ENABLED (bgp->rfapi_cfg)) if (!VNC_EXPORT_BGP_GRP_ENABLED (bgp->rfapi_cfg))
{ {
zlog_debug ("%s: export-to-bgp group mode not enabled, skipping", vnc_zlog_debug_verbose ("%s: export-to-bgp group mode not enabled, skipping",
__func__); __func__);
return; return;
} }
if (!bgp->redist[afi][ZEBRA_ROUTE_VNC_DIRECT]) if (!bgp->redist[afi][ZEBRA_ROUTE_VNC_DIRECT])
{ {
zlog_debug ("%s: bgp redistribution of VNC direct routes is off", vnc_zlog_debug_verbose ("%s: bgp redistribution of VNC direct routes is off",
__func__); __func__);
return; return;
} }
@ -1276,12 +1276,12 @@ vnc_direct_bgp_add_group_afi (
struct attr attr = { 0 }; struct attr attr = { 0 };
struct rfapi_import_table *import_table; struct rfapi_import_table *import_table;
zlog_debug ("%s: entry", __func__); vnc_zlog_debug_verbose ("%s: entry", __func__);
import_table = rfg->rfapi_import_table; import_table = rfg->rfapi_import_table;
if (!import_table) if (!import_table)
{ {
zlog_debug ("%s: import table not defined, returning", __func__); vnc_zlog_debug_verbose ("%s: import table not defined, returning", __func__);
return; return;
} }
@ -1299,7 +1299,7 @@ vnc_direct_bgp_add_group_afi (
if (!rfg->nves) if (!rfg->nves)
{ {
/* avoid segfault below if list doesn't exist */ /* avoid segfault below if list doesn't exist */
zlog_debug ("%s: no NVEs in this group", __func__); vnc_zlog_debug_verbose ("%s: no NVEs in this group", __func__);
return; return;
} }
@ -1417,12 +1417,12 @@ vnc_direct_bgp_del_group_afi (
struct route_node *rn; struct route_node *rn;
struct rfapi_import_table *import_table; struct rfapi_import_table *import_table;
zlog_debug ("%s: entry", __func__); vnc_zlog_debug_verbose ("%s: entry", __func__);
import_table = rfg->rfapi_import_table; import_table = rfg->rfapi_import_table;
if (!import_table) if (!import_table)
{ {
zlog_debug ("%s: import table not defined, returning", __func__); vnc_zlog_debug_verbose ("%s: import table not defined, returning", __func__);
return; return;
} }
@ -1433,7 +1433,7 @@ vnc_direct_bgp_del_group_afi (
if (!rfg->nves) if (!rfg->nves)
{ {
/* avoid segfault below if list does not exist */ /* avoid segfault below if list does not exist */
zlog_debug ("%s: no NVEs in this group", __func__); vnc_zlog_debug_verbose ("%s: no NVEs in this group", __func__);
return; return;
} }
@ -1592,7 +1592,7 @@ vnc_direct_bgp_vpn_enable (struct bgp *bgp, afi_t afi)
if (!VNC_EXPORT_BGP_GRP_ENABLED (bgp->rfapi_cfg)) if (!VNC_EXPORT_BGP_GRP_ENABLED (bgp->rfapi_cfg))
{ {
zlog_debug ("%s: export-to-bgp group mode not enabled, skipping", vnc_zlog_debug_verbose ("%s: export-to-bgp group mode not enabled, skipping",
__func__); __func__);
return; return;
} }
@ -1600,7 +1600,7 @@ vnc_direct_bgp_vpn_enable (struct bgp *bgp, afi_t afi)
if (afi != AFI_IP if (afi != AFI_IP
&& afi != AFI_IP6) && afi != AFI_IP6)
{ {
zlog_debug ("%s: bad afi: %d", __func__, afi); vnc_zlog_debug_verbose ("%s: bad afi: %d", __func__, afi);
return; return;
} }
@ -1626,21 +1626,21 @@ vnc_direct_bgp_vpn_disable (struct bgp *bgp, afi_t afi)
struct rfapi_import_table *it; struct rfapi_import_table *it;
uint8_t family = afi2family (afi); uint8_t family = afi2family (afi);
zlog_debug ("%s: entry, afi=%d", __func__, afi); vnc_zlog_debug_verbose ("%s: entry, afi=%d", __func__, afi);
if (!bgp) if (!bgp)
return; return;
if (!bgp->rfapi) if (!bgp->rfapi)
{ {
zlog_debug ("%s: rfapi not initialized", __func__); vnc_zlog_debug_verbose ("%s: rfapi not initialized", __func__);
return; return;
} }
if (!family || (afi != AFI_IP if (!family || (afi != AFI_IP
&& afi != AFI_IP6)) && afi != AFI_IP6))
{ {
zlog_debug ("%s: bad afi: %d", __func__, afi); vnc_zlog_debug_verbose ("%s: bad afi: %d", __func__, afi);
return; return;
} }
@ -1699,20 +1699,20 @@ vnc_direct_bgp_rh_add_route (
/* check bgp redist flag for vnc direct ("vpn") routes */ /* check bgp redist flag for vnc direct ("vpn") routes */
if (!bgp->redist[afi][ZEBRA_ROUTE_VNC_DIRECT]) if (!bgp->redist[afi][ZEBRA_ROUTE_VNC_DIRECT])
{ {
zlog_debug ("%s: bgp redistribution of VNC direct routes is off", vnc_zlog_debug_verbose ("%s: bgp redistribution of VNC direct routes is off",
__func__); __func__);
return; return;
} }
if (!(hc = bgp->rfapi_cfg)) if (!(hc = bgp->rfapi_cfg))
{ {
zlog_debug ("%s: bgp->rfapi_cfg is NULL, skipping", __func__); vnc_zlog_debug_verbose ("%s: bgp->rfapi_cfg is NULL, skipping", __func__);
return; return;
} }
if (!VNC_EXPORT_BGP_RH_ENABLED (bgp->rfapi_cfg)) if (!VNC_EXPORT_BGP_RH_ENABLED (bgp->rfapi_cfg))
{ {
zlog_debug ("%s: export-to-bgp RH mode not enabled, skipping", vnc_zlog_debug_verbose ("%s: export-to-bgp RH mode not enabled, skipping",
__func__); __func__);
return; return;
} }
@ -1835,19 +1835,19 @@ vnc_direct_bgp_rh_del_route (
/* check bgp redist flag for vnc direct ("vpn") routes */ /* check bgp redist flag for vnc direct ("vpn") routes */
if (!bgp->redist[afi][ZEBRA_ROUTE_VNC_DIRECT]) if (!bgp->redist[afi][ZEBRA_ROUTE_VNC_DIRECT])
{ {
zlog_debug ("%s: bgp redistribution of VNC direct routes is off", vnc_zlog_debug_verbose ("%s: bgp redistribution of VNC direct routes is off",
__func__); __func__);
return; return;
} }
if (!bgp->rfapi_cfg) if (!bgp->rfapi_cfg)
{ {
zlog_debug ("%s: bgp->rfapi_cfg is NULL, skipping", __func__); vnc_zlog_debug_verbose ("%s: bgp->rfapi_cfg is NULL, skipping", __func__);
return; return;
} }
if (!VNC_EXPORT_BGP_RH_ENABLED (bgp->rfapi_cfg)) if (!VNC_EXPORT_BGP_RH_ENABLED (bgp->rfapi_cfg))
{ {
zlog_debug ("%s: export-to-bgp group mode not enabled, skipping", vnc_zlog_debug_verbose ("%s: export-to-bgp group mode not enabled, skipping",
__func__); __func__);
return; return;
} }
@ -1860,7 +1860,7 @@ vnc_direct_bgp_rh_del_route (
eti->timer = thread_add_timer (bm->master, eti->timer = thread_add_timer (bm->master,
vncExportWithdrawTimer, vncExportWithdrawTimer,
eti, eti->lifetime); eti, eti->lifetime);
zlog_debug ("%s: set expiration timer for %u seconds", vnc_zlog_debug_verbose ("%s: set expiration timer for %u seconds",
__func__, eti->lifetime); __func__, eti->lifetime);
} }
} }
@ -1873,7 +1873,7 @@ vnc_direct_bgp_rh_vpn_enable (struct bgp *bgp, afi_t afi)
struct bgp_node *prn; struct bgp_node *prn;
struct rfapi_cfg *hc; struct rfapi_cfg *hc;
zlog_debug ("%s: entry, afi=%d", __func__, afi); vnc_zlog_debug_verbose ("%s: entry, afi=%d", __func__, afi);
if (!bgp) if (!bgp)
return; return;
@ -1883,14 +1883,14 @@ vnc_direct_bgp_rh_vpn_enable (struct bgp *bgp, afi_t afi)
if (!VNC_EXPORT_BGP_RH_ENABLED (bgp->rfapi_cfg)) if (!VNC_EXPORT_BGP_RH_ENABLED (bgp->rfapi_cfg))
{ {
zlog_debug ("%s: export of RH routes not enabled, skipping", __func__); vnc_zlog_debug_verbose ("%s: export of RH routes not enabled, skipping", __func__);
return; return;
} }
if (afi != AFI_IP if (afi != AFI_IP
&& afi != AFI_IP6) && afi != AFI_IP6)
{ {
zlog_debug ("%s: bad afi: %d", __func__, afi); vnc_zlog_debug_verbose ("%s: bad afi: %d", __func__, afi);
return; return;
} }
@ -1898,7 +1898,7 @@ vnc_direct_bgp_rh_vpn_enable (struct bgp *bgp, afi_t afi)
* Go through the entire BGP VPN table and export to BGP unicast. * Go through the entire BGP VPN table and export to BGP unicast.
*/ */
zlog_debug ("%s: starting RD loop", __func__); vnc_zlog_debug_verbose ("%s: starting RD loop", __func__);
/* Loop over all the RDs */ /* Loop over all the RDs */
for (prn = bgp_table_top (bgp->rib[afi][SAFI_MPLS_VPN]); prn; for (prn = bgp_table_top (bgp->rib[afi][SAFI_MPLS_VPN]); prn;
@ -1931,7 +1931,7 @@ vnc_direct_bgp_rh_vpn_enable (struct bgp *bgp, afi_t afi)
prefixstr[0] = 0; prefixstr[0] = 0;
inet_ntop (rn->p.family, &rn->p.u.prefix, prefixstr, BUFSIZ); inet_ntop (rn->p.family, &rn->p.u.prefix, prefixstr, BUFSIZ);
zlog_debug ("%s: checking prefix %s/%d", __func__, prefixstr, vnc_zlog_debug_verbose ("%s: checking prefix %s/%d", __func__, prefixstr,
rn->p.prefixlen); rn->p.prefixlen);
} }
@ -1944,7 +1944,7 @@ vnc_direct_bgp_rh_vpn_enable (struct bgp *bgp, afi_t afi)
PREFIX_DENY) PREFIX_DENY)
{ {
zlog_debug ("%s: prefix list says DENY", __func__); vnc_zlog_debug_verbose ("%s: prefix list says DENY", __func__);
continue; continue;
} }
} }
@ -1952,7 +1952,7 @@ vnc_direct_bgp_rh_vpn_enable (struct bgp *bgp, afi_t afi)
for (ri = rn->info; ri; ri = ri->next) for (ri = rn->info; ri; ri = ri->next)
{ {
zlog_debug ("%s: ri->sub_type: %d", __func__, ri->sub_type); vnc_zlog_debug_verbose ("%s: ri->sub_type: %d", __func__, ri->sub_type);
if (ri->sub_type == BGP_ROUTE_NORMAL || if (ri->sub_type == BGP_ROUTE_NORMAL ||
ri->sub_type == BGP_ROUTE_RFP) ri->sub_type == BGP_ROUTE_RFP)
@ -1968,7 +1968,7 @@ vnc_direct_bgp_rh_vpn_enable (struct bgp *bgp, afi_t afi)
*/ */
if (encap_attr_export (&hattr, ri->attr, NULL, NULL)) if (encap_attr_export (&hattr, ri->attr, NULL, NULL))
{ {
zlog_debug ("%s: encap_attr_export failed", __func__); vnc_zlog_debug_verbose ("%s: encap_attr_export failed", __func__);
continue; continue;
} }
@ -1986,7 +1986,7 @@ vnc_direct_bgp_rh_vpn_enable (struct bgp *bgp, afi_t afi)
{ {
bgp_attr_flush (&hattr); bgp_attr_flush (&hattr);
bgp_attr_extra_free (&hattr); bgp_attr_extra_free (&hattr);
zlog_debug ("%s: route map says DENY", __func__); vnc_zlog_debug_verbose ("%s: route map says DENY", __func__);
continue; continue;
} }
} }
@ -2014,7 +2014,7 @@ vnc_direct_bgp_rh_vpn_enable (struct bgp *bgp, afi_t afi)
eti->timer = NULL; eti->timer = NULL;
} }
zlog_debug ("%s: calling bgp_update", __func__); vnc_zlog_debug_verbose ("%s: calling bgp_update", __func__);
bgp_update (ri->peer, &rn->p, /* prefix */ bgp_update (ri->peer, &rn->p, /* prefix */
0, /* addpath_id */ 0, /* addpath_id */
@ -2034,7 +2034,7 @@ vnc_direct_bgp_rh_vpn_disable (struct bgp *bgp, afi_t afi)
{ {
struct bgp_node *rn; struct bgp_node *rn;
zlog_debug ("%s: entry, afi=%d", __func__, afi); vnc_zlog_debug_verbose ("%s: entry, afi=%d", __func__, afi);
if (!bgp) if (!bgp)
return; return;
@ -2042,7 +2042,7 @@ vnc_direct_bgp_rh_vpn_disable (struct bgp *bgp, afi_t afi)
if (afi != AFI_IP if (afi != AFI_IP
&& afi != AFI_IP6) && afi != AFI_IP6)
{ {
zlog_debug ("%s: bad afi: %d", __func__, afi); vnc_zlog_debug_verbose ("%s: bad afi: %d", __func__, afi);
return; return;
} }

View File

@ -32,6 +32,7 @@
#include "bgpd/rfapi/vnc_export_table.h" #include "bgpd/rfapi/vnc_export_table.h"
#include "bgpd/rfapi/rfapi_private.h" #include "bgpd/rfapi/rfapi_private.h"
#include "bgpd/rfapi/rfapi_import.h" #include "bgpd/rfapi/rfapi_import.h"
#include "bgpd/rfapi/vnc_debug.h"
struct route_node * struct route_node *
vnc_etn_get (struct bgp *bgp, vnc_export_type_t type, struct prefix *p) vnc_etn_get (struct bgp *bgp, vnc_export_type_t type, struct prefix *p)
@ -160,7 +161,7 @@ vnc_eti_delete (struct vnc_export_info *goner)
if (!eti) if (!eti)
{ {
zlog_debug ("%s: COULDN'T FIND ETI", __func__); vnc_zlog_debug_verbose ("%s: COULDN'T FIND ETI", __func__);
return; return;
} }

File diff suppressed because it is too large Load Diff

View File

@ -46,6 +46,7 @@
#include "bgpd/rfapi/vnc_zebra.h" #include "bgpd/rfapi/vnc_zebra.h"
#include "bgpd/rfapi/rfapi_vty.h" #include "bgpd/rfapi/rfapi_vty.h"
#include "bgpd/rfapi/rfapi_backend.h" #include "bgpd/rfapi/rfapi_backend.h"
#include "bgpd/rfapi/vnc_debug.h"
static struct rfapi_descriptor vncHD1VR; /* Single-VR export dummy nve descr */ static struct rfapi_descriptor vncHD1VR; /* Single-VR export dummy nve descr */
static struct zclient *zclient_vnc = NULL; static struct zclient *zclient_vnc = NULL;
@ -75,28 +76,28 @@ vnc_redistribute_add (
if (!bgp->rfapi_cfg) if (!bgp->rfapi_cfg)
{ {
zlog_debug ("%s: bgp->rfapi_cfg is NULL, skipping", __func__); vnc_zlog_debug_verbose ("%s: bgp->rfapi_cfg is NULL, skipping", __func__);
return; return;
} }
afi = family2afi (p->family); afi = family2afi (p->family);
if (!afi) if (!afi)
{ {
zlog_debug ("%s: unknown prefix address family %d", __func__, vnc_zlog_debug_verbose ("%s: unknown prefix address family %d", __func__,
p->family); p->family);
return; return;
} }
if (!bgp->rfapi_cfg->redist[afi][type]) if (!bgp->rfapi_cfg->redist[afi][type])
{ {
zlog_debug vnc_zlog_debug_verbose
("%s: bgp->rfapi_cfg->redist[afi=%d][type=%d] is 0, skipping", ("%s: bgp->rfapi_cfg->redist[afi=%d][type=%d] is 0, skipping",
__func__, afi, type); __func__, afi, type);
return; return;
} }
if (!bgp->rfapi_cfg->rfg_redist) if (!bgp->rfapi_cfg->rfg_redist)
{ {
zlog_debug ("%s: no redist nve group, skipping", __func__); vnc_zlog_debug_verbose ("%s: no redist nve group, skipping", __func__);
return; return;
} }
@ -111,7 +112,7 @@ vnc_redistribute_add (
case AF_INET: case AF_INET:
if (bgp->rfapi_cfg->rfg_redist->vn_prefix.prefixlen != 32) if (bgp->rfapi_cfg->rfg_redist->vn_prefix.prefixlen != 32)
{ {
zlog_debug vnc_zlog_debug_verbose
("%s: redist nve group VN prefix len (%d) != 32, skipping", ("%s: redist nve group VN prefix len (%d) != 32, skipping",
__func__, bgp->rfapi_cfg->rfg_redist->vn_prefix.prefixlen); __func__, bgp->rfapi_cfg->rfg_redist->vn_prefix.prefixlen);
return; return;
@ -121,7 +122,7 @@ vnc_redistribute_add (
case AF_INET6: case AF_INET6:
if (bgp->rfapi_cfg->rfg_redist->vn_prefix.prefixlen != 128) if (bgp->rfapi_cfg->rfg_redist->vn_prefix.prefixlen != 128)
{ {
zlog_debug vnc_zlog_debug_verbose
("%s: redist nve group VN prefix len (%d) != 128, skipping", ("%s: redist nve group VN prefix len (%d) != 128, skipping",
__func__, bgp->rfapi_cfg->rfg_redist->vn_prefix.prefixlen); __func__, bgp->rfapi_cfg->rfg_redist->vn_prefix.prefixlen);
return; return;
@ -129,7 +130,7 @@ vnc_redistribute_add (
vnaddr.addr.v6 = bgp->rfapi_cfg->rfg_redist->vn_prefix.u.prefix6; vnaddr.addr.v6 = bgp->rfapi_cfg->rfg_redist->vn_prefix.u.prefix6;
break; break;
default: default:
zlog_debug vnc_zlog_debug_verbose
("%s: no redist nve group VN host prefix configured, skipping", ("%s: no redist nve group VN host prefix configured, skipping",
__func__); __func__);
return; return;
@ -155,7 +156,7 @@ vnc_redistribute_add (
case AF_INET: case AF_INET:
if (pfx_un.length != 32) if (pfx_un.length != 32)
{ {
zlog_debug vnc_zlog_debug_verbose
("%s: redist nve group UN prefix len (%d) != 32, skipping", ("%s: redist nve group UN prefix len (%d) != 32, skipping",
__func__, pfx_un.length); __func__, pfx_un.length);
return; return;
@ -164,14 +165,14 @@ vnc_redistribute_add (
case AF_INET6: case AF_INET6:
if (pfx_un.length != 128) if (pfx_un.length != 128)
{ {
zlog_debug vnc_zlog_debug_verbose
("%s: redist nve group UN prefix len (%d) != 128, skipping", ("%s: redist nve group UN prefix len (%d) != 128, skipping",
__func__, pfx_un.length); __func__, pfx_un.length);
return; return;
} }
break; break;
default: default:
zlog_debug vnc_zlog_debug_verbose
("%s: no redist nve group UN host prefix configured, skipping", ("%s: no redist nve group UN host prefix configured, skipping",
__func__); __func__);
return; return;
@ -238,26 +239,26 @@ vnc_redistribute_delete (struct prefix *p, uint8_t type)
if (!bgp->rfapi_cfg) if (!bgp->rfapi_cfg)
{ {
zlog_debug ("%s: bgp->rfapi_cfg is NULL, skipping", __func__); vnc_zlog_debug_verbose ("%s: bgp->rfapi_cfg is NULL, skipping", __func__);
return; return;
} }
afi = family2afi (p->family); afi = family2afi (p->family);
if (!afi) if (!afi)
{ {
zlog_debug ("%s: unknown prefix address family %d", __func__, vnc_zlog_debug_verbose ("%s: unknown prefix address family %d", __func__,
p->family); p->family);
return; return;
} }
if (!bgp->rfapi_cfg->redist[afi][type]) if (!bgp->rfapi_cfg->redist[afi][type])
{ {
zlog_debug vnc_zlog_debug_verbose
("%s: bgp->rfapi_cfg->redist[afi=%d][type=%d] is 0, skipping", ("%s: bgp->rfapi_cfg->redist[afi=%d][type=%d] is 0, skipping",
__func__, afi, type); __func__, afi, type);
return; return;
} }
if (!bgp->rfapi_cfg->rfg_redist) if (!bgp->rfapi_cfg->rfg_redist)
{ {
zlog_debug ("%s: no redist nve group, skipping", __func__); vnc_zlog_debug_verbose ("%s: no redist nve group, skipping", __func__);
return; return;
} }
@ -284,13 +285,13 @@ vnc_redistribute_withdraw (struct bgp *bgp, afi_t afi, uint8_t type)
struct bgp_node *prn; struct bgp_node *prn;
struct bgp_node *rn; struct bgp_node *rn;
zlog_debug ("%s: entry", __func__); vnc_zlog_debug_verbose ("%s: entry", __func__);
if (!bgp) if (!bgp)
return; return;
if (!bgp->rfapi_cfg) if (!bgp->rfapi_cfg)
{ {
zlog_debug ("%s: bgp->rfapi_cfg is NULL, skipping", __func__); vnc_zlog_debug_verbose ("%s: bgp->rfapi_cfg is NULL, skipping", __func__);
return; return;
} }
@ -331,7 +332,7 @@ vnc_redistribute_withdraw (struct bgp *bgp, afi_t afi, uint8_t type)
} }
} }
} }
zlog_debug ("%s: return", __func__); vnc_zlog_debug_verbose ("%s: return", __func__);
} }
/* /*
@ -388,7 +389,7 @@ vnc_zebra_read_ipv4 (
if (BGP_DEBUG (zebra, ZEBRA)) if (BGP_DEBUG (zebra, ZEBRA))
{ {
char buf[2][INET_ADDRSTRLEN]; char buf[2][INET_ADDRSTRLEN];
zlog_debug vnc_zlog_debug_verbose
("%s: Zebra rcvd: IPv4 route add %s %s/%d nexthop %s metric %u", ("%s: Zebra rcvd: IPv4 route add %s %s/%d nexthop %s metric %u",
__func__, zebra_route_string (api.type), inet_ntop (AF_INET, __func__, zebra_route_string (api.type), inet_ntop (AF_INET,
&p.prefix, &p.prefix,
@ -406,7 +407,7 @@ vnc_zebra_read_ipv4 (
if (BGP_DEBUG (zebra, ZEBRA)) if (BGP_DEBUG (zebra, ZEBRA))
{ {
char buf[2][INET_ADDRSTRLEN]; char buf[2][INET_ADDRSTRLEN];
zlog_debug ("%s: Zebra rcvd: IPv4 route delete %s %s/%d " vnc_zlog_debug_verbose ("%s: Zebra rcvd: IPv4 route delete %s %s/%d "
"nexthop %s metric %u", "nexthop %s metric %u",
__func__, __func__,
zebra_route_string (api.type), zebra_route_string (api.type),
@ -477,7 +478,7 @@ vnc_zebra_read_ipv6 (
if (BGP_DEBUG (zebra, ZEBRA)) if (BGP_DEBUG (zebra, ZEBRA))
{ {
char buf[INET6_ADDRSTRLEN]; char buf[INET6_ADDRSTRLEN];
zlog_debug ("Zebra rcvd: IPv6 route add %s %s/%d metric %u", vnc_zlog_debug_verbose ("Zebra rcvd: IPv6 route add %s %s/%d metric %u",
zebra_route_string (api.type), zebra_route_string (api.type),
inet_ntop (AF_INET6, &p.prefix, buf, sizeof (buf)), inet_ntop (AF_INET6, &p.prefix, buf, sizeof (buf)),
p.prefixlen, api.metric); p.prefixlen, api.metric);
@ -489,7 +490,7 @@ vnc_zebra_read_ipv6 (
if (BGP_DEBUG (zebra, ZEBRA)) if (BGP_DEBUG (zebra, ZEBRA))
{ {
char buf[INET6_ADDRSTRLEN]; char buf[INET6_ADDRSTRLEN];
zlog_debug ("Zebra rcvd: IPv6 route delete %s %s/%d metric %u", vnc_zlog_debug_verbose ("Zebra rcvd: IPv6 route delete %s %s/%d metric %u",
zebra_route_string (api.type), zebra_route_string (api.type),
inet_ntop (AF_INET6, &p.prefix, buf, sizeof (buf)), inet_ntop (AF_INET6, &p.prefix, buf, sizeof (buf)),
p.prefixlen, api.metric); p.prefixlen, api.metric);
@ -516,7 +517,7 @@ vnc_zebra_route_msg (
{ {
if (!nhp_count) if (!nhp_count)
{ {
zlog_debug ("%s: empty nexthop list, skipping", __func__); vnc_zlog_debug_verbose ("%s: empty nexthop list, skipping", __func__);
return; return;
} }
@ -538,7 +539,7 @@ vnc_zebra_route_msg (
{ {
char buf[INET_ADDRSTRLEN]; char buf[INET_ADDRSTRLEN];
zlog_debug ("%s: Zebra send: IPv4 route %s %s/%d, nhp_count=%d", vnc_zlog_debug_verbose ("%s: Zebra send: IPv4 route %s %s/%d, nhp_count=%d",
__func__, __func__,
(add ? "add" : "del"), (add ? "add" : "del"),
inet_ntop (AF_INET, &p->u.prefix4, buf, sizeof (buf)), inet_ntop (AF_INET, &p->u.prefix4, buf, sizeof (buf)),
@ -572,7 +573,7 @@ vnc_zebra_route_msg (
{ {
char buf[INET6_ADDRSTRLEN]; char buf[INET6_ADDRSTRLEN];
zlog_debug ("%s: Zebra send: IPv6 route %s %s/%d nhp_count=%d", vnc_zlog_debug_verbose ("%s: Zebra send: IPv6 route %s %s/%d nhp_count=%d",
__func__, __func__,
(add ? "add" : "del"), (add ? "add" : "del"),
inet_ntop (AF_INET6, &p->u.prefix6, buf, sizeof (buf)), inet_ntop (AF_INET6, &p->u.prefix6, buf, sizeof (buf)),
@ -585,7 +586,7 @@ vnc_zebra_route_msg (
} }
else else
{ {
zlog_debug ("%s: unknown prefix address family, skipping", __func__); vnc_zlog_debug_verbose ("%s: unknown prefix address family, skipping", __func__);
return; return;
} }
} }
@ -607,7 +608,7 @@ nve_list_to_nh_array (
if (!nve_count) if (!nve_count)
{ {
zlog_debug ("%s: empty nve_list, skipping", __func__); vnc_zlog_debug_verbose ("%s: empty nve_list, skipping", __func__);
return; return;
} }
@ -643,7 +644,7 @@ nve_list_to_nh_array (
*iap = nhp.u.prefix4; *iap = nhp.u.prefix4;
*v = iap; *v = iap;
zlog_debug ("%s: ipadr: (%p)<-0x%x, ptr: (%p)<-%p", vnc_zlog_debug_verbose ("%s: ipadr: (%p)<-0x%x, ptr: (%p)<-%p",
__func__, iap, nhp.u.prefix4.s_addr, v, iap); __func__, iap, nhp.u.prefix4.s_addr, v, iap);
++iap; ++iap;
@ -729,7 +730,7 @@ vnc_zebra_add_del_prefix (
void *nh_ary = NULL; void *nh_ary = NULL;
void *nhp_ary = NULL; void *nhp_ary = NULL;
zlog_debug ("%s: entry, add=%d", __func__, add); vnc_zlog_debug_verbose ("%s: entry, add=%d", __func__, add);
if (zclient_vnc->sock < 0) if (zclient_vnc->sock < 0)
return; return;
@ -746,12 +747,12 @@ vnc_zebra_add_del_prefix (
if (!bgp->rfapi_cfg) if (!bgp->rfapi_cfg)
{ {
zlog_debug ("%s: bgp->rfapi_cfg is NULL, skipping", __func__); vnc_zlog_debug_verbose ("%s: bgp->rfapi_cfg is NULL, skipping", __func__);
return; return;
} }
if (!listcount (bgp->rfapi_cfg->rfg_export_zebra_l)) if (!listcount (bgp->rfapi_cfg->rfg_export_zebra_l))
{ {
zlog_debug ("%s: no zebra export nve group, skipping", __func__); vnc_zlog_debug_verbose ("%s: no zebra export nve group, skipping", __func__);
return; return;
} }
@ -808,7 +809,7 @@ vnc_zebra_add_del_nve (
// struct prefix *nhpp; // struct prefix *nhpp;
void *pAddr; void *pAddr;
zlog_debug ("%s: entry, add=%d", __func__, add); vnc_zlog_debug_verbose ("%s: entry, add=%d", __func__, add);
if (zclient_vnc->sock < 0) if (zclient_vnc->sock < 0)
return; return;
@ -826,13 +827,13 @@ vnc_zebra_add_del_nve (
return; return;
if (!bgp->rfapi_cfg) if (!bgp->rfapi_cfg)
{ {
zlog_debug ("%s: bgp->rfapi_cfg is NULL, skipping", __func__); vnc_zlog_debug_verbose ("%s: bgp->rfapi_cfg is NULL, skipping", __func__);
return; return;
} }
if (rfapiRaddr2Qprefix (&rfd->vn_addr, &nhp)) if (rfapiRaddr2Qprefix (&rfd->vn_addr, &nhp))
{ {
zlog_debug ("%s: can't convert vn address, skipping", __func__); vnc_zlog_debug_verbose ("%s: can't convert vn address, skipping", __func__);
return; return;
} }
@ -857,7 +858,7 @@ vnc_zebra_add_del_nve (
struct rfapi_import_table *import_table; struct rfapi_import_table *import_table;
import_table = rfg->rfapi_import_table; import_table = rfg->rfapi_import_table;
zlog_debug ("%s: this nve's group is in zebra export list", vnc_zlog_debug_verbose ("%s: this nve's group is in zebra export list",
__func__); __func__);
rt = import_table->imported_vpn[afi]; rt = import_table->imported_vpn[afi];
@ -871,7 +872,7 @@ vnc_zebra_add_del_nve (
if (rn->info) if (rn->info)
{ {
zlog_debug ("%s: sending %s", __func__, vnc_zlog_debug_verbose ("%s: sending %s", __func__,
(add ? "add" : "del")); (add ? "add" : "del"));
vnc_zebra_route_msg (&rn->p, 1, &pAddr, add); vnc_zebra_route_msg (&rn->p, 1, &pAddr, add);
} }
@ -909,11 +910,11 @@ vnc_zebra_add_del_group_afi (
void *nh_ary = NULL; void *nh_ary = NULL;
void *nhp_ary = NULL; void *nhp_ary = NULL;
zlog_debug ("%s: entry", __func__); vnc_zlog_debug_verbose ("%s: entry", __func__);
import_table = rfg->rfapi_import_table; import_table = rfg->rfapi_import_table;
if (!import_table) if (!import_table)
{ {
zlog_debug ("%s: import table not defined, returning", __func__); vnc_zlog_debug_verbose ("%s: import table not defined, returning", __func__);
return; return;
} }
@ -937,17 +938,17 @@ vnc_zebra_add_del_group_afi (
if (!rfg->nves) if (!rfg->nves)
{ {
/* avoid segfault below if list doesn't exist */ /* avoid segfault below if list doesn't exist */
zlog_debug ("%s: no NVEs in this group", __func__); vnc_zlog_debug_verbose ("%s: no NVEs in this group", __func__);
return; return;
} }
nve_group_to_nve_list (rfg, &nves, family); nve_group_to_nve_list (rfg, &nves, family);
if (nves) if (nves)
{ {
zlog_debug ("%s: have nves", __func__); vnc_zlog_debug_verbose ("%s: have nves", __func__);
nve_list_to_nh_array (family, nves, &nexthop_count, &nh_ary, &nhp_ary); nve_list_to_nh_array (family, nves, &nexthop_count, &nh_ary, &nhp_ary);
zlog_debug ("%s: family: %d, nve count: %d", __func__, family, vnc_zlog_debug_verbose ("%s: family: %d, nve count: %d", __func__, family,
nexthop_count); nexthop_count);
list_delete (nves); list_delete (nves);
@ -982,7 +983,7 @@ vnc_zebra_add_group (struct bgp *bgp, struct rfapi_nve_group_cfg *rfg)
void void
vnc_zebra_del_group (struct bgp *bgp, struct rfapi_nve_group_cfg *rfg) vnc_zebra_del_group (struct bgp *bgp, struct rfapi_nve_group_cfg *rfg)
{ {
zlog_debug ("%s: entry", __func__); vnc_zlog_debug_verbose ("%s: entry", __func__);
vnc_zebra_add_del_group_afi (bgp, rfg, AFI_IP, 0); vnc_zebra_add_del_group_afi (bgp, rfg, AFI_IP, 0);
vnc_zebra_add_del_group_afi (bgp, rfg, AFI_IP6, 0); vnc_zebra_add_del_group_afi (bgp, rfg, AFI_IP6, 0);
} }
@ -1041,7 +1042,7 @@ vnc_redistribute_set (struct bgp *bgp, afi_t afi, int type)
return CMD_WARNING; return CMD_WARNING;
if (BGP_DEBUG (zebra, ZEBRA)) if (BGP_DEBUG (zebra, ZEBRA))
zlog_debug ("Zebra send: redistribute add %s", zebra_route_string (type)); vnc_zlog_debug_verbose ("Zebra send: redistribute add %s", zebra_route_string (type));
/* Send distribute add message to zebra. */ /* Send distribute add message to zebra. */
zebra_redistribute_send (ZEBRA_REDISTRIBUTE_ADD, zclient_vnc, afi, type, 0, VRF_DEFAULT); zebra_redistribute_send (ZEBRA_REDISTRIBUTE_ADD, zclient_vnc, afi, type, 0, VRF_DEFAULT);
@ -1053,11 +1054,11 @@ vnc_redistribute_set (struct bgp *bgp, afi_t afi, int type)
int int
vnc_redistribute_unset (struct bgp *bgp, afi_t afi, int type) vnc_redistribute_unset (struct bgp *bgp, afi_t afi, int type)
{ {
zlog_debug ("%s: type=%d entry", __func__, type); vnc_zlog_debug_verbose ("%s: type=%d entry", __func__, type);
if (!bgp->rfapi_cfg) if (!bgp->rfapi_cfg)
{ {
zlog_debug ("%s: return (no rfapi_cfg)", __func__); vnc_zlog_debug_verbose ("%s: return (no rfapi_cfg)", __func__);
return CMD_WARNING; return CMD_WARNING;
} }
@ -1074,7 +1075,7 @@ vnc_redistribute_unset (struct bgp *bgp, afi_t afi, int type)
{ {
/* Send distribute delete message to zebra. */ /* Send distribute delete message to zebra. */
if (BGP_DEBUG (zebra, ZEBRA)) if (BGP_DEBUG (zebra, ZEBRA))
zlog_debug ("Zebra send: redistribute delete %s", vnc_zlog_debug_verbose ("Zebra send: redistribute delete %s",
zebra_route_string (type)); zebra_route_string (type));
zebra_redistribute_send (ZEBRA_REDISTRIBUTE_DELETE, zclient_vnc, afi, type, zebra_redistribute_send (ZEBRA_REDISTRIBUTE_DELETE, zclient_vnc, afi, type,
0, VRF_DEFAULT); 0, VRF_DEFAULT);
@ -1083,7 +1084,7 @@ vnc_redistribute_unset (struct bgp *bgp, afi_t afi, int type)
/* Withdraw redistributed routes from current BGP's routing table. */ /* Withdraw redistributed routes from current BGP's routing table. */
vnc_redistribute_withdraw (bgp, afi, type); vnc_redistribute_withdraw (bgp, afi, type);
zlog_debug ("%s: return", __func__); vnc_zlog_debug_verbose ("%s: return", __func__);
return CMD_SUCCESS; return CMD_SUCCESS;
} }