[wifi] capture: OpenBSD support

Filter the tcpdump output on "received by filter" instead of "captured",
since the OpenBSD's tcpdump does not print the number of packets
captured.
This commit is contained in:
Matteo Cypriani 2011-08-11 23:28:40 +02:00
parent ca3a8a58fc
commit 9f2bb020fa
1 changed files with 4 additions and 4 deletions

View File

@ -87,7 +87,7 @@ iface_set_channel()
iface_up
iwconfig $IFACE channel $1
;;
NetBSD)
NetBSD | OpenBSD)
iface_down
ifconfig $IFACE media autoselect chan $1
iface_up
@ -112,7 +112,7 @@ iface_monitor()
Linux)
iwconfig $IFACE mode monitor
;;
NetBSD)
NetBSD | OpenBSD)
ifconfig $IFACE media autoselect mediaopt monitor
;;
*)
@ -145,7 +145,7 @@ iface_up()
invoke_tcpdump()
{
NCAP=$(tcpdump -i $IFACE -c $NB_PKT -w "$FILE" 2>&1 \
| sed -nr 's/([[:digit:]]+) packets captured$/\1/p')
| sed -nr 's/([[:digit:]]+) packets received by filter$/\1/p')
[ "$NCAP" = "" ] \
&& error "Error parsing the tcpdump messages! (NCAP=\"$NCAP\")"
echo $NCAP
@ -179,7 +179,7 @@ gather_system_information()
&& lsusb >"$DESTDIR"/lsusb \
|| echo "lsusb not available! Please install usbutils. "
;;
NetBSD)
NetBSD | OpenBSD)
modstat >"$DESTDIR"/modstat
which usbstats >/dev/null \
&& usbstats >"$DESTDIR"/usbstats \