static void nhrp_multicast_send(struct nhrp_peer *p, struct zbuf *zb)
{
- char buf[2][256];
size_t addrlen;
int ret;
addrlen == 4 ? ETH_P_IP : ETH_P_IPV6);
debugf(NHRP_DEBUG_COMMON,
- "Multicast Packet: %s -> %s, ret = %d, size = %zu, addrlen = %zu",
- sockunion2str(&p->vc->local.nbma, buf[0], sizeof(buf[0])),
- sockunion2str(&p->vc->remote.nbma, buf[1], sizeof(buf[1])), ret,
- zbuf_used(zb), addrlen);
+ "Multicast Packet: %pSU -> %pSU, ret = %d, size = %zu, addrlen = %zu",
+ &p->vc->local.nbma, &p->vc->remote.nbma, ret, zbuf_used(zb),
+ addrlen);
}
static void nhrp_multicast_forward_nbma(union sockunion *nbma_addr,
{
struct nhrp_interface *nifp = ifp->info;
struct nhrp_multicast *mcast;
- char buf[SU_ADDRSTRLEN];
list_for_each_entry(mcast, &nifp->afi[afi].mcastlist_head, list_entry)
{
};
list_add_tail(&mcast->list_entry, &nifp->afi[afi].mcastlist_head);
- sockunion2str(nbma_addr, buf, sizeof(buf));
- debugf(NHRP_DEBUG_COMMON, "Adding multicast entry (%s)", buf);
+ debugf(NHRP_DEBUG_COMMON, "Adding multicast entry (%pSU)", nbma_addr);
return NHRP_OK;
}
{
struct nhrp_interface *nifp = ifp->info;
struct nhrp_multicast *mcast, *tmp;
- char buf[SU_ADDRSTRLEN];
list_for_each_entry_safe(mcast, tmp, &nifp->afi[afi].mcastlist_head,
list_entry)
if (!sockunion_same(&mcast->nbma_addr, nbma_addr))
continue;
- sockunion2str(nbma_addr, buf, sizeof(buf));
- debugf(NHRP_DEBUG_COMMON, "Deleting multicast entry (%s)", buf);
+ debugf(NHRP_DEBUG_COMMON, "Deleting multicast entry (%pSU)",
+ nbma_addr);
nhrp_multicast_free(ifp, mcast);
{
struct write_map_ctx *ctx = data;
struct vty *vty = ctx->vty;
- char buf[2][SU_ADDRSTRLEN];
if (sockunion_family(&c->remote_addr) != ctx->family)
return;
- vty_out(vty, " %s nhrp map %s %s\n", ctx->aficmd,
- sockunion2str(&c->remote_addr, buf[0], sizeof(buf[0])),
- c->type == NHRP_CACHE_LOCAL
- ? "local"
- : sockunion2str(&c->nbma, buf[1], sizeof(buf[1])));
+ vty_out(vty, " %s nhrp map %pSU ", ctx->aficmd, &c->remote_addr);
+ if (c->type == NHRP_CACHE_LOCAL)
+ vty_out(vty, "local\n");
+ else
+ vty_out(vty, "%pSU\n", &c->nbma);
}
static int interface_config_write(struct vty *vty)
struct nhrp_multicast *mcast;
const char *aficmd;
afi_t afi;
- char buf[SU_ADDRSTRLEN];
int i;
FOR_ALL_INTERFACES (vrf, ifp) {
list_for_each_entry(nhs, &ad->nhslist_head,
nhslist_entry)
{
- vty_out(vty, " %s nhrp nhs %s nbma %s\n",
- aficmd,
- sockunion_family(&nhs->proto_addr)
- == AF_UNSPEC
- ? "dynamic"
- : sockunion2str(
- &nhs->proto_addr, buf,
- sizeof(buf)),
- nhs->nbma_fqdn);
+ vty_out(vty, " %s nhrp nhs ", aficmd);
+ if (sockunion_family(&nhs->proto_addr)
+ == AF_UNSPEC)
+ vty_out(vty, "dynamic");
+ else
+ vty_out(vty, "%pSU", &nhs->proto_addr);
+ vty_out(vty, "nbma %s\n", nhs->nbma_fqdn);
}
list_for_each_entry(mcast, &ad->mcastlist_head,
list_entry)
{
- vty_out(vty, " %s nhrp map multicast %s\n",
- aficmd,
- sockunion_family(&mcast->nbma_addr)
- == AF_UNSPEC
- ? "dynamic"
- : sockunion2str(
- &mcast->nbma_addr,
- buf, sizeof(buf)));
+ vty_out(vty, " %s nhrp map multicast ", aficmd);
+ if (sockunion_family(&mcast->nbma_addr)
+ == AF_UNSPEC)
+ vty_out(vty, "dynamic\n");
+ else
+ vty_out(vty, "%pSU\n",
+ &mcast->nbma_addr);
}
}