Undo the checking of command line interfaces. It might the a pipe...
[obnox/wireshark/wip.git] / test / config.sh
1 #!/bin/bash
2 #
3 # Configuration of the command line tests
4 #
5 # $Id$
6 #
7 # Wireshark - Network traffic analyzer
8 # By Gerald Combs <gerald@wireshark.org>
9 # Copyright 2005 Ulf Lamping
10 #
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License
13 # as published by the Free Software Foundation; either version 2
14 # of the License, or (at your option) any later version.
15 #
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24 #
25
26 # Set WS_SYSTEM to our system type, e.g. Windows, Linux, Darwin
27 # http://support.microsoft.com/kb/100843
28 if [ -n "${OS#Windows}" ] ; then
29         WS_SYSTEM="Windows"
30         export CYGWIN="$CYGWIN error_start=c:\cygwin\bin\dumper.exe -d %1 %2"
31 else
32         WS_SYSTEM=`uname -s`
33 fi
34
35
36 # Path to the Wireshark binaries, only used for the settings below
37 WS_BIN_PATH=..
38
39 # Are we allowed to open interfaces or capture on this system?
40 SKIP_CAPTURE=${SKIP_CAPTURE:-1}
41
42 # Override the last two items if we're running Windows
43 if [ "$WS_SYSTEM" = "Windows" ] ; then
44         WS_BIN_PATH=../wireshark-gtk2
45         SKIP_CAPTURE=0
46 fi
47
48 # Tweak the following to your liking.
49 WIRESHARK=$WS_BIN_PATH/wireshark
50 TSHARK=$WS_BIN_PATH/tshark
51 CAPINFOS=$WS_BIN_PATH/capinfos
52 DUMPCAP=$WS_BIN_PATH/dumpcap
53
54 # interface with at least a few packets/sec traffic on it
55 # (e.g. start a web radio to generate some traffic :-)
56 # an interfaces index (1 based) should do well for recent devbuilds
57 if [ "$WS_SYSTEM" = "Windows" -a -z "$TRAFFIC_CAPTURE_IFACE" ] ; then
58         # Try to fetch the first Ethernet interface.
59         TRAFFIC_CAPTURE_IFACE=`$TSHARK -D 2>&1 | \
60                 egrep 'Ethernet|Network Connection|VMware' | \
61                 head -1 | cut -c 1`
62 fi
63 TRAFFIC_CAPTURE_IFACE=${TRAFFIC_CAPTURE_IFACE:-1}
64
65 # time to capture some traffic (in seconds)
66 # (you may increase this if you get errors caused by very low traffic)
67 TRAFFIC_CAPTURE_DURATION=60
68
69 # the default is to not capture in promiscuous mode
70 # (this makes known trouble with some Windows WLAN adapters)
71 # if you need promiscuous mode, comment this line out
72 TRAFFIC_CAPTURE_PROMISC=-p
73
74 # only test capturing from a fifo if we're not on Windows
75 #  and we have a mkfifo. (Windows cygwin has a mkfifo but
76 #   Windows dumpcap & etc use Windows named pipes which
77 #   are different than the cygwin named pipes).
78 #
79 if [ "$WS_SYSTEM" != "Windows" ] && which mkfifo &>/dev/null ; then
80     TEST_FIFO=1
81 fi
82
83 # Display our environment
84
85 ##printf "\n ------- Info =-----------------\n"
86 ##printf "Syms :$WS_SYSTEM: :$TRAFFIC_CAPTURE_IFACE: :$SKIP_CAPTURE: :$TEST_FIFO:\n"
87 ##
88 ##ls -l $WIRESHARK $TSHARK $DUMPCAP
89 ##ls -l $(which wireshark) $(which tshark) $(which dumpcap)
90 ##printf " ----------------------------------\n\n"
91