mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 02:30:52 +00:00
lib: Add vrf name to outputs/debugs
Add some additional output/debug to code to allow us to see the vrf name instead of just the vrf id. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
b7e48f2147
commit
a94fbcca24
21
lib/if.c
21
lib/if.c
@ -745,12 +745,16 @@ static void if_dump(const struct interface *ifp)
|
|||||||
struct listnode *node;
|
struct listnode *node;
|
||||||
struct connected *c __attribute__((unused));
|
struct connected *c __attribute__((unused));
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, c))
|
for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, c)) {
|
||||||
|
struct vrf *vrf = vrf_lookup_by_id(ifp->vrf_id);
|
||||||
|
|
||||||
zlog_info(
|
zlog_info(
|
||||||
"Interface %s vrf %u index %d metric %d mtu %d "
|
"Interface %s vrf %s(%u) index %d metric %d mtu %d "
|
||||||
"mtu6 %d %s",
|
"mtu6 %d %s",
|
||||||
ifp->name, ifp->vrf_id, ifp->ifindex, ifp->metric,
|
ifp->name, VRF_LOGNAME(vrf), ifp->vrf_id, ifp->ifindex,
|
||||||
ifp->mtu, ifp->mtu6, if_flag_dump(ifp->flags));
|
ifp->metric, ifp->mtu, ifp->mtu6,
|
||||||
|
if_flag_dump(ifp->flags));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Interface printing for all interface. */
|
/* Interface printing for all interface. */
|
||||||
@ -850,7 +854,8 @@ DEFUN (show_address_vrf_all,
|
|||||||
if (RB_EMPTY (if_name_head, &vrf->ifaces_by_name))
|
if (RB_EMPTY (if_name_head, &vrf->ifaces_by_name))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
vty_out (vty, "\nVRF %u\n\n", vrf->vrf_id);
|
vty_out (vty, "\nVRF %s(%u)\n\n",
|
||||||
|
VRF_LOGNAME(vrf), vrf->vrf_id);
|
||||||
|
|
||||||
FOR_ALL_INTERFACES (vrf, ifp) {
|
FOR_ALL_INTERFACES (vrf, ifp) {
|
||||||
for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, ifc)) {
|
for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, ifc)) {
|
||||||
@ -923,14 +928,16 @@ connected_log(struct connected *connected, char *str)
|
|||||||
{
|
{
|
||||||
struct prefix *p;
|
struct prefix *p;
|
||||||
struct interface *ifp;
|
struct interface *ifp;
|
||||||
|
struct vrf *vrf;
|
||||||
char logbuf[BUFSIZ];
|
char logbuf[BUFSIZ];
|
||||||
char buf[BUFSIZ];
|
char buf[BUFSIZ];
|
||||||
|
|
||||||
ifp = connected->ifp;
|
ifp = connected->ifp;
|
||||||
p = connected->address;
|
p = connected->address;
|
||||||
|
|
||||||
snprintf(logbuf, BUFSIZ, "%s interface %s vrf %u %s %s/%d ", str,
|
vrf = vrf_lookup_by_id(ifp->vrf_id);
|
||||||
ifp->name, ifp->vrf_id, prefix_family_str(p),
|
snprintf(logbuf, BUFSIZ, "%s interface %s vrf %s(%u) %s %s/%d ", str,
|
||||||
|
ifp->name, VRF_LOGNAME(vrf), ifp->vrf_id, prefix_family_str(p),
|
||||||
inet_ntop(p->family, &p->u.prefix, buf, BUFSIZ), p->prefixlen);
|
inet_ntop(p->family, &p->u.prefix, buf, BUFSIZ), p->prefixlen);
|
||||||
|
|
||||||
p = connected->destination;
|
p = connected->destination;
|
||||||
|
Loading…
Reference in New Issue
Block a user