Skip to content

Commit

Permalink
Merge branch 'rc-4.0.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
salcock committed Jan 16, 2019
2 parents 9aa5d7d + ab3ddbe commit e4e33e9
Show file tree
Hide file tree
Showing 69 changed files with 3,829 additions and 998 deletions.
10 changes: 10 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
stages:
- build
- deploy
- upload

build-debian-jessie:
stage: build
Expand Down Expand Up @@ -111,3 +112,12 @@ deploy-packages:
expire_in: 1 month
only:
- tags

upload-packages:
stage: upload
image: ubuntu:bionic
script:
- ./bintray-upload.sh
only:
- tags

1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ In no particular order, we would like to recognise:
of other ERF/DAG issues
* Tim Dawson for fixing issues with building against musl libc
* Hendrik Leppelsack for reporting and fixing some errors in the tool manpages
* Jacob van Walraven for spending a summer doing various coding odd-jobs
* Jamie Curtis for fixing a couple of bugs many many years ago
* Brendon Jones for creating the original Windows DLLs and writing bits of
code here and there
Expand Down
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
libtrace 4.0.5
libtrace 4.0.6

---------------------------------------------------------------------------
Copyright (c) 2007-2018 The University of Waikato, Hamilton, New Zealand.
Copyright (c) 2007-2019 The University of Waikato, Hamilton, New Zealand.
All rights reserved.

This code has been developed by the University of Waikato WAND
Expand Down
41 changes: 41 additions & 0 deletions bintray-upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

set -x -e -o pipefail

VERSION=${CI_COMMIT_REF_NAME}
PKGVERSION=1
ARCH=amd64

APIKEY=${BINTRAY_API_KEY}

apt-get update
apt-get install -y curl

UBUNTU_DISTS=("xenial" "artful" "bionic")
DEBIAN_DISTS=("stretch" "jessie" "sid" "buster")
PACKAGE_LIST=("libtrace4" "libtrace4-dev" "libtrace4-tools" "libpacketdump4" "libpacketdump4-dev")

for i in "${UBUNTU_DISTS[@]}"
do
for comp in "${PACKAGE_LIST[@]}"; do
echo ubuntu_$i/${comp}

if [ ! -f built-packages/ubuntu_$i/${comp}_${VERSION}-${PKGVERSION}_${ARCH}.deb ]; then
continue
fi

curl -T built-packages/ubuntu_$i/${comp}_${VERSION}-${PKGVERSION}_${ARCH}.deb -usalcock:$APIKEY "https://api.bintray.com/content/wand/debian/$comp/$VERSION/pool/$i/main/lib${comp:3:1}/${comp}_${VERSION}-${PKGVERSION}_${ARCH}.deb;deb_distribution=$i;deb_component=main;deb_architecture=$ARCH"
done
done

for i in "${DEBIAN_DISTS[@]}"
do
for comp in "${PACKAGE_LIST[@]}"; do
echo debian_$i/${comp}
if [ ! -f built-packages/debian_$i/${comp}_${VERSION}-${PKGVERSION}_${ARCH}.deb ]; then
continue
fi

curl -T built-packages/debian_$i/${comp}_${VERSION}-${PKGVERSION}_${ARCH}.deb -usalcock:$APIKEY "https://api.bintray.com/content/wand/debian/$comp/$VERSION/pool/$i/main/lib${comp:3:1}/${comp}_${VERSION}-${PKGVERSION}_${ARCH}.deb;deb_distribution=$i;deb_component=main;deb_architecture=$ARCH"
done
done
16 changes: 9 additions & 7 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Now you only need to update the version number in two places - below,
# and in the README

AC_INIT([libtrace],[4.0.5],[[email protected]],[libtrace])
AC_INIT([libtrace],[4.0.6],[[email protected]],[libtrace])

LIBTRACE_MAJOR=4
LIBTRACE_MID=0
LIBTRACE_MINOR=5
LIBTRACE_MINOR=6

# OpenSolaris hides libraries like libncurses in /usr/gnu/lib, which is not
# searched by default - add it to LDFLAGS so we at least have a chance of
Expand Down Expand Up @@ -122,7 +122,8 @@ AC_PROG_GCC_TRADITIONAL

# Fail if any of these functions are missing
AC_CHECK_DECLS([strdup, strlcpy, strcasecmp, strncasecmp, snprintf, vsnprintf, strndup])
AC_CHECK_DECLS([socket, recvmmsg], [], [], [[#include <sys/socket.h>]])
AC_CHECK_DECLS([socket, recvmmsg], [], [], [[#define _GNU_SOURCE 1
#include <sys/socket.h>]])
AC_CHECK_SIZEOF([long int])


Expand Down Expand Up @@ -402,15 +403,15 @@ libtrace_dpdk=false
if test "$want_dpdk" != no; then
# So instead simply check for existence
if test "$RTE_SDK" != ""; then
AC_CHECK_FILE("$RTE_SDK/$RTE_TARGET/lib/libdpdk.so", dpdk_found="dpdk", dpdk_found=0)
fi
if test "$dpdk_found" = 0 -a "$RTE_SDK" != ""; then
AC_CHECK_FILE("$RTE_SDK/$RTE_TARGET/lib/libintel_dpdk.a", dpdk_found=":libintel_dpdk.a", dpdk_found=0)
fi
# DPDK 2.1.0+ renames this to libdpdk from libintel_dpdk
if test "$dpdk_found" = 0 -a "$RTE_SDK" != ""; then
AC_CHECK_FILE("$RTE_SDK/$RTE_TARGET/lib/libdpdk.a", dpdk_found=":libdpdk.a", dpdk_found=0)
fi
if test "$dpdk_found" = 0 -a "$RTE_SDK" != ""; then
AC_CHECK_FILE("$RTE_SDK/$RTE_TARGET/lib/libdpdk.so", dpdk_found="dpdk", dpdk_found=0)
fi
if test "$dpdk_found" = 0 -a "$RTE_SDK" != ""; then
AC_CHECK_LIB(dpdk, rte_eth_dev_configure, dpdk_found="dpdk", dpdk_found=0)
fi
Expand Down Expand Up @@ -510,6 +511,7 @@ fi

if test "$have_pthread" = 1; then
AC_DEFINE(HAVE_LIBPTHREAD, 1, [Set to 1 if pthreads are supported])
LIBTRACE_LIBS="$LIBTRACE_LIBS -lpthread"
fi

if test "$have_pthread_setname_np" = 1; then
Expand Down Expand Up @@ -601,7 +603,7 @@ if (test "$use_llvm" != "no"); then
JIT=no
else
LIBCXXFLAGS="`$LLVM_CONFIG --cxxflags` $CXXFLAGS"
LIBTRACE_LIBS="$LIBRACE_LIBS `$LLVM_CONFIG --libs all`";
LIBTRACE_LIBS="$LIBTRACE_LIBS `$LLVM_CONFIG --libs all`";
LDFLAGS="`$LLVM_CONFIG --ldflags` $LDFLAGS";
JIT=yes
AC_DEFINE(HAVE_LLVM, 1, [Set to 1 if you have LLVM installed])
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
libtrace4 (4.0.6-1) unstable; urgency=low

* New upstream release

-- Shane Alcock <[email protected]> Tue, 15 Jan 2019 11:50:06 +1300

libtrace4 (4.0.0-1) unstable; urgency=medium

* New upstream release
Expand Down
5 changes: 2 additions & 3 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Homepage: http://research.wand.net.nz/software/libtrace.php
Package: libtrace4-dev
Section: libdevel
Architecture: any
Depends: libtrace4 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
Depends: libtrace4 (= ${binary:Version}), ${misc:Depends}
Provides: libtrace-dev
Conflicts: libtrace-dev, libpacketdump3-dev
Replaces: libtrace-dev
Expand Down Expand Up @@ -45,8 +45,7 @@ Description: network trace processing library supporting many input formats
Package: libpacketdump4-dev
Section: libdevel
Architecture: any
Depends: libpacketdump4 (= ${binary:Version}), ${misc:Depends},
${shlibs:Depends}
Depends: libpacketdump4 (= ${binary:Version}), ${misc:Depends}
Provides: libpacketdump-dev
Conflicts: libpacketdump-dev
Replaces: libpacketdump-dev
Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ binary-arch: build install
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb -- -Zgzip

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
44 changes: 22 additions & 22 deletions examples/parallel/network_capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@
#include <stdlib.h>
#include <string.h>

static char *output = NULL;
static char *outputfile = NULL;

static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
static int count = 0;
static libtrace_t *trace = NULL;
static libtrace_t *inptrace = NULL;

static int compress_level=-1;
static trace_option_compresstype_t compress_type = TRACE_OPTION_COMPRESSTYPE_NONE;

static void stop(int signal UNUSED)
{
if (trace)
trace_pstop(trace);
if (inptrace)
trace_pstop(inptrace);
}

static void usage(char *argv0)
Expand All @@ -56,16 +56,16 @@ static libtrace_out_t *create_output(int my_id) {
const char * file_index = NULL;
const char * first_extension = NULL;

file_index = strrchr(output, '/');
file_index = strrchr(outputfile, '/');
if (file_index)
first_extension = strchr(file_index, '.');
else
first_extension = strchr(name, '.');

if (first_extension) {
snprintf(name, sizeof(name), "%.*s-%d%s", (int) (first_extension - output), output, my_id, first_extension);
snprintf(name, sizeof(name), "%.*s-%d%s", (int) (first_extension - outputfile), outputfile, my_id, first_extension);
} else {
snprintf(name, sizeof(name), "%s-%d", output, my_id);
snprintf(name, sizeof(name), "%s-%d", outputfile, my_id);
}

out = trace_create_output(name);
Expand Down Expand Up @@ -231,11 +231,11 @@ int main(int argc, char *argv[])
usage(argv[0]);
return 1;
}
trace = trace_create(argv[optind]);
output = argv[optind+1];
inptrace = trace_create(argv[optind]);
outputfile = argv[optind+1];

if (trace_is_err(trace)) {
trace_perror(trace,"Opening trace file");
if (trace_is_err(inptrace)) {
trace_perror(inptrace,"Opening trace file");
return 1;
}

Expand All @@ -246,35 +246,35 @@ int main(int argc, char *argv[])
trace_set_packet_cb(processing, per_packet);

if (snaplen != -1)
trace_set_snaplen(trace, snaplen);
trace_set_snaplen(inptrace, snaplen);
if(nb_threads != -1)
trace_set_perpkt_threads(trace, nb_threads);
trace_set_perpkt_threads(inptrace, nb_threads);

/* We use a new version of trace_start(), trace_pstart()
* The reporter function argument is optional and can be NULL */
if (trace_pstart(trace, NULL, processing, NULL)) {
trace_perror(trace,"Starting trace");
trace_destroy(trace);
if (trace_pstart(inptrace, NULL, processing, NULL)) {
trace_perror(inptrace,"Starting trace");
trace_destroy(inptrace);
trace_destroy_callback_set(processing);
return 1;
}

/* Wait for the trace to finish */
trace_join(trace);
trace_join(inptrace);

if (trace_is_err(trace)) {
trace_perror(trace,"Reading packets");
trace_destroy(trace);
if (trace_is_err(inptrace)) {
trace_perror(inptrace,"Reading packets");
trace_destroy(inptrace);
trace_destroy_callback_set(processing);
return 1;
}

/* Print stats before we destroy the trace */
stats = trace_get_statistics(trace, NULL);
stats = trace_get_statistics(inptrace, NULL);
fprintf(stderr, "Overall statistics\n");
trace_print_statistics(stats, stderr, "\t%s: %"PRIu64"\n");

trace_destroy_callback_set(processing);
trace_destroy(trace);
trace_destroy(inptrace);
return 0;
}
34 changes: 17 additions & 17 deletions examples/skeleton/parallel.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@
#include "libtrace_parallel.h"

volatile int done = 0;
libtrace_t *trace = NULL;
libtrace_t *inptrace = NULL;

static void cleanup_signal(int sig) {
(void)sig; /* avoid warnings about unused parameter */
done = 1;
if (trace)
trace_pstop(trace);
if (inptrace)
trace_pstop(inptrace);
}


Expand Down Expand Up @@ -287,35 +287,35 @@ int main(int argc, char *argv[]) {

for (i = optind; i < argc; i++) {

trace = trace_create(argv[i]);
inptrace = trace_create(argv[i]);

if (trace_is_err(trace)) {
trace_perror(trace, "Opening trace file");
if (trace_is_err(inptrace)) {
trace_perror(inptrace, "Opening trace file");
retcode = -1;
break;
}

if (filter && trace_config(trace, TRACE_OPTION_FILTER, filter) == -1) {
trace_perror(trace, "trace_config(filter)");
if (filter && trace_config(inptrace, TRACE_OPTION_FILTER, filter) == -1) {
trace_perror(inptrace, "trace_config(filter)");
retcode = -1;
break;
}

trace_set_perpkt_threads(trace, threads);
trace_set_combiner(trace, &combiner_ordered,
trace_set_perpkt_threads(inptrace, threads);
trace_set_combiner(inptrace, &combiner_ordered,
(libtrace_generic_t) {0});
trace_set_hasher(trace, HASHER_BIDIRECTIONAL, NULL, NULL);
trace_set_hasher(inptrace, HASHER_BIDIRECTIONAL, NULL, NULL);

if (trace_pstart(trace, &global, processing, reporter)) {
trace_perror(trace, "Starting trace");
if (trace_pstart(inptrace, &global, processing, reporter)) {
trace_perror(inptrace, "Starting trace");
break;
}

/* Wait for all threads to stop */
trace_join(trace);
trace_join(inptrace);

if (trace_is_err(trace)) {
trace_perror(trace, "Processing packets");
if (trace_is_err(inptrace)) {
trace_perror(inptrace, "Processing packets");
retcode = -1;
break;
}
Expand All @@ -326,7 +326,7 @@ int main(int argc, char *argv[]) {

if (filter)
trace_destroy_filter(filter);
trace_destroy(trace);
trace_destroy(inptrace);
trace_destroy_callback_set(processing);
trace_destroy_callback_set(reporter);
return retcode;
Expand Down
Loading

0 comments on commit e4e33e9

Please sign in to comment.