Changeset 33dff53 for tools/tracereport
- Timestamp:
- 04/03/07 10:48:24 (15 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:
- 6b6ede6
- Parents:
- d36a8c6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/tracereport/port_report.c
rb5dc60d r33dff53 9 9 #include "contain.h" 10 10 11 stat_t ports[3][256][65536]={{{{0,0}}}};11 stat_t *ports[3][256] = {{NULL}}; 12 12 char protn[256]={0}; 13 13 static bool suppress[3] = {true,true,true}; … … 31 31 : trace_get_destination_port(packet); 32 32 33 if (!ports[dir][proto]) 34 ports[dir][proto]=calloc(65536,sizeof(stat_t)); 33 35 ports[dir][proto][port].bytes+=trace_get_wire_length(packet); 34 36 ports[dir][proto][port].count++; … … 76 78 printf("%20s:",ent->s_name); 77 79 for(k=0;k<3;k++){ 78 if ( ports[k][i][j].count==0){80 if (!ports[k][i] || ports[k][i][j].count==0){ 79 81 if(!suppress[k]) 80 82 printf("\t%24s"," "); … … 90 92 printf("%20i:",j); 91 93 for(k=0;k<3;k++){ 92 if ( ports[k][i][j].count==0){94 if (!ports[k][i] || ports[k][i][j].count==0){ 93 95 if(!suppress[k]) 94 96 printf("\t%24s"," "); … … 112 114 for(j=0;j<65536;++j) { 113 115 for(k=0;k<3;k++){ 114 if (ports[k][i] [j].count) {116 if (ports[k][i] && ports[k][i][j].count) { 115 117 port_port(i,ent?ent->p_name:"",j); 116 118 break; … … 130 132 if (protn[i]) { 131 133 port_protocol(i); 134 free(ports[0][i]); 135 free(ports[1][i]); 136 free(ports[2][i]); 132 137 } 133 138 }
Note: See TracChangeset
for help on using the changeset viewer.