+// SPDX-License-Identifier: GPL-2.0-or-later
/*
*
* Copyright 2009-2016, LabN Consulting, L.L.C.
*
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "lib/zebra.h"
afi_t afi; /* of the VN address */
struct bgp_dest *bn;
struct bgp_path_info *bpi;
- char buf2[RD_ADDRSTRLEN];
struct prefix_rd prd0;
afi = family2afi(p->family);
bn = bgp_afi_node_get(bgp->rib[afi][safi], afi, safi, p, prd);
vnc_zlog_debug_verbose(
- "%s: peer=%p, prefix=%pFX, prd=%s afi=%d, safi=%d bn=%p, bn->info=%p",
- __func__, peer, p, prefix_rd2str(prd, buf2, sizeof(buf2)), afi,
- safi, bn, (bn ? bgp_dest_get_bgp_path_info(bn) : NULL));
+ "%s: peer=%p, prefix=%pFX, prd=%pRDP afi=%d, safi=%d bn=%p, bn->info=%p",
+ __func__, peer, p, prd, afi, safi, bn,
+ (bn ? bgp_dest_get_bgp_path_info(bn) : NULL));
for (bpi = (bn ? bgp_dest_get_bgp_path_info(bn) : NULL); bpi;
bpi = bpi->next) {
struct bgp_attr_encap_subtlv *encaptlv;
char buf[PREFIX_STRLEN];
- char buf2[RD_ADDRSTRLEN];
struct rfapi_nexthop *lnh = NULL; /* local nexthop */
struct rfapi_vn_option *vo;
else
label_val = MPLS_LABEL_IMPLICIT_NULL;
- prefix_rd2str(prd, buf2, sizeof(buf2));
-
afi = family2afi(p->family);
assert(afi == AFI_IP || afi == AFI_IP6);
bgp_aggregate_decrement(bgp, p, bpi, afi, safi);
bgp_attr_unintern(&bpi->attr);
bpi->attr = new_attr;
- bpi->uptime = bgp_clock();
+ bpi->uptime = monotime(NULL);
if (safi == SAFI_MPLS_VPN) {
bgp_process(bgp, bn, afi, safi);
vnc_zlog_debug_any(
- "%s: Added route (safi=%s) at prefix %s (bn=%p, prd=%s)",
- __func__, safi2str(safi), buf, bn, buf2);
+ "%s: Added route (safi=%s) at prefix %s (bn=%p, prd=%pRDP)",
+ __func__, safi2str(safi), buf, bn, prd);
done:
/* Loop back to import tables */
* since this peer is not on the I/O thread, this lock is not strictly
* necessary, but serves as a reminder to those who may meddle...
*/
- frr_with_mutex(&rfd->peer->io_mtx) {
+ frr_with_mutex (&rfd->peer->io_mtx) {
// we don't need any I/O related facilities
if (rfd->peer->ibuf)
stream_fifo_free(rfd->peer->ibuf);
}
{ /* base code assumes have valid host pointer */
- char buf[BUFSIZ];
+ char buf[INET6_ADDRSTRLEN];
buf[0] = 0;
if (rfd->vn_addr.addr_family == AF_INET) {
- inet_ntop(AF_INET, &rfd->vn_addr.addr.v4, buf, BUFSIZ);
+ inet_ntop(AF_INET, &rfd->vn_addr.addr.v4, buf,
+ sizeof(buf));
} else if (rfd->vn_addr.addr_family == AF_INET6) {
- inet_ntop(AF_INET6, &rfd->vn_addr.addr.v6, buf, BUFSIZ);
+ inet_ntop(AF_INET6, &rfd->vn_addr.addr.v6, buf,
+ sizeof(buf));
}
rfd->peer->host = XSTRDUP(MTYPE_BGP_PEER_HOST, buf);
}
struct prefix pfx_un;
struct agg_node *rn;
-
- rfapi_time(&rfd->open_time);
+ rfd->open_time = monotime(NULL);
if (rfg->type == RFAPI_GROUP_CFG_VRF)
SET_FLAG(rfd->flags, RFAPI_HD_FLAG_IS_VRF);
}
rfd->rsp_counter++; /* dedup: identify this generation */
- rfd->rsp_time = rfapi_time(NULL); /* response content dedup */
+ rfd->rsp_time = monotime(NULL); /* response content dedup */
rfd->ftd_last_allowed_time =
- bgp_clock()
- - bgp->rfapi_cfg->rfp_cfg.ftd_advertisement_interval;
+ monotime(NULL) -
+ bgp->rfapi_cfg->rfp_cfg.ftd_advertisement_interval;
if (l2o) {
if (!memcmp(l2o->macaddr.octet, rfapi_ethaddr0.octet,
DEFUN (debug_rfapi_register_vn_un_l2o,
debug_rfapi_register_vn_un_l2o_cmd,
- "debug rfapi-dev register vn <A.B.C.D|X:X::X:X> un <A.B.C.D|X:X::X:X> prefix <A.B.C.D/M|X:X::X:X/M> lifetime SECONDS macaddr YY:YY:YY:YY:YY:YY lni (0-16777215)",
+ "debug rfapi-dev register vn <A.B.C.D|X:X::X:X> un <A.B.C.D|X:X::X:X> prefix <A.B.C.D/M|X:X::X:X/M> lifetime SECONDS macaddr X:X:X:X:X:X lni (0-16777215)",
DEBUG_STR
DEBUG_RFAPI_STR
"rfapi_register\n"
"debug rfapi-dev unregister vn <A.B.C.D|X:X::X:X> un <A.B.C.D|X:X::X:X> prefix <A.B.C.D/M|X:X::X:X/M> [kill]",
DEBUG_STR
DEBUG_RFAPI_STR
- "rfapi_register\n"
+ "rfapi_unregister\n"
"indicate vn addr follows\n"
"virtual network interface address\n"
+ "virtual network interface address\n"
"indicate xt addr follows\n"
"underlay network interface address\n"
+ "underlay network interface address\n"
+ "prefix to remove\n"
"prefix to remove\n"
- "Remove without holddown")
+ "prefix to remove\n"
+ "Remove without holddown\n")
{
struct rfapi_ip_addr vn;
struct rfapi_ip_addr un;
if ((rc = rfapiCliGetRfapiIpAddr(vty, argv[4]->arg, &vn)))
return rc;
-
/*
* Get UN addr
*/
DEFUN (debug_rfapi_query_vn_un_l2o,
debug_rfapi_query_vn_un_l2o_cmd,
- "debug rfapi-dev query vn <A.B.C.D|X:X::X:X> un <A.B.C.D|X:X::X:X> lni LNI target YY:YY:YY:YY:YY:YY",
+ "debug rfapi-dev query vn <A.B.C.D|X:X::X:X> un <A.B.C.D|X:X::X:X> lni LNI target X:X:X:X:X:X",
DEBUG_STR
DEBUG_RFAPI_STR
"rfapi_query\n"
memcpy(rd->val + 2, &vn->addr.v6.s6_addr32[3],
4); /* low order 4 bytes */
}
- {
- char buf[RD_ADDRSTRLEN];
-
- vnc_zlog_debug_verbose("%s: auto-RD is set to %s", __func__,
- prefix_rd2str(rd, buf, sizeof(buf)));
- }
+ vnc_zlog_debug_verbose("%s: auto-RD is set to %pRDP", __func__, rd);
return 0;
}