MSWSP: * add parse_lcid()
[wireshark-wip.git] / doc / README.python
blob284122e23dc7c7251bf0db4108e17f5b801ae43f
1 Help on module wspy_dissector:
3 NAME
4 wspy_dissector
6 FILE
7 /Users/standel/xcode/wireshark/wireshark.git/epan/wspython/wspy_dissector.py
9 DESCRIPTION
10 # wspy_dissector.py
12 # $Id$
14 # Wireshark Protocol Python Binding
16 # Copyright (c) 2009 by Sebastien Tandel <sebastien [AT] tandel [dot] be>
17 # Copyright (c) 2001 by Gerald Combs <gerald@wireshark.org>
19 # This program is free software; you can redistribute it and/or
20 # modify it under the terms of the GNU General Public License
21 # as published by the Free Software Foundation; either version 2
22 # of the License, or (at your option) any later version.
24 # This program is distributed in the hope that it will be useful,
25 # but WITHOUT ANY WARRANTY; without even the implied warranty of
26 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 # GNU General Public License for more details.
29 # You should have received a copy of the GNU General Public License
30 # along with this program; if not, write to the Free Software
31 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
33 CLASSES
34 __builtin__.object
35 Dissector
36 Subtree
37 TVB
38 Tree
39 register_info
41 class Dissector(__builtin__.object)
42 | #Dissector class : base class to write a dissector in python
44 | Methods defined here:
46 | __hash__(self)
48 | __init__(self, protocol_name, short_desc, short)
50 | __str__(self)
52 | __unicode__(self)
54 | advance(self, step)
55 | method used to change the value of the offset
57 | create_dissector_handle(self, protocol=None)
58 | create_dissector_handle : see proto.h
60 | display(self)
62 | dissect(self)
63 | point of entry when starting dissecting a packet. This method must be
64 | therefore overloaded by the object implementing the dissector of a specific
65 | protocol.
67 | find_dissector(self, protocol)
68 | find_dissector : see proto.h
70 | pre_dissect(self)
71 | private method executed right before dissect in order to retrieve some
72 | internal information and enabling the possibility to add the base tree of
73 | this protocol dissection to the tree without any user intervention
75 | protocol(self)
77 | protocol_ids(self)
78 | defined a list of tuples containing three values. Each tuple is defining
79 | the parameters of dissector_add_uint(). This function MUST be defined when
80 | implementing the dissector of a specific protocol.
82 | register_handoff(self)
83 | private method used during the registration of protocol dissectors
85 | register_protocol(self)
86 | private function called by libwireshark when registering all
87 | protocols
89 | ----------------------------------------------------------------------
90 | Data descriptors defined here:
92 | __dict__
93 | dictionary for instance variables (if defined)
95 | __weakref__
96 | list of weak references to the object (if defined)
98 | hf
99 | hf property : hf_register_info fields. every defined field is available
100 | as an attribute of this object
102 | libhandle
103 | libhandle property : return a handle to the libwireshark lib. You don't
104 | want to use this in normal situation. Use it only if you know what you're
105 | doing.
107 | offset
108 | offset property : if is the current offset computed from the
109 | dissection.
111 | raw_pinfo
112 | raw_pinfo property : return the raw pinfo pointer. You can use this with
113 | libhandle. You don't want to use this in normal situation. Use it only if
114 | you know what you're doing.
116 | raw_tree
117 | raw_tree property : returns the raw tree pointer. You can use this with
118 | libhandle. You don't want to use this in normal situation. Use it only if
119 | you know what you're doing.
121 | raw_tvb
122 | raw_tvb property : returns the raw tvb pointer. You can use this with
123 | libhandle. You don't want to use this in normal situation. Use it only if
124 | you know what you're doing.
126 | subtrees
127 | subtrees property : subtress definition. every subtree added is
128 | accessible as an attribute of this object
130 | tree
131 | tree property : initial tree at the start of the dissection
133 class Subtree(__builtin__.object)
134 | #Subtrees definition
135 | #Every subtree added can be accesses as an attribute after having been
136 | #registered
138 | Methods defined here:
140 | __getattr__(self, name)
142 | __init__(self, wsl, protocol)
144 | add(self, name)
146 | has_user_defined_protocol_tree(self)
148 | register(self)
150 | ----------------------------------------------------------------------
151 | Data descriptors defined here:
153 | __dict__
154 | dictionary for instance variables (if defined)
156 | __weakref__
157 | list of weak references to the object (if defined)
159 class TVB(__builtin__.object)
160 | #tvb class implementation
161 | #see proto.h
163 | Methods defined here:
165 | __init__(self, wsl, tvb, dissector)
167 | get_guint8(self, offset=-1)
169 | get_letohl(self, offset=-1)
171 | get_letohs(self, offset=-1)
173 | get_ntohl(self, offset=-1)
175 | get_ntohs(self, offset=-1)
177 | get_ptr(self, offset=-1)
178 | #STA TODO : check that we can do that
180 | length(self)
182 | length_remaining(self, offset=-1)
184 | reported_length(self)
186 | reported_length_remaining(self, offset=-1)
188 | ----------------------------------------------------------------------
189 | Data descriptors defined here:
191 | __dict__
192 | dictionary for instance variables (if defined)
194 | __weakref__
195 | list of weak references to the object (if defined)
197 class Tree(__builtin__.object)
198 | #Tree class implementation
199 | #see proto.h
201 | Methods defined here:
203 | __init__(self, tree, dissector)
205 | add_item(self, field, offset=0, length=-1, little_endian=False, adv=True)
206 | add an item to the tree
208 | add_subtree(self, subtree)
209 | add a subtree to the tree
211 | add_text(self, string, offset=0, length=-1, adv=True)
212 | add text to the tree
214 | add_uint(self, field, value, offset=0, length=4, adv=True)
215 | add unsigned integer to the tree
217 | ----------------------------------------------------------------------
218 | Data descriptors defined here:
220 | __dict__
221 | dictionary for instance variables (if defined)
223 | __weakref__
224 | list of weak references to the object (if defined)
226 | raw_tree
228 class register_info(__builtin__.object)
229 | # hf_register_info from usual dissectors
231 | Methods defined here:
233 | __del__(self)
235 | __init__(self, wsl)
237 | add(self, name, short_desc, type=6, display=1, strings=None, bitmask=0, desc=None)
239 | display(self)
241 | get(self)
243 | register(self, protocol)
245 | ----------------------------------------------------------------------
246 | Data descriptors defined here:
248 | __dict__
249 | dictionary for instance variables (if defined)
251 | __weakref__
252 | list of weak references to the object (if defined)
254 FUNCTIONS
255 POINTER(...)
257 pointer(...)
259 DATA
260 BASE_CUSTOM = 6
261 BASE_DEC = 1
262 BASE_DEC_HEX = 4
263 BASE_HEX = 2
264 BASE_HEX_DEC = 5
265 BASE_NONE = 0
266 BASE_OCT = 3
267 FT_ABSOLUTE_TIME = 15
268 FT_BOOLEAN = 2
269 FT_BYTES = 22
270 FT_DOUBLE = 14
271 FT_EBCDIC = 19
272 FT_ETHER = 21
273 FT_FLOAT = 13
274 FT_FRAMENUM = 27
275 FT_GUID = 29
276 FT_INT16 = 9
277 FT_INT24 = 10
278 FT_INT32 = 11
279 FT_INT64 = 12
280 FT_INT8 = 8
281 FT_IPXNET = 26
282 FT_IPv4 = 24
283 FT_IPv6 = 25
284 FT_NONE = 0
285 FT_OID = 30
286 FT_PCRE = 28
287 FT_PROTOCOL = 1
288 FT_RELATIVE_TIME = 16
289 FT_STRING = 17
290 FT_STRINGZ = 18
291 FT_UINT16 = 4
292 FT_UINT24 = 5
293 FT_UINT32 = 6
294 FT_UINT64 = 7
295 FT_UINT8 = 3
296 FT_UINT_BYTES = 23
297 FT_UINT_STRING = 20