1
0
Fork 0

initial checking of example out-of-tree wireshark plugin

This builds on Debian unstable against the header files in
/usr/include/wireshark

The SIM disesctor will not work, as it is not called by GSMTAP.  So this
is just an example on how to build a wireshark plugin out-of-tree.
This commit is contained in:
Harald Welte 2011-12-18 23:44:10 +01:00
commit abf043ae10
7 changed files with 1975 additions and 0 deletions

32
.gitignore vendored Normal file
View File

@ -0,0 +1,32 @@
Makefile
Makefile.in
.deps
.libs
*.o
*.lo
*.la
*.pc
aclocal.m4
acinclude.m4
aminclude.am
m4/*.m4
autom4te.cache
config.h*
config.sub
config.log
config.status
config.guess
configure
depcomp
missing
ltmain.sh
install-sh
stamp-h1
libtool
libosmocore-*.tar.*
.tarball-version
.version
# vi files
*.sw?

15
Makefile.am Normal file
View File

@ -0,0 +1,15 @@
WS_INC = -I/usr/include/wireshark
AM_CFLAGS = $(GLIB_CFLAGS) $(WS_INC)
ACLOCAL_AMFLAGS = -I m4
plugindir = /usr/lib/wireshark/libwireshark1/plugins/
plugin_LTLIBRARIES = gsm_sim.la
gsm_sim_la_SOURCES = \
plugin.c \
moduleinfo.h \
packet-gsm_sim.c
gsm_sim_la_LDFLAGS = -module -avoid-version
#gsm_sim_la_LIBADD = @PLUGIN_LIBS@

124
config.h.in Normal file
View File

@ -0,0 +1,124 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Define to 1 if you have the <arpa/nameser.h> header file. */
#undef HAVE_ARPA_NAMESER_H
/* Define to 1 if you have the <direct.h> header file. */
#undef HAVE_DIRECT_H
/* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the <grp.h> header file. */
#undef HAVE_GRP_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define to 1 if you have the <pwd.h> header file. */
#undef HAVE_PWD_H
/* Define to 1 if you have the <stdarg.h> header file. */
#undef HAVE_STDARG_H
/* Define to 1 if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/sockio.h> header file. */
#undef HAVE_SYS_SOCKIO_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <sys/utsname.h> header file. */
#undef HAVE_SYS_UTSNAME_H
/* Define to 1 if you have the <sys/wait.h> header file. */
#undef HAVE_SYS_WAIT_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Define as the string to precede declarations of routines that never return
*/
#undef WS_MSVC_NORETURN
/* Define as the string to precede external variable declarations in
dynamically-linked libraries */
#undef WS_VAR_IMPORT

46
configure.ac Normal file
View File

@ -0,0 +1,46 @@
AC_INIT([wireshark-m2m],
0,
[openbsc-devel@lists.openbsc.org])
dnl m4_esyscmd([./git-version-gen .tarball-version]),
AM_INIT_AUTOMAKE([dist-bzip2])
AC_CONFIG_MACRO_DIR([m4])
dnl kernel style compile messages
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl checks for programs
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_INSTALL
LT_INIT
AC_PROG_LIBTOOL
PKG_CHECK_MODULES(GLIB, glib-2.0)
AC_CHECK_HEADERS(direct.h dirent.h fcntl.h grp.h inttypes.h netdb.h pwd.h stdarg.h stddef.h unistd.h)
AC_CHECK_HEADERS(sys/ioctl.h sys/param.h sys/socket.h sys/sockio.h sys/stat.h sys/time.h sys/types.h sys/utsname.h sys/wait.h)
AC_CHECK_HEADERS(netinet/in.h)
AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
#
# Define WS_VAR_IMPORT appropriately for declarations of external
# variables exported from dynamically-linked libraries.
#
AC_DEFINE(WS_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
#
# Define WS_MSVC_NORETURN appropriately for declarations of routines that
# never return (just like Charlie on the MTA).
#
# Note that MSVC++ expects __declspec(noreturn) to precede the function
# name and GCC, as far as I know, expects __attribute__((noreturn)) to
# follow the function name, so we need two different flavors of
# noreturn tag.
#
AC_DEFINE(WS_MSVC_NORETURN,, [Define as the string to precede declarations of routines that never return])
AM_CONFIG_HEADER(config.h)
AC_OUTPUT(
Makefile)

52
moduleinfo.h Normal file
View File

@ -0,0 +1,52 @@
/* moduleinfo.h
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan
*
* $Id$
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1999 Gerald Combs
*
* 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.
*/
/* Included *after* config.h, in order to re-define these macros */
#ifdef PACKAGE
#undef PACKAGE
#endif
/* Name of package */
#define PACKAGE "m2m"
#ifdef VERSION
#undef VERSION
#endif
/* Version number of package */
#define stringiz1(x) #x
#define stringize(x) stringiz1(x)
#ifndef BUILD_NUMBER
#define BUILD_NUMBER 0
#endif
#define VERSION "1.1." stringize(BUILD_NUMBER)

1675
packet-gsm_sim.c Normal file

File diff suppressed because it is too large Load Diff

31
plugin.c Normal file
View File

@ -0,0 +1,31 @@
/*
* Do not modify this file.
*
* It is created automatically by Makefile or Makefile.nmake.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <gmodule.h>
#include "moduleinfo.h"
#ifndef ENABLE_STATIC
G_MODULE_EXPORT const gchar version[] = VERSION;
/* Start the functions we need for the plugin stuff */
G_MODULE_EXPORT void
plugin_register (void)
{
{extern void proto_register_gsm_sim (void); proto_register_gsm_sim ();}
}
G_MODULE_EXPORT void
plugin_reg_handoff(void)
{
{extern void proto_reg_handoff_gsm_sim (void); proto_reg_handoff_gsm_sim ();}
}
#endif