Ignore:
Timestamp:
09/21/04 15:32:23 (17 years ago)
Author:
Daniel Lawson <dlawson@…>
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:
d5e7d91
Parents:
6f34090
Message:

finished rest of libtrace api.
fixed memleak with calling strdup() on inet_ntoa on ip_src/ip_dst

File:
1 edited

Legend:

Unmodified
Added
Removed
  • swig/python/check.py

    r6f34090 rf2794ea  
    1111
    1212count = 0
     13
     14filter = libtrace.Filter("tcp and port 80")
     15
    1316while 1:
    1417        trace.trace_read_packet(packet)
    1518        if not packet:
    1619                break
     20
    1721        ippacket = packet.trace_get_ip()
    1822        if not ippacket:
    1923                continue
    2024
    21         count += 1
    22         if count % 10000 == 0:
    23                 print count
    24         #print packet.size
    25 #       print ippacket.ip_src,'->',ippacket.ip_dst
     25        tcppacket = packet.trace_get_tcp()
     26        if not tcppacket:
     27                continue
    2628
     29        if not packet.trace_bpf_filter(filter):
     30                continue
     31
     32        print ippacket.ip_src,':',tcppacket.source,'->',ippacket.ip_dst,':',tcppacket.dest
     33
Note: See TracChangeset for help on using the changeset viewer.