Changeset 3840760 for tools/tracemerge/tracemerge.c
- Timestamp:
- 11/28/05 10:15:22 (17 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:
- 08594b8
- Parents:
- 14d8a63
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/tracemerge/tracemerge.c
rb297e50 r3840760 19 19 struct libtrace_out_t *output; 20 20 struct libtrace_t **input; 21 struct libtrace_packet_t * packet;21 struct libtrace_packet_t **packet; 22 22 bool *live; 23 23 bool set_interface=false; … … 57 57 58 58 input=calloc((argc-optind),sizeof(struct libtrace_t *)); 59 packet=calloc((argc-optind),sizeof(struct libtrace_packet_t ));59 packet=calloc((argc-optind),sizeof(struct libtrace_packet_t *)); 60 60 live=calloc((argc-optind),sizeof(bool)); 61 61 for(i=0;i<argc-optind;++i) { 62 62 struct libtrace_t *f; 63 struct libtrace_packet_t p;63 struct libtrace_packet_t *p; 64 64 f=trace_create(argv[i+optind]); 65 p=trace_packet_create(); 65 66 input[i]=f; 67 packet[i]=p; 66 68 if (!input[i]) { 67 69 fprintf(stderr,"Could not read %s\n",argv[i+optind]); 68 70 return 1; 69 71 } 70 trace_read_packet(f, &p);72 trace_read_packet(f,p); 71 73 } 72 74 … … 76 78 for(i=0;i<argc-2;++i) { 77 79 if (!live[i] && input[i]) { 78 int ret=trace_read_packet(input[i], &packet[i]);80 int ret=trace_read_packet(input[i],packet[i]); 79 81 if (ret<0) { 80 82 /* Error */ … … 93 95 if (live[i] && 94 96 (oldest==-1 || 95 oldest_ts<trace_get_erf_timestamp( &packet[i]))) {97 oldest_ts<trace_get_erf_timestamp(packet[i]))) { 96 98 oldest=i; 97 oldest_ts=trace_get_erf_timestamp( &packet[i]);99 oldest_ts=trace_get_erf_timestamp(packet[i]); 98 100 } 99 101 } … … 104 106 105 107 if (set_interface) 106 trace_set_direction( &packet[oldest],oldest);107 trace_write_packet(output, &packet[oldest]);108 trace_set_direction(packet[oldest],oldest); 109 trace_write_packet(output,packet[oldest]); 108 110 live[oldest]=false; 109 111
Note: See TracChangeset
for help on using the changeset viewer.