4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change
on this file since 76b37b0 was
5d6ebe1,
checked in by Perry Lorier <perry@…>, 18 years ago
|
Added asn1 parsing
Started fixing bug with tcp option parsing
|
-
Property mode set to
100644
|
File size:
735 bytes
|
Line | |
---|
1 | #include <libtrace.h> |
---|
2 | #include <err.h> |
---|
3 | #include <time.h> |
---|
4 | #include "tracedump.h" |
---|
5 | #include <stdio.h> |
---|
6 | |
---|
7 | int main(int argc,char **argv) |
---|
8 | { |
---|
9 | struct libtrace_t *trace = trace_create(argv[1]); |
---|
10 | struct libtrace_packet_t packet; |
---|
11 | struct libtrace_filter_t *filter=NULL; |
---|
12 | |
---|
13 | if (!trace) { |
---|
14 | errx(1,"Failed to open trace"); |
---|
15 | } |
---|
16 | |
---|
17 | if (argc>2) |
---|
18 | filter=trace_bpf_setfilter(argv[2]); |
---|
19 | |
---|
20 | while(trace_read_packet(trace,&packet)!=-1) { |
---|
21 | time_t sec = (time_t)trace_get_seconds(&packet); |
---|
22 | char *link=(char *)trace_get_link(&packet); |
---|
23 | if (filter && !trace_bpf_filter(filter,&packet)) |
---|
24 | continue; |
---|
25 | |
---|
26 | printf("%s",ctime(&sec)); |
---|
27 | per_packet(trace_get_link_type(&packet), |
---|
28 | link, |
---|
29 | packet.size-(link-packet.buffer)); |
---|
30 | } |
---|
31 | |
---|
32 | trace_destroy(trace); |
---|
33 | return 0; |
---|
34 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.