Skip to content
Permalink
Browse files

Merge branch 'topic/dopheide/2.7-btest-update' of https://github.com/…

…dopheide-esnet/bro-quic-1

* 'topic/dopheide/2.7-btest-update' of https://github.com/dopheide-esnet/bro-quic-1:
  Remove version number from show-plugin test
  • Loading branch information...
jsiwek committed Nov 14, 2018
2 parents dd8f540 + 40a4f54 commit 49c7e25c5d3074c08b40dfe17d670845e234c58c
Showing with 93 additions and 12 deletions.
  1. +9 −0 CHANGES
  2. +1 −1 VERSION
  3. +1 −1 bro-pkg.meta
  4. +79 −7 configure
  5. +1 −1 src/Plugin.cc
  6. +1 −1 tests/Baseline/gquic.show-plugin/output
  7. +1 −1 tests/gquic/show-plugin.bro
@@ -0,0 +1,9 @@

0.2 Wed Nov 14 16:10:17 CST 2018

- Release 0.2.

- Update show-plugin test to remove version number from baseline. (Michael Dopheide)

- Update configure script to support building against bro installation. (Jon Siwek, Corelight)

@@ -1 +1 @@
0.1
0.2
@@ -4,4 +4,4 @@ description = Detects the Google QUIC (GQUIC) protocol and adds "gquic"
tags = plugin, analyzer, gquic, quic
plugin_dir = build/Corelight_GQUIC.tgz
script_dir = build/scripts/Corelight/GQUIC
build_command = ( ./configure --bro-dist=%(bro_dist)s && make )
build_command = test -e %(bro_dist)s/bro-path-dev.in && ( ./configure --bro-dist=%(bro_dist)s && make ) || ( ./configure && make )
@@ -31,6 +31,11 @@ Usage: $0 [OPTIONS]
Plugin Options:
--bro-dist=DIR Path to Bro source tree
--install-root=DIR Path where to install plugin into
--with-binpac=DIR Path to BinPAC installation root
--with-broker=DIR Path to Broker installation root
--with-caf=DIR Path to CAF installation root
--with-bifcl=PATH Path to bifcl executable
--enable-debug Compile in debugging mode
EOF

if type plugin_usage >/dev/null 2>&1; then
@@ -53,7 +58,7 @@ append_cache_entry () {

# set defaults
builddir=build
brodist=`bro-config --bro_dist 2> /dev/null || (cd ../../.. && pwd)`
brodist=""
installroot="default"
CMakeCacheEntries=""

@@ -76,6 +81,29 @@ while [ $# -ne 0 ]; do
installroot=$optarg
;;

--with-binpac=*)
append_cache_entry BinPAC_ROOT_DIR PATH $optarg
binpac_root=$optarg
;;

--with-broker=*)
append_cache_entry BROKER_ROOT_DIR PATH $optarg
broker_root=$optarg
;;

--with-caf=*)
append_cache_entry CAF_ROOT_DIR PATH $optarg
caf_root=$optarg
;;

--with-bifcl=*)
append_cache_entry BifCl_EXE PATH $optarg
;;

--enable-debug)
append_cache_entry BRO_PLUGIN_ENABLE_DEBUG BOOL true
;;

*)
if type plugin_option >/dev/null 2>&1; then
plugin_option $1 && shift && continue;
@@ -88,13 +116,57 @@ while [ $# -ne 0 ]; do
shift
done

if [ ! -e "$brodist/bro-path-dev.in" ]; then
echo "Cannot determine Bro source directory, use --bro-dist=DIR."
exit 1
fi
if [ -z "$brodist" ]; then
if type bro-config >/dev/null 2>&1; then
if bro-config --cmake_dir >/dev/null 2>&1; then
# Have a newer version of bro-config that has needed flags
append_cache_entry BRO_CONFIG_PREFIX PATH `bro-config --prefix`
append_cache_entry BRO_CONFIG_INCLUDE_DIR PATH `bro-config --include_dir`
append_cache_entry BRO_CONFIG_PLUGIN_DIR PATH `bro-config --plugin_dir`
append_cache_entry BRO_CONFIG_CMAKE_DIR PATH `bro-config --cmake_dir`
append_cache_entry CMAKE_MODULE_PATH PATH `bro-config --cmake_dir`

build_type=`bro-config --build_type`

append_cache_entry BRO_DIST PATH $brodist
append_cache_entry CMAKE_MODULE_PATH PATH $brodist/cmake
if [ "$build_type" = "debug" ]; then
append_cache_entry BRO_PLUGIN_ENABLE_DEBUG BOOL true
fi

if [ -z "$binpac_root" ]; then
append_cache_entry BinPAC_ROOT_DIR PATH `bro-config --binpac_root`
fi

if [ -z "$broker_root" ]; then
append_cache_entry BROKER_ROOT_DIR PATH `bro-config --broker_root`
fi

if [ -z "$caf_root" ]; then
append_cache_entry CAF_ROOT_DIR PATH `bro-config --caf_root`
fi
else
brodist=`bro-config --bro_dist 2> /dev/null`

if [ ! -e "$brodist/bro-path-dev.in" ]; then
echo "$brodist does not appear to be a valid Bro source tree."
exit 1
fi

append_cache_entry BRO_DIST PATH $brodist
append_cache_entry CMAKE_MODULE_PATH PATH $brodist/cmake
fi
else
echo "Either 'bro-config' must be in PATH or '--bro-dist=<path>' used"
exit 1
fi
else
if [ ! -e "$brodist/bro-path-dev.in" ]; then
echo "$brodist does not appear to be a valid Bro source tree."
exit 1
fi

append_cache_entry BRO_DIST PATH $brodist
append_cache_entry CMAKE_MODULE_PATH PATH $brodist/cmake
fi

if [ "$installroot" != "default" ]; then
mkdir -p $installroot
@@ -15,6 +15,6 @@ plugin::Configuration Plugin::Configure()
config.name = "Corelight::GQUIC";
config.description = "Google QUIC (QGUIC) protocol analyzer";
config.version.major = 0;
config.version.minor = 1;
config.version.minor = 2;
return config;
}
@@ -1,4 +1,4 @@
Corelight::GQUIC - Google QUIC (QGUIC) protocol analyzer (dynamic, version 0.1)
Corelight::GQUIC - Google QUIC (QGUIC) protocol analyzer (dynamic, version)
[Analyzer] GQUIC (ANALYZER_GQUIC, enabled)
[Event] gquic_packet
[Event] gquic_client_version
@@ -1,2 +1,2 @@
# @TEST-EXEC: bro -NN Corelight::GQUIC >output
# @TEST-EXEC: bro -NN Corelight::GQUIC |sed -e 's/version.*)/version)/g' >output
# @TEST-EXEC: btest-diff output

0 comments on commit 49c7e25

Please sign in to comment.
You can’t perform that action at this time.