Changeset a472b50
- Timestamp:
- 05/23/06 13:23:06 (16 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:
- 11c4044
- Parents:
- 0837e57
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/tracereport/tracereport.c
rc3e6e47 ra472b50 29 29 */ 30 30 31 / /32 // This program takes a series of traces and bpf filters and outputs how many 33 // bytes/packets 31 /* This program takes a series of traces and bpf filters and outputs how many 32 * bytes/packets 33 */ 34 34 35 35 #include <stdio.h> … … 59 59 60 60 /* Process a trace, counting packets that match filter(s) */ 61 void run_trace(char *uri )61 void run_trace(char *uri, libtrace_filter_t *filter, int count) 62 62 { 63 63 struct libtrace_packet_t *packet = trace_create_packet(); … … 68 68 if (trace_is_err(trace)) { 69 69 trace_perror(trace,"trace_create"); 70 return 1; 70 return; 71 } 72 73 if (filter) { 74 trace_config(trace,TRACE_OPTION_FILTER,filter); 71 75 } 72 76 73 77 if (trace_start(trace)==-1) { 74 78 trace_perror(trace,"trace_start"); 75 return 1;79 return; 76 80 } 77 81 78 82 for (;;) { 79 83 int psize; 84 if (count--<1) 85 break; 80 86 if ((psize = trace_read_packet(trace, packet)) <1) { 81 87 break; … … 104 110 int i; 105 111 112 /*char *filterstring="host 130.197.127.210"; */ 113 114 libtrace_filter_t *filter = NULL;/*trace_bpf_setfilter(filterstring); */ 106 115 107 116 for(i=1;i<argc;++i) { 108 run_trace(argv[i] );117 run_trace(argv[i],filter,1000); 109 118 } 110 119
Note: See TracChangeset
for help on using the changeset viewer.