Skip to content

Commit

Permalink
For non tcp/udp/sctp FatFlows, print proto:*
Browse files Browse the repository at this point in the history
'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
  • Loading branch information
anandhk-juniper committed Dec 8, 2015
1 parent 7e8b355 commit 6d01d73
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions utils/vif.c
Expand Up @@ -258,6 +258,7 @@ vr_interface_req_process(void *s)
char name[50];
int platform = get_platform();
unsigned int printed = 0, i;
uint16_t proto, port;

vr_interface_req *req = (vr_interface_req *)s;

Expand Down Expand Up @@ -336,11 +337,22 @@ vr_interface_req_process(void *s)
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) {
Expand Down

0 comments on commit 6d01d73

Please sign in to comment.