[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 iface_up
iwconfig $IFACE channel $1 iwconfig $IFACE channel $1
;; ;;
NetBSD) NetBSD | OpenBSD)
iface_down iface_down
ifconfig $IFACE media autoselect chan $1 ifconfig $IFACE media autoselect chan $1
iface_up iface_up
@ -112,7 +112,7 @@ iface_monitor()
Linux) Linux)
iwconfig $IFACE mode monitor iwconfig $IFACE mode monitor
;; ;;
NetBSD) NetBSD | OpenBSD)
ifconfig $IFACE media autoselect mediaopt monitor ifconfig $IFACE media autoselect mediaopt monitor
;; ;;
*) *)
@ -145,7 +145,7 @@ iface_up()
invoke_tcpdump() invoke_tcpdump()
{ {
NCAP=$(tcpdump -i $IFACE -c $NB_PKT -w "$FILE" 2>&1 \ 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" = "" ] \ [ "$NCAP" = "" ] \
&& error "Error parsing the tcpdump messages! (NCAP=\"$NCAP\")" && error "Error parsing the tcpdump messages! (NCAP=\"$NCAP\")"
echo $NCAP echo $NCAP
@ -179,7 +179,7 @@ gather_system_information()
&& lsusb >"$DESTDIR"/lsusb \ && lsusb >"$DESTDIR"/lsusb \
|| echo "lsusb not available! Please install usbutils. " || echo "lsusb not available! Please install usbutils. "
;; ;;
NetBSD) NetBSD | OpenBSD)
modstat >"$DESTDIR"/modstat modstat >"$DESTDIR"/modstat
which usbstats >/dev/null \ which usbstats >/dev/null \
&& usbstats >"$DESTDIR"/usbstats \ && usbstats >"$DESTDIR"/usbstats \