source: swig/python/libtrace.py @ 49f147b

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

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

  • Property mode set to 100644
File size: 18.8 KB
Line 
1# This file was created automatically by SWIG.
2# Don't modify this file, modify the SWIG interface instead.
3# This file is compatible with both classic and new-style classes.
4
5import _libtrace
6
7def _swig_setattr(self,class_type,name,value):
8    if (name == "this"):
9        if isinstance(value, class_type):
10            self.__dict__[name] = value.this
11            if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
12            del value.thisown
13            return
14    method = class_type.__swig_setmethods__.get(name,None)
15    if method: return method(self,value)
16    self.__dict__[name] = value
17
18def _swig_getattr(self,class_type,name):
19    method = class_type.__swig_getmethods__.get(name,None)
20    if method: return method(self)
21    raise AttributeError,name
22
23import types
24try:
25    _object = types.ObjectType
26    _newclass = 1
27except AttributeError:
28    class _object : pass
29    _newclass = 0
30del types
31
32
33class in_addr(_object):
34    __swig_setmethods__ = {}
35    __setattr__ = lambda self, name, value: _swig_setattr(self, in_addr, name, value)
36    __swig_getmethods__ = {}
37    __getattr__ = lambda self, name: _swig_getattr(self, in_addr, name)
38    def __init__(self): raise RuntimeError, "No constructor defined"
39    def __repr__(self):
40        return "<C in_addr instance at %s>" % (self.this,)
41    __swig_setmethods__["s_addr"] = _libtrace.in_addr_s_addr_set
42    __swig_getmethods__["s_addr"] = _libtrace.in_addr_s_addr_get
43    if _newclass:s_addr = property(_libtrace.in_addr_s_addr_get, _libtrace.in_addr_s_addr_set)
44
45class in_addrPtr(in_addr):
46    def __init__(self, this):
47        _swig_setattr(self, in_addr, 'this', this)
48        if not hasattr(self,"thisown"): _swig_setattr(self, in_addr, 'thisown', 0)
49        _swig_setattr(self, in_addr,self.__class__,in_addr)
50_libtrace.in_addr_swigregister(in_addrPtr)
51
52class libtrace_ip(_object):
53    __swig_setmethods__ = {}
54    __setattr__ = lambda self, name, value: _swig_setattr(self, libtrace_ip, name, value)
55    __swig_getmethods__ = {}
56    __getattr__ = lambda self, name: _swig_getattr(self, libtrace_ip, name)
57    def __init__(self): raise RuntimeError, "No constructor defined"
58    def __repr__(self):
59        return "<C libtrace_ip instance at %s>" % (self.this,)
60    __swig_setmethods__["ip_hl"] = _libtrace.libtrace_ip_ip_hl_set
61    __swig_getmethods__["ip_hl"] = _libtrace.libtrace_ip_ip_hl_get
62    if _newclass:ip_hl = property(_libtrace.libtrace_ip_ip_hl_get, _libtrace.libtrace_ip_ip_hl_set)
63    __swig_setmethods__["ip_v"] = _libtrace.libtrace_ip_ip_v_set
64    __swig_getmethods__["ip_v"] = _libtrace.libtrace_ip_ip_v_get
65    if _newclass:ip_v = property(_libtrace.libtrace_ip_ip_v_get, _libtrace.libtrace_ip_ip_v_set)
66    __swig_setmethods__["ip_tos"] = _libtrace.libtrace_ip_ip_tos_set
67    __swig_getmethods__["ip_tos"] = _libtrace.libtrace_ip_ip_tos_get
68    if _newclass:ip_tos = property(_libtrace.libtrace_ip_ip_tos_get, _libtrace.libtrace_ip_ip_tos_set)
69    __swig_setmethods__["ip_ttl"] = _libtrace.libtrace_ip_ip_ttl_set
70    __swig_getmethods__["ip_ttl"] = _libtrace.libtrace_ip_ip_ttl_get
71    if _newclass:ip_ttl = property(_libtrace.libtrace_ip_ip_ttl_get, _libtrace.libtrace_ip_ip_ttl_set)
72    __swig_setmethods__["ip_p"] = _libtrace.libtrace_ip_ip_p_set
73    __swig_getmethods__["ip_p"] = _libtrace.libtrace_ip_ip_p_get
74    if _newclass:ip_p = property(_libtrace.libtrace_ip_ip_p_get, _libtrace.libtrace_ip_ip_p_set)
75    __swig_getmethods__["ip_sum"] = _libtrace.libtrace_ip_ip_sum_get
76    if _newclass:ip_sum = property(_libtrace.libtrace_ip_ip_sum_get)
77    __swig_getmethods__["ip_len"] = _libtrace.libtrace_ip_ip_len_get
78    if _newclass:ip_len = property(_libtrace.libtrace_ip_ip_len_get)
79    __swig_getmethods__["ip_id"] = _libtrace.libtrace_ip_ip_id_get
80    if _newclass:ip_id = property(_libtrace.libtrace_ip_ip_id_get)
81    __swig_getmethods__["ip_off"] = _libtrace.libtrace_ip_ip_off_get
82    if _newclass:ip_off = property(_libtrace.libtrace_ip_ip_off_get)
83    __swig_getmethods__["ip_src"] = _libtrace.libtrace_ip_ip_src_get
84    if _newclass:ip_src = property(_libtrace.libtrace_ip_ip_src_get)
85    __swig_getmethods__["ip_dst"] = _libtrace.libtrace_ip_ip_dst_get
86    if _newclass:ip_dst = property(_libtrace.libtrace_ip_ip_dst_get)
87
88class libtrace_ipPtr(libtrace_ip):
89    def __init__(self, this):
90        _swig_setattr(self, libtrace_ip, 'this', this)
91        if not hasattr(self,"thisown"): _swig_setattr(self, libtrace_ip, 'thisown', 0)
92        _swig_setattr(self, libtrace_ip,self.__class__,libtrace_ip)
93_libtrace.libtrace_ip_swigregister(libtrace_ipPtr)
94IP_RF = _libtrace.IP_RF
95IP_DF = _libtrace.IP_DF
96IP_MF = _libtrace.IP_MF
97IP_OFFMASK = _libtrace.IP_OFFMASK
98
99class libtrace_tcp(_object):
100    __swig_setmethods__ = {}
101    __setattr__ = lambda self, name, value: _swig_setattr(self, libtrace_tcp, name, value)
102    __swig_getmethods__ = {}
103    __getattr__ = lambda self, name: _swig_getattr(self, libtrace_tcp, name)
104    def __init__(self): raise RuntimeError, "No constructor defined"
105    def __repr__(self):
106        return "<C libtrace_tcp instance at %s>" % (self.this,)
107    __swig_setmethods__["res1"] = _libtrace.libtrace_tcp_res1_set
108    __swig_getmethods__["res1"] = _libtrace.libtrace_tcp_res1_get
109    if _newclass:res1 = property(_libtrace.libtrace_tcp_res1_get, _libtrace.libtrace_tcp_res1_set)
110    __swig_setmethods__["doff"] = _libtrace.libtrace_tcp_doff_set
111    __swig_getmethods__["doff"] = _libtrace.libtrace_tcp_doff_get
112    if _newclass:doff = property(_libtrace.libtrace_tcp_doff_get, _libtrace.libtrace_tcp_doff_set)
113    __swig_setmethods__["fin"] = _libtrace.libtrace_tcp_fin_set
114    __swig_getmethods__["fin"] = _libtrace.libtrace_tcp_fin_get
115    if _newclass:fin = property(_libtrace.libtrace_tcp_fin_get, _libtrace.libtrace_tcp_fin_set)
116    __swig_setmethods__["syn"] = _libtrace.libtrace_tcp_syn_set
117    __swig_getmethods__["syn"] = _libtrace.libtrace_tcp_syn_get
118    if _newclass:syn = property(_libtrace.libtrace_tcp_syn_get, _libtrace.libtrace_tcp_syn_set)
119    __swig_setmethods__["rst"] = _libtrace.libtrace_tcp_rst_set
120    __swig_getmethods__["rst"] = _libtrace.libtrace_tcp_rst_get
121    if _newclass:rst = property(_libtrace.libtrace_tcp_rst_get, _libtrace.libtrace_tcp_rst_set)
122    __swig_setmethods__["psh"] = _libtrace.libtrace_tcp_psh_set
123    __swig_getmethods__["psh"] = _libtrace.libtrace_tcp_psh_get
124    if _newclass:psh = property(_libtrace.libtrace_tcp_psh_get, _libtrace.libtrace_tcp_psh_set)
125    __swig_setmethods__["ack"] = _libtrace.libtrace_tcp_ack_set
126    __swig_getmethods__["ack"] = _libtrace.libtrace_tcp_ack_get
127    if _newclass:ack = property(_libtrace.libtrace_tcp_ack_get, _libtrace.libtrace_tcp_ack_set)
128    __swig_setmethods__["urg"] = _libtrace.libtrace_tcp_urg_set
129    __swig_getmethods__["urg"] = _libtrace.libtrace_tcp_urg_get
130    if _newclass:urg = property(_libtrace.libtrace_tcp_urg_get, _libtrace.libtrace_tcp_urg_set)
131    __swig_setmethods__["res2"] = _libtrace.libtrace_tcp_res2_set
132    __swig_getmethods__["res2"] = _libtrace.libtrace_tcp_res2_get
133    if _newclass:res2 = property(_libtrace.libtrace_tcp_res2_get, _libtrace.libtrace_tcp_res2_set)
134    __swig_getmethods__["source"] = _libtrace.libtrace_tcp_source_get
135    if _newclass:source = property(_libtrace.libtrace_tcp_source_get)
136    __swig_getmethods__["dest"] = _libtrace.libtrace_tcp_dest_get
137    if _newclass:dest = property(_libtrace.libtrace_tcp_dest_get)
138    __swig_getmethods__["window"] = _libtrace.libtrace_tcp_window_get
139    if _newclass:window = property(_libtrace.libtrace_tcp_window_get)
140    __swig_getmethods__["check"] = _libtrace.libtrace_tcp_check_get
141    if _newclass:check = property(_libtrace.libtrace_tcp_check_get)
142    __swig_getmethods__["urg_ptr"] = _libtrace.libtrace_tcp_urg_ptr_get
143    if _newclass:urg_ptr = property(_libtrace.libtrace_tcp_urg_ptr_get)
144    __swig_getmethods__["seq"] = _libtrace.libtrace_tcp_seq_get
145    if _newclass:seq = property(_libtrace.libtrace_tcp_seq_get)
146    __swig_getmethods__["ack_seq"] = _libtrace.libtrace_tcp_ack_seq_get
147    if _newclass:ack_seq = property(_libtrace.libtrace_tcp_ack_seq_get)
148
149class libtrace_tcpPtr(libtrace_tcp):
150    def __init__(self, this):
151        _swig_setattr(self, libtrace_tcp, 'this', this)
152        if not hasattr(self,"thisown"): _swig_setattr(self, libtrace_tcp, 'thisown', 0)
153        _swig_setattr(self, libtrace_tcp,self.__class__,libtrace_tcp)
154_libtrace.libtrace_tcp_swigregister(libtrace_tcpPtr)
155
156class libtrace_udp(_object):
157    __swig_setmethods__ = {}
158    __setattr__ = lambda self, name, value: _swig_setattr(self, libtrace_udp, name, value)
159    __swig_getmethods__ = {}
160    __getattr__ = lambda self, name: _swig_getattr(self, libtrace_udp, name)
161    def __init__(self): raise RuntimeError, "No constructor defined"
162    def __repr__(self):
163        return "<C libtrace_udp instance at %s>" % (self.this,)
164    __swig_getmethods__["source"] = _libtrace.libtrace_udp_source_get
165    if _newclass:source = property(_libtrace.libtrace_udp_source_get)
166    __swig_getmethods__["dest"] = _libtrace.libtrace_udp_dest_get
167    if _newclass:dest = property(_libtrace.libtrace_udp_dest_get)
168    __swig_getmethods__["len"] = _libtrace.libtrace_udp_len_get
169    if _newclass:len = property(_libtrace.libtrace_udp_len_get)
170    __swig_getmethods__["check"] = _libtrace.libtrace_udp_check_get
171    if _newclass:check = property(_libtrace.libtrace_udp_check_get)
172
173class libtrace_udpPtr(libtrace_udp):
174    def __init__(self, this):
175        _swig_setattr(self, libtrace_udp, 'this', this)
176        if not hasattr(self,"thisown"): _swig_setattr(self, libtrace_udp, 'thisown', 0)
177        _swig_setattr(self, libtrace_udp,self.__class__,libtrace_udp)
178_libtrace.libtrace_udp_swigregister(libtrace_udpPtr)
179
180class libtrace_icmp(_object):
181    __swig_setmethods__ = {}
182    __setattr__ = lambda self, name, value: _swig_setattr(self, libtrace_icmp, name, value)
183    __swig_getmethods__ = {}
184    __getattr__ = lambda self, name: _swig_getattr(self, libtrace_icmp, name)
185    def __init__(self): raise RuntimeError, "No constructor defined"
186    def __repr__(self):
187        return "<C libtrace_icmp instance at %s>" % (self.this,)
188    __swig_setmethods__["type"] = _libtrace.libtrace_icmp_type_set
189    __swig_getmethods__["type"] = _libtrace.libtrace_icmp_type_get
190    if _newclass:type = property(_libtrace.libtrace_icmp_type_get, _libtrace.libtrace_icmp_type_set)
191    __swig_setmethods__["code"] = _libtrace.libtrace_icmp_code_set
192    __swig_getmethods__["code"] = _libtrace.libtrace_icmp_code_get
193    if _newclass:code = property(_libtrace.libtrace_icmp_code_get, _libtrace.libtrace_icmp_code_set)
194    __swig_setmethods__["checksum"] = _libtrace.libtrace_icmp_checksum_set
195    __swig_getmethods__["checksum"] = _libtrace.libtrace_icmp_checksum_get
196    if _newclass:checksum = property(_libtrace.libtrace_icmp_checksum_get, _libtrace.libtrace_icmp_checksum_set)
197    __swig_getmethods__["un"] = _libtrace.libtrace_icmp_un_get
198    if _newclass:un = property(_libtrace.libtrace_icmp_un_get)
199
200class libtrace_icmpPtr(libtrace_icmp):
201    def __init__(self, this):
202        _swig_setattr(self, libtrace_icmp, 'this', this)
203        if not hasattr(self,"thisown"): _swig_setattr(self, libtrace_icmp, 'thisown', 0)
204        _swig_setattr(self, libtrace_icmp,self.__class__,libtrace_icmp)
205_libtrace.libtrace_icmp_swigregister(libtrace_icmpPtr)
206
207class libtrace_icmp_un(_object):
208    __swig_setmethods__ = {}
209    __setattr__ = lambda self, name, value: _swig_setattr(self, libtrace_icmp_un, name, value)
210    __swig_getmethods__ = {}
211    __getattr__ = lambda self, name: _swig_getattr(self, libtrace_icmp_un, name)
212    def __init__(self): raise RuntimeError, "No constructor defined"
213    def __repr__(self):
214        return "<C libtrace_icmp_un instance at %s>" % (self.this,)
215    __swig_setmethods__["gateway"] = _libtrace.libtrace_icmp_un_gateway_set
216    __swig_getmethods__["gateway"] = _libtrace.libtrace_icmp_un_gateway_get
217    if _newclass:gateway = property(_libtrace.libtrace_icmp_un_gateway_get, _libtrace.libtrace_icmp_un_gateway_set)
218    __swig_getmethods__["frag"] = _libtrace.libtrace_icmp_un_frag_get
219    if _newclass:frag = property(_libtrace.libtrace_icmp_un_frag_get)
220    __swig_getmethods__["echo"] = _libtrace.libtrace_icmp_un_echo_get
221    if _newclass:echo = property(_libtrace.libtrace_icmp_un_echo_get)
222
223class libtrace_icmp_unPtr(libtrace_icmp_un):
224    def __init__(self, this):
225        _swig_setattr(self, libtrace_icmp_un, 'this', this)
226        if not hasattr(self,"thisown"): _swig_setattr(self, libtrace_icmp_un, 'thisown', 0)
227        _swig_setattr(self, libtrace_icmp_un,self.__class__,libtrace_icmp_un)
228_libtrace.libtrace_icmp_un_swigregister(libtrace_icmp_unPtr)
229
230class libtrace_icmp_un_frag(_object):
231    __swig_setmethods__ = {}
232    __setattr__ = lambda self, name, value: _swig_setattr(self, libtrace_icmp_un_frag, name, value)
233    __swig_getmethods__ = {}
234    __getattr__ = lambda self, name: _swig_getattr(self, libtrace_icmp_un_frag, name)
235    def __init__(self): raise RuntimeError, "No constructor defined"
236    def __repr__(self):
237        return "<C libtrace_icmp_un_frag instance at %s>" % (self.this,)
238    __swig_setmethods__["__unused"] = _libtrace.libtrace_icmp_un_frag___unused_set
239    __swig_getmethods__["__unused"] = _libtrace.libtrace_icmp_un_frag___unused_get
240    if _newclass:__unused = property(_libtrace.libtrace_icmp_un_frag___unused_get, _libtrace.libtrace_icmp_un_frag___unused_set)
241    __swig_setmethods__["mtu"] = _libtrace.libtrace_icmp_un_frag_mtu_set
242    __swig_getmethods__["mtu"] = _libtrace.libtrace_icmp_un_frag_mtu_get
243    if _newclass:mtu = property(_libtrace.libtrace_icmp_un_frag_mtu_get, _libtrace.libtrace_icmp_un_frag_mtu_set)
244
245class libtrace_icmp_un_fragPtr(libtrace_icmp_un_frag):
246    def __init__(self, this):
247        _swig_setattr(self, libtrace_icmp_un_frag, 'this', this)
248        if not hasattr(self,"thisown"): _swig_setattr(self, libtrace_icmp_un_frag, 'thisown', 0)
249        _swig_setattr(self, libtrace_icmp_un_frag,self.__class__,libtrace_icmp_un_frag)
250_libtrace.libtrace_icmp_un_frag_swigregister(libtrace_icmp_un_fragPtr)
251
252class libtrace_icmp_un_echo(_object):
253    __swig_setmethods__ = {}
254    __setattr__ = lambda self, name, value: _swig_setattr(self, libtrace_icmp_un_echo, name, value)
255    __swig_getmethods__ = {}
256    __getattr__ = lambda self, name: _swig_getattr(self, libtrace_icmp_un_echo, name)
257    def __init__(self): raise RuntimeError, "No constructor defined"
258    def __repr__(self):
259        return "<C libtrace_icmp_un_echo instance at %s>" % (self.this,)
260    __swig_setmethods__["id"] = _libtrace.libtrace_icmp_un_echo_id_set
261    __swig_getmethods__["id"] = _libtrace.libtrace_icmp_un_echo_id_get
262    if _newclass:id = property(_libtrace.libtrace_icmp_un_echo_id_get, _libtrace.libtrace_icmp_un_echo_id_set)
263    __swig_setmethods__["sequence"] = _libtrace.libtrace_icmp_un_echo_sequence_set
264    __swig_getmethods__["sequence"] = _libtrace.libtrace_icmp_un_echo_sequence_get
265    if _newclass:sequence = property(_libtrace.libtrace_icmp_un_echo_sequence_get, _libtrace.libtrace_icmp_un_echo_sequence_set)
266
267class libtrace_icmp_un_echoPtr(libtrace_icmp_un_echo):
268    def __init__(self, this):
269        _swig_setattr(self, libtrace_icmp_un_echo, 'this', this)
270        if not hasattr(self,"thisown"): _swig_setattr(self, libtrace_icmp_un_echo, 'thisown', 0)
271        _swig_setattr(self, libtrace_icmp_un_echo,self.__class__,libtrace_icmp_un_echo)
272_libtrace.libtrace_icmp_un_echo_swigregister(libtrace_icmp_un_echoPtr)
273
274class Packet(_object):
275    __swig_setmethods__ = {}
276    __setattr__ = lambda self, name, value: _swig_setattr(self, Packet, name, value)
277    __swig_getmethods__ = {}
278    __getattr__ = lambda self, name: _swig_getattr(self, Packet, name)
279    def __repr__(self):
280        return "<C libtrace_packet_t instance at %s>" % (self.this,)
281    def __init__(self, *args):
282        _swig_setattr(self, Packet, 'this', _libtrace.new_Packet(*args))
283        _swig_setattr(self, Packet, 'thisown', 1)
284    def __del__(self, destroy=_libtrace.delete_Packet):
285        try:
286            if self.thisown: destroy(self)
287        except: pass
288    def trace_get_ip(*args): return _libtrace.Packet_trace_get_ip(*args)
289    def trace_get_tcp(*args): return _libtrace.Packet_trace_get_tcp(*args)
290    def trace_get_udp(*args): return _libtrace.Packet_trace_get_udp(*args)
291    def trace_get_icmp(*args): return _libtrace.Packet_trace_get_icmp(*args)
292    def trace_get_link(*args): return _libtrace.Packet_trace_get_link(*args)
293    def trace_get_seconds(*args): return _libtrace.Packet_trace_get_seconds(*args)
294    def trace_get_erf_timestamp(*args): return _libtrace.Packet_trace_get_erf_timestamp(*args)
295    def trace_get_timeval(*args): return _libtrace.Packet_trace_get_timeval(*args)
296    def trace_get_capture_length(*args): return _libtrace.Packet_trace_get_capture_length(*args)
297    def trace_get_wire_lenth(*args): return _libtrace.Packet_trace_get_wire_lenth(*args)
298    def trace_get_link_type(*args): return _libtrace.Packet_trace_get_link_type(*args)
299    def trace_get_direction(*args): return _libtrace.Packet_trace_get_direction(*args)
300    def trace_bpf_filter(*args): return _libtrace.Packet_trace_bpf_filter(*args)
301
302class PacketPtr(Packet):
303    def __init__(self, this):
304        _swig_setattr(self, Packet, 'this', this)
305        if not hasattr(self,"thisown"): _swig_setattr(self, Packet, 'thisown', 0)
306        _swig_setattr(self, Packet,self.__class__,Packet)
307_libtrace.Packet_swigregister(PacketPtr)
308
309class Filter(_object):
310    __swig_setmethods__ = {}
311    __setattr__ = lambda self, name, value: _swig_setattr(self, Filter, name, value)
312    __swig_getmethods__ = {}
313    __getattr__ = lambda self, name: _swig_getattr(self, Filter, name)
314    def __repr__(self):
315        return "<C libtrace_filter_t instance at %s>" % (self.this,)
316    def __init__(self, *args):
317        _swig_setattr(self, Filter, 'this', _libtrace.new_Filter(*args))
318        _swig_setattr(self, Filter, 'thisown', 1)
319    def trace_bpf_filter(*args): return _libtrace.Filter_trace_bpf_filter(*args)
320
321class FilterPtr(Filter):
322    def __init__(self, this):
323        _swig_setattr(self, Filter, 'this', this)
324        if not hasattr(self,"thisown"): _swig_setattr(self, Filter, 'thisown', 0)
325        _swig_setattr(self, Filter,self.__class__,Filter)
326_libtrace.Filter_swigregister(FilterPtr)
327
328class Trace(_object):
329    __swig_setmethods__ = {}
330    __setattr__ = lambda self, name, value: _swig_setattr(self, Trace, name, value)
331    __swig_getmethods__ = {}
332    __getattr__ = lambda self, name: _swig_getattr(self, Trace, name)
333    def __repr__(self):
334        return "<C libtrace_t instance at %s>" % (self.this,)
335    def __init__(self, *args):
336        _swig_setattr(self, Trace, 'this', _libtrace.new_Trace(*args))
337        _swig_setattr(self, Trace, 'thisown', 1)
338    def __del__(self, destroy=_libtrace.delete_Trace):
339        try:
340            if self.thisown: destroy(self)
341        except: pass
342    def trace_read_packet(*args): return _libtrace.Trace_trace_read_packet(*args)
343
344class TracePtr(Trace):
345    def __init__(self, this):
346        _swig_setattr(self, Trace, 'this', this)
347        if not hasattr(self,"thisown"): _swig_setattr(self, Trace, 'thisown', 0)
348        _swig_setattr(self, Trace,self.__class__,Trace)
349_libtrace.Trace_swigregister(TracePtr)
350
351
Note: See TracBrowser for help on using the repository browser.