Skip to content

Commit

Permalink
added first EPAN prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovikov committed May 29, 2017
1 parent a3d3f7a commit 53967eb
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 0 deletions.
22 changes: 22 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ AC_ARG_ENABLE(mysql,
AC_MSG_RESULT([$MYSQL])
AC_SUBST([MYSQL])

useEpan=no
AC_ARG_ENABLE(compression,
[ --enable-epan Enable EPAN support / Wireshark dissectors)],
[EPAN="$enableval"]
useEpan=yes,
[EPAN="no"]
)
AC_MSG_RESULT([$EPAN])
AC_SUBST([EPAN])


usePCRE=no
AC_MSG_CHECKING([whether to use pcre])
Expand Down Expand Up @@ -216,6 +226,17 @@ if test "$ZLIB" = "yes"; then
AC_DEFINE(USE_ZLIB, 1, [Use ZIP library])
fi

dnl
dnl check for epan library
dnl

if test "$EPAN" = "yes"; then
AC_CHECKING([for epan Library and Header files])
AC_CHECK_HEADER(epan.h,,[AC_MSG_ERROR([epan.h headers not found.])])
AC_CHECK_LIB(wireshark, epan_get_version, [ ], [AC_MSG_ERROR([$PACKAGE_NAME requires but cannot find wireshark libraries])])
AC_DEFINE(USE_EPAN, 1, [Use EPAN library])
fi


dnl
dnl check for redis library
Expand Down Expand Up @@ -352,5 +373,6 @@ echo Build with REDIS............ : $useRedis
echo Build with MySQL............ : $useMysql
echo Build with PCRE............. : $usePCRE
echo Build with LibUV............ : $useLIBUV
echo Build with EPAN............. : $useEPAN
echo

16 changes: 16 additions & 0 deletions src/modules/protocol/epan/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
include $(top_srcdir)/modules.am

SUBDIRS = \
.

noinst_HEADERS =
#
protocol_epan_la_SOURCES = protocol_epan.c
protocol_epan_la_CFLAGS = -Wall ${MODULE_CFLAGS}
protocol_epan_la_LDFLAGS = -module -avoid-version
protocol_epan_la_LIBADD = ${PTHREAD_LIBS} ${EXPAT_LIBS} ${PCAP_LIBS}
protocol_epan_laconfdir = $(confdir)
protocol_epan_laconf_DATA = $(top_srcdir)/conf/protocol_epan.xml

mod_LTLIBRARIES = protocol_epan.la

83 changes: 83 additions & 0 deletions src/modules/protocol/epan/protocol_epan.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* $Id$
*
* captagent - Homer capture agent. Modular
* Duplicate SIP messages in Homer Encapulate Protocol [HEP] [ipv6 version]
*
* Author: Alexandr Dubovikov
* (C) Homer Project 2016 (http://www.sipcapture.org)
*
* Homer capture agent 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 3 of the License, or
* (at your option) any later version
*
* Homer capture agent 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
*
*/

#include <captagent/api.h>
#include <captagent/structure.h>
#include <captagent/modules_api.h>
#include <captagent/modules.h>
#include <captagent/log.h>

#include <sys/types.h>
#include <limits.h>


static uint64_t module_serial = 0;

static cmd_export_t epan_cmds[] = {
{
.name = "parse_epan",
.function = epan_parse,
.param_no = 0,
.flags = 0,
.fixup_flags = 0,
},
{ 0, },
};

struct module_exports exports = {
.name = "protocol_epan",
.cmds = epan_cmds,
.load_f = epan_load_module,
.unload_f = epan_unload_module,
.description_f = epan_description,
.stats_f = epan_statistic,
.serial_f = epan_serial_module,
};


static int epan_load_module(xml_node *config)
{
return 0;
}

static int epan_unload_module(void)
{
return 0;
}

static int epan_description(char *description)
{
return 1;
}

static int epan_statistic(char *buf, size_t len)
{
return 1;
}

static uint64_t epan_serial_module(void)
{
return module_serial;
}

0 comments on commit 53967eb

Please sign in to comment.