source: swig/python/check.py @ e641bdc

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since e641bdc was d5e7d91, checked in by Daniel Lawson <dlawson@…>, 17 years ago

changes in check.py

  • Property mode set to 100755
File size: 571 bytes
Line 
1#!/usr/bin/python
2import libtrace
3import sys
4
5trace = libtrace.Trace(sys.argv[1])
6
7print "trace=",trace
8
9
10packet = libtrace.Packet()
11
12count = 0
13
14filter = libtrace.Filter("tcp")
15
16while 1:
17        trace.trace_read_packet(packet)
18        if not packet:
19                break
20
21        ippacket = packet.trace_get_ip()
22        if not ippacket:
23                continue
24
25        count += 1
26        if count % 10000 == 0:
27                print count
28
29        #tcppacket = packet.trace_get_tcp()
30        #if not tcppacket:
31        #       continue
32
33        #if not packet.trace_bpf_filter(filter):
34        #       continue
35
36        #print ippacket.ip_src,':',tcppacket.source,'->',ippacket.ip_dst,':',tcppacket.dest
37
Note: See TracBrowser for help on using the repository browser.