# Makefile.in generated by automake 1.10.2 from Makefile.am.
# test/Makefile.  Generated from Makefile.in by configure.

# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.



pkgdatadir = $(datadir)/tcpreplay
pkglibdir = $(libdir)/tcpreplay
pkgincludedir = $(includedir)/tcpreplay
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = x86_64-unknown-linux-gnu
host_triplet = x86_64-unknown-linux-gnu
target_triplet = x86_64-unknown-linux-gnu
subdir = test
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
	$(srcdir)/config.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \
	$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/config.h
CONFIG_CLEAN_FILES = config
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = ${SHELL} /home/stsi/source/radware/tcpreplay-3.4.1/config/missing --run aclocal-1.10
AMTAR = ${SHELL} /home/stsi/source/radware/tcpreplay-3.4.1/config/missing --run tar
AR = ar
AUTOCONF = ${SHELL} /home/stsi/source/radware/tcpreplay-3.4.1/config/missing --run autoconf
AUTOGEN = 
AUTOHEADER = ${SHELL} /home/stsi/source/radware/tcpreplay-3.4.1/config/missing --run autoheader
AUTOMAKE = ${SHELL} /home/stsi/source/radware/tcpreplay-3.4.1/config/missing --run automake-1.10
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -D_U_="__attribute__((unused))"  -Wall -O3 -std=gnu99 -Wextra -Wno-variadic-macros -Wfatal-errors -I/usr/include
CPP = gcc -E
CPPFLAGS = 
CUT = /bin/cut
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
DMALLOC_LIB = 
DSYMUTIL = 
DUMPBIN = 
ECHO = /bin/echo
ECHO_C = 
ECHO_N = -n
ECHO_T = 
EGREP = /bin/grep -E
EXEEXT = 
FGREP = /bin/grep -F
GREP = /bin/grep
GROFF = /usr/bin/groff
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
LD = /usr/bin/ld -m elf_x86_64
LDFLAGS = 
LDNETINC = -I/usr/include
LDNETLIB = -L/usr/lib64 -ldnet
LIBOBJS = 
LIBOPTS_CFLAGS = -I$(top_srcdir)/libopts
LIBOPTS_DIR = libopts
LIBOPTS_LDADD = $(top_builddir)/libopts/libopts.la
LIBS = -lrt -lnsl 
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LIPO = 
LNAVLIB = 
LNAV_CFLAGS = 
LN_S = ln -s
LPCAPINC = /usr/include/pcap.h
LPCAPLIB = /usr/lib64/libpcap.a
LTLIBOBJS = 
MAINT = #
MAKEINFO = ${SHELL} /home/stsi/source/radware/tcpreplay-3.4.1/config/missing --run makeinfo
MKDIR_P = /bin/mkdir -p
NM = /usr/bin/nm -B
NMEDIT = 
OBJDUMP = objdump
OBJEXT = o
OTOOL = 
OTOOL64 = 
PACKAGE = tcpreplay
PACKAGE_BUGREPORT = 
PACKAGE_NAME = 
PACKAGE_STRING = 
PACKAGE_TARNAME = 
PACKAGE_VERSION = 
PATH_SEPARATOR = :
PCAP_BPF_H_FILE = /usr/include/pcap/bpf.h
PRINTF = /usr/bin/printf
RANLIB = ranlib
SED = /bin/sed
SET_MAKE = 
SHELL = /bin/sh
STRIP = strip
TCPREPLAY_RELEASE = 1
TCPREPLAY_VERSION = 3.4.1
VERSION = 3.4.1
abs_builddir = /home/stsi/source/radware/tcpreplay-3.4.1/test
abs_srcdir = /home/stsi/source/radware/tcpreplay-3.4.1/test
abs_top_builddir = /home/stsi/source/radware/tcpreplay-3.4.1
abs_top_srcdir = /home/stsi/source/radware/tcpreplay-3.4.1
ac_ct_CC = gcc
ac_ct_CXX = g++
ac_ct_DUMPBIN = 
am__include = include
am__leading_dot = .
am__quote = 
am__tar = ${AMTAR} chof - "$$tardir"
am__untar = ${AMTAR} xf -
bindir = ${exec_prefix}/bin
build = x86_64-unknown-linux-gnu
build_alias = 
build_cpu = x86_64
build_os = linux-gnu
build_vendor = unknown
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
debug_flag = 
docdir = ${datarootdir}/doc/${PACKAGE}
dvidir = ${docdir}
exec_prefix = ${prefix}
host = x86_64-unknown-linux-gnu
host_alias = 
host_cpu = x86_64
host_os = linux-gnu
host_vendor = unknown
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = $(SHELL) /home/stsi/source/radware/tcpreplay-3.4.1/config/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
lt_ECHO = echo
mandir = ${datarootdir}/man
mkdir_p = /bin/mkdir -p
nic1 = eth2
nic2 = eth2
oldincludedir = /usr/include
pcncfg = no 
pdfdir = ${docdir}
prefix = /usr/local
program_transform_name = s,x,x,
psdir = ${docdir}
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
srcdir = .
sysconfdir = ${prefix}/etc
target = x86_64-unknown-linux-gnu
target_alias = 
target_cpu = x86_64
target_os = linux-gnu
target_vendor = unknown
tcpdump_path = /usr/sbin/tcpdump
top_build_prefix = ../
top_builddir = ..
top_srcdir = ..

# $Id$
MAKEFLAGS = -s -k
HOST = x86_64-unknown-linux-gnu
TARGET = x86_64-unknown-linux-gnu
BUILD = x86_64-unknown-linux-gnu
ENABLE_DEBUG = 
TCPPREP = ../src/tcpprep --no-arg-comment
TCPREPLAY = ../src/tcpreplay
TCPREWRITE = ../src/tcprewrite
TCPBRIDGE = ../src/tcpbridge
EXTRA_DIST = test.pcap test.auto_bridge test.auto_client test.auto_router \
		test.auto_server test.auto_first test.cidr test.comment test.port test.mac \
		test.cidr_reverse test.mac_reverse test.regex_reverse \
		test.prep_config test.primary test.regex test.secondary \
		test.rewrite_seed test.rewrite_portmap test.rewrite_endpoint \
		test.rewrite_pnat test.rewrite_pad test.rewrite_trunc \
		test.rewrite_mac test.rewrite_layer2 test.rewrite_config \
		test.rewrite_skip test.rewrite_dltuser test.rewrite_dlthdlc \
		test.rewrite_vlandel test.rewrite_efcs test.rewrite_1ttl \
		test.rewrite_2ttl test.rewrite_3ttl \
		test2.rewrite_seed test2.rewrite_portmap test2.rewrite_endpoint \
		test2.rewrite_pnat test2.rewrite_pad test2.rewrite_trunc \
		test2.rewrite_mac test2.rewrite_layer2 test2.rewrite_config \
		test2.rewrite_skip test2.rewrite_dltuser test2.rewrite_dlthdlc \
		test2.rewrite_vlandel test2.rewrite_efcs test2.rewrite_1ttl \
		test2.rewrite_mtutrunc \
		test2.rewrite_2ttl test2.rewrite_3ttl test.rewrite_tos test2.rewrite_tos \
		test6.pcap test6.auto_bridge test6.auto_client test6.auto_router \
		test6.auto_server test6.auto_first test6.cidr test6.comment \
		test6.port test6.mac test6.cidr_reverse test6.mac_reverse \
		test6.regex_reverse \
		test6.rewrite_portmap6 test6.rewrite_endpoint6 \
		test2.rewrite_portmap6 test2.rewrite_endpoint6

STANDARD_REWRITE = standard_littleendian
#STANDARD_REWRITE = standard_bigendian
REWRITE_WARN = "little"
#REWRITE_WARN = "big"
all: all-am

.SUFFIXES:
$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am  $(am__configure_deps)
	@for dep in $?; do \
	  case '$(am__configure_deps)' in \
	    *$$dep*) \
	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
	        && { if test -f $@; then exit 0; else break; fi; }; \
	      exit 1;; \
	  esac; \
	done; \
	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  test/Makefile'; \
	cd $(top_srcdir) && \
	  $(AUTOMAKE) --gnu  test/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
	esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure: # $(am__configure_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
config: $(top_builddir)/config.status $(srcdir)/config.in
	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs
tags: TAGS
TAGS:

ctags: CTAGS
CTAGS:


distdir: $(DISTFILES)
	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	list='$(DISTFILES)'; \
	  dist_files=`for file in $$list; do echo $$file; done | \
	  sed -e "s|^$$srcdirstrip/||;t" \
	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
	case $$dist_files in \
	  */*) $(MKDIR_P) `echo "$$dist_files" | \
			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
			   sort -u` ;; \
	esac; \
	for file in $$dist_files; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  if test -d $$d/$$file; then \
	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
	    fi; \
	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
	  else \
	    test -f $(distdir)/$$file \
	    || cp -p $$d/$$file $(distdir)/$$file \
	    || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
install-strip:
	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	  `test -z '$(STRIP)' || \
	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:

clean-generic:

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
clean-am: clean-generic clean-libtool mostlyclean-am

distclean-am: clean-am distclean-generic

dvi: dvi-am

dvi-am:

html: html-am

info: info-am

info-am:

install-data-am:

install-dvi: install-dvi-am

install-exec-am:

install-html: install-html-am

install-info: install-info-am

install-man:

install-pdf: install-pdf-am

install-ps: install-ps-am

installcheck-am:

maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-generic mostlyclean-libtool

pdf: pdf-am

pdf-am:

ps: ps-am

ps-am:

uninstall-am:

.MAKE: install-am install-strip

.PHONY: all all-am check check-am clean clean-generic clean-libtool \
	distclean distclean-generic distclean-libtool distdir dvi \
	dvi-am html html-am info info-am install install-am \
	install-data install-data-am install-dvi install-dvi-am \
	install-exec install-exec-am install-html install-html-am \
	install-info install-info-am install-man install-pdf \
	install-pdf-am install-ps install-ps-am install-strip \
	installcheck installcheck-am installdirs maintainer-clean \
	maintainer-clean-generic mostlyclean mostlyclean-generic \
	mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am


test: all
all: clearlog check tcpprep tcpreplay tcprewrite tcprewrite6

6clearlog:
	-rm test.log

check:
	$(PRINTF) "%s\n" "NOTICE: Tests must be run as root"
	$(PRINTF) "%s\n" "Sending traffic on '$(nic1)' and '$(nic2)'"

standard: standard_prep $(STANDARD_REWRITE)
	$(PRINTF) "Warning: only creating %s endian standard test files\n" $(REWRITE_WARN)

standard_prep:	
	$(TCPPREP) -i test.pcap -o test.auto_router -a router
	$(TCPPREP) -i test.pcap -o test.auto_bridge -a bridge
	$(TCPPREP) -i test.pcap -o test.auto_client -a client
	$(TCPPREP) -i test.pcap -o test.auto_server -a server
	$(TCPPREP) -i test.pcap -o test.auto_first -a first
	$(TCPPREP) --load-opts config -o test.prep_config
	$(TCPPREP) -i test.pcap -o test.port -p
	$(TCPPREP) -i test.pcap -o test.mac -e 00:02:3b:00:3d:ce
	$(TCPPREP) -i test.pcap -o test.cidr -c '216.27.178.0/24'
	$(TCPPREP) -i test.pcap -o test.regex -r '216.27.178.*'
	$(TCPPREP) -i test.pcap -o test.comment -C "This is a comment" -p
	$(TCPPREP) -i test.pcap -o test.mac_reverse -e 00:02:3b:00:3d:ce --reverse
	$(TCPPREP) -i test.pcap -o test.cidr_reverse -c '216.27.178.0/24' --reverse
	$(TCPPREP) -i test.pcap -o test.regex_reverse -r '216.27.178.*' --reverse
# Not working - yet
#	$(TCPPREP) -i test6.pcap -o test6.auto_router -a router
#	$(TCPPREP) -i test6.pcap -o test6.auto_bridge -a bridge
#	$(TCPPREP) -i test6.pcap -o test6.auto_client -a client
#	$(TCPPREP) -i test6.pcap -o test6.auto_server -a server
#	$(TCPPREP) -i test6.pcap -o test6.auto_first -a first
	$(TCPPREP) -i test6.pcap -o test6.port -p
	$(TCPPREP) -i test6.pcap -o test6.mac -e '00:11:25:13:ec:dd'

standard_bigendian:
	$(TCPREWRITE) -i test.pcap -o test.rewrite_seed -s 55
	$(TCPREWRITE) -i test.pcap -o test.rewrite_tos --tos=50
	$(TCPREWRITE) -i test.pcap -o test.rewrite_portmap -r 80:8080
	$(TCPREWRITE) -i test.pcap -o test.rewrite_endpoint \
		-e 10.10.0.1:10.10.0.2 -c test.auto_router
	$(TCPREWRITE) -i test.pcap -o test.rewrite_pnat \
		-N 216.27.178.0/24:172.16.0.0/24
	$(TCPREWRITE) -i test.pcap -o test.rewrite_pad -F pad
	$(TCPREWRITE) -i test.pcap -o test.rewrite_trunc -F trunc
	$(TCPREWRITE) -i test.pcap -o test.rewrite_mac \
		--enet-dmac=00:12:13:14:15:16,00:22:33:44:55:66 \
		--enet-smac=00:22:33:44:55:66,00:12:13:14:15:16  -c test.auto_router
	$(TCPREWRITE) -i test.pcap -o test.rewrite_layer2 \
		 --dlt=user --user-dlink=00,50,da,5d,46,55,0,7,eb,30,a4,c3,08,0
	$(TCPREWRITE) -i test.pcap -o test.rewrite_config --enet-vlan=add --enet-vlan-tag=45 \
		--enet-vlan-cfi=1 --enet-vlan-pri=5
	$(TCPREWRITE) -i test.pcap -o test.rewrite_skip -b -s 55 \
		--enet-dmac=00:12:13:14:15:16,00:22:33:44:55:66 \
		--enet-smac=00:22:33:44:55:66,00:12:13:14:15:16  -c test.auto_router
	$(TCPREWRITE) -i test.pcap -o test.rewrite_dltuser --dlt=user \
		--user-dlink=0x0f,0x00,0x08,0x00 --user-dlt=104 
	$(TCPREWRITE) -i test.pcap -o test.rewrite_dlthdlc --dlt=hdlc \
		--hdlc-control=0 --hdlc-address=0x0F
	$(TCPREWRITE) -i test.rewrite_config -o test.rewrite_vlandel \
		--enet-vlan=del
	$(TCPREWRITE) -i test.pcap -o test.rewrite_efcs --efcs
	$(TCPREWRITE) -i test.pcap -o test.rewrite_1ttl --ttl=58
	$(TCPREWRITE) -i test.pcap -o test.rewrite_2ttl --ttl=+58
	$(TCPREWRITE) -i test.pcap -o test.rewrite_3ttl --ttl=-58
	# IPv6 tests
	$(TCPREWRITE) -i test6.pcap -o test6.rewrite_portmap6 -r 80:8080
	$(TCPREWRITE) -i test6.pcap -o test6.rewrite_endpoint6 -e test6.mac \
		-e '[2002::202]:[3003::303]'
	$(TCPREWRITE) -i test6.pcap -o test6.rewrite_pnat6 \
	    -N '[1001::/64]:[2002:/64]'

standard_littleendian:
	$(TCPREWRITE) -i test.pcap -o test2.rewrite_seed -s 55
	$(TCPREWRITE) -i test.pcap -o test2.rewrite_tos --tos=50	
	$(TCPREWRITE) -i test.pcap -o test2.rewrite_portmap -r 80:8080
	$(TCPREWRITE) -i test.pcap -o test2.rewrite_endpoint \
		-e 10.10.0.1:10.10.0.2 -c test.auto_router
	$(TCPREWRITE) -i test.pcap -o test2.rewrite_pnat \
		-N 216.27.178.0/24:172.16.0.0/24
	$(TCPREWRITE) -i test.pcap -o test2.rewrite_pad -F pad
	$(TCPREWRITE) -i test.pcap -o test2.rewrite_trunc -F trunc
	$(TCPREWRITE) -i test.pcap -o test2.rewrite_mac \
		--enet-dmac=00:12:13:14:15:16,00:22:33:44:55:66 \
		--enet-smac=00:22:33:44:55:66,00:12:13:14:15:16  -c test.auto_router
	$(TCPREWRITE) -i test.pcap -o test2.rewrite_layer2 \
		 --dlt=user --user-dlink=00,50,da,5d,46,55,0,7,eb,30,a4,c3,08,0
	$(TCPREWRITE) -i test.pcap -o test2.rewrite_config --enet-vlan=add --enet-vlan-tag=45 \
		--enet-vlan-cfi=1 --enet-vlan-pri=5
	$(TCPREWRITE) -i test.pcap -o test2.rewrite_skip -b -s 55 \
		--enet-dmac=00:12:13:14:15:16,00:22:33:44:55:66 \
		--enet-smac=00:22:33:44:55:66,00:12:13:14:15:16  -c test.auto_router
	$(TCPREWRITE) -i test.pcap -o test2.rewrite_dltuser --dlt=user \
		--user-dlink=0x0f,0x00,0x08,0x00 --user-dlt=104 
	$(TCPREWRITE) -i test.pcap -o test2.rewrite_dlthdlc --dlt=hdlc \
		--hdlc-control=0 --hdlc-address=0x0F
	$(TCPREWRITE) -i test.rewrite_config -o test2.rewrite_vlandel \
		--enet-vlan=del
	$(TCPREWRITE) -i test.pcap -o test2.rewrite_efcs --efcs
	$(TCPREWRITE) -i test.pcap -o test2.rewrite_1ttl --ttl=58
	$(TCPREWRITE) -i test.pcap -o test2.rewrite_2ttl --ttl=+58
	$(TCPREWRITE) -i test.pcap -o test2.rewrite_3ttl --ttl=-58
	$(TCPREWRITE) -i test.pcap -o test2.rewrite_mtutrunc --mtu-trunc --mtu=300
	# IPv6 tests
	$(TCPREWRITE) -i test6.pcap -o test6.rewrite_portmap6 -r 80:8080
	$(TCPREWRITE) -i test6.pcap -o test6.rewrite_endpoint6 -c test6.mac \
		-e '[2002::202]:[3003::303]'
	$(TCPREWRITE) -i test6.pcap -o test6.rewrite_pnat6 \
	    -N '[1001::/64]:[2002:/64]'

tcpprep: auto_router auto_bridge auto_client auto_server auto_first cidr regex \
	port mac comment print_info print_comment prep_config \
	mac_reverse cidr_reverse regex_reverse

tcprewrite: rewrite_portmap rewrite_endpoint rewrite_pnat rewrite_trunc \
	rewrite_pad rewrite_seed rewrite_mac rewrite_layer2 rewrite_config \
	rewrite_skip rewrite_dltuser rewrite_dlthdlc rewrite_vlandel rewrite_efcs \
	rewrite_1ttl rewrite_2ttl rewrite_3ttl rewrite_tos rewrite_mtutrunc

tcprewrite6: rewrite_portmap6 rewrite_endpoint6 rewrite_pnat6

tcpreplay: replay_basic replay_cache replay_pps replay_rate replay_top \
	replay_config replay_multi replay_pps_multi

prep_config:
	$(PRINTF) "%s" "[tcpprep] Config mode test: "
	$(PRINTF) "%s\n" "*** [tcpprep] Config mode test: " >>test.log
	$(TCPPREP) $(ENABLE_DEBUG) --load-opts=config -o test.$@1  >>test.log 2>&1
	diff test.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

auto_router:
	$(PRINTF) "%s" "[tcpprep] Auto/Router mode test: "
	$(PRINTF) "%s\n" "*** [tcpprep] Auto/Router mode test: " >>test.log
	$(TCPPREP) $(ENABLE_DEBUG) -i test.pcap -o test.$@1 -a router  >>test.log 2>&1
	diff test.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t%s\n" "OK"; fi

auto_bridge:
	$(PRINTF) "%s" "[tcpprep] Auto/Bridge mode test: "
	$(PRINTF) "%s\n" "*** [tcpprep] Auto/Bridge mode test: " >>test.log
	$(TCPPREP) $(ENABLE_DEBUG) -i test.pcap -o test.$@1 -a bridge  >>test.log 2>&1
	diff test.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t%s\n" "OK"; fi

auto_client:
	$(PRINTF) "%s" "[tcpprep] Auto/Client mode test: "
	$(PRINTF) "%s\n" "*** [tcpprep] Auto/Client mode test: " >>test.log
	$(TCPPREP) $(ENABLE_DEBUG) -i test.pcap -o test.$@1 -a client  >>test.log 2>&1
	diff test.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t%s\n" "OK"; fi

auto_server:
	$(PRINTF) "%s" "[tcpprep] Auto/Server mode test: "
	$(PRINTF) "%s\n" "*** [tcpprep] Auto/Server mode test: " >>test.log
	$(TCPPREP) $(ENABLE_DEBUG) -i test.pcap -o test.$@1 -a server >>test.log 2>&1
	diff test.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t%s\n" "OK"; fi

auto_first:
	$(PRINTF) "%s" "[tcpprep] Auto/First mode test: "
	$(PRINTF) "%s\n" "*** [tcpprep] Auto/First mode test: " >>test.log
	$(TCPPREP) $(ENABLE_DEBUG) -i test.pcap -o test.$@1 -a first >>test.log 2>&1
	diff test.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t%s\n" "OK"; fi

regex:
	$(PRINTF) "%s" "[tcpprep] Regex mode test: "
	$(PRINTF) "%s\n" "*** [tcpprep] Regex mode test: " >>test.log
	$(TCPPREP) $(ENABLE_DEBUG) -i test.pcap -o test.$@1 -r '216.27.178.*' >>test.log 2>&1
	diff  test.$@ test.$@1 >>test.log 2>&1 
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

cidr:
	$(PRINTF) "%s" "[tcpprep] CIDR mode test: "
	$(PRINTF) "%s\n" "*** [tcpprep] CIDR mode test: " >>test.log
	$(TCPPREP) $(ENABLE_DEBUG) -i test.pcap -o test.$@1 -c '216.27.178.0/24' >>test.log 2>&1
	diff test.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

port:
	$(PRINTF) "%s" "[tcpprep] Port mode test: "
	$(PRINTF) "%s\n" "*** [tcpprep] Port mode test: " >>test.log
	$(TCPPREP) $(ENABLE_DEBUG) -i test.pcap -o test.$@1 -p >>test.log 2>&1
	diff test.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

mac:
	$(PRINTF) "%s" "[tcpprep] MAC mode test: "
	$(PRINTF) "%s\n" "*** [tcpprep] MAC mode test: " >>test.log
	$(TCPPREP) $(ENABLE_DEBUG) -i test.pcap -o test.$@1 -e 00:02:3b:00:3d:ce >>test.log 2>&1
	diff test.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

comment:
	$(PRINTF) "%s" "[tcpprep] Comment mode test: "
	$(PRINTF) "%s\n" "*** [tcpprep] Comment mode test: " >>test.log
	$(TCPPREP) $(ENABLE_DEBUG) -i test.pcap -o test.$@1 -C "This is a comment" -p >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

print_comment:
	$(PRINTF) "%s" "[tcpprep] Print comment mode test: "
	$(PRINTF) "%s\n" "*** [tcpprep] Print comment mode test: " >>test.log
	$(TCPPREP) $(ENABLE_DEBUG) -P test.comment >test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t%s\n" "OK"; fi

print_info:
	$(PRINTF) "%s" "[tcpprep] Print info mode test: "
	$(PRINTF) "%s\n" "*** [tcpprep] Print info mode test: " >>test.log
	$(TCPPREP) $(ENABLE_DEBUG) -I test.comment >test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t%s\n" "OK"; fi

regex_reverse:
	$(PRINTF) "%s" "[tcpprep] Regex reverse mode test: "
	$(PRINTF) "%s\n" "*** [tcpprep] Regex reverse mode test: " >>test.log
	$(TCPPREP) $(ENABLE_DEBUG) -i test.pcap -o test.$@1 -r '216.27.178.*' --reverse >>test.log 2>&1
	diff  test.$@ test.$@1 >>test.log 2>&1 
	if [ $? ] ; then $(PRINTF) "\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t%s\n" "OK"; fi

cidr_reverse:
	$(PRINTF) "%s" "[tcpprep] CIDR reverse mode test: "
	$(PRINTF) "%s\n" "*** [tcpprep] CIDR reverse mode test: " >>test.log
	$(TCPPREP) $(ENABLE_DEBUG) -i test.pcap -o test.$@1 -c '216.27.178.0/24' --reverse >>test.log 2>&1
	diff test.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t%s\n" "OK"; fi

mac_reverse:
	$(PRINTF) "%s" "[tcpprep] MAC reverse mode test: "
	$(PRINTF) "%s\n" "*** [tcpprep] MAC reverse mode test: " >>test.log
	$(TCPPREP) $(ENABLE_DEBUG) -i test.pcap -o test.$@1 -e 00:02:3b:00:3d:ce --reverse >>test.log 2>&1
	diff test.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t%s\n" "OK"; fi

replay_basic:
	$(PRINTF) "%s" "[tcpreplay] Basic test: "
	$(PRINTF) "%s\n" "*** [tcpreplay] Basic test: " >>test.log
	$(TCPREPLAY) $(ENABLE_DEBUG) -i $(nic1) -t test.pcap >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

replay_cache:
	$(PRINTF) "%s" "[tcpreplay] Cache test: "
	$(PRINTF) "%s\n" "*** [tcpreplay] Cache test: " >>test.log
	$(TCPREPLAY) $(ENABLE_DEBUG) -c test.cidr -i $(nic1) -I $(nic2) -t test.pcap >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

replay_accurate:
	$(PRINTF) "%s" "[tcpreplay] Accurate test: "
	$(PRINTF) "%s\n" "*** [tcpreplay] Accurate test: " >>test.log
	$(TCPREPLAY) $(ENABLE_DEBUG) -a -i $(nic1) test.pcap >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

rewrite_portmap:
	$(PRINTF) "%s" "[tcprewrite] Portmap test: "
	$(PRINTF) "%s\n" "*** [tcprewrite] Portmap test: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -i test.pcap -o test.rewrite_portmap1 -r 80:8080 >>test.log 2>&1
#	diff test.$@ test.$@1 >>test.log 2>&1
	diff test2.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

rewrite_endpoint:
	$(PRINTF) "%s" "[tcprewrite] Endpoint test: "
	$(PRINTF) "%s\n" "*** [tcprewrite] Endpoint test: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -i test.pcap -o test.rewrite_endpoint1 -e 10.10.0.1:10.10.0.2 \
	    -c test.auto_router  >>test.log 2>&1
#	diff test.$@ test.$@1 >>test.log 2>&1
	diff test2.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

rewrite_pnat:
	$(PRINTF) "%s" "[tcprewrite] Pseudo NAT test: "
	$(PRINTF) "%s\n" "*** [tcprewrite] Pseudo NAT test: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -i test.pcap -o test.rewrite_pnat1 \
	    -N 216.27.178.0/24:172.16.0.0/24  >>test.log 2>&1
#	diff test.$@ test.$@1 >>test.log 2>&1
	diff test2.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

rewrite_mac:
	$(PRINTF) "%s" "[tcprewrite] Src/Dst MAC test: "
	$(PRINTF) "%s\n" "*** [tcprewrite] Src/Dst MAC test: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -i test.pcap -o test.rewrite_mac1 \
		--enet-dmac=00:12:13:14:15:16,00:22:33:44:55:66 \
		--enet-smac=00:22:33:44:55:66,00:12:13:14:15:16  -c test.auto_router  >>test.log 2>&1
#	diff test.$@ test.$@1 >>test.log 2>&1
	diff test2.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

rewrite_trunc:
	$(PRINTF) "%s" "[tcprewrite] Truncate test: "
	$(PRINTF) "%s\n" "*** [tcprewrite] Truncate test: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -F trunc -i test.pcap -o test.rewrite_trunc1 >>test.log 2>&1
#	diff test.$@ test.$@1 >>test.log 2>&1
	diff test2.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

rewrite_pad:
	$(PRINTF) "%s" "[tcprewrite] Pad test: "
	$(PRINTF) "%s\n" "*** [tcprewrite] Pad test: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -F pad -i test.pcap -o test.rewrite_pad1 >>test.log 2>&1
#	diff test.$@ test.$@1 >>test.log 2>&1
	diff test2.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t\t%s\n" "OK"; fi

rewrite_seed:
	$(PRINTF) "%s" "[tcprewrite] Seed IP test: "
	$(PRINTF) "%s\n" "*** [tcprewrite] Seed IP test: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -i test.pcap -o test.rewrite_seed1 -s 55 >>test.log 2>&1
#	diff test.$@ test.$@1 >>test.log 2>&1
	diff test2.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

rewrite_layer2:
	$(PRINTF) "%s" "[tcprewrite] Layer2 test: "
	$(PRINTF) "%s\n" "*** [tcprewrite] Layer2 test: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) --dlt=user --user-dlink=00,50,da,5d,46,55,0,7,eb,30,a4,c3,08,0 \
		-i test.pcap -o test.rewrite_layer21 >>test.log 2>&1
#	diff test.$@ test.$@1 >>test.log 2>&1
	diff test2.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

rewrite_config:
	$(PRINTF) "%s" "[tcprewrite] Config/VLAN Add test: "
	$(PRINTF) "%s\n" "*** [tcprewrite] Config/VLAN Add test: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) --load-opts config  >>test.log 2>&1
#	diff test.$@ test.$@1 >>test.log 2>&1
	diff test2.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t%s\n" "OK"; fi

rewrite_skip:
	$(PRINTF) "%s" "[tcprewrite] Skip bcast test: "
	$(PRINTF) "%s\n" "*** [tcprewrite] Skip bcast test: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -i test.pcap -o test.rewrite_skip1 -b -s 55 \
		--enet-dmac=00:12:13:14:15:16,00:22:33:44:55:66 \
		--enet-smac=00:22:33:44:55:66,00:12:13:14:15:16  -c test.auto_router  >>test.log 2>&1
#	diff test.$@ test.$@1 >>test.log 2>&1
	diff test2.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

rewrite_dltuser:
	$(PRINTF) "%s" "[tcprewrite] DLT User test: "
	$(PRINTF) "%s\n" "*** [tcprewrite] DLT User test: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -i test.pcap -o test.rewrite_dltuser1 --dlt=user \
		--user-dlink=0x0f,0x00,0x08,0x00 --user-dlt=104  >>test.log 2>&1
#	diff test.$@ test.$@1 >>test.log 2>&1
	diff test2.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

rewrite_dlthdlc:
	$(PRINTF) "%s" "[tcprewrite] DLT Cisco HDLC test: "
	$(PRINTF) "%s\n" "*** [tcprewrite] DLT Cisco HDLC test: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -i test.pcap -o test.rewrite_dlthdlc1 --dlt=hdlc \
		--hdlc-control=0 --hdlc-address=0x0F  >>test.log 2>&1
#	diff test.$@ test.$@1 >>test.log 2>&1
	diff test2.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t%s\n" "OK"; fi

rewrite_vlandel:
	$(PRINTF) "%s" "[tcprewrite] VLAN Delete test: "
	$(PRINTF) "%s\n" "*** [tcprewrite] VLAN Delete test: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -i test.rewrite_config -o test.rewrite_vlandel1 \
		--enet-vlan=del  >>test.log 2>&1
#	diff test.$@ test.$@1 >>test.log 2>&1
	diff test2.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

rewrite_efcs:
	$(PRINTF) "%s" "[tcprewrite] Remove EFCS: "
	$(PRINTF) "%s\n" "*** [tcprewrite] Remove EFCS: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -i test.pcap -o test.rewrite_efcs1 --efcs >>test.log 2>&1
#	diff test.$@ test.$@1 >>test.log 2>&1
	diff test2.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

rewrite_1ttl:
	$(PRINTF) "%s" "[tcprewrite] Force TTL: "
	$(PRINTF) "%s\n" "*** [tcprewrite] Force TTL: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -i test.pcap -o test.$@1 --ttl=58  >>test.log 2>&1
#	diff test.$@ test.$@1 >>test.log 2>&1
	diff test2.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

rewrite_2ttl:
	$(PRINTF) "%s" "[tcprewrite] Increase TTL: "
	$(PRINTF) "%s\n" "*** [tcprewrite] Increase TTL: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -i test.pcap -o test.$@1 --ttl=+58  >>test.log 2>&1
#	diff test.$@ test.$@1 >>test.log 2>&1
	diff test2.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

rewrite_3ttl:
	$(PRINTF) "%s" "[tcprewrite] Reduce TTL: "
	$(PRINTF) "%s\n" "*** [tcprewrite] Reduce TTL: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -i test.pcap -o test.$@1 --ttl=-58  >>test.log 2>&1
#	diff test.$@ test.$@1 >>test.log 2>&1
	diff test2.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

rewrite_tos:
	$(PRINTF) "%s" "[tcprewrite] TOS test: "
	$(PRINTF) "%s\n" "*** [tcprewrite] TOS test: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -i test.pcap -o test.$@1 --tos=50  >>test.log 2>&1
#	diff test.$@ test.$@1 >>test.log 2>&1
	diff test2.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t\t%s\n" "OK"; fi

rewrite_mtutrunc:
	$(PRINTF) "%s" "[tcprewrite] MTU Truncate test: "
	$(PRINTF) "%s\n" "*** [tcprewrite] MTU Truncate test: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -i test.pcap -o test.$@1  --mtu-trunc --mtu=300 >>test.log 2>&1
#	diff test.$@ test.$@1 >>test.log 2>&1
	diff test2.$@ test.$@1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t%s\n" "OK"; fi

rewrite_portmap6:
	$(PRINTF) "%s" "[tcprewrite6] Portmap test: "
	$(PRINTF) "%s\n" "*** [tcprewrite6] Portmap test: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -i test6.pcap -o test6.rewrite_portmap6.1 -r 80:8080 >>test.log 2>&1
#	diff test.$@ test6.$@.1 >>test.log 2>&1
	diff test2.$@ test6.$@.1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

rewrite_endpoint6:
	$(PRINTF) "%s" "[tcprewrite6] Endpoint test: "
	$(PRINTF) "%s\n" "*** [tcprewrite6] Endpoint test: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -i test6.pcap -o test6.rewrite_endpoint6.1 \
	    -e [2002::202]:[3003::303] \
	    -c test6.mac  >>test.log 2>&1
#	diff test.$@ test6.$@.1 >>test.log 2>&1
	diff test2.$@ test6.$@.1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

rewrite_pnat6:
	$(PRINTF) "%s" "[tcprewrite6] Pseudo NAT test: "
	$(PRINTF) "%s\n" "*** [tcprewrite6] Pseudo NAT test: " >>test.log
	$(TCPREWRITE) $(ENABLE_DEBUG) -i test6.pcap -o test6.rewrite_pnat6.1 \
	    -N '[1001::/64]:[2002::/64]' >>test.log 2>&1
#	diff test.$@ test6.$@.1 >>test.log 2>&1
	diff test2.$@ test6.$@.1 >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

replay_pps:
	$(PRINTF) "%s" "[tcpreplay] Packets/sec test: "
	$(PRINTF) "%s\n" "*** [tcpreplay] Packets/sec test: " >>test.log
	$(TCPREPLAY) $(ENABLE_DEBUG) -i $(nic1) -p 25 test.pcap >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

replay_rate:
	$(PRINTF) "%s" "[tcpreplay] Mbps test: "
	$(PRINTF) "%s\n" "*** [tcpreplay] Mbps test: " >>test.log
	$(TCPREPLAY) $(ENABLE_DEBUG) -i $(nic1) -M 25.0 test.pcap >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t\t%s\n" "OK"; fi

replay_multi:
	$(PRINTF) "%s" "[tcpreplay] Multiplier test: "
	$(PRINTF) "%s\n" "*** [tcpreplay] Multiplier test: " >>test.log
	$(TCPREPLAY) $(ENABLE_DEBUG) -i $(nic1) -x 25.0 test.pcap >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

replay_pps_multi:
	$(PRINTF) "%s" "[tcpreplay] Packets/sec Multiplier test: "
	$(PRINTF) "%s\n" "*** [tcpreplay] Packets/sec Multiplier test: " >>test.log
	$(TCPREPLAY) $(ENABLE_DEBUG) -i $(nic1) -p 100 --pps-multi=5 test.pcap >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t%s\n" "FAILED"; else $(PRINTF) "\t%s\n" "OK"; fi

replay_top:
	$(PRINTF) "%s" "[tcpreplay] Topspeed test: "
	$(PRINTF) "%s\n" "*** [tcpreplay] Topspeed test: " >>test.log
	$(TCPREPLAY) $(ENABLE_DEBUG) -i $(nic1) -t test.pcap >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

datadump_mode:
	$(PRINTF) "%s" "[tcpreplay] Data dump test: "
	$(PRINTF) "%s\n" "*** [tcpreplay] Data dump mode test: " >>test.log
	$(TCPREPLAY) $(ENABLE_DEBUG) -D -i $(nic1) -j $(nic2) -w primary.data -W secondary.data -c test.cidr -R test.pcap >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t\t%s\n" "OK"; fi

replay_config:
	$(PRINTF) "%s" "[tcpreplay] Config file/VLAN add test: "
	$(PRINTF) "%s\n" "*** [tcpreplay] Config file/VLAN add test: " >>test.log
	$(TCPREPLAY) $(ENABLE_DEBUG) --load-opts=config test.pcap >>test.log 2>&1
	if [ $? ] ; then $(PRINTF) "\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t%s\n" "OK"; fi

clean:
	rm -f *1 test.log core* *~ primary.data secondary.data

distclean: clean
	rm -f Makefile config

maintainer-clean: distclean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
