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 15, 2015
1 parent 48ae173 commit 3b543a8
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions utils/vif.c
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 3b543a8

Please sign in to comment.