Changeset c7c10de for tools/tracetop
- Timestamp:
- 03/11/13 13:37:47 (9 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- e99ba00
- Parents:
- 9ca1fce
- Location:
- tools/tracetop
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/tracetop/tracetop.1
rd6dc0f6 rc7c10de 9 9 [ \fB--bits-per-sec ] 10 10 [ \fB--percent ] 11 [ \fB--wide | -w ] 11 12 [ \fB-i \fRinterval | \fB--interval=\fRinterval] 12 13 [ \fB-h \fR| \fB--help\fR] … … 22 23 \fB\-i\fR interval 23 24 Wait interval seconds between updates. (default 2). 25 26 .TP 27 \fB\-\-wide 28 Expand the display to be able to fit IPv6 addresses. Use this to ensure the 29 formatting lines up in the presence of IPv6 traffic. 24 30 25 31 .TP -
tools/tracetop/tracetop.cc
r524ebb5 rc7c10de 14 14 #include <netdb.h> 15 15 #include <string.h> 16 #include <assert.h> 16 17 #ifdef HAVE_NETPACKET_PACKET_H 17 18 #include <netpacket/packet.h> … … 39 40 bool quit = false; 40 41 bool fullspeed = false; 42 bool wide_display = false; 41 43 42 44 uint64_t total_bytes=0; … … 303 305 move(1,0); 304 306 if (use_sip) { 305 printw("%20s", "source ip"); 307 if (wide_display) 308 printw("%46s", "source ip"); 309 else 310 printw("%20s", "source ip"); 311 306 312 if (use_sport) 307 313 printw("/"); … … 312 318 printw("%s\t", "sport"); 313 319 if (use_dip) { 314 printw("%20s", "dest ip"); 320 if (wide_display) 321 printw("%46s", "dest ip"); 322 else 323 printw("%20s", "dest ip"); 315 324 if (use_dport) 316 325 printw("/"); … … 341 350 move(i+1,0); 342 351 if (use_sip) { 343 printw("%20s", 344 trace_sockaddr2string((struct sockaddr*)&pq.top().sip, 345 sizeof(struct sockaddr_storage), 346 sipstr,sizeof(sipstr))); 352 if (wide_display) { 353 printw("%46s", 354 trace_sockaddr2string( 355 (struct sockaddr*)&pq.top().sip, 356 sizeof(struct sockaddr_storage), 357 sipstr,sizeof(sipstr))); 358 } else { 359 printw("%20s", 360 trace_sockaddr2string( 361 (struct sockaddr*)&pq.top().sip, 362 sizeof(struct sockaddr_storage), 363 sipstr,sizeof(sipstr))); 364 } 347 365 if (use_sport) 348 366 printw("/"); … … 353 371 printw("%-5d\t", get_port_from_sockaddr((struct sockaddr*)&pq.top().sip)); 354 372 if (use_dip) { 355 printw("%20s", 356 trace_sockaddr2string((struct sockaddr*)&pq.top().dip, 357 sizeof(struct sockaddr_storage), 358 dipstr,sizeof(dipstr))); 373 if (wide_display) { 374 printw("%46s", 375 trace_sockaddr2string( 376 (struct sockaddr*)&pq.top().dip, 377 sizeof(struct sockaddr_storage), 378 dipstr,sizeof(dipstr))); 379 } else { 380 printw("%20s", 381 trace_sockaddr2string( 382 (struct sockaddr*)&pq.top().dip, 383 sizeof(struct sockaddr_storage), 384 dipstr,sizeof(dipstr))); 385 386 } 359 387 if (use_dport) 360 388 printw("/"); … … 500 528 fprintf(stderr," -i int\n"); 501 529 fprintf(stderr,"\t\tUpdate the display every int seconds\n"); 530 fprintf(stderr," --wide\n"); 531 fprintf(stderr," -w\n"); 532 fprintf(stderr,"\t\tExpand IP address fields to fit IPv6 addresses\n"); 502 533 } 503 534 … … 523 554 { "interval", 1, 0, 'i' }, 524 555 { "fast", 0, 0, 'F' }, 556 { "wide", 0, 0, 'w' }, 525 557 { NULL, 0, 0, 0 } 526 558 }; 527 559 528 int c= getopt_long(argc, argv, "f:Fs:p:hHi: 12345",560 int c= getopt_long(argc, argv, "f:Fs:p:hHi:w12345", 529 561 long_options, &option_index); 530 562 … … 560 592 return 1; 561 593 } 594 break; 595 case 'w': 596 wide_display = true; 562 597 break; 563 598 case '1': use_sip = !use_sip; break;
Note: See TracChangeset
for help on using the changeset viewer.