More Python-bindings removal.
Change-Id: I4d82175781e65c73179f4c8e737a7900cb050bce Reviewed-on: https://code.wireshark.org/review/2283 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
This commit is contained in:
parent
048646d322
commit
f113306e0e
|
@ -654,10 +654,6 @@ WSExtendPath( "${WS_ALL_LIBS}" "${CMAKE_BINARY_DIR}/setpath.bat" )
|
||||||
#packaging
|
#packaging
|
||||||
include(CPackConfig.txt)
|
include(CPackConfig.txt)
|
||||||
|
|
||||||
if(HAVE_LIBPYTHON)
|
|
||||||
set(HAVE_PYTHON 1)
|
|
||||||
set(PYTHON_DIR "${CMAKE_INSTALL_PREFIX}/lib/wireshark/python/${CPACK_PACKAGE_VERSION}")
|
|
||||||
endif()
|
|
||||||
if(HAVE_LIBLUA)
|
if(HAVE_LIBLUA)
|
||||||
set(HAVE_LUA_H 1)
|
set(HAVE_LUA_H 1)
|
||||||
set(HAVE_LUA 1)
|
set(HAVE_LUA 1)
|
||||||
|
|
|
@ -18,9 +18,6 @@
|
||||||
/* Build wsutil with SIMD optimization */
|
/* Build wsutil with SIMD optimization */
|
||||||
#cmakedefine HAVE_SSE4_2 1
|
#cmakedefine HAVE_SSE4_2 1
|
||||||
|
|
||||||
/* Path to Python. */
|
|
||||||
#cmakedefine PYTHON_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}/python/${CPACK_PACKAGE_VERSION}"
|
|
||||||
|
|
||||||
/* Define to 1 if we want to enable plugins */
|
/* Define to 1 if we want to enable plugins */
|
||||||
#cmakedefine HAVE_PLUGINS 1
|
#cmakedefine HAVE_PLUGINS 1
|
||||||
|
|
||||||
|
|
40
config.nmake
40
config.nmake
|
@ -194,30 +194,6 @@ MSVC_VARIANT=MSVC2010EE
|
||||||
#
|
#
|
||||||
NASM=$(WIRESHARK_LIB_DIR)\nasm-2.09.08\nasm.exe
|
NASM=$(WIRESHARK_LIB_DIR)\nasm-2.09.08\nasm.exe
|
||||||
|
|
||||||
#
|
|
||||||
# Optional: the Python library enables scripting support.
|
|
||||||
#
|
|
||||||
# If you don't have the Python library, comment this line out, so that
|
|
||||||
# PYTHON_EMBED isn't defined.
|
|
||||||
#
|
|
||||||
# NOTE: The Python library must have been compiled with the same
|
|
||||||
# compiler (MSVC_VARIANT) as Wireshark. Known python.org Python
|
|
||||||
# CRT versions:
|
|
||||||
#
|
|
||||||
# Python version CRT (32-bit) CRT (64-bit)
|
|
||||||
# 2.4.4 7.1 ?
|
|
||||||
# 2.6.1 9.0 ?
|
|
||||||
# 2.6.2 ? 9.0
|
|
||||||
# 2.7.1 9.0 9.0
|
|
||||||
# 3.2.2 9.0 9.0
|
|
||||||
#
|
|
||||||
# If you versions of Python and Visual C++ use different CRTs
|
|
||||||
# comment this out.
|
|
||||||
#
|
|
||||||
# XXX The DLL path in epan/wspython/wspy_libws.py likely needs to
|
|
||||||
# be fixed before this is enabled by default.
|
|
||||||
#PYTHON_EMBED=1
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Optional: the Python interpreter is used as part of the buildsystem
|
# Optional: the Python interpreter is used as part of the buildsystem
|
||||||
#
|
#
|
||||||
|
@ -926,11 +902,6 @@ UPX=$(WIRESHARK_LIB_DIR)\upx303w\upx.exe
|
||||||
|
|
||||||
##### Flags, PATHs and Miscellaneous #####
|
##### Flags, PATHs and Miscellaneous #####
|
||||||
|
|
||||||
# Santity check: Python embedding requires a valid PYTHON_DIR
|
|
||||||
!IF DEFINED(PYTHON_EMBED) && !DEFINED(PYTHON_DIR)
|
|
||||||
!ERROR PYTHON_EMBED requires that PYTHON_DIR is defined
|
|
||||||
!ENDIF
|
|
||||||
|
|
||||||
# "convert" the MSVC variant into the required MSC compiler version
|
# "convert" the MSVC variant into the required MSC compiler version
|
||||||
!IF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20"
|
!IF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20"
|
||||||
MSC_VER_REQUIRED=1400
|
MSC_VER_REQUIRED=1400
|
||||||
|
@ -1671,17 +1642,6 @@ LUA_LIBS=
|
||||||
LUA_CONFIG=
|
LUA_CONFIG=
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
!IF DEFINED(PYTHON_EMBED)
|
|
||||||
PYTHON_CFLAGS=/I$(PYTHON_DIR)\include
|
|
||||||
PYTHON_LIBS=$(PYTHON_DIR)\libs\python$(PYTHON_VER).lib
|
|
||||||
# Nmake uses carets to escape special characters
|
|
||||||
PYTHON_CONFIG=^#define HAVE_PYTHON 1
|
|
||||||
!else
|
|
||||||
PYTHON_CFLAGS=
|
|
||||||
PYTHON_LIBS=
|
|
||||||
PYTHON_CONFIG=
|
|
||||||
!ENDIF
|
|
||||||
|
|
||||||
!IFDEF PORTAUDIO_DIR
|
!IFDEF PORTAUDIO_DIR
|
||||||
# Nmake uses carets to escape special characters
|
# Nmake uses carets to escape special characters
|
||||||
PORTAUDIO_CONFIG=^#define HAVE_LIBPORTAUDIO 1
|
PORTAUDIO_CONFIG=^#define HAVE_LIBPORTAUDIO 1
|
||||||
|
|
|
@ -253,7 +253,6 @@ EXTRA_DIST = \
|
||||||
README.malloc \
|
README.malloc \
|
||||||
README.packaging \
|
README.packaging \
|
||||||
README.plugins \
|
README.plugins \
|
||||||
README.python \
|
|
||||||
README.regression \
|
README.regression \
|
||||||
README.request_response_tracking\
|
README.request_response_tracking\
|
||||||
README.stats_tree \
|
README.stats_tree \
|
||||||
|
|
|
@ -1,297 +0,0 @@
|
||||||
Help on module wspy_dissector:
|
|
||||||
|
|
||||||
NAME
|
|
||||||
wspy_dissector
|
|
||||||
|
|
||||||
FILE
|
|
||||||
/Users/standel/xcode/wireshark/wireshark.git/epan/wspython/wspy_dissector.py
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
# wspy_dissector.py
|
|
||||||
#
|
|
||||||
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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
|
|
||||||
|
|
||||||
|
|
|
@ -477,12 +477,6 @@ This environment variable causes the various data files to be loaded from
|
||||||
a directory other than the standard locations. It has no effect when the
|
a directory other than the standard locations. It has no effect when the
|
||||||
program in question is running with root (or setuid) permissions on *NIX.
|
program in question is running with root (or setuid) permissions on *NIX.
|
||||||
|
|
||||||
=item WIRESHARK_PYTHON_DIR
|
|
||||||
|
|
||||||
This environment variable points to an alternate location for Python.
|
|
||||||
It has no effect when the program in question is running with root (or setuid)
|
|
||||||
permissions on *NIX.
|
|
||||||
|
|
||||||
=item ERF_RECORDS_TO_CHECK
|
=item ERF_RECORDS_TO_CHECK
|
||||||
|
|
||||||
This environment variable controls the number of ERF records checked when
|
This environment variable controls the number of ERF records checked when
|
||||||
|
|
|
@ -1686,12 +1686,6 @@ This environment variable causes the various data files to be loaded from
|
||||||
a directory other than the standard locations. It has no effect when the
|
a directory other than the standard locations. It has no effect when the
|
||||||
program in question is running with root (or setuid) permissions on *NIX.
|
program in question is running with root (or setuid) permissions on *NIX.
|
||||||
|
|
||||||
=item WIRESHARK_PYTHON_DIR
|
|
||||||
|
|
||||||
This environment variable points to an alternate location for Python.
|
|
||||||
It has no effect when the program in question is running with root (or setuid)
|
|
||||||
permissions on *NIX.
|
|
||||||
|
|
||||||
=item ERF_RECORDS_TO_CHECK
|
=item ERF_RECORDS_TO_CHECK
|
||||||
|
|
||||||
This environment variable controls the number of ERF records checked when
|
This environment variable controls the number of ERF records checked when
|
||||||
|
|
|
@ -2797,12 +2797,6 @@ This environment variable causes the various data files to be loaded from
|
||||||
a directory other than the standard locations. It has no effect when the
|
a directory other than the standard locations. It has no effect when the
|
||||||
program in question is running with root (or setuid) permissions on *NIX.
|
program in question is running with root (or setuid) permissions on *NIX.
|
||||||
|
|
||||||
=item WIRESHARK_PYTHON_DIR
|
|
||||||
|
|
||||||
This environment variable points to an alternate location for Python.
|
|
||||||
It has no effect when the program in question is running with root (or setuid)
|
|
||||||
permissions on *NIX.
|
|
||||||
|
|
||||||
=item ERF_RECORDS_TO_CHECK
|
=item ERF_RECORDS_TO_CHECK
|
||||||
|
|
||||||
This environment variable controls the number of ERF records checked when
|
This environment variable controls the number of ERF records checked when
|
||||||
|
|
14
epan/epan.c
14
epan/epan.c
|
@ -21,10 +21,6 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef HAVE_PYTHON
|
|
||||||
#include <Python.h> /* to get the Python version number (PY_VERSION) */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBGCRYPT
|
#ifdef HAVE_LIBGCRYPT
|
||||||
#include <wsutil/wsgcrypt.h>
|
#include <wsutil/wsgcrypt.h>
|
||||||
#endif /* HAVE_LIBGCRYPT */
|
#endif /* HAVE_LIBGCRYPT */
|
||||||
|
@ -501,16 +497,6 @@ epan_get_compiled_version_info(GString *str)
|
||||||
g_string_append(str, "without Lua");
|
g_string_append(str, "without Lua");
|
||||||
#endif /* HAVE_LUA */
|
#endif /* HAVE_LUA */
|
||||||
|
|
||||||
g_string_append(str, ", ");
|
|
||||||
#ifdef HAVE_PYTHON
|
|
||||||
g_string_append(str, "with Python");
|
|
||||||
#ifdef PY_VERSION
|
|
||||||
g_string_append(str, " " PY_VERSION);
|
|
||||||
#endif /* PY_VERSION */
|
|
||||||
#else
|
|
||||||
g_string_append(str, "without Python");
|
|
||||||
#endif /* HAVE_PYTHON */
|
|
||||||
|
|
||||||
/* GnuTLS */
|
/* GnuTLS */
|
||||||
g_string_append(str, ", ");
|
g_string_append(str, ", ");
|
||||||
#ifdef HAVE_LIBGNUTLS
|
#ifdef HAVE_LIBGNUTLS
|
||||||
|
|
13
epan/proto.c
13
epan/proto.c
|
@ -468,12 +468,6 @@ proto_init(void (register_all_protocols_func)(register_cb cb, gpointer client_da
|
||||||
handle, and do whatever one-time initialization it needs to
|
handle, and do whatever one-time initialization it needs to
|
||||||
do. */
|
do. */
|
||||||
register_all_protocols_func(cb, client_data);
|
register_all_protocols_func(cb, client_data);
|
||||||
#ifdef HAVE_PYTHON
|
|
||||||
/* Now scan for python protocols */
|
|
||||||
if (cb)
|
|
||||||
(*cb)(RA_PYTHON_REGISTER, NULL, client_data);
|
|
||||||
register_all_py_protocols_func();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_PLUGINS
|
#ifdef HAVE_PLUGINS
|
||||||
/* Now call the registration routines for all disssector
|
/* Now call the registration routines for all disssector
|
||||||
|
@ -489,13 +483,6 @@ proto_init(void (register_all_protocols_func)(register_cb cb, gpointer client_da
|
||||||
they need. */
|
they need. */
|
||||||
register_all_handoffs_func(cb, client_data);
|
register_all_handoffs_func(cb, client_data);
|
||||||
|
|
||||||
#ifdef HAVE_PYTHON
|
|
||||||
/* Now do the same with python dissectors */
|
|
||||||
if (cb)
|
|
||||||
(*cb)(RA_PYTHON_HANDOFF, NULL, client_data);
|
|
||||||
register_all_py_handoffs_func();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_PLUGINS
|
#ifdef HAVE_PLUGINS
|
||||||
/* Now do the same with plugins. */
|
/* Now do the same with plugins. */
|
||||||
if (cb)
|
if (cb)
|
||||||
|
|
|
@ -252,9 +252,6 @@ splash_update(register_action_e action, const char *message, gpointer client_dat
|
||||||
preferences and configuration */
|
preferences and configuration */
|
||||||
#ifdef HAVE_LUA
|
#ifdef HAVE_LUA
|
||||||
ul_count += wslua_count_plugins (); /* get count of lua plugins */
|
ul_count += wslua_count_plugins (); /* get count of lua plugins */
|
||||||
#endif
|
|
||||||
#ifdef HAVE_PYTHON
|
|
||||||
ul_count += 2; /* additional 2 for python register and handoff */
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -460,12 +457,6 @@ about_folders_page_new(void)
|
||||||
"dissector plugins");
|
"dissector plugins");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_PYTHON
|
|
||||||
/* global python bindings */
|
|
||||||
about_folders_row(table, "Python Bindings", get_wspython_dir(),
|
|
||||||
"python bindings");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_GEOIP
|
#ifdef HAVE_GEOIP
|
||||||
/* GeoIP */
|
/* GeoIP */
|
||||||
path = geoip_db_get_paths();
|
path = geoip_db_get_paths();
|
||||||
|
|
|
@ -210,11 +210,6 @@ AboutDialog::AboutDialog(QWidget *parent) :
|
||||||
message += about_folders_row("Global Plugins", get_plugin_dir(), "dissector plugins");
|
message += about_folders_row("Global Plugins", get_plugin_dir(), "dissector plugins");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_PYTHON
|
|
||||||
/* global python bindings */
|
|
||||||
message += about_folders_row("Python Bindings", get_wspython_dir(), "python bindings");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_GEOIP
|
#ifdef HAVE_GEOIP
|
||||||
/* GeoIP */
|
/* GeoIP */
|
||||||
path = geoip_db_get_paths();
|
path = geoip_db_get_paths();
|
||||||
|
|
|
@ -59,9 +59,6 @@ SplashOverlay::SplashOverlay(QWidget *parent) :
|
||||||
int register_add = 6;
|
int register_add = 6;
|
||||||
#ifdef HAVE_LUA
|
#ifdef HAVE_LUA
|
||||||
register_add++; /* additional one for lua plugins */
|
register_add++; /* additional one for lua plugins */
|
||||||
#endif
|
|
||||||
#ifdef HAVE_PYTHON
|
|
||||||
register_add += 2; /* additional 2 for python register and handoff */
|
|
||||||
#endif
|
#endif
|
||||||
so_ui_->progressBar->setMaximum((int)register_count() + register_add);
|
so_ui_->progressBar->setMaximum((int)register_count() + register_add);
|
||||||
time_.start();
|
time_.start();
|
||||||
|
|
|
@ -951,118 +951,6 @@ get_datafile_dir(void)
|
||||||
return datafile_dir;
|
return datafile_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_PYTHON
|
|
||||||
/*
|
|
||||||
* Find the directory where the python dissectors are stored.
|
|
||||||
*
|
|
||||||
* On Windows, we use the "py_dissector" subdirectory of the datafile directory.
|
|
||||||
*
|
|
||||||
* On UN*X, we use the PYTHON_DIR value supplied by the configure
|
|
||||||
* script, unless we think we're being run from the build directory,
|
|
||||||
* in which case we use the "py_dissector" subdirectory of the datafile directory.
|
|
||||||
*
|
|
||||||
* In both cases, we then use the subdirectory of that directory whose
|
|
||||||
* name is the version number.
|
|
||||||
*
|
|
||||||
* XXX - if we think we're being run from the build directory, perhaps we
|
|
||||||
* should have the plugin code not look in the version subdirectory
|
|
||||||
* of the plugin directory, but look in all of the subdirectories
|
|
||||||
* of the plugin directory, so it can just fetch the plugins built
|
|
||||||
* as part of the build process.
|
|
||||||
*/
|
|
||||||
static const char *wspython_dir = NULL;
|
|
||||||
|
|
||||||
static void
|
|
||||||
init_wspython_dir(void)
|
|
||||||
{
|
|
||||||
#ifdef _WIN32
|
|
||||||
/*
|
|
||||||
* On Windows, the data file directory is the installation
|
|
||||||
* directory; the python dissectors are stored under it.
|
|
||||||
*
|
|
||||||
* Assume we're running the installed version of Wireshark;
|
|
||||||
* on Windows, the data file directory is the directory
|
|
||||||
* in which the Wireshark binary resides.
|
|
||||||
*/
|
|
||||||
wspython_dir = g_strdup_printf("%s\\python\\%s", get_datafile_dir(),
|
|
||||||
VERSION);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Make sure that pathname refers to a directory.
|
|
||||||
*/
|
|
||||||
if (test_for_directory(wspython_dir) != EISDIR) {
|
|
||||||
/*
|
|
||||||
* Either it doesn't refer to a directory or it
|
|
||||||
* refers to something that doesn't exist.
|
|
||||||
*
|
|
||||||
* Assume that means we're running a version of
|
|
||||||
* Wireshark we've built in a build directory,
|
|
||||||
* in which case {datafile dir}\python is the
|
|
||||||
* top-level plugins source directory, and use
|
|
||||||
* that directory and set the "we're running in
|
|
||||||
* a build directory" flag, so the plugin
|
|
||||||
* scanner will check all subdirectories of that
|
|
||||||
* directory for python dissectors.
|
|
||||||
*/
|
|
||||||
g_free( (gpointer) wspython_dir);
|
|
||||||
wspython_dir = g_strdup_printf("%s\\python", get_datafile_dir());
|
|
||||||
running_in_build_directory_flag = TRUE;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if (running_in_build_directory_flag) {
|
|
||||||
/*
|
|
||||||
* We're (probably) being run from the build directory and
|
|
||||||
* weren't started with special privileges, so we'll use
|
|
||||||
* the "python" subdirectory of the datafile directory
|
|
||||||
* (the datafile directory is the build directory).
|
|
||||||
*/
|
|
||||||
wspython_dir = g_strdup_printf("%s/epan/wspython/", get_datafile_dir());
|
|
||||||
} else {
|
|
||||||
if (getenv("WIRESHARK_PYTHON_DIR") && !started_with_special_privs()) {
|
|
||||||
/*
|
|
||||||
* The user specified a different directory for plugins
|
|
||||||
* and we aren't running with special privileges.
|
|
||||||
*/
|
|
||||||
wspython_dir = g_strdup(getenv("WIRESHARK_PYTHON_DIR"));
|
|
||||||
}
|
|
||||||
#ifdef __APPLE__
|
|
||||||
/*
|
|
||||||
* If we're running from an app bundle and weren't started
|
|
||||||
* with special privileges, use the Contents/Resources/lib/wireshark/python
|
|
||||||
* subdirectory of the app bundle.
|
|
||||||
*
|
|
||||||
* (appbundle_dir is not set to a non-null value if we're
|
|
||||||
* started with special privileges, so we need only check
|
|
||||||
* it; we don't need to call started_with_special_privs().)
|
|
||||||
*/
|
|
||||||
else if (appbundle_dir != NULL) {
|
|
||||||
wspython_dir = g_strdup_printf("%s/Contents/Resources/lib/wireshark/python",
|
|
||||||
appbundle_dir);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
else {
|
|
||||||
wspython_dir = PYTHON_DIR;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#endif /* HAVE_PYTHON */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Get the directory in which the python dissectors are stored.
|
|
||||||
*/
|
|
||||||
const char *
|
|
||||||
get_wspython_dir(void)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_PYTHON
|
|
||||||
if (!wspython_dir) init_wspython_dir();
|
|
||||||
return wspython_dir;
|
|
||||||
#else
|
|
||||||
return NULL;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(HAVE_PLUGINS) || defined(HAVE_LUA)
|
#if defined(HAVE_PLUGINS) || defined(HAVE_LUA)
|
||||||
/*
|
/*
|
||||||
* Find the directory where the plugins are stored.
|
* Find the directory where the plugins are stored.
|
||||||
|
|
|
@ -54,13 +54,6 @@ WS_DLL_PUBLIC const char *get_progfile_dir(void);
|
||||||
*/
|
*/
|
||||||
WS_DLL_PUBLIC const char *get_plugin_dir(void);
|
WS_DLL_PUBLIC const char *get_plugin_dir(void);
|
||||||
|
|
||||||
/*
|
|
||||||
* Get the directory in which python plugins are stored; this must not be
|
|
||||||
* called before init_progfile_dir() is called, as they might be stored in a
|
|
||||||
* subdirectory of the program file directory.
|
|
||||||
*/
|
|
||||||
WS_DLL_PUBLIC const char *get_wspython_dir(void);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the flag indicating whether we're running from a build
|
* Get the flag indicating whether we're running from a build
|
||||||
* directory.
|
* directory.
|
||||||
|
|
Loading…
Reference in New Issue