Skip to content

Commit

Permalink
Bug:#1377581. Formatting Bridge table display
Browse files Browse the repository at this point in the history
Change-Id: I315a46fa180403a57ec7bc4c50dc770af6c5aed1
  • Loading branch information
divakardhar committed Oct 6, 2014
1 parent ff17558 commit 9c97927
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions utils/rt.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,20 @@ vr_route_req_process(void *s_req)
printf("\n");
}
} else {
printf("%12s %5d", ether_ntoa((struct ether_addr *)(rt->rtr_mac)), rt->rtr_vrf_id);
ret = printf("%s", ether_ntoa((struct ether_addr *)(rt->rtr_mac)));
for(i = ret; i < 21; i++)
printf(" ");

ret = printf("%5d", rt->rtr_vrf_id);
for(i = ret; i < 12; i++)
printf(" ");
if (rt->rtr_label_flags & VR_RT_LABEL_VALID_FLAG)
printf("%5d ", rt->rtr_label);
ret = printf("%5d", rt->rtr_label);
else
printf("%5c ", '-');
printf("%3d \n",rt->rtr_nh_id);
ret = printf("%5c", '-');
for(i = ret; i < 12; i++)
printf(" ");
printf("%7d\n",rt->rtr_nh_id);
}

return;
Expand Down Expand Up @@ -264,7 +272,7 @@ vr_build_route_request(unsigned int op, int family, int8_t *prefix,

default:
rt_req.rtr_nh_id = nh_id;
if (prefix) {
if (cmd_prefix_set) {
memcpy(rt_req.rtr_prefix, prefix, RT_IP_ADDR_SIZE(family));
rt_req.rtr_prefix_size = RT_IP_ADDR_SIZE(family);

Expand Down Expand Up @@ -408,8 +416,8 @@ vr_route_op(void)
printf("(Src,Group) Nexthop\n");
}
} else {
printf("Kernel L2 Bridge table %d\n", req->rtr_rid);
printf("DestMac Vrf Label/VNID Nexthop\n");
printf("Kernel L2 Bridge table %d/%d\n", req->rtr_rid, cmd_vrf_id);
printf("DestMac Vrf Label/VNID Nexthop\n");
}
}

Expand Down

0 comments on commit 9c97927

Please sign in to comment.