From 3b543a83253258ba85b65995ed78e958a4c3b085 Mon Sep 17 00:00:00 2001 From: "Anand H. Krishnan" Date: Tue, 8 Dec 2015 12:27:59 +0530 Subject: [PATCH] For non tcp/udp/sctp FatFlows, print proto:* 'vif' utility displays protocol:port for configured FatFlows. For not TCP/UDP/SCTP protocols, vif will print protocol:*, indicating that all ports corresponding to the protocol will undergo FatFlow. Change-Id: I74161e905cf010dd68f049cf28a63c2996aac589 Partial-BUG: 1518234 --- utils/vif.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/utils/vif.c b/utils/vif.c index 93320ee1e..562ebfb5e 100644 --- a/utils/vif.c +++ b/utils/vif.c @@ -380,6 +380,7 @@ list_get_print(vr_interface_req *req) char name[50] = {0}; int printed = 0; unsigned int i; + uint16_t proto, port; bool print_zero = false; if (rate_set) { @@ -479,11 +480,22 @@ list_get_print(vr_interface_req *req) if (req->vifr_fat_flow_protocol_port_size) { vr_interface_print_head_space(); printed = 0; - printed += printf("FatFlows: "); + printed += printf("FatFlows (Protocol/Port): "); for (i = 0; i < req->vifr_fat_flow_protocol_port_size; i++) { - printed += printf("%d:%d", - VIF_FAT_FLOW_PROTOCOL(req->vifr_fat_flow_protocol_port[i]), - VIF_FAT_FLOW_PORT(req->vifr_fat_flow_protocol_port[i])); + proto = VIF_FAT_FLOW_PROTOCOL(req->vifr_fat_flow_protocol_port[i]); + port = VIF_FAT_FLOW_PORT(req->vifr_fat_flow_protocol_port[i]); + if (!proto) { + proto = port; + port = 0; + } + + printed += printf("%d:", proto); + if (port) { + printed += printf("%d", port); + } else { + printed += printf("%c", '*'); + } + if (i == (req->vifr_fat_flow_protocol_port_size - 1)) { printf("\n"); } else if (printed > 68) {