aboutsummaryrefslogtreecommitdiffstats
path: root/doc/README.python
blob: cfcf4b41eb062fecf25ae88f389d91624a1503d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
Help on module wspy_dissector:

NAME
    wspy_dissector

FILE
    /Users/standel/xcode/wireshark/wireshark.git/epan/wspython/wspy_dissector.py

DESCRIPTION
    # wspy_dissector.py
    #
    # $Id: $
    #
    # Wireshark Protocol Python Binding
    #
    # Copyright (c) 2009 by Sebastien Tandel <sebastien [AT] tandel [dot] be>
    # Copyright (c) 2001 by Gerald Combs <gerald@wireshark.org>
    #
    # This program is free software; you can redistribute it and/or
    # modify it under the terms of the GNU General Public License
    # as published by the Free Software Foundation; either version 2
    # of the License, or (at your option) any later version.
    #
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with this program; if not, write to the Free Software
    # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

CLASSES
    __builtin__.object
        Dissector
        Subtree
        TVB
        Tree
        register_info
    
    class Dissector(__builtin__.object)
     |  #Dissector class : base class to write a dissector in python
     |  
     |  Methods defined here:
     |  
     |  __hash__(self)
     |  
     |  __init__(self, protocol_name, short_desc, short)
     |  
     |  __str__(self)
     |  
     |  __unicode__(self)
     |  
     |  advance(self, step)
     |      method used to change the value of the offset
     |  
     |  create_dissector_handle(self, protocol=None)
     |      create_dissector_handle : see proto.h
     |  
     |  display(self)
     |  
     |  dissect(self)
     |      point of entry when starting dissecting a packet. This method must be
     |      therefore overloaded by the object implementing the dissector of a specific
     |      protocol.
     |  
     |  find_dissector(self, protocol)
     |      find_dissector : see proto.h
     |  
     |  pre_dissect(self)
     |      private method executed right before dissect in order to retrieve some
     |      internal information and enabling the possibility to add the base tree of
     |      this protocol dissection to the tree without any user intervention
     |  
     |  protocol(self)
     |  
     |  protocol_ids(self)
     |      defined a list of tuples containing three values. Each tuple is defining
     |      the parameters of dissector_add_uint(). This function MUST be defined when
     |      implementing the dissector of a specific protocol.
     |  
     |  register_handoff(self)
     |      private method used during the registration of protocol dissectors
     |  
     |  register_protocol(self)
     |      private function called by libwireshark when registering all
     |      protocols
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  __dict__
     |      dictionary for instance variables (if defined)
     |  
     |  __weakref__
     |      list of weak references to the object (if defined)
     |  
     |  hf
     |      hf property : hf_register_info fields. every defined field is available
     |      as an attribute of this object
     |  
     |  libhandle
     |      libhandle property : return a handle to the libwireshark lib. You don't
     |      want to use this in normal situation. Use it only if you know what you're
     |      doing.
     |  
     |  offset
     |      offset property : if is the current offset computed from the
     |      dissection.
     |  
     |  raw_pinfo
     |      raw_pinfo property : return the raw pinfo pointer. You can use this with
     |      libhandle. You don't want to use this in normal situation. Use it only if
     |      you know what you're doing.
     |  
     |  raw_tree
     |      raw_tree property : returns the raw tree pointer. You can use this with
     |      libhandle. You don't want to use this in normal situation. Use it only if
     |      you know what you're doing.
     |  
     |  raw_tvb
     |      raw_tvb property : returns the raw tvb pointer. You can use this with
     |      libhandle. You don't want to use this in normal situation. Use it only if
     |      you know what you're doing.
     |  
     |  subtrees
     |      subtrees property : subtress definition. every subtree added is
     |      accessible as an attribute of this object
     |  
     |  tree
     |      tree property : initial tree at the start of the dissection
    
    class Subtree(__builtin__.object)
     |  #Subtrees definition
     |  #Every subtree added can be accesses as an attribute after having been
     |  #registered
     |  
     |  Methods defined here:
     |  
     |  __getattr__(self, name)
     |  
     |  __init__(self, wsl, protocol)
     |  
     |  add(self, name)
     |  
     |  has_user_defined_protocol_tree(self)
     |  
     |  register(self)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  __dict__
     |      dictionary for instance variables (if defined)
     |  
     |  __weakref__
     |      list of weak references to the object (if defined)
    
    class TVB(__builtin__.object)
     |  #tvb class implementation
     |  #see proto.h
     |  
     |  Methods defined here:
     |  
     |  __init__(self, wsl, tvb, dissector)
     |  
     |  get_guint8(self, offset=-1)
     |  
     |  get_letohl(self, offset=-1)
     |  
     |  get_letohs(self, offset=-1)
     |  
     |  get_ntohl(self, offset=-1)
     |  
     |  get_ntohs(self, offset=-1)
     |  
     |  get_ptr(self, offset=-1)
     |      #STA TODO : check that we can do that
     |  
     |  length(self)
     |  
     |  length_remaining(self, offset=-1)
     |  
     |  reported_length(self)
     |  
     |  reported_length_remaining(self, offset=-1)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  __dict__
     |      dictionary for instance variables (if defined)
     |  
     |  __weakref__
     |      list of weak references to the object (if defined)
    
    class Tree(__builtin__.object)
     |  #Tree class implementation
     |  #see proto.h
     |  
     |  Methods defined here:
     |  
     |  __init__(self, tree, dissector)
     |  
     |  add_item(self, field, offset=0, length=-1, little_endian=False, adv=True)
     |      add an item to the tree
     |  
     |  add_subtree(self, subtree)
     |      add a subtree to the tree
     |  
     |  add_text(self, string, offset=0, length=-1, adv=True)
     |      add text to the tree
     |  
     |  add_uint(self, field, value, offset=0, length=4, adv=True)
     |      add unsigned integer to the tree
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  __dict__
     |      dictionary for instance variables (if defined)
     |  
     |  __weakref__
     |      list of weak references to the object (if defined)
     |  
     |  raw_tree
    
    class register_info(__builtin__.object)
     |  # hf_register_info from usual dissectors
     |  
     |  Methods defined here:
     |  
     |  __del__(self)
     |  
     |  __init__(self, wsl)
     |  
     |  add(self, name, short_desc, type=6, display=1, strings=None, bitmask=0, desc=None)
     |  
     |  display(self)
     |  
     |  get(self)
     |  
     |  register(self, protocol)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  __dict__
     |      dictionary for instance variables (if defined)
     |  
     |  __weakref__
     |      list of weak references to the object (if defined)

FUNCTIONS
    POINTER(...)
    
    pointer(...)

DATA
    BASE_CUSTOM = 6
    BASE_DEC = 1
    BASE_DEC_HEX = 4
    BASE_HEX = 2
    BASE_HEX_DEC = 5
    BASE_NONE = 0
    BASE_OCT = 3
    FT_ABSOLUTE_TIME = 15
    FT_BOOLEAN = 2
    FT_BYTES = 22
    FT_DOUBLE = 14
    FT_EBCDIC = 19
    FT_ETHER = 21
    FT_FLOAT = 13
    FT_FRAMENUM = 27
    FT_GUID = 29
    FT_INT16 = 9
    FT_INT24 = 10
    FT_INT32 = 11
    FT_INT64 = 12
    FT_INT8 = 8
    FT_IPXNET = 26
    FT_IPv4 = 24
    FT_IPv6 = 25
    FT_NONE = 0
    FT_OID = 30
    FT_PCRE = 28
    FT_PROTOCOL = 1
    FT_RELATIVE_TIME = 16
    FT_STRING = 17
    FT_STRINGZ = 18
    FT_UINT16 = 4
    FT_UINT24 = 5
    FT_UINT32 = 6
    FT_UINT64 = 7
    FT_UINT8 = 3
    FT_UINT_BYTES = 23
    FT_UINT_STRING = 20