-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
|
||
test -z "$srcdir" && export srcdir=. | ||
|
||
. $srcdir/pcapreader.sh | ||
|
||
run_pcap_reader_test "$pcap_dir/invalid_ipv6_ext_len.pcap" invalid_ipv6_ext_len | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
|
||
export LC_ALL=C | ||
export LANG=C | ||
|
||
test -z "$srcdir" && export srcdir=. | ||
|
||
ipfixprobe_bin=../../ipfixprobe | ||
if [ -x ../../../logger/logger ]; then | ||
logger_bin=../../../logger/logger | ||
elif [ -x /usr/local/bin/logger ]; then | ||
logger_bin=/usr/local/bin/logger | ||
else | ||
logger_bin=/usr/bin/nemea/logger | ||
fi | ||
|
||
pcap_dir=$srcdir/../../pcaps | ||
ref_dir=$srcdir/reference | ||
output_dir=./output | ||
file_out="$$.data" | ||
|
||
# Usage: run_pcap_reader_test <data file> <reference fie> | ||
run_pcap_reader_test() { | ||
if ! [ -f "$ipfixprobe_bin" ]; then | ||
echo "ipfixprobe not compiled" | ||
return 77 | ||
fi | ||
|
||
if ! `"$ipfixprobe_bin" -h unirec |head -1 | grep -q '^unirec'`; then | ||
echo "compiled without NEMEA" | ||
return 77 | ||
fi | ||
|
||
if ! [ -f "$logger_bin" ]; then | ||
echo "logger not compiled" | ||
return 77 | ||
fi | ||
|
||
if ! [ -d "$output_dir" ]; then | ||
mkdir "$output_dir" | ||
fi | ||
|
||
"$ipfixprobe_bin" -i "pcap;file=$1" -o "unirec;ifc=f:${output_dir}/${file_out}:buffer=off:timeout=WAIT;id=0" >/dev/null | ||
"$logger_bin" -i f:"$output_dir/$file_out" -t | sort > "$output_dir/$2" | ||
rm "$output_dir/$file_out" | ||
|
||
if sort "$ref_dir/$2" | diff -u "$output_dir/$2" -s - ; then | ||
echo "$2 pcap reader test OK" | ||
else | ||
echo "$2 pcap reader test FAILED" | ||
return 1 | ||
fi | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
6785:c903::a002:8018:202e:0,1a00:a1a1:a1a1:a1a1:a1a1:a1a1:9ba1:a117,40,0,0,2014-11-10T03:32:08.002213,2014-11-10T03:32:08.002213,00:00:00:00:00:00,00:00:00:00:00:00,1,0,0,0,0,1,0,0 | ||
ipaddr DST_IP,ipaddr SRC_IP,uint64 BYTES,uint64 BYTES_REV,uint64 LINK_BIT_FIELD,time TIME_FIRST,time TIME_LAST,macaddr DST_MAC,macaddr SRC_MAC,uint32 PACKETS,uint32 PACKETS_REV,uint16 DST_PORT,uint16 SRC_PORT,uint8 DIR_BIT_FIELD,uint8 PROTOCOL,uint8 TCP_FLAGS,uint8 TCP_FLAGS_REV |