- Timestamp:
- 12/03/07 23:11:00 (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:
- fdc7502
- Parents:
- 25024fd
- Location:
- tools
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/tracereport/Makefile.am
rc20af2a r4423dc7 26 26 ecn_report.c\ 27 27 tcpsegment_report.c\ 28 drops_report.c\ 28 29 contain.h\ 29 30 report.h\ -
tools/tracereport/report.h
r7be3cc4 r4423dc7 16 16 void tcpseg_per_packet(struct libtrace_packet_t *packet); 17 17 18 void drops_per_trace(libtrace_t *trace); 19 18 20 void dir_report(void); 19 21 void error_report(void); … … 29 31 void ecn_report(void); 30 32 void tcpseg_report(void); 33 void drops_report(void); 31 34 32 35 #endif -
tools/tracereport/tracereport.c
r2cf30f6 r4423dc7 120 120 tcpseg_per_packet(packet); 121 121 } 122 if (reports_required & REPORT_TYPE_DROPS) 123 drops_per_trace(trace); 122 124 trace_destroy(trace); 123 125 } … … 158 160 int option_index; 159 161 struct option long_options[] = { 162 { "ecn", 0, 0, 'C' }, 163 { "direction", 0, 0, 'd' }, 164 { "drops", 0, 0, 'D' }, 165 { "error", 0, 0, 'e' }, 166 { "flow", 0, 0, 'F' }, 160 167 { "filter", 1, 0, 'f' }, 161 168 { "help", 0, 0, 'H' }, 162 { "error", 0, 0, 'e' }, 163 { "flow", 0, 0, 'F' }, 169 { "misc", 0, 0, 'm' }, 170 { "nlp", 0, 0, 'n' }, 171 { "tcpoptions", 0, 0, 'O' }, 172 { "synoptions", 0, 0, 'o' }, 164 173 { "protocol", 0, 0, 'P' }, 165 174 { "port", 0, 0, 'p' }, 166 { " misc", 0, 0, 'm' },175 { "tcpsegment", 0, 0, 's' }, 167 176 { "tos", 0, 0, 'T' }, 168 177 { "ttl", 0, 0, 't' }, 169 { "tcpoptions", 0, 0, 'O' },170 { "synoptions", 0, 0, 'o' },171 { "nlp", 0, 0, 'n' },172 { "direction", 0, 0, 'd' },173 { "ecn", 0, 0, 'C' },174 { "tcpsegment", 0, 0, 's' },175 178 { NULL, 0, 0, 0 } 176 179 }; 177 opt = getopt_long(argc, argv, " f:HemFPpTtOondCsl:",180 opt = getopt_long(argc, argv, "Df:HemFPpTtOondCsl:", 178 181 long_options, &option_index); 179 182 if (opt == -1) … … 186 189 case 'd': 187 190 reports_required |= REPORT_TYPE_DIR; 191 break; 192 case 'D': 193 reports_required |= REPORT_TYPE_DROPS; 188 194 break; 189 195 case 'e': … … 284 290 if (reports_required & REPORT_TYPE_TCPSEG) 285 291 tcpseg_report(); 292 if (reports_required & REPORT_TYPE_DROPS) 293 drops_report(); 286 294 return 0; 287 295 } -
tools/tracereport/tracereport.h
rc20af2a r4423dc7 21 21 REPORT_TYPE_SYNOPT = 1 << 11, 22 22 REPORT_TYPE_LOCALITY = 1 << 12, /* No longer used by libtrace */ 23 REPORT_TYPE_MISC = 1 << 13 23 REPORT_TYPE_MISC = 1 << 13, 24 REPORT_TYPE_DROPS = 1<< 14 24 25 } report_type_t; 25 26 -
tools/tracesplit/tracesplit.c
rcd1fd75 r4423dc7 39 39 "-H --libtrace-help Print libtrace runtime documentation\n" 40 40 "-S --snaplen Snap packets at the specified length\n" 41 "-v --verbose Output statistics\n" 41 42 ,argv0); 42 43 exit(1); … … 70 71 uint64_t filescreated = 0; 71 72 uint16_t snaplen = 0; 73 int verbose=0; 72 74 73 75 if (argc<2) { … … 89 91 { "maxfiles", 1, 0, 'm' }, 90 92 { "snaplen", 1, 0, 'S' }, 93 { "verbose", 0, 0, 'v' }, 91 94 { NULL, 0, 0, 0 }, 92 95 }; 93 96 94 int c=getopt_long(argc, argv, "f:c:b:s:e:i:m:S:H ",97 int c=getopt_long(argc, argv, "f:c:b:s:e:i:m:S:Hv", 95 98 long_options, &option_index); 96 99 … … 118 121 trace_help(); 119 122 exit(1); 123 break; 124 case 'v': 125 verbose++; 120 126 break; 121 127 default: … … 250 256 trace_perror(input, "Reading packets"); 251 257 } 258 259 if (verbose) { 260 uint64_t f; 261 f=trace_get_received_packets(input); 262 if (f!=UINT64_MAX) 263 fprintf(stderr,"%" PRIu64 " packets on input\n",f); 264 f=trace_get_filtered_packets(input); 265 if (f!=UINT64_MAX) 266 fprintf(stderr,"%" PRIu64 " packets filtered\n",f); 267 f=trace_get_dropped_packets(input); 268 if (f!=UINT64_MAX) 269 fprintf(stderr,"%" PRIu64 " packets dropped\n",f); 270 f=trace_get_accepted_packets(input); 271 if (f!=UINT64_MAX) 272 fprintf(stderr,"%" PRIu64 " packets accepted\n",f); 273 } 252 274 253 275 trace_destroy(input); -
tools/tracestats/tracestats.c
rfbc4342 r4423dc7 85 85 uint64_t count = 0; 86 86 uint64_t bytes = 0; 87 uint64_t packets; 87 88 88 89 fprintf(stderr,"%s:\n",uri); … … 134 135 filters[i].count=0; 135 136 } 137 packets=trace_get_received_packets(trace); 138 if (packets!=UINT64_MAX) 139 fprintf(stderr,"%30s:\t%12" PRIu64"\n", 140 "Input packets", packets); 141 packets=trace_get_filtered_packets(trace); 142 if (packets!=UINT64_MAX) 143 fprintf(stderr,"%30s:\t%12" PRIu64"\n", 144 "Filtered packets", packets); 145 packets=trace_get_dropped_packets(trace); 146 if (packets!=UINT64_MAX) 147 fprintf(stderr,"%30s:\t%12" PRIu64"\n", 148 "Dropped packets",packets); 149 packets=trace_get_accepted_packets(trace); 150 if (packets!=UINT64_MAX) 151 fprintf(stderr,"%30s:\t%12" PRIu64 "\n", 152 "Accepted Packets",packets); 136 153 printf("%30s:\t%12"PRIu64"\t%12" PRIu64 "\n","Total",count,bytes); 137 154 totcount+=count;
Note: See TracChangeset
for help on using the changeset viewer.