Changeset 3bfeb7d for tools/tracereport
- Timestamp:
- 02/26/07 13:48:28 (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:
- 634089d
- Parents:
- 051618c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/tracereport/synopt_report.c
r051618c r3bfeb7d 13 13 bool ts; 14 14 bool ttcp; 15 bool other; 15 16 }; 16 17 … … 22 23 uint64_t mw; 23 24 uint64_t msw; 25 uint64_t mt; 24 26 uint64_t all_four; 25 27 uint64_t ts_and_another; 26 28 uint64_t ttcp; 29 uint64_t other; 27 30 }; 28 31 29 struct opt_counter counts = {0,0,0,0,0,0,0,0,0 };32 struct opt_counter counts = {0,0,0,0,0,0,0,0,0,0,0}; 30 33 uint64_t total_syns = 0; 31 34 32 35 void classify_packet(struct tcp_opts opts) { 33 if (!opts.mss && !opts.sack && !opts.winscale && !opts.ts && !opts.ttcp )36 if (!opts.mss && !opts.sack && !opts.winscale && !opts.ts && !opts.ttcp && !opts.other) 34 37 { 35 38 counts.no_options ++; … … 37 40 } 38 41 39 if (opts.mss && !opts.sack && !opts.winscale && !opts.ts && !opts.ttcp )42 if (opts.mss && !opts.sack && !opts.winscale && !opts.ts && !opts.ttcp && !opts.other) 40 43 { 41 44 counts.mss_only ++; … … 43 46 } 44 47 45 if (!opts.mss && !opts.sack && !opts.winscale && opts.ts && !opts.ttcp )48 if (!opts.mss && !opts.sack && !opts.winscale && opts.ts && !opts.ttcp && !opts.other) 46 49 { 47 50 counts.ts_only ++; … … 58 61 counts.msw ++; 59 62 63 if (opts.mss && opts.ts && !opts.winscale && !opts.sack) 64 counts.mt ++; 60 65 if (opts.mss && opts.sack && opts.winscale && opts.ts) { 61 66 counts.all_four ++; … … 68 73 if (opts.ttcp) 69 74 counts.ttcp ++; 70 75 if (opts.other) 76 counts.other ++; 71 77 } 72 78 … … 78 84 int tcp_payload, len; 79 85 unsigned char type, optlen, *data; 80 struct tcp_opts opts_seen = {false, false, false, false, false };86 struct tcp_opts opts_seen = {false, false, false, false, false, false}; 81 87 82 88 if(!tcp) … … 109 115 opts_seen.winscale = true; 110 116 break; 117 case 4: 118 opts_seen.sack = true; 119 break; 111 120 case 5: 112 121 opts_seen.sack = true; … … 120 129 opts_seen.ttcp = true; 121 130 break; 131 default: 132 opts_seen.other = true; 122 133 } 123 134 } … … 156 167 (double)(counts.msw) / total_syns * 100.0); 157 168 fprintf(out, "%-20s\t%.2f%%\n", 169 "M, T", 170 (double)(counts.mt) / total_syns * 100.0); 171 fprintf(out, "%-20s\t%.2f%%\n", 158 172 "M, S, W and T", 159 173 (double)(counts.all_four) / total_syns * 100.0); 160 fprintf(out, "%-20s\t%.2f%%\n",161 "T and (M or S or W)",162 (double)(counts.ts_and_another) / total_syns * 100.0);174 //fprintf(out, "%-20s\t%.2f%%\n", 175 // "T and (M or S or W)", 176 // (double)(counts.ts_and_another) / total_syns * 100.0); 163 177 fprintf(out, "%-20s\t%.2f%%\n", 164 178 "T/TCP", 165 179 (double)(counts.ttcp) / total_syns * 100.0); 180 fprintf(out, "%-20s\t%.2f%%\n", 181 "Other options", 182 (double)(counts.other) / total_syns * 100.0); 166 183 167 184
Note: See TracChangeset
for help on using the changeset viewer.