Changeset 2980487 for swig/python


Ignore:
Timestamp:
09/21/04 13:11:41 (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:
77ba31d
Parents:
4e194bc
Message:

new version

Location:
swig/python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • swig/python/check.py

    r4e194bc r2980487  
    77print "trace=",trace
    88
    9 packet = trace.read_packet()
    109
    11 print "packet=",packet
    1210
    1311while 1:
    14         packet = trace.read_packet()
     12        packet = libtrace.Packet()
     13        trace.trace_read_packet(packet)
    1514        if not packet:
    1615                break
    17         print packet.get_ip().ip_src,'->',packet.get_ip().ip_dst
     16        ippacket = packet.trace_get_ip()
     17        if not ippacket:
     18                continue
    1819
     20        print ippacket.ip_src,'->',ippacket.ip_dst
     21
  • swig/python/libtrace.py

    r4e194bc r2980487  
    8585    __swig_getmethods__["ip_dst"] = _libtrace.libtrace_ip_ip_dst_get
    8686    if _newclass:ip_dst = property(_libtrace.libtrace_ip_ip_dst_get)
     87    def __del__(self, destroy=_libtrace.delete_libtrace_ip):
     88        try:
     89            if self.thisown: destroy(self)
     90        except: pass
    8791
    8892class libtrace_ipPtr(libtrace_ip):
     
    146150    __swig_getmethods__["ack_seq"] = _libtrace.libtrace_tcp_ack_seq_get
    147151    if _newclass:ack_seq = property(_libtrace.libtrace_tcp_ack_seq_get)
     152    def __del__(self, destroy=_libtrace.delete_libtrace_tcp):
     153        try:
     154            if self.thisown: destroy(self)
     155        except: pass
    148156
    149157class libtrace_tcpPtr(libtrace_tcp):
     
    170178    __swig_getmethods__["check"] = _libtrace.libtrace_udp_check_get
    171179    if _newclass:check = property(_libtrace.libtrace_udp_check_get)
     180    def __del__(self, destroy=_libtrace.delete_libtrace_udp):
     181        try:
     182            if self.thisown: destroy(self)
     183        except: pass
    172184
    173185class libtrace_udpPtr(libtrace_udp):
     
    197209    __swig_getmethods__["un"] = _libtrace.libtrace_icmp_un_get
    198210    if _newclass:un = property(_libtrace.libtrace_icmp_un_get)
     211    def __del__(self, destroy=_libtrace.delete_libtrace_icmp):
     212        try:
     213            if self.thisown: destroy(self)
     214        except: pass
    199215
    200216class libtrace_icmpPtr(libtrace_icmp):
     
    277293    __swig_getmethods__ = {}
    278294    __getattr__ = lambda self, name: _swig_getattr(self, Packet, name)
    279     def __init__(self): raise RuntimeError, "No constructor defined"
    280     def __repr__(self):
    281         return "<C Packet instance at %s>" % (self.this,)
    282     __swig_setmethods__["buffer"] = _libtrace.Packet_buffer_set
    283     __swig_getmethods__["buffer"] = _libtrace.Packet_buffer_get
    284     if _newclass:buffer = property(_libtrace.Packet_buffer_get, _libtrace.Packet_buffer_set)
    285     __swig_setmethods__["status"] = _libtrace.Packet_status_set
    286     __swig_getmethods__["status"] = _libtrace.Packet_status_get
    287     if _newclass:status = property(_libtrace.Packet_status_get, _libtrace.Packet_status_set)
    288     __swig_setmethods__["len"] = _libtrace.Packet_len_set
    289     __swig_getmethods__["len"] = _libtrace.Packet_len_get
    290     if _newclass:len = property(_libtrace.Packet_len_get, _libtrace.Packet_len_set)
    291     def get_ip(*args): return _libtrace.Packet_get_ip(*args)
    292     def get_tcp(*args): return _libtrace.Packet_get_tcp(*args)
    293     def get_udp(*args): return _libtrace.Packet_get_udp(*args)
    294     def get_icmp(*args): return _libtrace.Packet_get_icmp(*args)
    295     def get_seconds(*args): return _libtrace.Packet_get_seconds(*args)
     295    def __repr__(self):
     296        return "<C libtrace_packet_t instance at %s>" % (self.this,)
     297    def __init__(self, *args):
     298        _swig_setattr(self, Packet, 'this', _libtrace.new_Packet(*args))
     299        _swig_setattr(self, Packet, 'thisown', 1)
     300    def __del__(self, destroy=_libtrace.delete_Packet):
     301        try:
     302            if self.thisown: destroy(self)
     303        except: pass
     304    def trace_get_ip(*args): return _libtrace.Packet_trace_get_ip(*args)
     305    def trace_get_tcp(*args): return _libtrace.Packet_trace_get_tcp(*args)
     306    def trace_get_udp(*args): return _libtrace.Packet_trace_get_udp(*args)
     307    def trace_get_icmp(*args): return _libtrace.Packet_trace_get_icmp(*args)
     308    def trace_get_seconds(*args): return _libtrace.Packet_trace_get_seconds(*args)
    296309
    297310class PacketPtr(Packet):
     
    316329            if self.thisown: destroy(self)
    317330        except: pass
    318     def read_packet(*args): return _libtrace.Trace_read_packet(*args)
     331    def trace_read_packet(*args): return _libtrace.Trace_trace_read_packet(*args)
    319332
    320333class TracePtr(Trace):
Note: See TracChangeset for help on using the changeset viewer.