1 Help on module wspy_dissector
:
7 /Users
/standel
/xcode
/wireshark
/wireshark
.git
/epan
/wspython
/wspy_dissector
.py
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.
41 class Dissector(__builtin__
.object)
42 |
#Dissector class : base class to write a dissector in python
44 | Methods defined here
:
48 |
__init__(self
, protocol_name
, short_desc
, short
)
55 | method used to change the value of the offset
57 |
create_dissector_handle(self
, protocol
=None)
58 | create_dissector_handle
: see proto
.h
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
67 |
find_dissector(self
, protocol
)
68 | find_dissector
: see proto
.h
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
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
89 |
----------------------------------------------------------------------
90 | Data descriptors defined here
:
93 | dictionary
for instance
variables (if defined
)
96 |
list of weak references to the
object (if defined
)
99 | hf
property : hf_register_info fields
. every defined field
is available
100 |
as an attribute of this
object
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
108 | offset
property : if is the current offset computed
from the
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
.
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
.
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
.
127 | subtrees
property : subtress definition
. every subtree added
is
128 | accessible
as an attribute of this
object
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
138 | Methods defined here
:
140 |
__getattr__(self
, name
)
142 |
__init__(self
, wsl
, protocol
)
146 |
has_user_defined_protocol_tree(self
)
150 |
----------------------------------------------------------------------
151 | Data descriptors defined here
:
154 | dictionary
for instance
variables (if defined
)
157 |
list of weak references to the
object (if defined
)
159 class TVB(__builtin__
.object)
160 |
#tvb class implementation
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
182 |
length_remaining(self
, offset
=-1)
184 |
reported_length(self
)
186 |
reported_length_remaining(self
, offset
=-1)
188 |
----------------------------------------------------------------------
189 | Data descriptors defined here
:
192 | dictionary
for instance
variables (if defined
)
195 |
list of weak references to the
object (if defined
)
197 class Tree(__builtin__
.object)
198 |
#Tree class implementation
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
:
221 | dictionary
for instance
variables (if defined
)
224 |
list of weak references to the
object (if defined
)
228 class register_info(__builtin__
.object)
229 |
# hf_register_info from usual dissectors
231 | Methods defined here
:
235 |
__init__(self
, wsl
)
237 |
add(self
, name
, short_desc
, type=6, display
=1, strings
=None, bitmask
=0, desc
=None)
243 |
register(self
, protocol
)
245 |
----------------------------------------------------------------------
246 | Data descriptors defined here
:
249 | dictionary
for instance
variables (if defined
)
252 |
list of weak references to the
object (if defined
)
267 FT_ABSOLUTE_TIME
= 15
288 FT_RELATIVE_TIME
= 16