source: swig/python/check.py @ 39b37d2

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

changes in check.py

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