--- wpasupplicant-0.6.0+0.5.8.orig/debian/copyright +++ wpasupplicant-0.6.0+0.5.8/debian/copyright @@ -0,0 +1,64 @@ +This package was Debian-ized by Kyle McMartin + +The sources were obtained from: + + http://hostap.epitest.fi/ + +and http://www.sourceforge.net/projects/madwifi/ + +Some components are not covered (madwifi/*, driver_*) by Jouni's +copyright, but are licensed under GPL/BSD as wpa_supplicant, please +see the individual files for their specific copyrights. + +On Debian GNU systems, the GPL can be found in +/usr/share/common-licenses/GPL, and the BSD-style license can be found +in /usr/share/common-licenses/BSD. + +wpa_supplicant is Copyright (C) 2003-2005 Jouni Malinen + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License version 2 as +published by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +(this copy of the license is in COPYING file) + + +Alternatively, this software may be distributed under the terms of BSD +license: + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name(s) of the above-listed copyright holder(s) nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + --- wpasupplicant-0.6.0+0.5.8.orig/debian/rules +++ wpasupplicant-0.6.0+0.5.8/debian/rules @@ -0,0 +1,33 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/dpatch.mk + +QMAKE=qmake-qt4 +WPAGUI=wpa_gui + +build/wpagui:: + cd $(WPAGUI) && $(QMAKE) + $(MAKE) -C $(WPAGUI) + +build/wpasupplicant:: + $(MAKE) + # prepare upstream example configuration file + sed 's/^\([^#]\+=.*\|}\)/#\1/' < wpa_supplicant.conf \ + > README.wpa_supplicant.conf + +install/wpasupplicant:: + install --mode=755 -D debian/ifupdown.sh \ + debian/wpasupplicant/etc/wpa_supplicant/ifupdown.sh + install --mode=755 -D debian/functions.sh \ + debian/wpasupplicant/etc/wpa_supplicant/functions.sh + install --mode=755 -D debian/wpa_action.sh \ + debian/wpasupplicant/sbin/wpa_action + dh_installinit --name=wpa-ifupdown --no-start \ + --update-rcd-params="start 15 0 6 ." + dh_installlogrotate --name=wpa_action + +clean:: + $(MAKE) clean + -$(MAKE) -C $(WPAGUI) distclean + -rm -f $(WPAGUI)/Makefile README.wpa_supplicant.conf --- wpasupplicant-0.6.0+0.5.8.orig/debian/wpasupplicant.examples +++ wpasupplicant-0.6.0+0.5.8/debian/wpasupplicant.examples @@ -0,0 +1,4 @@ +README.wpa_supplicant.conf +examples/*.conf +debian/wpa_supplicant.conf.template +debian/wpa_supplicant.init-daemon --- wpasupplicant-0.6.0+0.5.8.orig/debian/wpasupplicant.postrm +++ wpasupplicant-0.6.0+0.5.8/debian/wpasupplicant.postrm @@ -0,0 +1,81 @@ +#!/bin/sh -e +# This script can be called in the following ways: +# +# After the package was removed: +# remove +# +# After the package was purged: +# purge +# +# After the package was upgraded: +# upgrade +# if that fails: +# failed-upgrade +# +# +# After all of the packages files have been replaced: +# disappear +# +# +# If preinst fails during install: +# abort-install +# +# If preinst fails during upgrade of removed package: +# abort-install +# +# If preinst fails during upgrade: +# abort-upgrade + +# Undo removal of a no-longer used conffile +undo_rm_conffile() +{ + CONFFILE="$1" + + if [ ! -e "$CONFFILE" ]; then + if [ -e "$CONFFILE".dpkg-bak ]; then + echo "Restoring modified conffile $CONFFILE" + mv -f "$CONFFILE".dpkg-bak "$CONFFILE" + fi + fi +} + + +# Undo removal of init script +undo_rm_init_script() +{ + undo_rm_conffile /etc/default/wpasupplicant + undo_rm_conffile /etc/init.d/wpasupplicant + undo_rm_conffile /etc/wpa_supplicant.conf + undo_rm_conffile /etc/network/if-pre-up.d/wpasupplicant + undo_rm_conffile /etc/network/if-post-down.d/wpasupplicant +} + + +case "$1" in + remove) + ;; + + purge) + # Remove logfiles + rm -f /var/log/wpa_action.log* + # Remove stale lock file (lockfile absent since 0.5.5-2) + rm -f /var/lock/wpa_action.*.lock + ;; + + upgrade|failed-upgrade|disappear) + ;; + + abort-install|abort-upgrade) + if dpkg --compare-versions "$2" lt "0.4.8-1"; then + undo_rm_init_script + fi + ;; + + *) + echo "$0 called with unknown argument \`$1'" 1>&2 + exit 1 + ;; +esac + +#DEBHELPER# +exit 0 --- wpasupplicant-0.6.0+0.5.8.orig/debian/functions.sh +++ wpasupplicant-0.6.0+0.5.8/debian/functions.sh @@ -0,0 +1,833 @@ +#!/bin/sh + +# Copyright (C) 2006 Debian/Ubuntu wpasupplicant Maintainers +# +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# On Debian GNU/Linux systems, the text of the GPL license can be +# found in /usr/share/common-licenses/GPL. + +##################################################################### +## global variables +# wpa_supplicant variables +WPA_SUP_BIN="/sbin/wpa_supplicant" +WPA_SUP_PNAME="wpa_supplicant" +WPA_SUP_PIDFILE="/var/run/wpa_supplicant.$WPA_IFACE.pid" + +# wpa_cli variables +WPA_CLI_BIN="/sbin/wpa_cli" +WPA_CLI_PNAME="wpa_cli" +WPA_CLI_PIDFILE="/var/run/wpa_action.$WPA_IFACE.pid" +WPA_CLI_LOGFILE="/var/log/wpa_action.log" +WPA_CLI_TIMESTAMP="/var/run/wpa_action.$WPA_IFACE.timestamp" + +# default ctrl_interface socket directory +if [ -z "$WPA_CTRL_DIR" ]; then + WPA_CTRL_DIR="/var/run/wpa_supplicant" +fi + +# verbosity variables +if [ -n "$IF_WPA_VERBOSITY" ] || [ "$VERBOSITY" = "1" ]; then + TO_NULL="/dev/stdout" + DAEMON_VERBOSITY="--verbose" +else + TO_NULL="/dev/null" + DAEMON_VERBOSITY="--quiet" +fi + +##################################################################### +## wpa_cli wrapper +# Path to common ctrl_interface socket and iface supplied. +# NB: WPA_CTRL_DIR cannot be used for interactive commands. +# +wpa_cli () { + $WPA_CLI_BIN -p $WPA_CTRL_DIR -i $WPA_IFACE "$@" +} + +##################################################################### +## verbose and stderr message wrapper +# Ensures a standard and easily identifiable message is printed by +# scripts using this function library. +# +# verbose To stdout when IF_WPA_VERBOSITY or VERBOSITY is true +# +# action Same as verbose but without newline +# Useful for allowing wpa_cli commands to echo result +# value of 'OK' or 'FAILED' +# +# stderr Echo warning or error messages to stderr +# +# NB: when called by wpa_action, there is no redirection (verbose) +# +wpa_msg () { + + if [ -n "$WPA_ACTION" ]; then + shift + echo "wpa_action: $@" + return + fi + + case "$1" in + "verbose") + shift + echo "$WPA_SUP_PNAME: $@" >$TO_NULL + ;; + "action") + shift + echo -n "$WPA_SUP_PNAME: $@ -- " >$TO_NULL + ;; + "stderr") + shift + echo "$WPA_SUP_PNAME: $@" >/dev/stderr + ;; + *) + ;; + esac +} + +##################################################################### +## validate daemon pid files +# Test daemon process ID files via start-stop-daemon with a signal 0 +# given the exec binary and pidfile location. +# +# $1 daemon +# $2 pidfile +# +# Returns true when pidfile exists, the process ID exists _and_ was +# created by the exec binary. +# +# If the test fails, but the pidfile exists, it is stale +# +test_daemon_pidfile () { + local DAEMON PIDFILE + + if [ -n "$1" ]; then + DAEMON="$1" + fi + + if [ -f "$2" ]; then + PIDFILE="$2" + fi + + if [ -n "$DAEMON" ] && [ -f "$PIDFILE" ]; then + if start-stop-daemon --stop --quiet --signal 0 \ + --exec "$DAEMON" --pidfile "$PIDFILE"; then + return 0 + else + rm -f "$PIDFILE" + return 1 + fi + else + return 1 + fi +} + +# validate wpa_supplicant pidfile +test_wpa_supplicant () { + test_daemon_pidfile "$WPA_SUP_BIN" "$WPA_SUP_PIDFILE" +} + +# validate wpa_cli pidfile +test_wpa_cli () { + test_daemon_pidfile "$WPA_CLI_BIN" "$WPA_CLI_PIDFILE" +} + +##################################################################### +## daemonize wpa_supplicant +# Start wpa_supplicant via start-stop-dameon with all required +# options. Will start if environment variable WPA_SUP_CONF is present +# +# Required options: +# -B dameonize/background process +# -D driver backend ('wext' if none given) +# -P process ID file +# -C path to ctrl_interface socket directory +# +# Optional options: +# -c configuration file +# -W wait for wpa_cli to attach to ctrl_interface socket +# -b bridge interface name +# +init_wpa_supplicant () { + if [ -n "$WPA_SUP_CONF" ]; then + # wpa-action was removed, point to wpa-roam + if [ -n "$IF_WPA_ACTION" ]; then + wpa_msg stderr "wpa-action support has been removed" + wpa_msg stderr "refer to /usr/share/doc/wpasupplicant/README.modes.gz" + return 1 + fi + + local WPA_SUP_DRIVER WPA_SUP_OPTIONS + + if [ -n "$WPA_ACTION_SCRIPT" ]; then + if [ -x "$WPA_ACTION_SCRIPT" ]; then + WPA_SUP_OPTIONS="-W -B -P $WPA_SUP_PIDFILE -i $WPA_IFACE" + wpa_msg verbose "wait for wpa_cli to attach" + else + wpa_msg stderr "action script \"$WPA_ACTION_SCRIPT\" not executable" + return 1 + fi + else + WPA_SUP_OPTIONS="-B -P $WPA_SUP_PIDFILE -i $WPA_IFACE" + fi + + if [ -n "$IF_WPA_BRIDGE" ]; then + WPA_SUP_OPTIONS="$WPA_SUP_OPTIONS -b $IF_WPA_BRIDGE" + wpa_msg verbose "wpa-bridge $IF_WPA_BRIDGE" + fi + + if [ -n "$IF_WPA_DRIVER" ]; then + WPA_SUP_DRIVER="$IF_WPA_DRIVER" + wpa_msg verbose "wpa-driver $WPA_SUP_DRIVER" + else + WPA_SUP_DRIVER="wext" + wpa_msg verbose "using default driver type: wpa-driver $WPA_SUP_DRIVER" + fi + + wpa_msg verbose "$WPA_SUP_BIN $WPA_SUP_OPTIONS -D $WPA_SUP_DRIVER $WPA_SUP_CONF" + + start-stop-daemon --start --oknodo $DAEMON_VERBOSITY \ + --name $WPA_SUP_PNAME --startas $WPA_SUP_BIN --pidfile $WPA_SUP_PIDFILE \ + -- $WPA_SUP_OPTIONS -D $WPA_SUP_DRIVER $WPA_SUP_CONF + + if [ "$?" != "0" ]; then + wpa_msg stderr "$WPA_SUP_BIN daemon failed to start" + return 1 + fi + + local WPA_SOCKET_WAIT MAX_WPA_SOCKET_WAIT + WPA_SOCKET_WAIT="0" + MAX_WPA_SOCKET_WAIT="5" + until [ -S "$WPA_CTRL_DIR/$WPA_IFACE" ]; do + if [ "$WPA_SOCKET_WAIT" -ge "$MAX_WPA_SOCKET_WAIT" ]; then + wpa_msg stderr "ctrl_interface socket not found at $WPA_CTRL_DIR/$WPA_IFACE" + return 1 + else + wpa_msg verbose "waiting for \"$WPA_CTRL_DIR/$WPA_IFACE\": $WPA_SOCKET_WAIT (max. $MAX_WPA_SOCKET_WAIT)" + fi + + WPA_SOCKET_WAIT=$(($WPA_SOCKET_WAIT + 1)) + sleep 1 + done + + wpa_msg verbose "ctrl_interface socket located at $WPA_CTRL_DIR/$WPA_IFACE" + else + wpa_msg stderr "init_wpa_supplicant() called without WPA_SUP_CONF" + return 1 + fi +} + +##################################################################### +## stop wpa_supplicant process +# Kill wpa_supplicant via start-stop-daemon, given the location of +# the pidfile or ctrl_interface socket path and interface name +# +kill_wpa_supplicant () { + if test_wpa_supplicant; then + + wpa_msg verbose "terminating $WPA_SUP_PNAME daemon via pidfile $WPA_SUP_PIDFILE" + + start-stop-daemon --stop --oknodo $DAEMON_VERBOSITY \ + --exec $WPA_SUP_BIN --pidfile $WPA_SUP_PIDFILE + + if [ -f "$WPA_SUP_PIDFILE" ]; then + rm -f "$WPA_SUP_PIDFILE" + fi + elif [ -S "$WPA_CTRL_DIR/$WPA_IFACE" ]; then + + wpa_msg action "terminating via ctrl_interface socket $WPA_CTRL_DIR/$WPA_IFACE" + + wpa_cli terminate >$TO_NULL + + if [ -S "$WPA_CTRL_DIR/$WPA_IFACE" ]; then + rm -f "$WPA_CTRL_DIR/$WPA_IFACE" + fi + fi +} + +##################################################################### +## reload wpa_supplicant process +# Sending a HUP signal causes wpa_supplicant to reparse its +# configuration file +# +reload_wpa_supplicant () { + if test_wpa_supplicant; then + wpa_msg verbose "reloading wpa_supplicant configuration file via HUP signal" + start-stop-daemon --stop --signal HUP \ + --name "$WPA_SUP_PNAME" --pidfile "$WPA_SUP_PIDFILE" + else + wpa_msg verbose "cannot $WPA_ACTION, $WPA_SUP_PIDFILE does not exist" + fi +} + +##################################################################### +## daemonize wpa_cli and action script +# If environment variable WPA_ACTION_SCRIPT is present, wpa_cli will +# be spawned via start-stop-daemon +# +# Required options: +# -a action script => wpa_action +# -P process ID file +# -B background process +# +init_wpa_cli () { + if [ -n "$WPA_ACTION_SCRIPT" ]; then + local WPA_CLI_OPTIONS + WPA_CLI_OPTIONS="-B -P $WPA_CLI_PIDFILE -i $WPA_IFACE" + + wpa_msg verbose "$WPA_CLI_BIN $WPA_CLI_OPTIONS -p $WPA_CTRL_DIR -a $WPA_ACTION_SCRIPT" + + start-stop-daemon --start --oknodo $DAEMON_VERBOSITY \ + --name $WPA_CLI_PNAME --startas $WPA_CLI_BIN --pidfile $WPA_CLI_PIDFILE \ + -- $WPA_CLI_OPTIONS -p $WPA_CTRL_DIR -a $WPA_ACTION_SCRIPT + + if [ "$?" != "0" ]; then + wpa_msg stderr "$WPA_CLI_BIN daemon failed to start" + return 1 + fi + fi +} + +##################################################################### +## stop wpa_cli process +# Kill wpa_cli via start-stop-daemon, given the location of the +# pidfile +# +kill_wpa_cli () { + if test_wpa_cli; then + + wpa_msg verbose "terminating $WPA_CLI_PNAME daemon via pidfile $WPA_CLI_PIDFILE" + + start-stop-daemon --stop --oknodo $DAEMON_VERBOSITY \ + --exec $WPA_CLI_BIN --pidfile $WPA_CLI_PIDFILE + + if [ -f "$WPA_CLI_PIDFILE" ]; then + rm -f "$WPA_CLI_PIDFILE" + fi + fi +} + +##################################################################### +## higher level wpa_cli wrapper for variable and set_network commands +# wpa_cli_do [set_network variable] +# +# $1 envorinment variable +# $2 data type of variable {raw|ascii} +# $3 wpa_cli variable, if $3 is set_network, shift and take +# set_network subvariable +# $4 wpa-* string as it would appear in interfaces file, enhances +# verbose messages +# +wpa_cli_do () { + if [ -z "$1" ]; then + return 0 + fi + + local WPACLISET_VALUE WPACLISET_VARIABLE WPACLISET_DESC + + case "$2" in + ascii) + # Double quote + WPACLISET_VALUE="\"$1\"" + ;; + raw|*) + # Provide raw value + WPACLISET_VALUE="$1" + ;; + esac + + case "$3" in + set_network) + if [ -z "$WPA_ID" ]; then + return 1 + fi + shift + WPACLISET_VARIABLE="set_network $WPA_ID $3" + ;; + *) + WPACLISET_VARIABLE="$3" + ;; + esac + + case "$4" in + *-psk|*-passphrase|*-passwd*|*-wep-key*) + WPACLISET_DESC="$4 *****" + ;; + *) + WPACLISET_DESC="$4 $WPACLISET_VALUE" + ;; + esac + + wpa_msg action "$WPACLISET_DESC" + + wpa_cli $WPACLISET_VARIABLE "$WPACLISET_VALUE" >$TO_NULL +} + +##################################################################### +## check value data type in plaintext or hex +# returns 0 if input consists of hexadecimal digits only, 1 otherwise +# +ishex () { + if [ -z "$1" ]; then + return 0 + fi + + case "$1" in + *[!0-9a-fA-F]*) + # plaintext + return 1 + ;; + *) + # hexadecimal + return 0 + ;; + esac +} + +##################################################################### +## sanity check and set psk|passphrase +# Warn about strange psk|passphrase values +# +# $1 psk or passphrase value +# +# If psk is surrounded by quotes strip them. +# +# If psk contains all hexadecimal characters and string length is 64: +# is 256bit hexadecimal +# else: +# is plaintext +# +# plaintext passphrases must be 8 - 63 characters in length +# 256-bit hexadecimal key must be 64 characters in length +# +wpa_key_check_and_set () { + if [ -z "$1" ]; then + return 0 + fi + + local KEY KEY_TYPE + + case "$1" in + '"'*'"') + # Strip surrounding quotation marks + KEY=$(echo -n "$1" | sed 's/^"//;s/"$//') + ;; + *) + KEY="$1" + ;; + esac + + if ishex "$KEY" && [ "${#KEY}" -eq "64" ]; then + KEY_TYPE="raw" + else + KEY_TYPE="ascii" + if [ "${#KEY}" -lt "8" ] || [ "${#KEY}" -gt "63" ]; then + wpa_msg stderr \ + "plaintext or ascii wpa-psk has ${#KEY} characters, it must have between 8 and 63" + wpa_msg stderr \ + "if wpa-psk truly is a 256-bit hexadecimal key, it must have 64 characters" + fi + fi + + wpa_cli_do "$KEY" "$KEY_TYPE" \ + set_network psk wpa-psk +} + +##################################################################### +## formulate a usable configuration from interfaces(5) wpa- lines +# A series of wpa_cli commands corresponding to environment variables +# created as a result of wpa- lines in an interfaces stanza. +# +# NB: no-act when roaming daemon is used (to avoid prematurely +# attaching to ctrl_interface socket) +# +conf_wpa_supplicant () { + if [ -n "$WPA_ACTION_SCRIPT" ]; then + return 0 + fi + + if [ "$IF_WPA_DRIVER" = "wired" ]; then + IF_WPA_AP_SCAN="0" + wpa_msg verbose "forcing ap_scan=0 (required for wired IEEE8021X auth)" + fi + + wpa_cli_do "$IF_WPA_AP_SCAN" raw \ + ap_scan wpa-ap-scan + + wpa_cli_do "$IF_WPA_PREAUTHENTICATE" raw \ + preauthenticate wpa-preauthenticate + + if [ -n "$IF_WPA_SSID" ] || [ "$IF_WPA_DRIVER" = "wired" ]; then + + case "$IF_WPA_SSID" in + '"'*'"') + IF_WPA_SSID=$(echo -n "$IF_WPA_SSID" | sed 's/^"//;s/"$//') + ;; + *) + ;; + esac + + WPA_ID=$(wpa_cli add_network) + + wpa_msg verbose "configuring network block -- $WPA_ID" + + wpa_cli_do "$IF_WPA_SSID" ascii \ + set_network ssid wpa-ssid + + wpa_cli_do "$IF_WPA_PRIORITY" raw \ + set_network priority wpa-priority + + wpa_cli_do "$IF_WPA_BSSID" raw \ + set_network bssid wpa-bssid + + if [ -s "$IF_WPA_PSK_FILE" ]; then + IF_WPA_PSK=$(cat "$IF_WPA_PSK_FILE") + fi + + # remain compat with wpa-passphrase-file + if [ -s "$IF_WPA_PASSPHRASE_FILE" ]; then + IF_WPA_PSK=$(cat "$IF_WPA_PASSPHRASE_FILE") + fi + + # remain compat with wpa-passphrase + if [ -n "$IF_WPA_PASSPHRASE" ]; then + IF_WPA_PSK="$IF_WPA_PASSPHRASE" + fi + + if [ -n "$IF_WPA_PSK" ]; then + wpa_key_check_and_set "$IF_WPA_PSK" + fi + + wpa_cli_do "$IF_WPA_PAIRWISE" raw \ + set_network pairwise wpa-pairwise + + wpa_cli_do "$IF_WPA_GROUP" raw \ + set_network group wpa-group + + wpa_cli_do "$IF_WPA_KEY_MGMT" raw \ + set_network key_mgmt wpa-key-mgmt + + wpa_cli_do "$IF_WPA_PROTO" raw \ + set_network proto wpa-proto + + wpa_cli_do "$IF_WPA_AUTH_ALG" raw \ + set_network auth_alg wpa-auth-alg + + wpa_cli_do "$IF_WPA_SCAN_SSID" raw \ + set_network scan_ssid wpa-scan-ssid + + wpa_cli_do "$IF_WPA_IDENTITY" ascii \ + set_network identity wpa-identity + + wpa_cli_do "$IF_WPA_ANONYMOUS_IDENTITY" ascii \ + set_network anonymous_identity wpa-anonymous-identity + + wpa_cli_do "$IF_WPA_EAP" raw \ + set_network eap wpa-eap + + wpa_cli_do "$IF_WPA_EAPPSK" raw \ + set_network eappsk wpa-eappsk + + wpa_cli_do "$IF_WPA_NAI" ascii \ + set_network nai wpa-nai + + wpa_cli_do "$IF_WPA_PASSWORD" ascii \ + set_network password wpa-password + + wpa_cli_do "$IF_WPA_CA_CERT" ascii \ + set_network ca_cert wpa-ca-cert + + wpa_cli_do "$IF_WPA_CA_PATH" ascii \ + set_network ca_path wpa-ca-path + + wpa_cli_do "$IF_WPA_CLIENT_CERT" ascii \ + set_network client_cert wpa-client-cert + + wpa_cli_do "$IF_WPA_PRIVATE_KEY" ascii \ + set_network private_key wpa-private-key + + wpa_cli_do "$IF_WPA_PRIVATE_KEY_PASSWD" ascii \ + set_network private_key_passwd wpa-private-key-passwd + + wpa_cli_do "$IF_WPA_DH_FILE" ascii \ + set_network dh_file wpa-dh-file + + wpa_cli_do "$IF_WPA_SUBJECT_MATCH" ascii \ + set_network subject_match wpa-subject-match + + wpa_cli_do "$IF_WPA_ALTSUBJECT_MATCH" ascii \ + set_network altsubject_match wpa-altsubject-match + + wpa_cli_do "$IF_WPA_CA_CERT2" ascii \ + set_network ca_cert2 wpa-ca-cert2 + + wpa_cli_do "$IF_WPA_CA_PATH2" ascii \ + set_network ca_path2 wpa-ca-path2 + + wpa_cli_do "$IF_WPA_CLIENT_CERT2" ascii \ + set_network client_cert2 wpa-client-cert2 + + wpa_cli_do "$IF_WPA_PRIVATE_KEY2" ascii \ + set_network private_key2 wpa-private-key2 + + wpa_cli_do "$IF_WPA_PRIVATE_KEY_PASSWD2" ascii \ + set_network private_key_passwd2 wpa-private-key-passwd2 + + wpa_cli_do "$IF_WPA_DH_FILE2" ascii \ + set_network dh_file2 wpa-dh-file2 + + wpa_cli_do "$IF_WPA_SUBJECT_MATCH2" ascii \ + set_network subject_match2 wpa-subject-match2 + + wpa_cli_do "$IF_WPA_ALTSUBJECT_MATCH2" ascii \ + set_network altsubject_match2 wpa-altsubject-match2 + + wpa_cli_do "$IF_WPA_EAP_METHODS" raw \ + set_network eap_methods wpa-eap-methods + + wpa_cli_do "$IF_WPA_PHASE1" ascii \ + set_network phase1 wpa-phase1 + + wpa_cli_do "$IF_WPA_PHASE2" ascii \ + set_network phase2 wpa-phase2 + + wpa_cli_do "$IF_WPA_PCSC" raw \ + set_network pcsc wpa-pcsc + + wpa_cli_do "$IF_WPA_PIN" ascii \ + set_network pin wpa-pin + + wpa_cli_do "$IF_WPA_ENGINE" raw \ + set_network engine wpa-engine + + wpa_cli_do "$IF_WPA_ENGINE_ID" ascii \ + set_network engine_id wpa-engine-id + + wpa_cli_do "$IF_WPA_KEY_ID" ascii \ + set_network key_id wpa-key-id + + wpa_cli_do "$IF_WPA_EAPOL_FLAGS" raw \ + set_network eapol_flags wpa-eapol-flags + + wpa_cli_do "$IF_WPA_WEP_KEY0" raw \ + set_network wep_key0 wpa-wep-key0 + + wpa_cli_do "$IF_WPA_WEP_KEY1" raw \ + set_network wep_key1 wpa-wep-key1 + + wpa_cli_do "$IF_WPA_WEP_KEY2" raw \ + set_network wep_key2 wpa-wep-key2 + + wpa_cli_do "$IF_WPA_WEP_KEY3" raw \ + set_network wep_key3 wpa-wep-key3 + + wpa_cli_do "$IF_WPA_WEP_TX_KEYIDX" raw \ + set_network wep_tx_keyidx wpa-wep-tx-keyidx + + wpa_cli_do "$IF_WPA_PROACTIVE_KEY_CACHING" raw \ + set_network proactive_key_caching wpa-proactive-key-caching + + wpa_cli_do "$IF_WPA_PAC_FILE" ascii \ + set_network pac_file wpa-pac-file + + wpa_cli_do "$IF_WPA_MODE" raw \ + set_network mode wpa-mode + + wpa_cli_do "$IF_WPA_STAKEY" raw \ + set_network stakey wpa-stakey + + wpa_cli_do "$IF_WPA_PEERKEY" raw \ + set_network peerkey wpa-peerkey + + wpa_cli_do "$IF_FRAGMENT_SIZE" raw \ + set_network fragment_size wpa-fragment-size + + wpa_cli_do "$IF_WPA_ID_STR" ascii \ + set_network id_str wpa-id-str + + wpa_cli_do "$WPA_ID" raw \ + enable_network "enabling network block" + fi +} + +##################################################################### +## wpa_action basic logging +# Log actions to file, test to see if it is writeable first +# +wpa_log_init () { + if touch "$WPA_CLI_LOGFILE" 2>/dev/null; then + exec >> "$WPA_CLI_LOGFILE" 2>&1 + fi +} + +# log timestamp and wpa_action arguments +wpa_log_action () { + echo "########## $(date +"%H:%M:%S %Y-%m-%d") ##########" + echo "IFACE=$WPA_IFACE ACTION=$WPA_ACTION" +} + +# log wpa_cli environment variables +wpa_log_environment () { + echo "WPA_ID=$WPA_ID WPA_ID_STR=$WPA_ID_STR" + echo "WPA_CTRL_DIR=$WPA_CTRL_DIR" +} + +##################################################################### +## hysteresis checking +# Networking tools such as dhcp clients used with ifupdown can +# synthesize artificial ACTION events, particuarly just after a +# DISCONNECTED/CONNECTED events are experienced in quick succession. +# This can lead to infinite event loops, and in extreme cases has the +# potential to cause system instability. +# +wpa_hysteresis_event () { + echo "$(date +%s)" > "$WPA_CLI_TIMESTAMP" +} + +wpa_hysteresis_check () { + if [ -f "$WPA_CLI_TIMESTAMP" ]; then + local TIME TIMESTAMP TIMEWAIT + TIME=$(date +%s) + # current time minus 4 second event buffer + TIMEWAIT=$(($TIME-4)) + # get time of last event + TIMESTAMP=$(cat $WPA_CLI_TIMESTAMP) + # compare values, allowing new action to be processed + # only if last action was more than 4 seconds ago + if [ "$TIMEWAIT" -le "$TIMESTAMP" ]; then + echo "Ignoring $WPA_ACTION event, too soon after previous event" + return 1 + fi + fi + + return 0 +} + +##################################################################### +## identify ifupdown files +# Identify ifupdown core files, so that state of the interface can be +# checked. This is the weakest part of the wpa_action roaming scheme, +# it would be _much_ better if stateless ifupdown capabilities were +# a reality. +# +ifupdown_check () { + if [ -e /etc/network/interfaces ]; then + INTERFACES_FILE="/etc/network/interfaces" + else + echo "Cannot locate ifupdown's \"interfaces\" file, $WPA_IFACE will not be configured" + return 1 + fi + + if [ -e /etc/network/run/ifstate ]; then + # debian's ifupdown + IFSTATE_FILE="/etc/network/run/ifstate" + elif [ -e /var/run/network/ifstate ]; then + # ubuntu's + IFSTATE_FILE="/var/run/network/ifstate" + else + echo "Cannot locate ifupdown's \"ifstate\" file, $WPA_IFACE will not be configured" + return 1 + fi + + return 0 +} + +##################################################################### +## apply mapping logic and ifup logical interface +# Apply mapping logic via id_str or external mapping script, check +# state of IFACE with respect to ifupdown and ifup logical interaface +# +ifup () { + local WPA_LOGICAL_IFACE + + if [ -z "$IF_WPA_MAPPING_SCRIPT_PRIORITY" ] && [ -n "$WPA_ID_STR" ]; then + WPA_LOGICAL_IFACE="$WPA_ID_STR" + echo "Mapping logical interface via id_str: $WPA_LOGICAL_IFACE" + fi + + if [ -z "$WPA_LOGICAL_IFACE" ] && [ -n "$IF_WPA_MAPPING_SCRIPT" ]; then + echo "Mapping logical interface via wpa-mapping-script: $IF_WPA_MAPPING_SCRIPT" + + local WPA_MAP_STDIN + + WPA_MAP_STDIN=$(set | sed --quiet 's/^\(IF_WPA_MAP[0-9]*\)=.*/echo \$\1/p') + + if [ -n "$WPA_MAP_STDIN" ]; then + WPA_LOGICAL_IFACE=$(eval "$WPA_MAP_STDIN" | "$IF_WPA_MAPPING_SCRIPT" "$WPA_IFACE") + else + WPA_LOGICAL_IFACE=$("$IF_WPA_MAPPING_SCRIPT" "$WPA_IFACE") + fi + + if [ -n "$WPA_LOGICAL_IFACE" ]; then + echo "Mapping script result: $WPA_LOGICAL_IFACE" + else + echo "Mapping script failed." + fi + fi + + if [ -z "$WPA_LOGICAL_IFACE" ]; then + if [ -n "$IF_WPA_ROAM_DEFAULT_IFACE" ]; then + WPA_LOGICAL_IFACE="$IF_WPA_ROAM_DEFAULT_IFACE" + echo "Using wpa-roam-default-iface: $WPA_LOGICAL_IFACE" + else + WPA_LOGICAL_IFACE="default" + echo "Using fallback logical interface: $WPA_LOGICAL_IFACE" + fi + fi + + if [ -n "$WPA_LOGICAL_IFACE" ]; then + if egrep --quiet "^iface[[:space:]]+$WPA_LOGICAL_IFACE[[:space:]]+inet" "$INTERFACES_FILE"; then + + echo "ifup $WPA_IFACE=$WPA_LOGICAL_IFACE" + + if grep --quiet "^$WPA_IFACE=$WPA_IFACE" "$IFSTATE_FILE"; then + # Force settings over the unconfigured "master" IFACE + /sbin/ifup --force "$WPA_IFACE=$WPA_LOGICAL_IFACE" + else + /sbin/ifup "$WPA_IFACE=$WPA_LOGICAL_IFACE" + fi + else + echo "No network defined for \"$WPA_LOGICAL_IFACE\" in \"$INTERFACES_FILE\"" + fi + else + echo "No suitable logical interface mapping for ifupdown to configure" + fi +} + +##################################################################### +## ifdown IFACE +# Check IFACE state and ifdown as requested. +# +ifdown () { + if grep --quiet "^$WPA_IFACE" "$IFSTATE_FILE"; then + echo "ifdown $WPA_IFACE" + /sbin/ifdown "$WPA_IFACE" + else + echo "Ignoring request to take \"$WPA_IFACE\" down, it is not up" + fi +} + +##################################################################### +## keep IFACE scanning +# After ifdown, the IFACE may left "down", and inhibits its ability +# to continue roaming. Keep it in an up operstate. +# +# NB: use iproute if present, flushing the IFACE first +# +if_post_down_up () { + if [ -x /sbin/ip ]; then + /sbin/ip addr flush dev "$WPA_IFACE" 2>/dev/null + /sbin/ip link set "$WPA_IFACE" up + else + /sbin/ifconfig "$WPA_IFACE" up + fi +} --- wpasupplicant-0.6.0+0.5.8.orig/debian/README.Debian +++ wpasupplicant-0.6.0+0.5.8/debian/README.Debian @@ -0,0 +1,95 @@ +wpasupplicant in debian +======================= + +wpasupplicant is now integrated into ifupdown. You can configure it in +/etc/network/interfaces, in a similar method to configuring WEP keys[1]. +After that, wpa_supplicant will be controlled by ifupdown without further +user intervention. + +For details about integration into the interfaces file, refer to +/usr/share/doc/wpasupplicant/README.modes.gz + +The old method of wpa_supplicant invocation was the other way round, +invoking it from an init script. This method is no longer recommended, however +there are instructions below for reverting to the old behaviour. + +[1] As described in /usr/share/doc/wireless-tools/README.Debian + + +wpasupplicant, Wireless Extension 18 and the Linux 2.6.14 kernel +================================================================ + +WPA/WPA2 support was added in Wireless Extension 18. + +This version (or more correctly, WE 19) was included in the Linux 2.6.14 +kernel, and is therefore supported by 2.6.14-compliant drivers such as +ipw2200 v1.0.8. + +wpasupplicant supports this new capability from 0.4.6. + +In order to take advantage of this WE 18 support you need to use +wpasupplicant's wext driver. You may have previously used a specific driver +such as "-D ipw" for older kernels, but to use the new WE 18 features in +kernel 2.6.14 or later, you'll want to use the generic "wext" driver instead. + +You may check which version of Wireless Extensions your current kernel uses by +inspecting /proc/net/wireless (the "WE" entry). + + +wpasupplicant, Prism54 support +============================== + +Note that previously this software was compiled with support for +driver_prism54. However, this support never worked, and is still not +supported upstream. Therefore, I've disabled this so people do not +get the false impression that it is actually working. + + + -- Kyle McMartin + Sat Jan 28 14:12:20 EST 2006 + + +wpa_supplicant as system daemon +=============================== + +The current wpasupplicant package is not starting as system daemon per default +anymore. We consider the old behavior as deprecated and do not support that any +longer. You need to read this section only if you want to keep the old +behaviour from the wpasupplicant package in Debian 3.1 (sarge). + +The current behavior uses wpasupplicant the other way round: ifupdown now +controls wpasupplicant. This means the supplicant is running as long as you want +to use the interface (i.e. it is ifupped from the ifupdown POV). For a roaming +solution, please read the wpa_action(8) manual page. + +Please note that past packages didn't provide any roaming solution by itself. +The fact that it was a system daemon enabled the user to make it 'control' +ifupdown, so that mechanisms like guessnet can choose the current location. If +you insist on this behavior, please install the init script yourself. + +We do however, provide a somewhat improved init script in the +/usr/share/doc/wpasupplicant/examples/ directory of the package. Follow the +instructions below to revert to the deprecated behaviour: + +Copy the file into the /etc/init.d directory and make it executable: + + cp /usr/share/doc/wpasupplicant/examples/wpa_supplicant.init-daemon \ + /etc/init.d/wparoamd + chmod +x /etc/init.d/wparoamd + +The init daemon must be altered to suit your persnal configuration. Edit the +script so that INTERFACE, CONFIG and DRIVER are defined, then make sure the +init daemon begins with the following commands: + + update-rc.d wparoamd start 15 2 3 4 5 . stop 90 0 1 6 . + invoke-rc.d wparoamd start + + The following commands revert the above changes: + + invoke-rc.d wparoamd stop + update-rc.d wparoamd remove + rm -f /etc/init.d/wparoamd + +A howto for using a system daemon for these purposes is located at: + +http://www.debian-administration.org/articles/312 --- wpasupplicant-0.6.0+0.5.8.orig/debian/wpasupplicant.manpages +++ wpasupplicant-0.6.0+0.5.8/debian/wpasupplicant.manpages @@ -0,0 +1,6 @@ +debian/wpa_action.8 +doc/docbook/wpa_background.8 +doc/docbook/wpa_cli.8 +doc/docbook/wpa_passphrase.8 +doc/docbook/wpa_supplicant.8 +doc/docbook/wpa_supplicant.conf.5 --- wpasupplicant-0.6.0+0.5.8.orig/debian/wpasupplicant.docs +++ wpasupplicant-0.6.0+0.5.8/debian/wpasupplicant.docs @@ -0,0 +1,2 @@ +debian/README.modes +eap_testing.txt --- wpasupplicant-0.6.0+0.5.8.orig/debian/control +++ wpasupplicant-0.6.0+0.5.8/debian/control @@ -0,0 +1,29 @@ +Source: wpasupplicant +Section: net +Priority: optional +Maintainer: Reinhard Tartler +Original-Maintainer: Debian/Ubuntu wpasupplicant Maintainers +Uploaders: Kyle McMartin , Reinhard Tartler , Kel Modderman +Standards-Version: 3.7.2 +Build-Depends: cdbs, debhelper (>= 5.0.0), dpatch, libssl-dev, libreadline5-dev, libqt4-dev, libdbus-1-dev +XS-X-Vcs-Svn: svn://svn.debian.org/pkg-wpa/trunk/wpasupplicant + +Package: wpasupplicant +Architecture: any +Depends: ${shlibs:Depends}, lsb-base (>= 3.0-6) +Suggests: libengine-pkcs11-openssl, guessnet, iproute +Recommends: dhcp3-client +Description: Client support for WPA and WPA2 (IEEE 802.11i) + WPA and WPA2 are methods for securing wireless networks, the former + using IEEE 802.1X, and the latter using IEEE 802.11i. This software + provides key negotiation with the WPA Authenticator, and controls + association with IEEE 802.11i networks. + +Package: wpagui +Architecture: any +Depends: ${shlibs:Depends}, wpasupplicant +Description: GUI for wpa_supplicant + wpagui provides a Qt interface for choosing which configured network + to connect to. It also provides a method for browsing 802.11 SSID scan + results, an event history log of messages generated by wpa_supplicant, + and a method to add or edit wpa_supplicant networks. --- wpasupplicant-0.6.0+0.5.8.orig/debian/patches/10_silence_siocsiwauth_icotl_failure.dpatch +++ wpasupplicant-0.6.0+0.5.8/debian/patches/10_silence_siocsiwauth_icotl_failure.dpatch @@ -0,0 +1,32 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 02_debian_doc_examples.patch by Kel Modderman +## +## DP: From: Jouni Malinen +## DP: Date: Sat, 23 Feb 2008 03:36:47 +0000 (-0800) +## DP: Subject: Silence SIOCSIWAUTH ioctl failure message. +## DP: X-Git-Url: http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=commitdiff_plain;h=8933ee9a42ae3ddba77a8ae6707396a4fed37778 +## DP: +## DP: Silence SIOCSIWAUTH ioctl failure message. +## DP: +## DP: These are expected in most cases and there is no need to confuse users +## DP: with the messages in stderr (perror was used here). These are now only +## DP: shown in debug output and EOPNOTSUPP errors are silently ignored. + +@DPATCH@ +--- a/driver_wext.c ++++ b/driver_wext.c +@@ -251,9 +251,11 @@ + iwr.u.param.value = value; + + if (ioctl(drv->ioctl_sock, SIOCSIWAUTH, &iwr) < 0) { +- perror("ioctl[SIOCSIWAUTH]"); +- fprintf(stderr, "WEXT auth param %d value 0x%x - ", +- idx, value); ++ if (errno != EOPNOTSUPP) { ++ wpa_printf(MSG_DEBUG, "WEXT: SIOCSIWAUTH(param %d " ++ "value 0x%x) failed: %s)", ++ idx, value, strerror(errno)); ++ } + ret = errno == EOPNOTSUPP ? -2 : -1; + } + --- wpasupplicant-0.6.0+0.5.8.orig/debian/patches/10_set_channel_in_adhoc_mode.dpatch +++ wpasupplicant-0.6.0+0.5.8/debian/patches/10_set_channel_in_adhoc_mode.dpatch @@ -0,0 +1,84 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 02_debian_doc_examples.patch by Kel Modderman +## +## DP: wpasupplicant fails to set frequency when in adhoc mode. This patch +## DP: was taken from the GNOME bugzilla +## DP: cf. http://bugs.launchpad.net/ubuntu/+source/wpasupplicant/+bug/112009 + +@DPATCH@ +diff --git wpa_supplicant/config.c wpa_supplicant/config.c +index 6a21bbc..10c454f 100644 +--- wpa_supplicant/config.c ++++ wpa_supplicant/config.c +@@ -1158,7 +1158,8 @@ static const struct parse_data ssid_fields[] = { + { INT_RANGE(ieee80211w, 0, 2) }, + #endif /* CONFIG_IEEE80211W */ + { INT_RANGE(peerkey, 0, 1) }, +- { INT_RANGE(mixed_cell, 0, 1) } ++ { INT_RANGE(mixed_cell, 0, 1) }, ++ { INT_RANGE(frequency, 0, 10000) } + }; + + #undef OFFSET +diff --git wpa_supplicant/config_ssid.h wpa_supplicant/config_ssid.h +index d4c3654..393f750 100644 +--- wpa_supplicant/config_ssid.h ++++ wpa_supplicant/config_ssid.h +@@ -851,6 +851,18 @@ struct wpa_ssid { + IEEE80211W_REQUIRED = 2 + } ieee80211w; + #endif /* CONFIG_IEEE80211W */ ++ ++ /** ++ * frequency - Channel frequency in megahertz (MHz) for IBSS ++ * ++ * This value is used to configure the initial channel for IBSS (adhoc) ++ * networks, e.g., 2412 = IEEE 802.11g channel 1. It is ignored in ++ * the infrastructure mode. In addition, this value is only used by the ++ * station that creates the IBSS. If an IBSS network with the ++ * configured SSID is already present, the frequency of the network ++ * will be used instead of this configured value. ++ */ ++ int frequency; + }; + + int wpa_config_allowed_eap_method(struct wpa_ssid *ssid, int vendor, +diff --git wpa_supplicant/wpa_supplicant.c wpa_supplicant/wpa_supplicant.c +index d5342fe..35ddbcd 100644 +--- wpa_supplicant/wpa_supplicant.c ++++ wpa_supplicant/wpa_supplicant.c +@@ -1468,6 +1468,8 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s, + params.ssid = ssid->ssid; + params.ssid_len = ssid->ssid_len; + } ++ if (ssid->mode == 1 && ssid->frequency > 0 && params.freq == 0) ++ params.freq = ssid->frequency; /* Initial channel for IBSS */ + params.wpa_ie = wpa_ie; + params.wpa_ie_len = wpa_ie_len; + params.pairwise_suite = cipher_pairwise; +diff --git wpa_supplicant/wpa_supplicant.conf wpa_supplicant/wpa_supplicant.conf +index dce9d87..ec8b0ee 100644 +--- wpa_supplicant/wpa_supplicant.conf ++++ wpa_supplicant/wpa_supplicant.conf +@@ -192,6 +192,13 @@ fast_reauth=1 + # proto=WPA, key_mgmt=WPA-NONE, pairwise=NONE, group=TKIP (or CCMP, but not + # both), and psk must also be set. + # ++# frequency: Channel frequency in megahertz (MHz) for IBSS, e.g., ++# 2412 = IEEE 802.11g channel 1. This value is used to configure the initial ++# channel for IBSS (adhoc) networks. It is ignored in the infrastructure mode. ++# In addition, this value is only used by the station that creates the IBSS. If ++# an IBSS network with the configured SSID is already present, the frequency of ++# the network will be used instead of this configured value. ++# + # proto: list of accepted protocols + # WPA = WPIEEE 802.11i/D3.0 + # RSN = WPA2/IEEE 802.11i (also WPA2 can be used as an alias for RSN) +@@ -657,6 +664,7 @@ network={ + network={ + ssid="test adhoc" + mode=1 ++ frequency=2412 + proto=WPA + key_mgmt=WPA-NONE + pairwise=NONE --- wpasupplicant-0.6.0+0.5.8.orig/debian/patches/10_orinoco_wep_key_fix.dpatch +++ wpasupplicant-0.6.0+0.5.8/debian/patches/10_orinoco_wep_key_fix.dpatch @@ -0,0 +1,20 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_orinoco_wep_key_fix.patch by Kel Modderman +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: http://cvs.fedora.redhat.com/viewcvs/devel/wpa_supplicant/wpa_supplicant-wep-key-fix.patch +## DP: Dan Williams + +@DPATCH@ +diff -Nrup wpa_supplicant-0.5-2006-05-22.orig/driver_wext.c wpa_supplicant-0.5-2006-05-22.patched/driver_wext.c +--- wpa_supplicant-0.5-2006-05-22.orig/driver_wext.c 2006-05-21 03:32:46.000000000 +1000 ++++ wpa_supplicant-0.5-2006-05-22.patched/driver_wext.c 2006-06-09 22:48:16.000000000 +1000 +@@ -1565,7 +1565,7 @@ int wpa_driver_wext_set_key(void *priv, + memset(&iwr, 0, sizeof(iwr)); + strncpy(iwr.ifr_name, drv->ifname, IFNAMSIZ); + iwr.u.encoding.flags = key_idx + 1; +- iwr.u.encoding.pointer = (caddr_t) key; ++ iwr.u.encoding.pointer = (caddr_t) NULL; + iwr.u.encoding.length = 0; + if (ioctl(drv->ioctl_sock, SIOCSIWENCODE, &iwr) < 0) { + perror("ioctl[SIOCSIWENCODE] (set_tx)"); --- wpasupplicant-0.6.0+0.5.8.orig/debian/patches/20_include_madwifi.dpatch +++ wpasupplicant-0.6.0+0.5.8/debian/patches/20_include_madwifi.dpatch @@ -0,0 +1,21 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## include_madwifi.patch by Kel Modderman +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Activate madwifi driver + +@DPATCH@ +diff -Nrup wpa_supplicant.orig/.config wpa_supplicant/.config +--- wpa_supplicant.orig/.config 2006-07-15 08:56:55.000000000 +1000 ++++ wpa_supplicant/.config 2006-07-15 08:57:11.000000000 +1000 +@@ -1,8 +1,8 @@ + CONFIG_DRIVER_ATMEL=y + CONFIG_DRIVER_HOSTAP=y + CONFIG_DRIVER_IPW=y +-#CONFIG_DRIVER_MADWIFI=y +-#CFLAGS+=-I./driver_madwifi ++CONFIG_DRIVER_MADWIFI=y ++CFLAGS+=-I./driver_madwifi + CONFIG_DRIVER_NDISWRAPPER=y + CONFIG_DRIVER_WEXT=y + CONFIG_DRIVER_WIRED=y --- wpasupplicant-0.6.0+0.5.8.orig/debian/patches/21_madwifiold_20060207_includes.dpatch +++ wpasupplicant-0.6.0+0.5.8/debian/patches/21_madwifiold_20060207_includes.dpatch @@ -0,0 +1,1675 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## madwifiold-20060207-includes.patch by Kel Modderman +## +## All lines beginning with `## DP:' are a description of the patch. +## +## DP: Development includes for supporting madwifi ioctl's. These includes +## DP: are taken from the madwifi-old branch of madwifi.org svn +## DP: (via madwifi-dev). Be aware that the resulting wpasupplicant +## DP: binaries cannot work with the madwifi-ng driver. + +@DPATCH@ +diff -Nru wpa_supplicant.orig/driver_madwifi/include/compat.h wpa_supplicant/driver_madwifi/include/compat.h +--- wpa_supplicant.orig/driver_madwifi/include/compat.h 1970-01-01 10:00:00.000000000 +1000 ++++ wpa_supplicant/driver_madwifi/include/compat.h 2005-02-17 02:09:10.000000000 +1000 +@@ -0,0 +1,86 @@ ++/*- ++ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer, ++ * without modification. ++ * 2. Redistributions in binary form must reproduce at minimum a disclaimer ++ * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any ++ * redistribution must be conditioned upon including a substantially ++ * similar Disclaimer requirement for further binary redistribution. ++ * 3. Neither the names of the above-listed copyright holders nor the names ++ * of any contributors may be used to endorse or promote products derived ++ * from this software without specific prior written permission. ++ * ++ * Alternatively, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2 as published by the Free ++ * Software Foundation. ++ * ++ * NO WARRANTY ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ++ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ++ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY ++ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ++ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, ++ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER ++ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF ++ * THE POSSIBILITY OF SUCH DAMAGES. ++ * ++ * $Id: compat.h 846 2005-02-16 16:09:10Z samleffler $ ++ */ ++#ifndef _ATH_COMPAT_H_ ++#define _ATH_COMPAT_H_ ++/* ++ * BSD/Linux compatibility shims. These are used mainly to ++ * minimize differences when importing necesary BSD code. ++ */ ++#define NBBY 8 /* number of bits/byte */ ++ ++#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */ ++#define howmany(x, y) (((x)+((y)-1))/(y)) ++ ++/* Bit map related macros. */ ++#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY)) ++#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY))) ++#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY))) ++#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0) ++ ++#define __packed __attribute__((__packed__)) ++#define __printflike(_a,_b) \ ++ __attribute__ ((__format__ (__printf__, _a, _b))) ++ ++#ifndef ALIGNED_POINTER ++/* ++ * ALIGNED_POINTER is a boolean macro that checks whether an address ++ * is valid to fetch data elements of type t from on this architecture. ++ * This does not reflect the optimal alignment, just the possibility ++ * (within reasonable limits). ++ * ++ */ ++#define ALIGNED_POINTER(p,t) 1 ++#endif ++ ++#ifdef __KERNEL__ ++#include ++ ++#define KASSERT(exp, msg) do { \ ++ if (unlikely(!(exp))) { \ ++ printk msg; \ ++ BUG(); \ ++ } \ ++} while (0) ++#endif /* __KERNEL__ */ ++ ++/* ++ * NetBSD/FreeBSD defines for file version. ++ */ ++#define __FBSDID(_s) ++#define __KERNEL_RCSID(_n,_s) ++#endif /* _ATH_COMPAT_H_ */ +diff -Nru wpa_supplicant.orig/driver_madwifi/net80211/ieee80211_crypto.h wpa_supplicant/driver_madwifi/net80211/ieee80211_crypto.h +--- wpa_supplicant.orig/driver_madwifi/net80211/ieee80211_crypto.h 1970-01-01 10:00:00.000000000 +1000 ++++ wpa_supplicant/driver_madwifi/net80211/ieee80211_crypto.h 2005-07-11 23:24:17.000000000 +1000 +@@ -0,0 +1,225 @@ ++/*- ++ * Copyright (c) 2001 Atsushi Onoe ++ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The name of the author may not be used to endorse or promote products ++ * derived from this software without specific prior written permission. ++ * ++ * Alternatively, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2 as published by the Free ++ * Software Foundation. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ * ++ * $FreeBSD: src/sys/net80211/ieee80211_crypto.h,v 1.5 2004/12/31 22:44:26 sam Exp $ ++ */ ++#ifndef _NET80211_IEEE80211_CRYPTO_H_ ++#define _NET80211_IEEE80211_CRYPTO_H_ ++ ++/* ++ * 802.11 protocol crypto-related definitions. ++ */ ++#define IEEE80211_KEYBUF_SIZE 16 ++#define IEEE80211_MICBUF_SIZE (8+8) /* space for both tx+rx keys */ ++ ++/* ++ * Old WEP-style key. Deprecated. ++ */ ++struct ieee80211_wepkey { ++ u_int wk_len; /* key length in bytes */ ++ u_int8_t wk_key[IEEE80211_KEYBUF_SIZE]; ++}; ++ ++struct ieee80211_cipher; ++ ++/* ++ * Crypto key state. There is sufficient room for all supported ++ * ciphers (see below). The underlying ciphers are handled ++ * separately through loadable cipher modules that register with ++ * the generic crypto support. A key has a reference to an instance ++ * of the cipher; any per-key state is hung off wk_private by the ++ * cipher when it is attached. Ciphers are automatically called ++ * to detach and cleanup any such state when the key is deleted. ++ * ++ * The generic crypto support handles encap/decap of cipher-related ++ * frame contents for both hardware- and software-based implementations. ++ * A key requiring software crypto support is automatically flagged and ++ * the cipher is expected to honor this and do the necessary work. ++ * Ciphers such as TKIP may also support mixed hardware/software ++ * encrypt/decrypt and MIC processing. ++ */ ++/* XXX need key index typedef */ ++/* XXX pack better? */ ++/* XXX 48-bit rsc/tsc */ ++struct ieee80211_key { ++ u_int8_t wk_keylen; /* key length in bytes */ ++ u_int8_t wk_flags; ++#define IEEE80211_KEY_XMIT 0x01 /* key used for xmit */ ++#define IEEE80211_KEY_RECV 0x02 /* key used for recv */ ++#define IEEE80211_KEY_GROUP 0x04 /* key used for WPA group operation */ ++#define IEEE80211_KEY_SWCRYPT 0x10 /* host-based encrypt/decrypt */ ++#define IEEE80211_KEY_SWMIC 0x20 /* host-based enmic/demic */ ++ u_int16_t wk_keyix; /* key index */ ++ u_int8_t wk_key[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE]; ++#define wk_txmic wk_key+IEEE80211_KEYBUF_SIZE+0 /* XXX can't () right */ ++#define wk_rxmic wk_key+IEEE80211_KEYBUF_SIZE+8 /* XXX can't () right */ ++ u_int64_t wk_keyrsc; /* key receive sequence counter */ ++ u_int64_t wk_keytsc; /* key transmit sequence counter */ ++ const struct ieee80211_cipher *wk_cipher; ++ void *wk_private; /* private cipher state */ ++}; ++#define IEEE80211_KEY_COMMON /* common flags passed in by apps */\ ++ (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV | IEEE80211_KEY_GROUP) ++ ++/* ++ * NB: these values are ordered carefully; there are lots of ++ * of implications in any reordering. In particular beware ++ * that 4 is not used to avoid conflicting with IEEE80211_F_PRIVACY. ++ */ ++#define IEEE80211_CIPHER_WEP 0 ++#define IEEE80211_CIPHER_TKIP 1 ++#define IEEE80211_CIPHER_AES_OCB 2 ++#define IEEE80211_CIPHER_AES_CCM 3 ++#define IEEE80211_CIPHER_CKIP 5 ++#define IEEE80211_CIPHER_NONE 6 /* pseudo value */ ++ ++#define IEEE80211_CIPHER_MAX (IEEE80211_CIPHER_NONE+1) ++ ++#define IEEE80211_KEYIX_NONE ((u_int16_t) -1) ++ ++#if defined(__KERNEL__) || defined(_KERNEL) ++ ++struct ieee80211com; ++struct ieee80211_node; ++struct sk_buff; ++ ++/* ++ * Crypto state kept in each ieee80211com. Some of this ++ * can/should be shared when virtual AP's are supported. ++ * ++ * XXX save reference to ieee80211com to properly encapsulate state. ++ * XXX split out crypto capabilities from ic_caps ++ */ ++struct ieee80211_crypto_state { ++ struct ieee80211_key cs_nw_keys[IEEE80211_WEP_NKID]; ++ u_int16_t cs_def_txkey; /* default/group tx key index */ ++ ++ int (*cs_key_alloc)(struct ieee80211com *, ++ const struct ieee80211_key *); ++ int (*cs_key_delete)(struct ieee80211com *, ++ const struct ieee80211_key *); ++ int (*cs_key_set)(struct ieee80211com *, ++ const struct ieee80211_key *, ++ const u_int8_t mac[IEEE80211_ADDR_LEN]); ++ void (*cs_key_update_begin)(struct ieee80211com *); ++ void (*cs_key_update_end)(struct ieee80211com *); ++}; ++ ++extern void ieee80211_crypto_attach(struct ieee80211com *); ++extern void ieee80211_crypto_detach(struct ieee80211com *); ++extern int ieee80211_crypto_newkey(struct ieee80211com *, ++ int cipher, int flags, struct ieee80211_key *); ++extern int ieee80211_crypto_delkey(struct ieee80211com *, ++ struct ieee80211_key *); ++extern int ieee80211_crypto_setkey(struct ieee80211com *, ++ struct ieee80211_key *, const u_int8_t macaddr[IEEE80211_ADDR_LEN]); ++extern void ieee80211_crypto_delglobalkeys(struct ieee80211com *); ++ ++/* ++ * Template for a supported cipher. Ciphers register with the ++ * crypto code and are typically loaded as separate modules ++ * (the null cipher is always present). ++ * XXX may need refcnts ++ */ ++struct ieee80211_cipher { ++ const char *ic_name; /* printable name */ ++ u_int ic_cipher; /* IEEE80211_CIPHER_* */ ++ u_int ic_header; /* size of privacy header (bytes) */ ++ u_int ic_trailer; /* size of privacy trailer (bytes) */ ++ u_int ic_miclen; /* size of mic trailer (bytes) */ ++ void* (*ic_attach)(struct ieee80211com *, struct ieee80211_key *); ++ void (*ic_detach)(struct ieee80211_key *); ++ int (*ic_setkey)(struct ieee80211_key *); ++ int (*ic_encap)(struct ieee80211_key *, struct sk_buff *, ++ u_int8_t keyid); ++ int (*ic_decap)(struct ieee80211_key *, struct sk_buff *, int); ++ int (*ic_enmic)(struct ieee80211_key *, struct sk_buff *, int); ++ int (*ic_demic)(struct ieee80211_key *, struct sk_buff *, int); ++}; ++extern const struct ieee80211_cipher ieee80211_cipher_none; ++ ++extern void ieee80211_crypto_register(const struct ieee80211_cipher *); ++extern void ieee80211_crypto_unregister(const struct ieee80211_cipher *); ++extern int ieee80211_crypto_available(u_int cipher); ++ ++extern struct ieee80211_key *ieee80211_crypto_encap(struct ieee80211com *, ++ struct ieee80211_node *, struct sk_buff *); ++extern struct ieee80211_key *ieee80211_crypto_decap(struct ieee80211com *, ++ struct ieee80211_node *, struct sk_buff *, int); ++ ++/* ++ * Check and remove any MIC. ++ */ ++static inline int ++ieee80211_crypto_demic(struct ieee80211com *ic, struct ieee80211_key *k, ++ struct sk_buff *skb, int force) ++{ ++ const struct ieee80211_cipher *cip = k->wk_cipher; ++ return (cip->ic_miclen > 0 ? (*cip->ic_demic)(k, skb, force) : 1); ++} ++ ++/* ++ * Add any MIC. ++ */ ++static inline int ++ieee80211_crypto_enmic(struct ieee80211com *ic, ++ struct ieee80211_key *k, struct sk_buff *skb, int force) ++{ ++ const struct ieee80211_cipher *cip = k->wk_cipher; ++ return (cip->ic_miclen > 0 ? (*cip->ic_enmic)(k, skb, force) : 1); ++} ++ ++/* ++ * Reset key state to an unused state. The crypto ++ * key allocation mechanism insures other state (e.g. ++ * key data) is properly setup before a key is used. ++ */ ++static inline void ++ieee80211_crypto_resetkey(struct ieee80211com *ic, ++ struct ieee80211_key *k, u_int16_t ix) ++{ ++ k->wk_cipher = &ieee80211_cipher_none; ++ k->wk_private = k->wk_cipher->ic_attach(ic, k); ++ k->wk_keyix = ix; ++ k->wk_flags = IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV; ++} ++ ++/* ++ * Crypt-related notification methods. ++ */ ++extern void ieee80211_notify_replay_failure(struct ieee80211com *, ++ const struct ieee80211_frame *, const struct ieee80211_key *, ++ u_int64_t rsc); ++extern void ieee80211_notify_michael_failure(struct ieee80211com *, ++ const struct ieee80211_frame *, u_int keyix); ++ ++#endif /* defined(__KERNEL__) || defined(_KERNEL) */ ++#endif /* _NET80211_IEEE80211_CRYPTO_H_ */ +diff -Nru wpa_supplicant.orig/driver_madwifi/net80211/_ieee80211.h wpa_supplicant/driver_madwifi/net80211/_ieee80211.h +--- wpa_supplicant.orig/driver_madwifi/net80211/_ieee80211.h 1970-01-01 10:00:00.000000000 +1000 ++++ wpa_supplicant/driver_madwifi/net80211/_ieee80211.h 2005-07-11 23:24:17.000000000 +1000 +@@ -0,0 +1,188 @@ ++/*- ++ * Copyright (c) 2001 Atsushi Onoe ++ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The name of the author may not be used to endorse or promote products ++ * derived from this software without specific prior written permission. ++ * ++ * Alternatively, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2 as published by the Free ++ * Software Foundation. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ * ++ * $FreeBSD: src/sys/net80211/_ieee80211.h,v 1.2 2004/12/31 22:42:38 sam Exp $ ++ */ ++#ifndef _NET80211__IEEE80211_H_ ++#define _NET80211__IEEE80211_H_ ++ ++enum ieee80211_phytype { ++ IEEE80211_T_DS, /* direct sequence spread spectrum */ ++ IEEE80211_T_FH, /* frequency hopping */ ++ IEEE80211_T_OFDM, /* frequency division multiplexing */ ++ IEEE80211_T_TURBO /* high rate OFDM, aka turbo mode */ ++}; ++#define IEEE80211_T_CCK IEEE80211_T_DS /* more common nomenclature */ ++ ++/* XXX not really a mode; there are really multiple PHY's */ ++enum ieee80211_phymode { ++ IEEE80211_MODE_AUTO = 0, /* autoselect */ ++ IEEE80211_MODE_11A = 1, /* 5GHz, OFDM */ ++ IEEE80211_MODE_11B = 2, /* 2GHz, CCK */ ++ IEEE80211_MODE_11G = 3, /* 2GHz, OFDM */ ++ IEEE80211_MODE_FH = 4, /* 2GHz, GFSK */ ++ IEEE80211_MODE_TURBO_A = 5, /* 5GHz, OFDM, 2x clock */ ++ IEEE80211_MODE_TURBO_G = 6 /* 2GHz, OFDM, 2x clock */ ++}; ++#define IEEE80211_MODE_MAX (IEEE80211_MODE_TURBO_G+1) ++ ++enum ieee80211_opmode { ++ IEEE80211_M_STA = 1, /* infrastructure station */ ++ IEEE80211_M_IBSS = 0, /* IBSS (adhoc) station */ ++ IEEE80211_M_AHDEMO = 3, /* Old lucent compatible adhoc demo */ ++ IEEE80211_M_HOSTAP = 6, /* Software Access Point */ ++ IEEE80211_M_MONITOR = 8 /* Monitor mode */ ++}; ++ ++/* ++ * 802.11g protection mode. ++ */ ++enum ieee80211_protmode { ++ IEEE80211_PROT_NONE = 0, /* no protection */ ++ IEEE80211_PROT_CTSONLY = 1, /* CTS to self */ ++ IEEE80211_PROT_RTSCTS = 2 /* RTS-CTS */ ++}; ++ ++/* ++ * Authentication mode. ++ */ ++enum ieee80211_authmode { ++ IEEE80211_AUTH_NONE = 0, ++ IEEE80211_AUTH_OPEN = 1, /* open */ ++ IEEE80211_AUTH_SHARED = 2, /* shared-key */ ++ IEEE80211_AUTH_8021X = 3, /* 802.1x */ ++ IEEE80211_AUTH_AUTO = 4, /* auto-select/accept */ ++ /* NB: these are used only for ioctls */ ++ IEEE80211_AUTH_WPA = 5 /* WPA/RSN w/ 802.1x/PSK */ ++}; ++ ++/* ++ * Roaming mode is effectively who controls the operation ++ * of the 802.11 state machine when operating as a station. ++ * State transitions are controlled either by the driver ++ * (typically when management frames are processed by the ++ * hardware/firmware), the host (auto/normal operation of ++ * the 802.11 layer), or explicitly through ioctl requests ++ * when applications like wpa_supplicant want control. ++ */ ++enum ieee80211_roamingmode { ++ IEEE80211_ROAMING_DEVICE= 0, /* driver/hardware control */ ++ IEEE80211_ROAMING_AUTO = 1, /* 802.11 layer control */ ++ IEEE80211_ROAMING_MANUAL= 2 /* application control */ ++}; ++ ++/* ++ * Channels are specified by frequency and attributes. ++ */ ++struct ieee80211_channel { ++ u_int16_t ic_freq; /* setting in Mhz */ ++ u_int16_t ic_flags; /* see below */ ++}; ++ ++#define IEEE80211_CHAN_MAX 255 ++#define IEEE80211_CHAN_BYTES 32 /* howmany(IEEE80211_CHAN_MAX, NBBY) */ ++#define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */ ++#define IEEE80211_CHAN_ANYC \ ++ ((struct ieee80211_channel *) IEEE80211_CHAN_ANY) ++ ++/* bits 0-3 are for private use by drivers */ ++/* channel attributes */ ++#define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */ ++#define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */ ++#define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */ ++#define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */ ++#define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */ ++#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */ ++#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */ ++#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */ ++ ++/* ++ * Useful combinations of channel characteristics. ++ */ ++#define IEEE80211_CHAN_FHSS \ ++ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_GFSK) ++#define IEEE80211_CHAN_A \ ++ (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM) ++#define IEEE80211_CHAN_B \ ++ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_CCK) ++#define IEEE80211_CHAN_PUREG \ ++ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM) ++#define IEEE80211_CHAN_G \ ++ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN) ++#define IEEE80211_CHAN_T \ ++ (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO) ++#define IEEE80211_CHAN_108G \ ++ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO) ++ ++#define IEEE80211_IS_CHAN_FHSS(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_FHSS) == IEEE80211_CHAN_FHSS) ++#define IEEE80211_IS_CHAN_A(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_A) == IEEE80211_CHAN_A) ++#define IEEE80211_IS_CHAN_B(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_B) == IEEE80211_CHAN_B) ++#define IEEE80211_IS_CHAN_PUREG(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_PUREG) == IEEE80211_CHAN_PUREG) ++#define IEEE80211_IS_CHAN_G(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G) ++#define IEEE80211_IS_CHAN_T(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_T) == IEEE80211_CHAN_T) ++#define IEEE80211_IS_CHAN_108G(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_108G) == IEEE80211_CHAN_108G) ++ ++#define IEEE80211_IS_CHAN_2GHZ(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_2GHZ) != 0) ++#define IEEE80211_IS_CHAN_5GHZ(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_5GHZ) != 0) ++#define IEEE80211_IS_CHAN_OFDM(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_OFDM) != 0) ++#define IEEE80211_IS_CHAN_CCK(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_CCK) != 0) ++#define IEEE80211_IS_CHAN_GFSK(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_GFSK) != 0) ++ ++/* ni_chan encoding for FH phy */ ++#define IEEE80211_FH_CHANMOD 80 ++#define IEEE80211_FH_CHAN(set,pat) (((set)-1)*IEEE80211_FH_CHANMOD+(pat)) ++#define IEEE80211_FH_CHANSET(chan) ((chan)/IEEE80211_FH_CHANMOD+1) ++#define IEEE80211_FH_CHANPAT(chan) ((chan)%IEEE80211_FH_CHANMOD) ++ ++/* ++ * 802.11 rate set. ++ */ ++#define IEEE80211_RATE_SIZE 8 /* 802.11 standard */ ++#define IEEE80211_RATE_MAXSIZE 15 /* max rates we'll handle */ ++ ++struct ieee80211_rateset { ++ u_int8_t rs_nrates; ++ u_int8_t rs_rates[IEEE80211_RATE_MAXSIZE]; ++}; ++ ++#endif /* _NET80211__IEEE80211_H_ */ +diff -Nru wpa_supplicant.orig/driver_madwifi/net80211/ieee80211.h wpa_supplicant/driver_madwifi/net80211/ieee80211.h +--- wpa_supplicant.orig/driver_madwifi/net80211/ieee80211.h 1970-01-01 10:00:00.000000000 +1000 ++++ wpa_supplicant/driver_madwifi/net80211/ieee80211.h 2005-07-11 23:24:17.000000000 +1000 +@@ -0,0 +1,631 @@ ++/*- ++ * Copyright (c) 2001 Atsushi Onoe ++ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The name of the author may not be used to endorse or promote products ++ * derived from this software without specific prior written permission. ++ * ++ * Alternatively, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2 as published by the Free ++ * Software Foundation. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ * ++ * $FreeBSD: src/sys/net80211/ieee80211.h,v 1.8 2004/12/31 22:44:26 sam Exp $ ++ */ ++#ifndef _NET80211_IEEE80211_H_ ++#define _NET80211_IEEE80211_H_ ++ ++/* ++ * 802.11 protocol definitions. ++ */ ++ ++#define IEEE80211_ADDR_LEN 6 /* size of 802.11 address */ ++/* is 802.11 address multicast/broadcast? */ ++#define IEEE80211_IS_MULTICAST(_a) (*(_a) & 0x01) ++ ++/* IEEE 802.11 PLCP header */ ++struct ieee80211_plcp_hdr { ++ u_int16_t i_sfd; ++ u_int8_t i_signal; ++ u_int8_t i_service; ++ u_int16_t i_length; ++ u_int16_t i_crc; ++} __packed; ++ ++#define IEEE80211_PLCP_SFD 0xF3A0 ++#define IEEE80211_PLCP_SERVICE 0x00 ++ ++/* ++ * generic definitions for IEEE 802.11 frames ++ */ ++struct ieee80211_frame { ++ u_int8_t i_fc[2]; ++ u_int8_t i_dur[2]; ++ u_int8_t i_addr1[IEEE80211_ADDR_LEN]; ++ u_int8_t i_addr2[IEEE80211_ADDR_LEN]; ++ u_int8_t i_addr3[IEEE80211_ADDR_LEN]; ++ u_int8_t i_seq[2]; ++ /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */ ++ /* see below */ ++} __packed; ++ ++struct ieee80211_qosframe { ++ u_int8_t i_fc[2]; ++ u_int8_t i_dur[2]; ++ u_int8_t i_addr1[IEEE80211_ADDR_LEN]; ++ u_int8_t i_addr2[IEEE80211_ADDR_LEN]; ++ u_int8_t i_addr3[IEEE80211_ADDR_LEN]; ++ u_int8_t i_seq[2]; ++ u_int8_t i_qos[2]; ++ /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */ ++ /* see below */ ++} __packed; ++ ++struct ieee80211_qoscntl { ++ u_int8_t i_qos[2]; ++}; ++ ++struct ieee80211_frame_addr4 { ++ u_int8_t i_fc[2]; ++ u_int8_t i_dur[2]; ++ u_int8_t i_addr1[IEEE80211_ADDR_LEN]; ++ u_int8_t i_addr2[IEEE80211_ADDR_LEN]; ++ u_int8_t i_addr3[IEEE80211_ADDR_LEN]; ++ u_int8_t i_seq[2]; ++ u_int8_t i_addr4[IEEE80211_ADDR_LEN]; ++} __packed; ++ ++ ++struct ieee80211_qosframe_addr4 { ++ u_int8_t i_fc[2]; ++ u_int8_t i_dur[2]; ++ u_int8_t i_addr1[IEEE80211_ADDR_LEN]; ++ u_int8_t i_addr2[IEEE80211_ADDR_LEN]; ++ u_int8_t i_addr3[IEEE80211_ADDR_LEN]; ++ u_int8_t i_seq[2]; ++ u_int8_t i_addr4[IEEE80211_ADDR_LEN]; ++ u_int8_t i_qos[2]; ++} __packed; ++ ++#define IEEE80211_FC0_VERSION_MASK 0x03 ++#define IEEE80211_FC0_VERSION_SHIFT 0 ++#define IEEE80211_FC0_VERSION_0 0x00 ++#define IEEE80211_FC0_TYPE_MASK 0x0c ++#define IEEE80211_FC0_TYPE_SHIFT 2 ++#define IEEE80211_FC0_TYPE_MGT 0x00 ++#define IEEE80211_FC0_TYPE_CTL 0x04 ++#define IEEE80211_FC0_TYPE_DATA 0x08 ++ ++#define IEEE80211_FC0_SUBTYPE_MASK 0xf0 ++#define IEEE80211_FC0_SUBTYPE_SHIFT 4 ++/* for TYPE_MGT */ ++#define IEEE80211_FC0_SUBTYPE_ASSOC_REQ 0x00 ++#define IEEE80211_FC0_SUBTYPE_ASSOC_RESP 0x10 ++#define IEEE80211_FC0_SUBTYPE_REASSOC_REQ 0x20 ++#define IEEE80211_FC0_SUBTYPE_REASSOC_RESP 0x30 ++#define IEEE80211_FC0_SUBTYPE_PROBE_REQ 0x40 ++#define IEEE80211_FC0_SUBTYPE_PROBE_RESP 0x50 ++#define IEEE80211_FC0_SUBTYPE_BEACON 0x80 ++#define IEEE80211_FC0_SUBTYPE_ATIM 0x90 ++#define IEEE80211_FC0_SUBTYPE_DISASSOC 0xa0 ++#define IEEE80211_FC0_SUBTYPE_AUTH 0xb0 ++#define IEEE80211_FC0_SUBTYPE_DEAUTH 0xc0 ++/* for TYPE_CTL */ ++#define IEEE80211_FC0_SUBTYPE_PS_POLL 0xa0 ++#define IEEE80211_FC0_SUBTYPE_RTS 0xb0 ++#define IEEE80211_FC0_SUBTYPE_CTS 0xc0 ++#define IEEE80211_FC0_SUBTYPE_ACK 0xd0 ++#define IEEE80211_FC0_SUBTYPE_CF_END 0xe0 ++#define IEEE80211_FC0_SUBTYPE_CF_END_ACK 0xf0 ++/* for TYPE_DATA (bit combination) */ ++#define IEEE80211_FC0_SUBTYPE_DATA 0x00 ++#define IEEE80211_FC0_SUBTYPE_CF_ACK 0x10 ++#define IEEE80211_FC0_SUBTYPE_CF_POLL 0x20 ++#define IEEE80211_FC0_SUBTYPE_CF_ACPL 0x30 ++#define IEEE80211_FC0_SUBTYPE_NODATA 0x40 ++#define IEEE80211_FC0_SUBTYPE_CFACK 0x50 ++#define IEEE80211_FC0_SUBTYPE_CFPOLL 0x60 ++#define IEEE80211_FC0_SUBTYPE_CF_ACK_CF_ACK 0x70 ++#define IEEE80211_FC0_SUBTYPE_QOS 0x80 ++#define IEEE80211_FC0_SUBTYPE_QOS_NULL 0xc0 ++ ++#define IEEE80211_FC1_DIR_MASK 0x03 ++#define IEEE80211_FC1_DIR_NODS 0x00 /* STA->STA */ ++#define IEEE80211_FC1_DIR_TODS 0x01 /* STA->AP */ ++#define IEEE80211_FC1_DIR_FROMDS 0x02 /* AP ->STA */ ++#define IEEE80211_FC1_DIR_DSTODS 0x03 /* AP ->AP */ ++ ++#define IEEE80211_FC1_MORE_FRAG 0x04 ++#define IEEE80211_FC1_RETRY 0x08 ++#define IEEE80211_FC1_PWR_MGT 0x10 ++#define IEEE80211_FC1_MORE_DATA 0x20 ++#define IEEE80211_FC1_WEP 0x40 ++#define IEEE80211_FC1_ORDER 0x80 ++ ++#define IEEE80211_SEQ_FRAG_MASK 0x000f ++#define IEEE80211_SEQ_FRAG_SHIFT 0 ++#define IEEE80211_SEQ_SEQ_MASK 0xfff0 ++#define IEEE80211_SEQ_SEQ_SHIFT 4 ++ ++#define IEEE80211_NWID_LEN 32 ++ ++#define IEEE80211_QOS_TXOP 0x00ff ++/* bit 8 is reserved */ ++#define IEEE80211_QOS_ACKPOLICY 0x60 ++#define IEEE80211_QOS_ACKPOLICY_S 5 ++#define IEEE80211_QOS_ESOP 0x10 ++#define IEEE80211_QOS_ESOP_S 4 ++#define IEEE80211_QOS_TID 0x0f ++ ++/* does frame have QoS sequence control data */ ++#define IEEE80211_QOS_HAS_SEQ(wh) \ ++ (((wh)->i_fc[0] & \ ++ (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_QOS)) == \ ++ (IEEE80211_FC0_TYPE_DATA | IEEE80211_FC0_SUBTYPE_QOS)) ++ ++/* ++ * WME/802.11e information element. ++ */ ++struct ieee80211_wme_info { ++ u_int8_t wme_id; /* IEEE80211_ELEMID_VENDOR */ ++ u_int8_t wme_len; /* length in bytes */ ++ u_int8_t wme_oui[3]; /* 0x00, 0x50, 0xf2 */ ++ u_int8_t wme_type; /* OUI type */ ++ u_int8_t wme_subtype; /* OUI subtype */ ++ u_int8_t wme_version; /* spec revision */ ++ u_int8_t wme_info; /* QoS info */ ++} __packed; ++ ++/* ++ * WME/802.11e Tspec Element ++ */ ++struct ieee80211_wme_tspec { ++ u_int8_t ts_id; ++ u_int8_t ts_len; ++ u_int8_t ts_oui[3]; ++ u_int8_t ts_oui_type; ++ u_int8_t ts_oui_subtype; ++ u_int8_t ts_version; ++ u_int8_t ts_tsinfo[3]; ++ u_int8_t ts_nom_msdu[2]; ++ u_int8_t ts_max_msdu[2]; ++ u_int8_t ts_min_svc[4]; ++ u_int8_t ts_max_svc[4]; ++ u_int8_t ts_inactv_intv[4]; ++ u_int8_t ts_susp_intv[4]; ++ u_int8_t ts_start_svc[4]; ++ u_int8_t ts_min_rate[4]; ++ u_int8_t ts_mean_rate[4]; ++ u_int8_t ts_max_burst[4]; ++ u_int8_t ts_min_phy[4]; ++ u_int8_t ts_peak_rate[4]; ++ u_int8_t ts_delay[4]; ++ u_int8_t ts_surplus[2]; ++ u_int8_t ts_medium_time[2]; ++} __packed; ++ ++/* ++ * WME AC parameter field ++ */ ++struct ieee80211_wme_acparams { ++ u_int8_t acp_aci_aifsn; ++ u_int8_t acp_logcwminmax; ++ u_int16_t acp_txop; ++} __packed; ++ ++#define WME_NUM_AC 4 /* 4 AC categories */ ++ ++#define WME_PARAM_ACI 0x60 /* Mask for ACI field */ ++#define WME_PARAM_ACI_S 5 /* Shift for ACI field */ ++#define WME_PARAM_ACM 0x10 /* Mask for ACM bit */ ++#define WME_PARAM_ACM_S 4 /* Shift for ACM bit */ ++#define WME_PARAM_AIFSN 0x0f /* Mask for aifsn field */ ++#define WME_PARAM_AIFSN_S 0 /* Shift for aifsn field */ ++#define WME_PARAM_LOGCWMIN 0x0f /* Mask for CwMin field (in log) */ ++#define WME_PARAM_LOGCWMIN_S 0 /* Shift for CwMin field */ ++#define WME_PARAM_LOGCWMAX 0xf0 /* Mask for CwMax field (in log) */ ++#define WME_PARAM_LOGCWMAX_S 4 /* Shift for CwMax field */ ++ ++#define WME_AC_TO_TID(_ac) ( \ ++ ((_ac) == WME_AC_VO) ? 6 : \ ++ ((_ac) == WME_AC_VI) ? 5 : \ ++ ((_ac) == WME_AC_BK) ? 1 : \ ++ 0) ++ ++#define TID_TO_WME_AC(_tid) ( \ ++ ((_tid) < 1) ? WME_AC_BE : \ ++ ((_tid) < 3) ? WME_AC_BK : \ ++ ((_tid) < 6) ? WME_AC_VI : \ ++ WME_AC_VO) ++ ++/* ++ * WME Parameter Element ++ */ ++struct ieee80211_wme_param { ++ u_int8_t param_id; ++ u_int8_t param_len; ++ u_int8_t param_oui[3]; ++ u_int8_t param_oui_type; ++ u_int8_t param_oui_sybtype; ++ u_int8_t param_version; ++ u_int8_t param_qosInfo; ++#define WME_QOSINFO_COUNT 0x0f /* Mask for param count field */ ++ u_int8_t param_reserved; ++ struct ieee80211_wme_acparams params_acParams[WME_NUM_AC]; ++} __packed; ++ ++/* ++ * Management Notification Frame ++ */ ++struct ieee80211_mnf { ++ u_int8_t mnf_category; ++ u_int8_t mnf_action; ++ u_int8_t mnf_dialog; ++ u_int8_t mnf_status; ++} __packed; ++#define MNF_SETUP_REQ 0 ++#define MNF_SETUP_RESP 1 ++#define MNF_TEARDOWN 2 ++ ++/* ++ * Control frames. ++ */ ++struct ieee80211_frame_min { ++ u_int8_t i_fc[2]; ++ u_int8_t i_dur[2]; ++ u_int8_t i_addr1[IEEE80211_ADDR_LEN]; ++ u_int8_t i_addr2[IEEE80211_ADDR_LEN]; ++ /* FCS */ ++} __packed; ++ ++struct ieee80211_frame_rts { ++ u_int8_t i_fc[2]; ++ u_int8_t i_dur[2]; ++ u_int8_t i_ra[IEEE80211_ADDR_LEN]; ++ u_int8_t i_ta[IEEE80211_ADDR_LEN]; ++ /* FCS */ ++} __packed; ++ ++struct ieee80211_frame_cts { ++ u_int8_t i_fc[2]; ++ u_int8_t i_dur[2]; ++ u_int8_t i_ra[IEEE80211_ADDR_LEN]; ++ /* FCS */ ++} __packed; ++ ++struct ieee80211_frame_ack { ++ u_int8_t i_fc[2]; ++ u_int8_t i_dur[2]; ++ u_int8_t i_ra[IEEE80211_ADDR_LEN]; ++ /* FCS */ ++} __packed; ++ ++struct ieee80211_frame_pspoll { ++ u_int8_t i_fc[2]; ++ u_int8_t i_aid[2]; ++ u_int8_t i_bssid[IEEE80211_ADDR_LEN]; ++ u_int8_t i_ta[IEEE80211_ADDR_LEN]; ++ /* FCS */ ++} __packed; ++ ++struct ieee80211_frame_cfend { /* NB: also CF-End+CF-Ack */ ++ u_int8_t i_fc[2]; ++ u_int8_t i_dur[2]; /* should be zero */ ++ u_int8_t i_ra[IEEE80211_ADDR_LEN]; ++ u_int8_t i_bssid[IEEE80211_ADDR_LEN]; ++ /* FCS */ ++} __packed; ++ ++/* ++ * BEACON management packets ++ * ++ * octet timestamp[8] ++ * octet beacon interval[2] ++ * octet capability information[2] ++ * information element ++ * octet elemid ++ * octet length ++ * octet information[length] ++ */ ++ ++typedef u_int8_t *ieee80211_mgt_beacon_t; ++ ++#define IEEE80211_BEACON_INTERVAL(beacon) \ ++ ((beacon)[8] | ((beacon)[9] << 8)) ++#define IEEE80211_BEACON_CAPABILITY(beacon) \ ++ ((beacon)[10] | ((beacon)[11] << 8)) ++ ++#define IEEE80211_CAPINFO_ESS 0x0001 ++#define IEEE80211_CAPINFO_IBSS 0x0002 ++#define IEEE80211_CAPINFO_CF_POLLABLE 0x0004 ++#define IEEE80211_CAPINFO_CF_POLLREQ 0x0008 ++#define IEEE80211_CAPINFO_PRIVACY 0x0010 ++#define IEEE80211_CAPINFO_SHORT_PREAMBLE 0x0020 ++#define IEEE80211_CAPINFO_PBCC 0x0040 ++#define IEEE80211_CAPINFO_CHNL_AGILITY 0x0080 ++/* bits 8-9 are reserved */ ++#define IEEE80211_CAPINFO_SHORT_SLOTTIME 0x0400 ++#define IEEE80211_CAPINFO_RSN 0x0800 ++/* bit 12 is reserved */ ++#define IEEE80211_CAPINFO_DSSSOFDM 0x2000 ++/* bits 14-15 are reserved */ ++ ++/* ++ * 802.11i/WPA information element (maximally sized). ++ */ ++struct ieee80211_ie_wpa { ++ u_int8_t wpa_id; /* IEEE80211_ELEMID_VENDOR */ ++ u_int8_t wpa_len; /* length in bytes */ ++ u_int8_t wpa_oui[3]; /* 0x00, 0x50, 0xf2 */ ++ u_int8_t wpa_type; /* OUI type */ ++ u_int16_t wpa_version; /* spec revision */ ++ u_int32_t wpa_mcipher[1]; /* multicast/group key cipher */ ++ u_int16_t wpa_uciphercnt; /* # pairwise key ciphers */ ++ u_int32_t wpa_uciphers[8];/* ciphers */ ++ u_int16_t wpa_authselcnt; /* authentication selector cnt*/ ++ u_int32_t wpa_authsels[8];/* selectors */ ++ u_int16_t wpa_caps; /* 802.11i capabilities */ ++ u_int16_t wpa_pmkidcnt; /* 802.11i pmkid count */ ++ u_int16_t wpa_pmkids[8]; /* 802.11i pmkids */ ++} __packed; ++ ++/* ++ * Management information element payloads. ++ */ ++ ++enum { ++ IEEE80211_ELEMID_SSID = 0, ++ IEEE80211_ELEMID_RATES = 1, ++ IEEE80211_ELEMID_FHPARMS = 2, ++ IEEE80211_ELEMID_DSPARMS = 3, ++ IEEE80211_ELEMID_CFPARMS = 4, ++ IEEE80211_ELEMID_TIM = 5, ++ IEEE80211_ELEMID_IBSSPARMS = 6, ++ IEEE80211_ELEMID_COUNTRY = 7, ++ IEEE80211_ELEMID_CHALLENGE = 16, ++ /* 17-31 reserved for challenge text extension */ ++ IEEE80211_ELEMID_ERP = 42, ++ IEEE80211_ELEMID_RSN = 48, ++ IEEE80211_ELEMID_XRATES = 50, ++ IEEE80211_ELEMID_TPC = 150, ++ IEEE80211_ELEMID_CCKM = 156, ++ IEEE80211_ELEMID_VENDOR = 221 /* vendor private */ ++}; ++ ++struct ieee80211_tim_ie { ++ u_int8_t tim_ie; /* IEEE80211_ELEMID_TIM */ ++ u_int8_t tim_len; ++ u_int8_t tim_count; /* DTIM count */ ++ u_int8_t tim_period; /* DTIM period */ ++ u_int8_t tim_bitctl; /* bitmap control */ ++ u_int8_t tim_bitmap[1]; /* variable-length bitmap */ ++} __packed; ++ ++struct ieee80211_country_ie { ++ u_int8_t ie; /* IEEE80211_ELEMID_COUNTRY */ ++ u_int8_t len; ++ u_int8_t cc[3]; /* ISO CC+(I)ndoor/(O)utdoor */ ++ struct { ++ u_int8_t schan; /* starting channel */ ++ u_int8_t nchan; /* number channels */ ++ u_int8_t maxtxpwr; /* tx power cap */ ++ } band[4] __packed; /* up to 4 sub bands */ ++} __packed; ++ ++#define IEEE80211_CHALLENGE_LEN 128 ++ ++#define IEEE80211_RATE_BASIC 0x80 ++#define IEEE80211_RATE_VAL 0x7f ++ ++/* EPR information element flags */ ++#define IEEE80211_ERP_NON_ERP_PRESENT 0x01 ++#define IEEE80211_ERP_USE_PROTECTION 0x02 ++#define IEEE80211_ERP_LONG_PREAMBLE 0x04 ++ ++/* Atheros private advanced capabilities info */ ++#define ATHEROS_CAP_TURBO_PRIME 0x01 ++#define ATHEROS_CAP_COMPRESSION 0x02 ++#define ATHEROS_CAP_FAST_FRAME 0x04 ++/* bits 3-6 reserved */ ++#define ATHEROS_CAP_BOOST 0x80 ++ ++#define ATH_OUI 0x7f0300 /* Atheros OUI */ ++#define ATH_OUI_TYPE 0x01 ++#define ATH_OUI_VERSION 0x01 ++ ++#define WPA_OUI 0xf25000 ++#define WPA_OUI_TYPE 0x01 ++#define WPA_VERSION 1 /* current supported version */ ++ ++#define WPA_CSE_NULL 0x00 ++#define WPA_CSE_WEP40 0x01 ++#define WPA_CSE_TKIP 0x02 ++#define WPA_CSE_CCMP 0x04 ++#define WPA_CSE_WEP104 0x05 ++ ++#define WPA_ASE_NONE 0x00 ++#define WPA_ASE_8021X_UNSPEC 0x01 ++#define WPA_ASE_8021X_PSK 0x02 ++ ++#define RSN_OUI 0xac0f00 ++#define RSN_VERSION 1 /* current supported version */ ++ ++#define RSN_CSE_NULL 0x00 ++#define RSN_CSE_WEP40 0x01 ++#define RSN_CSE_TKIP 0x02 ++#define RSN_CSE_WRAP 0x03 ++#define RSN_CSE_CCMP 0x04 ++#define RSN_CSE_WEP104 0x05 ++ ++#define RSN_ASE_NONE 0x00 ++#define RSN_ASE_8021X_UNSPEC 0x01 ++#define RSN_ASE_8021X_PSK 0x02 ++ ++#define RSN_CAP_PREAUTH 0x01 ++ ++#define WME_OUI 0xf25000 ++#define WME_OUI_TYPE 0x02 ++#define WME_INFO_OUI_SUBTYPE 0x00 ++#define WME_PARAM_OUI_SUBTYPE 0x01 ++#define WME_VERSION 1 ++ ++/* WME stream classes */ ++#define WME_AC_BE 0 /* best effort */ ++#define WME_AC_BK 1 /* background */ ++#define WME_AC_VI 2 /* video */ ++#define WME_AC_VO 3 /* voice */ ++ ++/* ++ * AUTH management packets ++ * ++ * octet algo[2] ++ * octet seq[2] ++ * octet status[2] ++ * octet chal.id ++ * octet chal.length ++ * octet chal.text[253] ++ */ ++ ++typedef u_int8_t *ieee80211_mgt_auth_t; ++ ++#define IEEE80211_AUTH_ALGORITHM(auth) \ ++ ((auth)[0] | ((auth)[1] << 8)) ++#define IEEE80211_AUTH_TRANSACTION(auth) \ ++ ((auth)[2] | ((auth)[3] << 8)) ++#define IEEE80211_AUTH_STATUS(auth) \ ++ ((auth)[4] | ((auth)[5] << 8)) ++ ++#define IEEE80211_AUTH_ALG_OPEN 0x0000 ++#define IEEE80211_AUTH_ALG_SHARED 0x0001 ++#define IEEE80211_AUTH_ALG_LEAP 0x0080 ++ ++enum { ++ IEEE80211_AUTH_OPEN_REQUEST = 1, ++ IEEE80211_AUTH_OPEN_RESPONSE = 2 ++}; ++ ++enum { ++ IEEE80211_AUTH_SHARED_REQUEST = 1, ++ IEEE80211_AUTH_SHARED_CHALLENGE = 2, ++ IEEE80211_AUTH_SHARED_RESPONSE = 3, ++ IEEE80211_AUTH_SHARED_PASS = 4 ++}; ++ ++/* ++ * Reason codes ++ * ++ * Unlisted codes are reserved ++ */ ++ ++enum { ++ IEEE80211_REASON_UNSPECIFIED = 1, ++ IEEE80211_REASON_AUTH_EXPIRE = 2, ++ IEEE80211_REASON_AUTH_LEAVE = 3, ++ IEEE80211_REASON_ASSOC_EXPIRE = 4, ++ IEEE80211_REASON_ASSOC_TOOMANY = 5, ++ IEEE80211_REASON_NOT_AUTHED = 6, ++ IEEE80211_REASON_NOT_ASSOCED = 7, ++ IEEE80211_REASON_ASSOC_LEAVE = 8, ++ IEEE80211_REASON_ASSOC_NOT_AUTHED = 9, ++ ++ IEEE80211_REASON_RSN_REQUIRED = 11, ++ IEEE80211_REASON_RSN_INCONSISTENT = 12, ++ IEEE80211_REASON_IE_INVALID = 13, ++ IEEE80211_REASON_MIC_FAILURE = 14, ++ ++ IEEE80211_STATUS_SUCCESS = 0, ++ IEEE80211_STATUS_UNSPECIFIED = 1, ++ IEEE80211_STATUS_CAPINFO = 10, ++ IEEE80211_STATUS_NOT_ASSOCED = 11, ++ IEEE80211_STATUS_OTHER = 12, ++ IEEE80211_STATUS_ALG = 13, ++ IEEE80211_STATUS_SEQUENCE = 14, ++ IEEE80211_STATUS_CHALLENGE = 15, ++ IEEE80211_STATUS_TIMEOUT = 16, ++ IEEE80211_STATUS_TOOMANY = 17, ++ IEEE80211_STATUS_BASIC_RATE = 18, ++ IEEE80211_STATUS_SP_REQUIRED = 19, ++ IEEE80211_STATUS_PBCC_REQUIRED = 20, ++ IEEE80211_STATUS_CA_REQUIRED = 21, ++ IEEE80211_STATUS_TOO_MANY_STATIONS = 22, ++ IEEE80211_STATUS_RATES = 23, ++ IEEE80211_STATUS_SHORTSLOT_REQUIRED = 25, ++ IEEE80211_STATUS_DSSSOFDM_REQUIRED = 26 ++}; ++ ++#define IEEE80211_WEP_KEYLEN 5 /* 40bit */ ++#define IEEE80211_WEP_IVLEN 3 /* 24bit */ ++#define IEEE80211_WEP_KIDLEN 1 /* 1 octet */ ++#define IEEE80211_WEP_CRCLEN 4 /* CRC-32 */ ++#define IEEE80211_WEP_NKID 4 /* number of key ids */ ++ ++/* ++ * 802.11i defines an extended IV for use with non-WEP ciphers. ++ * When the EXTIV bit is set in the key id byte an additional ++ * 4 bytes immediately follow the IV for TKIP. For CCMP the ++ * EXTIV bit is likewise set but the 8 bytes represent the ++ * CCMP header rather than IV+extended-IV. ++ */ ++#define IEEE80211_WEP_EXTIV 0x20 ++#define IEEE80211_WEP_EXTIVLEN 4 /* extended IV length */ ++#define IEEE80211_WEP_MICLEN 8 /* trailing MIC */ ++ ++#define IEEE80211_CRC_LEN 4 ++ ++/* ++ * Maximum acceptable MTU is: ++ * IEEE80211_MAX_LEN - WEP overhead - CRC - ++ * QoS overhead - RSN/WPA overhead ++ * Min is arbitrarily chosen > IEEE80211_MIN_LEN. The default ++ * mtu is Ethernet-compatible; it's set by ether_ifattach. ++ */ ++#define IEEE80211_MTU_MAX 2290 ++#define IEEE80211_MTU_MIN 32 ++ ++#define IEEE80211_MAX_LEN (2300 + IEEE80211_CRC_LEN + \ ++ (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + IEEE80211_WEP_CRCLEN)) ++#define IEEE80211_ACK_LEN \ ++ (sizeof(struct ieee80211_frame_ack) + IEEE80211_CRC_LEN) ++#define IEEE80211_MIN_LEN \ ++ (sizeof(struct ieee80211_frame_min) + IEEE80211_CRC_LEN) ++ ++/* ++ * The 802.11 spec says at most 2007 stations may be ++ * associated at once. For most AP's this is way more ++ * than is feasible so we use a default of 128. This ++ * number may be overridden by the driver and/or by ++ * user configuration. ++ */ ++#define IEEE80211_AID_MAX 2007 ++#define IEEE80211_AID_DEF 128 ++ ++#define IEEE80211_AID(b) ((b) &~ 0xc000) ++ ++/* ++ * RTS frame length parameters. The default is specified in ++ * the 802.11 spec. The max may be wrong for jumbo frames. ++ */ ++#define IEEE80211_RTS_DEFAULT 512 ++#define IEEE80211_RTS_MIN 1 ++#define IEEE80211_RTS_MAX IEEE80211_MAX_LEN ++ ++#endif /* _NET80211_IEEE80211_H_ */ +diff -Nru wpa_supplicant.orig/driver_madwifi/net80211/ieee80211_ioctl.h wpa_supplicant/driver_madwifi/net80211/ieee80211_ioctl.h +--- wpa_supplicant.orig/driver_madwifi/net80211/ieee80211_ioctl.h 1970-01-01 10:00:00.000000000 +1000 ++++ wpa_supplicant/driver_madwifi/net80211/ieee80211_ioctl.h 2005-10-20 01:46:20.000000000 +1000 +@@ -0,0 +1,514 @@ ++/* $NetBSD: ieee80211_ioctl.h,v 1.5 2003/10/13 04:16:59 dyoung Exp $ */ ++/*- ++ * Copyright (c) 2001 Atsushi Onoe ++ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The name of the author may not be used to endorse or promote products ++ * derived from this software without specific prior written permission. ++ * ++ * Alternatively, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2 as published by the Free ++ * Software Foundation. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ * ++ * $FreeBSD: src/sys/net80211/ieee80211_ioctl.h,v 1.8 2004/12/31 22:42:38 sam Exp $ ++ */ ++#ifndef _NET80211_IEEE80211_IOCTL_H_ ++#define _NET80211_IEEE80211_IOCTL_H_ ++ ++#include ++ ++/* ++ * IEEE 802.11 ioctls. ++ */ ++ ++/* ++ * Per/node (station) statistics available when operating as an AP. ++ */ ++struct ieee80211_nodestats { ++ u_int32_t ns_rx_data; /* rx data frames */ ++ u_int32_t ns_rx_mgmt; /* rx management frames */ ++ u_int32_t ns_rx_ctrl; /* rx control frames */ ++ u_int32_t ns_rx_ucast; /* rx unicast frames */ ++ u_int32_t ns_rx_mcast; /* rx multi/broadcast frames */ ++ u_int64_t ns_rx_bytes; /* rx data count (bytes) */ ++ u_int64_t ns_rx_beacons; /* rx beacon frames */ ++ u_int32_t ns_rx_proberesp; /* rx probe response frames */ ++ ++ u_int32_t ns_rx_dup; /* rx discard 'cuz dup */ ++ u_int32_t ns_rx_noprivacy; /* rx w/ wep but privacy off */ ++ u_int32_t ns_rx_wepfail; /* rx wep processing failed */ ++ u_int32_t ns_rx_demicfail; /* rx demic failed */ ++ u_int32_t ns_rx_decap; /* rx decapsulation failed */ ++ u_int32_t ns_rx_defrag; /* rx defragmentation failed */ ++ u_int32_t ns_rx_disassoc; /* rx disassociation */ ++ u_int32_t ns_rx_deauth; /* rx deauthentication */ ++ u_int32_t ns_rx_decryptcrc; /* rx decrypt failed on crc */ ++ u_int32_t ns_rx_unauth; /* rx on unauthorized port */ ++ u_int32_t ns_rx_unencrypted; /* rx unecrypted w/ privacy */ ++ ++ u_int32_t ns_tx_data; /* tx data frames */ ++ u_int32_t ns_tx_mgmt; /* tx management frames */ ++ u_int32_t ns_tx_ucast; /* tx unicast frames */ ++ u_int32_t ns_tx_mcast; /* tx multi/broadcast frames */ ++ u_int64_t ns_tx_bytes; /* tx data count (bytes) */ ++ u_int32_t ns_tx_probereq; /* tx probe request frames */ ++ ++ u_int32_t ns_tx_novlantag; /* tx discard 'cuz no tag */ ++ u_int32_t ns_tx_vlanmismatch; /* tx discard 'cuz bad tag */ ++ ++ u_int32_t ns_ps_discard; /* ps discard 'cuz of age */ ++ ++ /* MIB-related state */ ++ u_int32_t ns_tx_assoc; /* [re]associations */ ++ u_int32_t ns_tx_assoc_fail; /* [re]association failures */ ++ u_int32_t ns_tx_auth; /* [re]authentications */ ++ u_int32_t ns_tx_auth_fail; /* [re]authentication failures*/ ++ u_int32_t ns_tx_deauth; /* deauthentications */ ++ u_int32_t ns_tx_deauth_code; /* last deauth reason */ ++ u_int32_t ns_tx_disassoc; /* disassociations */ ++ u_int32_t ns_tx_disassoc_code; /* last disassociation reason */ ++}; ++ ++/* ++ * Summary statistics. ++ */ ++struct ieee80211_stats { ++ u_int32_t is_rx_badversion; /* rx frame with bad version */ ++ u_int32_t is_rx_tooshort; /* rx frame too short */ ++ u_int32_t is_rx_wrongbss; /* rx from wrong bssid */ ++ u_int32_t is_rx_dup; /* rx discard 'cuz dup */ ++ u_int32_t is_rx_wrongdir; /* rx w/ wrong direction */ ++ u_int32_t is_rx_mcastecho; /* rx discard 'cuz mcast echo */ ++ u_int32_t is_rx_notassoc; /* rx discard 'cuz sta !assoc */ ++ u_int32_t is_rx_noprivacy; /* rx w/ wep but privacy off */ ++ u_int32_t is_rx_unencrypted; /* rx w/o wep and privacy on */ ++ u_int32_t is_rx_wepfail; /* rx wep processing failed */ ++ u_int32_t is_rx_decap; /* rx decapsulation failed */ ++ u_int32_t is_rx_mgtdiscard; /* rx discard mgt frames */ ++ u_int32_t is_rx_ctl; /* rx discard ctrl frames */ ++ u_int32_t is_rx_beacon; /* rx beacon frames */ ++ u_int32_t is_rx_rstoobig; /* rx rate set truncated */ ++ u_int32_t is_rx_elem_missing; /* rx required element missing*/ ++ u_int32_t is_rx_elem_toobig; /* rx element too big */ ++ u_int32_t is_rx_elem_toosmall; /* rx element too small */ ++ u_int32_t is_rx_elem_unknown; /* rx element unknown */ ++ u_int32_t is_rx_badchan; /* rx frame w/ invalid chan */ ++ u_int32_t is_rx_chanmismatch; /* rx frame chan mismatch */ ++ u_int32_t is_rx_nodealloc; /* rx frame dropped */ ++ u_int32_t is_rx_ssidmismatch; /* rx frame ssid mismatch */ ++ u_int32_t is_rx_auth_unsupported; /* rx w/ unsupported auth alg */ ++ u_int32_t is_rx_auth_fail; /* rx sta auth failure */ ++ u_int32_t is_rx_auth_countermeasures;/* rx auth discard 'cuz CM */ ++ u_int32_t is_rx_assoc_bss; /* rx assoc from wrong bssid */ ++ u_int32_t is_rx_assoc_notauth; /* rx assoc w/o auth */ ++ u_int32_t is_rx_assoc_capmismatch;/* rx assoc w/ cap mismatch */ ++ u_int32_t is_rx_assoc_norate; /* rx assoc w/ no rate match */ ++ u_int32_t is_rx_assoc_badwpaie; /* rx assoc w/ bad WPA IE */ ++ u_int32_t is_rx_deauth; /* rx deauthentication */ ++ u_int32_t is_rx_disassoc; /* rx disassociation */ ++ u_int32_t is_rx_badsubtype; /* rx frame w/ unknown subtype*/ ++ u_int32_t is_rx_nobuf; /* rx failed for lack of buf */ ++ u_int32_t is_rx_decryptcrc; /* rx decrypt failed on crc */ ++ u_int32_t is_rx_ahdemo_mgt; /* rx discard ahdemo mgt frame*/ ++ u_int32_t is_rx_bad_auth; /* rx bad auth request */ ++ u_int32_t is_rx_unauth; /* rx on unauthorized port */ ++ u_int32_t is_rx_badkeyid; /* rx w/ incorrect keyid */ ++ u_int32_t is_rx_ccmpreplay; /* rx seq# violation (CCMP) */ ++ u_int32_t is_rx_ccmpformat; /* rx format bad (CCMP) */ ++ u_int32_t is_rx_ccmpmic; /* rx MIC check failed (CCMP) */ ++ u_int32_t is_rx_tkipreplay; /* rx seq# violation (TKIP) */ ++ u_int32_t is_rx_tkipformat; /* rx format bad (TKIP) */ ++ u_int32_t is_rx_tkipmic; /* rx MIC check failed (TKIP) */ ++ u_int32_t is_rx_tkipicv; /* rx ICV check failed (TKIP) */ ++ u_int32_t is_rx_badcipher; /* rx failed 'cuz key type */ ++ u_int32_t is_rx_nocipherctx; /* rx failed 'cuz key !setup */ ++ u_int32_t is_rx_acl; /* rx discard 'cuz acl policy */ ++ u_int32_t is_tx_nobuf; /* tx failed for lack of buf */ ++ u_int32_t is_tx_nonode; /* tx failed for no node */ ++ u_int32_t is_tx_unknownmgt; /* tx of unknown mgt frame */ ++ u_int32_t is_tx_badcipher; /* tx failed 'cuz key type */ ++ u_int32_t is_tx_nodefkey; /* tx failed 'cuz no defkey */ ++ u_int32_t is_tx_noheadroom; /* tx failed 'cuz no space */ ++ u_int32_t is_scan_active; /* active scans started */ ++ u_int32_t is_scan_passive; /* passive scans started */ ++ u_int32_t is_node_timeout; /* nodes timed out inactivity */ ++ u_int32_t is_crypto_nomem; /* no memory for crypto ctx */ ++ u_int32_t is_crypto_tkip; /* tkip crypto done in s/w */ ++ u_int32_t is_crypto_tkipenmic; /* tkip en-MIC done in s/w */ ++ u_int32_t is_crypto_tkipdemic; /* tkip de-MIC done in s/w */ ++ u_int32_t is_crypto_tkipcm; /* tkip counter measures */ ++ u_int32_t is_crypto_ccmp; /* ccmp crypto done in s/w */ ++ u_int32_t is_crypto_wep; /* wep crypto done in s/w */ ++ u_int32_t is_crypto_setkey_cipher;/* cipher rejected key */ ++ u_int32_t is_crypto_setkey_nokey; /* no key index for setkey */ ++ u_int32_t is_crypto_delkey; /* driver key delete failed */ ++ u_int32_t is_crypto_badcipher; /* unknown cipher */ ++ u_int32_t is_crypto_nocipher; /* cipher not available */ ++ u_int32_t is_crypto_attachfail; /* cipher attach failed */ ++ u_int32_t is_crypto_swfallback; /* cipher fallback to s/w */ ++ u_int32_t is_crypto_keyfail; /* driver key alloc failed */ ++ u_int32_t is_crypto_enmicfail; /* en-MIC failed */ ++ u_int32_t is_ibss_capmismatch; /* merge failed-cap mismatch */ ++ u_int32_t is_ibss_norate; /* merge failed-rate mismatch */ ++ u_int32_t is_ps_unassoc; /* ps-poll for unassoc. sta */ ++ u_int32_t is_ps_badaid; /* ps-poll w/ incorrect aid */ ++ u_int32_t is_ps_qempty; /* ps-poll w/ nothing to send */ ++}; ++ ++/* ++ * Max size of optional information elements. We artificially ++ * constrain this; it's limited only by the max frame size (and ++ * the max parameter size of the wireless extensions). ++ */ ++#define IEEE80211_MAX_OPT_IE 256 ++ ++/* ++ * WPA/RSN get/set key request. Specify the key/cipher ++ * type and whether the key is to be used for sending and/or ++ * receiving. The key index should be set only when working ++ * with global keys (use IEEE80211_KEYIX_NONE for ``no index''). ++ * Otherwise a unicast/pairwise key is specified by the bssid ++ * (on a station) or mac address (on an ap). They key length ++ * must include any MIC key data; otherwise it should be no ++ more than IEEE80211_KEYBUF_SIZE. ++ */ ++struct ieee80211req_key { ++ u_int8_t ik_type; /* key/cipher type */ ++ u_int8_t ik_pad; ++ u_int16_t ik_keyix; /* key index */ ++ u_int8_t ik_keylen; /* key length in bytes */ ++ u_int8_t ik_flags; ++/* NB: IEEE80211_KEY_XMIT and IEEE80211_KEY_RECV defined elsewhere */ ++#define IEEE80211_KEY_DEFAULT 0x80 /* default xmit key */ ++ u_int8_t ik_macaddr[IEEE80211_ADDR_LEN]; ++ u_int64_t ik_keyrsc; /* key receive sequence counter */ ++ u_int64_t ik_keytsc; /* key transmit sequence counter */ ++ u_int8_t ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE]; ++}; ++ ++/* ++ * Delete a key either by index or address. Set the index ++ * to IEEE80211_KEYIX_NONE when deleting a unicast key. ++ */ ++struct ieee80211req_del_key { ++ u_int8_t idk_keyix; /* key index */ ++ u_int8_t idk_macaddr[IEEE80211_ADDR_LEN]; ++}; ++ ++/* ++ * MLME state manipulation request. IEEE80211_MLME_ASSOC ++ * only makes sense when operating as a station. The other ++ * requests can be used when operating as a station or an ++ * ap (to effect a station). ++ */ ++struct ieee80211req_mlme { ++ u_int8_t im_op; /* operation to perform */ ++#define IEEE80211_MLME_ASSOC 1 /* associate station */ ++#define IEEE80211_MLME_DISASSOC 2 /* disassociate station */ ++#define IEEE80211_MLME_DEAUTH 3 /* deauthenticate station */ ++#define IEEE80211_MLME_AUTHORIZE 4 /* authorize station */ ++#define IEEE80211_MLME_UNAUTHORIZE 5 /* unauthorize station */ ++#define IEEE80211_MLME_CLEAR_STATS 6 /* clear station statistic */ ++ u_int8_t im_ssid_len; /* length of optional ssid */ ++ u_int16_t im_reason; /* 802.11 reason code */ ++ u_int8_t im_macaddr[IEEE80211_ADDR_LEN]; ++ u_int8_t im_ssid[IEEE80211_NWID_LEN]; ++}; ++ ++/* ++ * MAC ACL operations. ++ */ ++enum { ++ IEEE80211_MACCMD_POLICY_OPEN = 0, /* set policy: no ACL's */ ++ IEEE80211_MACCMD_POLICY_ALLOW = 1, /* set policy: allow traffic */ ++ IEEE80211_MACCMD_POLICY_DENY = 2, /* set policy: deny traffic */ ++ IEEE80211_MACCMD_FLUSH = 3, /* flush ACL database */ ++ IEEE80211_MACCMD_DETACH = 4 /* detach ACL policy */ ++}; ++ ++/* ++ * Set the active channel list. Note this list is ++ * intersected with the available channel list in ++ * calculating the set of channels actually used in ++ * scanning. ++ */ ++struct ieee80211req_chanlist { ++ u_int8_t ic_channels[IEEE80211_CHAN_BYTES]; ++}; ++ ++/* ++ * Get the active channel list info. ++ */ ++struct ieee80211req_chaninfo { ++ u_int ic_nchans; ++ struct ieee80211_channel ic_chans[IEEE80211_CHAN_MAX]; ++}; ++ ++/* ++ * Retrieve the WPA/RSN information element for an associated station. ++ */ ++struct ieee80211req_wpaie { ++ u_int8_t wpa_macaddr[IEEE80211_ADDR_LEN]; ++ u_int8_t wpa_ie[IEEE80211_MAX_OPT_IE]; ++}; ++ ++/* ++ * Retrieve per-node statistics. ++ */ ++struct ieee80211req_sta_stats { ++ union { ++ /* NB: explicitly force 64-bit alignment */ ++ u_int8_t macaddr[IEEE80211_ADDR_LEN]; ++ u_int64_t pad; ++ } is_u; ++ struct ieee80211_nodestats is_stats; ++}; ++ ++/* ++ * Station information block; the mac address is used ++ * to retrieve other data like stats, unicast key, etc. ++ */ ++struct ieee80211req_sta_info { ++ u_int16_t isi_len; /* length (mult of 4) */ ++ u_int16_t isi_freq; /* MHz */ ++ u_int16_t isi_flags; /* channel flags */ ++ u_int16_t isi_state; /* state flags */ ++ u_int8_t isi_authmode; /* authentication algorithm */ ++ u_int8_t isi_rssi; ++ u_int8_t isi_capinfo; /* capabilities */ ++ u_int8_t isi_erp; /* ERP element */ ++ u_int8_t isi_macaddr[IEEE80211_ADDR_LEN]; ++ u_int8_t isi_nrates; ++ /* negotiated rates */ ++ u_int8_t isi_rates[IEEE80211_RATE_MAXSIZE]; ++ u_int8_t isi_txrate; /* index to isi_rates[] */ ++ u_int16_t isi_ie_len; /* IE length */ ++ u_int16_t isi_associd; /* assoc response */ ++ u_int16_t isi_txpower; /* current tx power */ ++ u_int16_t isi_vlan; /* vlan tag */ ++ u_int16_t isi_txseqs[17]; /* seq to be transmitted */ ++ u_int16_t isi_rxseqs[17]; /* seq previous for qos frames*/ ++ u_int16_t isi_inact; /* inactivity timer */ ++ /* XXX frag state? */ ++ /* variable length IE data */ ++}; ++ ++/* ++ * Retrieve per-station information; to retrieve all ++ * specify a mac address of ff:ff:ff:ff:ff:ff. ++ */ ++struct ieee80211req_sta_req { ++ union { ++ /* NB: explicitly force 64-bit alignment */ ++ u_int8_t macaddr[IEEE80211_ADDR_LEN]; ++ u_int64_t pad; ++ } is_u; ++ struct ieee80211req_sta_info info[1]; /* variable length */ ++}; ++ ++/* ++ * Get/set per-station tx power cap. ++ */ ++struct ieee80211req_sta_txpow { ++ u_int8_t it_macaddr[IEEE80211_ADDR_LEN]; ++ u_int8_t it_txpow; ++}; ++ ++/* ++ * WME parameters are set and return using i_val and i_len. ++ * i_val holds the value itself. i_len specifies the AC ++ * and, as appropriate, then high bit specifies whether the ++ * operation is to be applied to the BSS or ourself. ++ */ ++#define IEEE80211_WMEPARAM_SELF 0x0000 /* parameter applies to self */ ++#define IEEE80211_WMEPARAM_BSS 0x8000 /* parameter applies to BSS */ ++#define IEEE80211_WMEPARAM_VAL 0x7fff /* parameter value */ ++ ++#ifdef __FreeBSD__ ++/* ++ * FreeBSD-style ioctls. ++ */ ++/* the first member must be matched with struct ifreq */ ++struct ieee80211req { ++ char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */ ++ u_int16_t i_type; /* req type */ ++ int16_t i_val; /* Index or simple value */ ++ int16_t i_len; /* Index or simple value */ ++ void *i_data; /* Extra data */ ++}; ++#define SIOCS80211 _IOW('i', 234, struct ieee80211req) ++#define SIOCG80211 _IOWR('i', 235, struct ieee80211req) ++ ++#define IEEE80211_IOC_SSID 1 ++#define IEEE80211_IOC_NUMSSIDS 2 ++#define IEEE80211_IOC_WEP 3 ++#define IEEE80211_WEP_NOSUP -1 ++#define IEEE80211_WEP_OFF 0 ++#define IEEE80211_WEP_ON 1 ++#define IEEE80211_WEP_MIXED 2 ++#define IEEE80211_IOC_WEPKEY 4 ++#define IEEE80211_IOC_NUMWEPKEYS 5 ++#define IEEE80211_IOC_WEPTXKEY 6 ++#define IEEE80211_IOC_AUTHMODE 7 ++#define IEEE80211_IOC_STATIONNAME 8 ++#define IEEE80211_IOC_CHANNEL 9 ++#define IEEE80211_IOC_POWERSAVE 10 ++#define IEEE80211_POWERSAVE_NOSUP -1 ++#define IEEE80211_POWERSAVE_OFF 0 ++#define IEEE80211_POWERSAVE_CAM 1 ++#define IEEE80211_POWERSAVE_PSP 2 ++#define IEEE80211_POWERSAVE_PSP_CAM 3 ++#define IEEE80211_POWERSAVE_ON IEEE80211_POWERSAVE_CAM ++#define IEEE80211_IOC_POWERSAVESLEEP 11 ++#define IEEE80211_IOC_RTSTHRESHOLD 12 ++#define IEEE80211_IOC_PROTMODE 13 ++#define IEEE80211_PROTMODE_OFF 0 ++#define IEEE80211_PROTMODE_CTS 1 ++#define IEEE80211_PROTMODE_RTSCTS 2 ++#define IEEE80211_IOC_TXPOWER 14 /* global tx power limit */ ++#define IEEE80211_IOC_BSSID 15 ++#define IEEE80211_IOC_ROAMING 16 /* roaming mode */ ++#define IEEE80211_IOC_PRIVACY 17 /* privacy invoked */ ++#define IEEE80211_IOC_DROPUNENCRYPTED 18 /* discard unencrypted frames */ ++#define IEEE80211_IOC_WPAKEY 19 ++#define IEEE80211_IOC_DELKEY 20 ++#define IEEE80211_IOC_MLME 21 ++#define IEEE80211_IOC_OPTIE 22 /* optional info. element */ ++#define IEEE80211_IOC_SCAN_REQ 23 ++#define IEEE80211_IOC_SCAN_RESULTS 24 ++#define IEEE80211_IOC_COUNTERMEASURES 25 /* WPA/TKIP countermeasures */ ++#define IEEE80211_IOC_WPA 26 /* WPA mode (0,1,2) */ ++#define IEEE80211_IOC_CHANLIST 27 /* channel list */ ++#define IEEE80211_IOC_WME 28 /* WME mode (on, off) */ ++#define IEEE80211_IOC_HIDESSID 29 /* hide SSID mode (on, off) */ ++#define IEEE80211_IOC_APBRIDGE 30 /* AP inter-sta bridging */ ++#define IEEE80211_IOC_MCASTCIPHER 31 /* multicast/default cipher */ ++#define IEEE80211_IOC_MCASTKEYLEN 32 /* multicast key length */ ++#define IEEE80211_IOC_UCASTCIPHERS 33 /* unicast cipher suites */ ++#define IEEE80211_IOC_UCASTCIPHER 34 /* unicast cipher */ ++#define IEEE80211_IOC_UCASTKEYLEN 35 /* unicast key length */ ++#define IEEE80211_IOC_DRIVER_CAPS 36 /* driver capabilities */ ++#define IEEE80211_IOC_KEYMGTALGS 37 /* key management algorithms */ ++#define IEEE80211_IOC_RSNCAPS 38 /* RSN capabilities */ ++#define IEEE80211_IOC_WPAIE 39 /* WPA information element */ ++#define IEEE80211_IOC_STA_STATS 40 /* per-station statistics */ ++#define IEEE80211_IOC_MACCMD 41 /* MAC ACL operation */ ++#define IEEE80211_IOC_CHANINFO 42 /* channel info list */ ++#define IEEE80211_IOC_TXPOWMAX 43 /* max tx power for channel */ ++#define IEEE80211_IOC_STA_TXPOW 44 /* per-station tx power limit */ ++#define IEEE80211_IOC_STA_INFO 45 /* station/neighbor info */ ++#define IEEE80211_IOC_WME_CWMIN 46 /* WME: ECWmin */ ++#define IEEE80211_IOC_WME_CWMAX 47 /* WME: ECWmax */ ++#define IEEE80211_IOC_WME_AIFS 48 /* WME: AIFSN */ ++#define IEEE80211_IOC_WME_TXOPLIMIT 49 /* WME: txops limit */ ++#define IEEE80211_IOC_WME_ACM 50 /* WME: ACM (bss only) */ ++#define IEEE80211_IOC_WME_ACKPOLICY 51 /* WME: ACK policy (!bss only)*/ ++#define IEEE80211_IOC_DTIM_PERIOD 52 /* DTIM period (beacons) */ ++#define IEEE80211_IOC_BEACON_INTERVAL 53 /* beacon interval (ms) */ ++#define IEEE80211_IOC_ADDMAC 54 /* add sta to MAC ACL table */ ++#define IEEE80211_IOC_DELMAC 55 /* del sta from MAC ACL table */ ++ ++/* ++ * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS. ++ */ ++struct ieee80211req_scan_result { ++ u_int16_t isr_len; /* length (mult of 4) */ ++ u_int16_t isr_freq; /* MHz */ ++ u_int16_t isr_flags; /* channel flags */ ++ u_int8_t isr_noise; ++ u_int8_t isr_rssi; ++ u_int8_t isr_intval; /* beacon interval */ ++ u_int8_t isr_capinfo; /* capabilities */ ++ u_int8_t isr_erp; /* ERP element */ ++ u_int8_t isr_bssid[IEEE80211_ADDR_LEN]; ++ u_int8_t isr_nrates; ++ u_int8_t isr_rates[IEEE80211_RATE_MAXSIZE]; ++ u_int8_t isr_ssid_len; /* SSID length */ ++ u_int8_t isr_ie_len; /* IE length */ ++ u_int8_t isr_pad[5]; ++ /* variable length SSID followed by IE data */ ++}; ++ ++#define SIOCG80211STATS _IOWR('i', 236, struct ifreq) ++#endif /* __FreeBSD__ */ ++ ++#ifdef __linux__ ++/* ++ * Wireless Extensions API, private ioctl interfaces. ++ * ++ * NB: Even-numbered ioctl numbers have set semantics and are privileged! ++ * (regardless of the incorrect comment in wireless.h!) ++ */ ++#define IEEE80211_IOCTL_SETPARAM (SIOCIWFIRSTPRIV+0) ++#define IEEE80211_IOCTL_GETPARAM (SIOCIWFIRSTPRIV+1) ++#define IEEE80211_IOCTL_SETKEY (SIOCIWFIRSTPRIV+2) ++#define IEEE80211_IOCTL_DELKEY (SIOCIWFIRSTPRIV+4) ++#define IEEE80211_IOCTL_SETMLME (SIOCIWFIRSTPRIV+6) ++#define IEEE80211_IOCTL_SETOPTIE (SIOCIWFIRSTPRIV+8) ++#define IEEE80211_IOCTL_GETOPTIE (SIOCIWFIRSTPRIV+9) ++#define IEEE80211_IOCTL_ADDMAC (SIOCIWFIRSTPRIV+10) ++#define IEEE80211_IOCTL_DELMAC (SIOCIWFIRSTPRIV+12) ++#define IEEE80211_IOCTL_CHANLIST (SIOCIWFIRSTPRIV+14) ++#define IEEE80211_IOCTL_WDSADD (SIOCIWFIRSTPRIV+16) ++#define IEEE80211_IOCTL_WDSDEL (SIOCIWFIRSTPRIV+18) ++ ++enum { ++ IEEE80211_PARAM_TURBO = 1, /* turbo mode */ ++ IEEE80211_PARAM_MODE = 2, /* phy mode (11a, 11b, etc.) */ ++ IEEE80211_PARAM_AUTHMODE = 3, /* authentication mode */ ++ IEEE80211_PARAM_PROTMODE = 4, /* 802.11g protection */ ++ IEEE80211_PARAM_MCASTCIPHER = 5, /* multicast/default cipher */ ++ IEEE80211_PARAM_MCASTKEYLEN = 6, /* multicast key length */ ++ IEEE80211_PARAM_UCASTCIPHERS = 7, /* unicast cipher suites */ ++ IEEE80211_PARAM_UCASTCIPHER = 8, /* unicast cipher */ ++ IEEE80211_PARAM_UCASTKEYLEN = 9, /* unicast key length */ ++ IEEE80211_PARAM_WPA = 10, /* WPA mode (0,1,2) */ ++ IEEE80211_PARAM_ROAMING = 12, /* roaming mode */ ++ IEEE80211_PARAM_PRIVACY = 13, /* privacy invoked */ ++ IEEE80211_PARAM_COUNTERMEASURES = 14, /* WPA/TKIP countermeasures */ ++ IEEE80211_PARAM_DROPUNENCRYPTED = 15, /* discard unencrypted frames */ ++ IEEE80211_PARAM_DRIVER_CAPS = 16, /* driver capabilities */ ++ IEEE80211_PARAM_MACCMD = 17, /* MAC ACL operation */ ++ IEEE80211_PARAM_WME = 18, /* WME mode (on, off) */ ++ IEEE80211_PARAM_HIDESSID = 19, /* hide SSID mode (on, off) */ ++ IEEE80211_PARAM_APBRIDGE = 20, /* AP inter-sta bridging */ ++ IEEE80211_PARAM_KEYMGTALGS = 21, /* key management algorithms */ ++ IEEE80211_PARAM_RSNCAPS = 22, /* RSN capabilities */ ++ IEEE80211_PARAM_INACT = 23, /* station inactivity timeout */ ++ IEEE80211_PARAM_INACT_AUTH = 24, /* station auth inact timeout */ ++ IEEE80211_PARAM_INACT_INIT = 25, /* station init inact timeout */ ++ IEEE80211_PARAM_IBSS = 26, /* pseudo ad-hoc mode or standard IBSS mode */ ++ IEEE80211_PARAM_PUREG = 27, /* pure or mixed G */ ++ IEEE80211_PARAM_WDSONLY = 28, /* only wds traffic allowed */ ++ IEEE80211_PARAM_RESET = 99 /* reset the device */ ++}; ++ ++#define SIOCG80211STATS (SIOCDEVPRIVATE+2) ++/* NB: require in+out parameters so cannot use wireless extensions, yech */ ++#define IEEE80211_IOCTL_GETKEY (SIOCDEVPRIVATE+3) ++#define IEEE80211_IOCTL_GETWPAIE (SIOCDEVPRIVATE+4) ++#define IEEE80211_IOCTL_GETSTASTATS (SIOCDEVPRIVATE+5) ++ ++#endif /* __linux__ */ ++ ++#endif /* _NET80211_IEEE80211_IOCTL_H_ */ --- wpasupplicant-0.6.0+0.5.8.orig/debian/patches/02_debian_doc_examples.dpatch +++ wpasupplicant-0.6.0+0.5.8/debian/patches/02_debian_doc_examples.dpatch @@ -0,0 +1,21 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 02_debian_doc_examples.patch by Kel Modderman +## +## DP: Add Debian specific path to docs and examples to wpa_supplicant.conf(8) + +@DPATCH@ +diff -Nrup wpa_supplicant-0.5.5.orig/doc/docbook/wpa_supplicant.conf.5 wpa_supplicant-0.5.5/doc/docbook/wpa_supplicant.conf.5 +--- wpa_supplicant-0.5.5.orig/doc/docbook/wpa_supplicant.conf.5 2006-08-28 14:19:12.000000000 +1000 ++++ wpa_supplicant-0.5.5/doc/docbook/wpa_supplicant.conf.5 2006-11-07 16:09:32.000000000 +1000 +@@ -16,6 +16,11 @@ probably in \fB/usr/share/doc/wpa_suppli + detailed information about the configuration format and supported + fields. + .PP ++On Debian systems example configuration files are located at ++\fB/usr/share/doc/wpasupplicant/examples/\fR. Use ++\fB/usr/share/doc/wpasupplicant/examples/wpa_supplicant.conf.template\fR ++as a starting point for a custom configuration file. ++.PP + All file paths in this configuration file should use full + (absolute, not relative to working directory) path in order to allow + working directory to be changed. This can happen if wpa_supplicant is --- wpasupplicant-0.6.0+0.5.8.orig/debian/patches/01_config.dpatch +++ wpasupplicant-0.6.0+0.5.8/debian/patches/01_config.dpatch @@ -0,0 +1,70 @@ +#! /bin/sh -e +## 01_config.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +if [ $# -lt 1 ]; then + echo "`basename $0`: script expects -patch|-unpatch as argument" >&2 + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}" + +case "$1" in + -patch) patch -p1 ${patch_opts} < $0;; + -unpatch) patch -R -p1 ${patch_opts} < $0;; + *) + echo "`basename $0`: script expects -patch|-unpatch as argument" >&2 + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -Nru wpa_supplicant.orig/.config wpa_supplicant/.config +--- wpa_supplicant.orig/.config 1970-01-01 10:00:00.000000000 +1000 ++++ wpa_supplicant/.config 2006-03-14 21:53:16.364723608 +1000 +@@ -0,0 +1,41 @@ ++CONFIG_DRIVER_ATMEL=y ++CONFIG_DRIVER_HOSTAP=y ++CONFIG_DRIVER_IPW=y ++#CONFIG_DRIVER_MADWIFI=y ++#CFLAGS+=-I./driver_madwifi ++CONFIG_DRIVER_NDISWRAPPER=y ++CONFIG_DRIVER_WEXT=y ++CONFIG_DRIVER_WIRED=y ++CONFIG_WIRELESS_EXTENSION=y ++CONFIG_DRIVER_TEST=y ++ ++#CONFIG_DRIVER_PRISM54=y # Prism54 support broken upstream ++#CONFIG_DRIVER_NDIS=y # Windows only ++#CONFIG_DRIVER_HERMES=y # Non-GPL header required ++#CONFIG_DRIVER_BROADCOM=y # Non-GPL header required ++ ++CONFIG_IEEE8021X_EAPOL=y ++ ++CONFIG_EAP_MD5=y ++CONFIG_EAP_MSCHAPV2=y ++#CONFIG_EAP_FAST=y # Requires OpenSSL rebuild ++CONFIG_EAP_TLS=y ++CONFIG_EAP_PEAP=y ++CONFIG_EAP_TTLS=y ++CONFIG_EAP_GTC=y ++CONFIG_EAP_OTP=y ++#CONFIG_EAP_SIM=y ++CONFIG_EAP_PSK=y ++CONFIG_EAP_PAX=y ++CONFIG_EAP_LEAP=y ++#CONFIG_EAP_AKA=y ++#CONFIG_EAP_SAKE=y ++ ++CONFIG_PKCS12=y ++CONFIG_SMARTCARD=y ++#CONFIG_PCSC=y ++ ++CONFIG_CTRL_IFACE=y ++CONFIG_CTRL_IFACE_DBUS=y ++CONFIG_READLINE=y ++ --- wpasupplicant-0.6.0+0.5.8.orig/debian/patches/21_madwifi_r1794_includes.dpatch +++ wpasupplicant-0.6.0+0.5.8/debian/patches/21_madwifi_r1794_includes.dpatch @@ -0,0 +1,2163 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## wpa_madwifing_r1794_includes.patch by Kel Modderman +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Includes for madwifi private ioctl's (madwifi.org svn trunk r1794). + +@DPATCH@ +diff -Nrup wpa_supplicant.orig/driver_madwifi/include/compat.h wpa_supplicant/driver_madwifi/include/compat.h +--- wpa_supplicant.orig/driver_madwifi/include/compat.h 1970-01-01 10:00:00.000000000 +1000 ++++ wpa_supplicant/driver_madwifi/include/compat.h 2006-07-23 10:03:55.000000000 +1000 +@@ -0,0 +1,90 @@ ++/*- ++ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer, ++ * without modification. ++ * 2. Redistributions in binary form must reproduce at minimum a disclaimer ++ * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any ++ * redistribution must be conditioned upon including a substantially ++ * similar Disclaimer requirement for further binary redistribution. ++ * 3. Neither the names of the above-listed copyright holders nor the names ++ * of any contributors may be used to endorse or promote products derived ++ * from this software without specific prior written permission. ++ * ++ * Alternatively, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2 as published by the Free ++ * Software Foundation. ++ * ++ * NO WARRANTY ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ++ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ++ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY ++ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ++ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, ++ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER ++ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF ++ * THE POSSIBILITY OF SUCH DAMAGES. ++ * ++ * $Id: compat.h 1692 2006-07-22 17:32:14Z mrenzmann $ ++ */ ++#ifndef _ATH_COMPAT_H_ ++#define _ATH_COMPAT_H_ ++/* ++ * BSD/Linux compatibility shims. These are used mainly to ++ * minimize differences when importing necesary BSD code. ++ */ ++#define NBBY 8 /* number of bits/byte */ ++ ++/* roundup() appears in Linux 2.6.18 */ ++#include ++#ifndef roundup ++#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */ ++#endif ++ ++#define howmany(x, y) (((x)+((y)-1))/(y)) ++ ++/* Bit map related macros. */ ++#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY)) ++#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY))) ++#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY))) ++#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0) ++ ++#define __packed __attribute__((__packed__)) ++#define __printflike(_a,_b) \ ++ __attribute__ ((__format__ (__printf__, _a, _b))) ++#define __offsetof(t,m) offsetof(t,m) ++ ++#ifndef ALIGNED_POINTER ++/* ++ * ALIGNED_POINTER is a boolean macro that checks whether an address ++ * is valid to fetch data elements of type t from on this architecture. ++ * This does not reflect the optimal alignment, just the possibility ++ * (within reasonable limits). ++ * ++ */ ++#define ALIGNED_POINTER(p,t) 1 ++#endif ++ ++#ifdef __KERNEL__ ++#define KASSERT(exp, msg) do { \ ++ if (unlikely(!(exp))) { \ ++ printk msg; \ ++ BUG(); \ ++ } \ ++} while (0) ++#endif /* __KERNEL__ */ ++ ++/* ++ * NetBSD/FreeBSD defines for file version. ++ */ ++#define __FBSDID(_s) ++#define __KERNEL_RCSID(_n,_s) ++#endif /* _ATH_COMPAT_H_ */ +diff -Nrup wpa_supplicant.orig/driver_madwifi/net80211/ieee80211_crypto.h wpa_supplicant/driver_madwifi/net80211/ieee80211_crypto.h +--- wpa_supplicant.orig/driver_madwifi/net80211/ieee80211_crypto.h 1970-01-01 10:00:00.000000000 +1000 ++++ wpa_supplicant/driver_madwifi/net80211/ieee80211_crypto.h 2006-04-12 21:36:10.000000000 +1000 +@@ -0,0 +1,205 @@ ++/*- ++ * Copyright (c) 2001 Atsushi Onoe ++ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The name of the author may not be used to endorse or promote products ++ * derived from this software without specific prior written permission. ++ * ++ * Alternatively, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2 as published by the Free ++ * Software Foundation. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ * ++ * $Id: ieee80211_crypto.h 1441 2006-02-06 16:03:21Z mrenzmann $ ++ */ ++#ifndef _NET80211_IEEE80211_CRYPTO_H_ ++#define _NET80211_IEEE80211_CRYPTO_H_ ++ ++/* ++ * 802.11 protocol crypto-related definitions. ++ */ ++#define IEEE80211_KEYBUF_SIZE 16 ++#define IEEE80211_MICBUF_SIZE (8 + 8) /* space for both tx+rx keys */ ++#define IEEE80211_TID_SIZE 17 /* total number of TIDs */ ++ ++/* ++ * Old WEP-style key. Deprecated. ++ */ ++struct ieee80211_wepkey { ++ u_int wk_len; /* key length in bytes */ ++ u_int8_t wk_key[IEEE80211_KEYBUF_SIZE]; ++}; ++ ++struct ieee80211_cipher; ++ ++/* ++ * Crypto key state. There is sufficient room for all supported ++ * ciphers (see below). The underlying ciphers are handled ++ * separately through loadable cipher modules that register with ++ * the generic crypto support. A key has a reference to an instance ++ * of the cipher; any per-key state is hung off wk_private by the ++ * cipher when it is attached. Ciphers are automatically called ++ * to detach and cleanup any such state when the key is deleted. ++ * ++ * The generic crypto support handles encap/decap of cipher-related ++ * frame contents for both hardware- and software-based implementations. ++ * A key requiring software crypto support is automatically flagged and ++ * the cipher is expected to honor this and do the necessary work. ++ * Ciphers such as TKIP may also support mixed hardware/software ++ * encrypt/decrypt and MIC processing. ++ */ ++/* XXX need key index typedef */ ++/* XXX pack better? */ ++/* XXX 48-bit rsc/tsc */ ++struct ieee80211_key { ++ u_int8_t wk_keylen; /* key length in bytes */ ++ u_int8_t wk_flags; ++#define IEEE80211_KEY_XMIT 0x01 /* key used for xmit */ ++#define IEEE80211_KEY_RECV 0x02 /* key used for recv */ ++#define IEEE80211_KEY_GROUP 0x04 /* key used for WPA group operation */ ++#define IEEE80211_KEY_SWCRYPT 0x10 /* host-based encrypt/decrypt */ ++#define IEEE80211_KEY_SWMIC 0x20 /* host-based enmic/demic */ ++ u_int16_t wk_keyix; /* key index */ ++ u_int8_t wk_key[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE]; ++#define wk_txmic wk_key+IEEE80211_KEYBUF_SIZE+0 /* XXX can't () right */ ++#define wk_rxmic wk_key+IEEE80211_KEYBUF_SIZE+8 /* XXX can't () right */ ++ u_int64_t wk_keyrsc[IEEE80211_TID_SIZE]; /* key receive sequence counter */ ++ u_int64_t wk_keytsc; /* key transmit sequence counter */ ++ const struct ieee80211_cipher *wk_cipher; ++ void *wk_private; /* private cipher state */ ++}; ++#define IEEE80211_KEY_COMMON /* common flags passed in by apps */\ ++ (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV | IEEE80211_KEY_GROUP) ++ ++/* ++ * NB: these values are ordered carefully; there are lots of ++ * of implications in any reordering. In particular beware ++ * that 4 is not used to avoid conflicting with IEEE80211_F_PRIVACY. ++ */ ++#define IEEE80211_CIPHER_WEP 0 ++#define IEEE80211_CIPHER_TKIP 1 ++#define IEEE80211_CIPHER_AES_OCB 2 ++#define IEEE80211_CIPHER_AES_CCM 3 ++#define IEEE80211_CIPHER_CKIP 5 ++#define IEEE80211_CIPHER_NONE 6 /* pseudo value */ ++ ++#define IEEE80211_CIPHER_MAX (IEEE80211_CIPHER_NONE+1) ++ ++#define IEEE80211_KEYIX_NONE ((u_int16_t) - 1) ++ ++#if defined(__KERNEL__) || defined(_KERNEL) ++ ++struct ieee80211com; ++struct ieee80211vap; ++struct ieee80211_node; ++struct sk_buff; ++ ++void ieee80211_crypto_attach(struct ieee80211com *); ++void ieee80211_crypto_detach(struct ieee80211com *); ++void ieee80211_crypto_vattach(struct ieee80211vap *); ++void ieee80211_crypto_vdetach(struct ieee80211vap *); ++int ieee80211_crypto_newkey(struct ieee80211vap *, int, int, ++ struct ieee80211_key *); ++int ieee80211_crypto_delkey(struct ieee80211vap *, struct ieee80211_key *, ++ struct ieee80211_node *); ++int ieee80211_crypto_setkey(struct ieee80211vap *, struct ieee80211_key *, ++ const u_int8_t macaddr[IEEE80211_ADDR_LEN], struct ieee80211_node *); ++void ieee80211_crypto_delglobalkeys(struct ieee80211vap *); ++ ++/* ++ * Template for a supported cipher. Ciphers register with the ++ * crypto code and are typically loaded as separate modules ++ * (the null cipher is always present). ++ * XXX may need refcnts ++ */ ++struct ieee80211_cipher { ++ const char *ic_name; /* printable name */ ++ u_int ic_cipher; /* IEEE80211_CIPHER_* */ ++ u_int ic_header; /* size of privacy header (bytes) */ ++ u_int ic_trailer; /* size of privacy trailer (bytes) */ ++ u_int ic_miclen; /* size of mic trailer (bytes) */ ++ void *(*ic_attach)(struct ieee80211vap *, struct ieee80211_key *); ++ void (*ic_detach)(struct ieee80211_key *); ++ int (*ic_setkey)(struct ieee80211_key *); ++ int (*ic_encap)(struct ieee80211_key *, struct sk_buff *, u_int8_t); ++ int (*ic_decap)(struct ieee80211_key *, struct sk_buff *, int); ++ int (*ic_enmic)(struct ieee80211_key *, struct sk_buff *, int); ++ int (*ic_demic)(struct ieee80211_key *, struct sk_buff *, int); ++}; ++extern const struct ieee80211_cipher ieee80211_cipher_none; ++ ++void ieee80211_crypto_register(const struct ieee80211_cipher *); ++void ieee80211_crypto_unregister(const struct ieee80211_cipher *); ++int ieee80211_crypto_available(u_int); ++ ++struct ieee80211_key *ieee80211_crypto_encap(struct ieee80211_node *, ++ struct sk_buff *); ++struct ieee80211_key *ieee80211_crypto_decap(struct ieee80211_node *, ++ struct sk_buff *, int); ++ ++/* ++ * Check and remove any MIC. ++ */ ++static __inline int ++ieee80211_crypto_demic(struct ieee80211vap *vap, struct ieee80211_key *k, ++ struct sk_buff *skb, int hdrlen) ++{ ++ const struct ieee80211_cipher *cip = k->wk_cipher; ++ return (cip->ic_miclen > 0 ? cip->ic_demic(k, skb, hdrlen) : 1); ++} ++ ++/* ++ * Add any MIC. ++ */ ++static __inline int ++ieee80211_crypto_enmic(struct ieee80211vap *vap, struct ieee80211_key *k, ++ struct sk_buff *skb, int force) ++{ ++ const struct ieee80211_cipher *cip = k->wk_cipher; ++ return (cip->ic_miclen > 0 ? cip->ic_enmic(k, skb, force) : 1); ++} ++ ++/* ++ * Reset key state to an unused state. The crypto ++ * key allocation mechanism ensures other state (e.g. ++ * key data) is properly setup before a key is used. ++ */ ++static __inline void ++ieee80211_crypto_resetkey(struct ieee80211vap *vap, struct ieee80211_key *k, ++ u_int16_t ix) ++{ ++ k->wk_cipher = &ieee80211_cipher_none;; ++ k->wk_private = k->wk_cipher->ic_attach(vap, k); ++ k->wk_keyix = ix; ++ k->wk_flags = IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV; ++} ++ ++/* ++ * Crypto-related notification methods. ++ */ ++void ieee80211_notify_replay_failure(struct ieee80211vap *, ++ const struct ieee80211_frame *, const struct ieee80211_key *, ++ u_int64_t rsc); ++void ieee80211_notify_michael_failure(struct ieee80211vap *, ++ const struct ieee80211_frame *, u_int keyix); ++#endif /* defined(__KERNEL__) || defined(_KERNEL) */ ++#endif /* _NET80211_IEEE80211_CRYPTO_H_ */ +diff -Nrup wpa_supplicant.orig/driver_madwifi/net80211/_ieee80211.h wpa_supplicant/driver_madwifi/net80211/_ieee80211.h +--- wpa_supplicant.orig/driver_madwifi/net80211/_ieee80211.h 1970-01-01 10:00:00.000000000 +1000 ++++ wpa_supplicant/driver_madwifi/net80211/_ieee80211.h 2006-04-12 21:36:10.000000000 +1000 +@@ -0,0 +1,243 @@ ++/*- ++ * Copyright (c) 2001 Atsushi Onoe ++ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The name of the author may not be used to endorse or promote products ++ * derived from this software without specific prior written permission. ++ * ++ * Alternatively, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2 as published by the Free ++ * Software Foundation. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ * ++ * $Id: _ieee80211.h 1441 2006-02-06 16:03:21Z mrenzmann $ ++ */ ++#ifndef _NET80211__IEEE80211_H_ ++#define _NET80211__IEEE80211_H_ ++ ++enum ieee80211_phytype { ++ IEEE80211_T_DS, /* direct sequence spread spectrum */ ++ IEEE80211_T_FH, /* frequency hopping */ ++ IEEE80211_T_OFDM, /* frequency division multiplexing */ ++ IEEE80211_T_TURBO, /* high rate OFDM, aka turbo mode */ ++}; ++#define IEEE80211_T_CCK IEEE80211_T_DS /* more common nomenclature */ ++ ++/* XXX not really a mode; there are really multiple PHY's */ ++enum ieee80211_phymode { ++ IEEE80211_MODE_AUTO = 0, /* autoselect */ ++ IEEE80211_MODE_11A = 1, /* 5GHz, OFDM */ ++ IEEE80211_MODE_11B = 2, /* 2GHz, CCK */ ++ IEEE80211_MODE_11G = 3, /* 2GHz, OFDM */ ++ IEEE80211_MODE_FH = 4, /* 2GHz, GFSK */ ++ IEEE80211_MODE_TURBO_A = 5, /* 5GHz, OFDM, 2x clock dynamic turbo */ ++ IEEE80211_MODE_TURBO_G = 6, /* 2GHz, OFDM, 2x clock dynamic turbo*/ ++}; ++#define IEEE80211_MODE_MAX (IEEE80211_MODE_TURBO_G+1) ++ ++enum ieee80211_opmode { ++ IEEE80211_M_STA = 1, /* infrastructure station */ ++ IEEE80211_M_IBSS = 0, /* IBSS (adhoc) station */ ++ IEEE80211_M_AHDEMO = 3, /* Old lucent compatible adhoc demo */ ++ IEEE80211_M_HOSTAP = 6, /* Software Access Point */ ++ IEEE80211_M_MONITOR = 8, /* Monitor mode */ ++ IEEE80211_M_WDS = 2 /* WDS link */ ++}; ++ ++/* ++ * 802.11g protection mode. ++ */ ++enum ieee80211_protmode { ++ IEEE80211_PROT_NONE = 0, /* no protection */ ++ IEEE80211_PROT_CTSONLY = 1, /* CTS to self */ ++ IEEE80211_PROT_RTSCTS = 2, /* RTS-CTS */ ++}; ++ ++/* ++ * Authentication mode. ++ */ ++enum ieee80211_authmode { ++ IEEE80211_AUTH_NONE = 0, ++ IEEE80211_AUTH_OPEN = 1, /* open */ ++ IEEE80211_AUTH_SHARED = 2, /* shared-key */ ++ IEEE80211_AUTH_8021X = 3, /* 802.1x */ ++ IEEE80211_AUTH_AUTO = 4, /* auto-select/accept */ ++ /* NB: these are used only for ioctls */ ++ IEEE80211_AUTH_WPA = 5, /* WPA/RSN w/ 802.1x/PSK */ ++}; ++ ++/* ++ * Roaming mode is effectively who controls the operation ++ * of the 802.11 state machine when operating as a station. ++ * State transitions are controlled either by the driver ++ * (typically when management frames are processed by the ++ * hardware/firmware), the host (auto/normal operation of ++ * the 802.11 layer), or explicitly through ioctl requests ++ * when applications like wpa_supplicant want control. ++ */ ++enum ieee80211_roamingmode { ++ IEEE80211_ROAMING_DEVICE= 0, /* driver/hardware control */ ++ IEEE80211_ROAMING_AUTO = 1, /* 802.11 layer control */ ++ IEEE80211_ROAMING_MANUAL= 2, /* application control */ ++}; ++ ++/* ++ * Scanning mode controls station scanning work; this is ++ * used only when roaming mode permits the host to select ++ * the bss to join/channel to use. ++ */ ++enum ieee80211_scanmode { ++ IEEE80211_SCAN_DEVICE = 0, /* driver/hardware control */ ++ IEEE80211_SCAN_BEST = 1, /* 802.11 layer selects best */ ++ IEEE80211_SCAN_FIRST = 2, /* take first suitable candidate */ ++}; ++ ++/* ++ * Channels are specified by frequency and attributes. ++ */ ++struct ieee80211_channel { ++ u_int16_t ic_freq; /* setting in Mhz */ ++ u_int16_t ic_flags; /* see below */ ++ u_int8_t ic_ieee; /* IEEE channel number */ ++ int8_t ic_maxregpower; /* maximum regulatory tx power in dBm */ ++ int8_t ic_maxpower; /* maximum tx power in dBm */ ++ int8_t ic_minpower; /* minimum tx power in dBm */ ++}; ++ ++#define IEEE80211_CHAN_MAX 255 ++#define IEEE80211_CHAN_BYTES 32 /* howmany(IEEE80211_CHAN_MAX, NBBY) */ ++#define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */ ++#define IEEE80211_CHAN_ANYC ((struct ieee80211_channel *) IEEE80211_CHAN_ANY) ++ ++#define IEEE80211_RADAR_11HCOUNT 1 ++#define IEEE80211_RADAR_TEST_MUTE_CHAN 36 /* Move to channel 36 for mute test */ ++ ++/* bits 0-3 are for private use by drivers */ ++/* channel attributes */ ++#define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */ ++#define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */ ++#define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */ ++#define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */ ++#define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */ ++#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */ ++#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */ ++#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */ ++#define IEEE80211_CHAN_RADAR 0x1000 /* Radar found on channel */ ++#define IEEE80211_CHAN_STURBO 0x2000 /* 11a static turbo channel only */ ++#define IEEE80211_CHAN_HALF 0x4000 /* Half rate channel */ ++#define IEEE80211_CHAN_QUARTER 0x8000 /* Quarter rate channel */ ++ ++/* ++ * Useful combinations of channel characteristics. ++ */ ++#define IEEE80211_CHAN_FHSS \ ++ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_GFSK) ++#define IEEE80211_CHAN_A \ ++ (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM) ++#define IEEE80211_CHAN_B \ ++ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_CCK) ++#define IEEE80211_CHAN_PUREG \ ++ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM) ++#define IEEE80211_CHAN_G \ ++ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN) ++#define IEEE80211_CHAN_108A \ ++ (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO) ++#define IEEE80211_CHAN_108G \ ++ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO) ++#define IEEE80211_CHAN_ST \ ++ (IEEE80211_CHAN_108A | IEEE80211_CHAN_STURBO) ++ ++#define IEEE80211_CHAN_ALL \ ++ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_GFSK | \ ++ IEEE80211_CHAN_CCK | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_DYN) ++#define IEEE80211_CHAN_ALLTURBO \ ++ (IEEE80211_CHAN_ALL | IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO) ++ ++#define IEEE80211_IS_CHAN_FHSS(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_FHSS) == IEEE80211_CHAN_FHSS) ++#define IEEE80211_IS_CHAN_A(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_A) == IEEE80211_CHAN_A) ++#define IEEE80211_IS_CHAN_B(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_B) == IEEE80211_CHAN_B) ++#define IEEE80211_IS_CHAN_PUREG(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_PUREG) == IEEE80211_CHAN_PUREG) ++#define IEEE80211_IS_CHAN_G(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G) ++#define IEEE80211_IS_CHAN_ANYG(_c) \ ++ (IEEE80211_IS_CHAN_PUREG(_c) || IEEE80211_IS_CHAN_G(_c)) ++#define IEEE80211_IS_CHAN_ST(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_ST) == IEEE80211_CHAN_ST) ++#define IEEE80211_IS_CHAN_108A(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_108A) == IEEE80211_CHAN_108A) ++#define IEEE80211_IS_CHAN_108G(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_108G) == IEEE80211_CHAN_108G) ++ ++#define IEEE80211_IS_CHAN_2GHZ(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_2GHZ) != 0) ++#define IEEE80211_IS_CHAN_5GHZ(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_5GHZ) != 0) ++#define IEEE80211_IS_CHAN_OFDM(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_OFDM) != 0) ++#define IEEE80211_IS_CHAN_CCK(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_CCK) != 0) ++#define IEEE80211_IS_CHAN_GFSK(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_GFSK) != 0) ++#define IEEE80211_IS_CHAN_TURBO(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_TURBO) != 0) ++#define IEEE80211_IS_CHAN_STURBO(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_STURBO) != 0) ++#define IEEE80211_IS_CHAN_DTURBO(_c) \ ++ (((_c)->ic_flags & \ ++ (IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO)) == IEEE80211_CHAN_TURBO) ++#define IEEE80211_IS_CHAN_HALF(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_HALF) != 0) ++#define IEEE80211_IS_CHAN_QUARTER(_c) \ ++ (((_c)->ic_flags & IEEE80211_CHAN_QUARTER) != 0) ++ ++/* ni_chan encoding for FH phy */ ++#define IEEE80211_FH_CHANMOD 80 ++#define IEEE80211_FH_CHAN(set,pat) (((set) - 1) * IEEE80211_FH_CHANMOD + (pat)) ++#define IEEE80211_FH_CHANSET(chan) ((chan) / IEEE80211_FH_CHANMOD + 1) ++#define IEEE80211_FH_CHANPAT(chan) ((chan) % IEEE80211_FH_CHANMOD) ++ ++/* ++ * 802.11 rate set. ++ */ ++#define IEEE80211_RATE_SIZE 8 /* 802.11 standard */ ++#define IEEE80211_RATE_MAXSIZE 15 /* max rates we'll handle */ ++ ++struct ieee80211_rateset { ++ u_int8_t rs_nrates; ++ u_int8_t rs_rates[IEEE80211_RATE_MAXSIZE]; ++}; ++ ++struct ieee80211_roam { ++ int8_t rssi11a; /* rssi thresh for 11a bss */ ++ int8_t rssi11b; /* for 11g sta in 11b bss */ ++ int8_t rssi11bOnly; /* for 11b sta */ ++ u_int8_t pad1; ++ u_int8_t rate11a; /* rate thresh for 11a bss */ ++ u_int8_t rate11b; /* for 11g sta in 11b bss */ ++ u_int8_t rate11bOnly; /* for 11b sta */ ++ u_int8_t pad2; ++}; ++#endif /* _NET80211__IEEE80211_H_ */ +diff -Nrup wpa_supplicant.orig/driver_madwifi/net80211/ieee80211.h wpa_supplicant/driver_madwifi/net80211/ieee80211.h +--- wpa_supplicant.orig/driver_madwifi/net80211/ieee80211.h 1970-01-01 10:00:00.000000000 +1000 ++++ wpa_supplicant/driver_madwifi/net80211/ieee80211.h 2006-11-07 16:55:15.000000000 +1000 +@@ -0,0 +1,939 @@ ++/*- ++ * Copyright (c) 2001 Atsushi Onoe ++ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The name of the author may not be used to endorse or promote products ++ * derived from this software without specific prior written permission. ++ * ++ * Alternatively, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2 as published by the Free ++ * Software Foundation. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ * ++ * $Id: ieee80211.h 1762 2006-10-23 09:11:21Z kelmo $ ++ */ ++#ifndef _NET80211_IEEE80211_H_ ++#define _NET80211_IEEE80211_H_ ++ ++/* ++ * 802.11 protocol definitions. ++ */ ++ ++#define IEEE80211_ADDR_LEN 6 /* size of 802.11 address */ ++/* is 802.11 address multicast/broadcast? */ ++#define IEEE80211_IS_MULTICAST(_a) (*(_a) & 0x01) ++ ++/* IEEE 802.11 PLCP header */ ++struct ieee80211_plcp_hdr { ++ u_int16_t i_sfd; ++ u_int8_t i_signal; ++ u_int8_t i_service; ++ u_int16_t i_length; ++ u_int16_t i_crc; ++} __packed; ++ ++#define IEEE80211_PLCP_SFD 0xF3A0 ++#define IEEE80211_PLCP_SERVICE 0x00 ++ ++/* ++ * generic definitions for IEEE 802.11 frames ++ */ ++struct ieee80211_frame { ++ u_int8_t i_fc[2]; ++ u_int8_t i_dur[2]; ++ u_int8_t i_addr1[IEEE80211_ADDR_LEN]; ++ u_int8_t i_addr2[IEEE80211_ADDR_LEN]; ++ u_int8_t i_addr3[IEEE80211_ADDR_LEN]; ++ u_int8_t i_seq[2]; ++ /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */ ++ /* see below */ ++} __packed; ++ ++struct ieee80211_qosframe { ++ u_int8_t i_fc[2]; ++ u_int8_t i_dur[2]; ++ u_int8_t i_addr1[IEEE80211_ADDR_LEN]; ++ u_int8_t i_addr2[IEEE80211_ADDR_LEN]; ++ u_int8_t i_addr3[IEEE80211_ADDR_LEN]; ++ u_int8_t i_seq[2]; ++ u_int8_t i_qos[2]; ++ /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */ ++ /* see below */ ++} __packed; ++ ++struct ieee80211_qoscntl { ++ u_int8_t i_qos[2]; ++}; ++ ++struct ieee80211_frame_addr4 { ++ u_int8_t i_fc[2]; ++ u_int8_t i_dur[2]; ++ u_int8_t i_addr1[IEEE80211_ADDR_LEN]; ++ u_int8_t i_addr2[IEEE80211_ADDR_LEN]; ++ u_int8_t i_addr3[IEEE80211_ADDR_LEN]; ++ u_int8_t i_seq[2]; ++ u_int8_t i_addr4[IEEE80211_ADDR_LEN]; ++} __packed; ++ ++ ++struct ieee80211_qosframe_addr4 { ++ u_int8_t i_fc[2]; ++ u_int8_t i_dur[2]; ++ u_int8_t i_addr1[IEEE80211_ADDR_LEN]; ++ u_int8_t i_addr2[IEEE80211_ADDR_LEN]; ++ u_int8_t i_addr3[IEEE80211_ADDR_LEN]; ++ u_int8_t i_seq[2]; ++ u_int8_t i_addr4[IEEE80211_ADDR_LEN]; ++ u_int8_t i_qos[2]; ++} __packed; ++ ++struct ieee80211_ctlframe_addr2 { ++ u_int8_t i_fc[2]; ++ u_int8_t i_aidordur[2]; /* AID or duration */ ++ u_int8_t i_addr1[IEEE80211_ADDR_LEN]; ++ u_int8_t i_addr2[IEEE80211_ADDR_LEN]; ++} __packed; ++ ++#define IEEE80211_FC0_VERSION_MASK 0x03 ++#define IEEE80211_FC0_VERSION_SHIFT 0 ++#define IEEE80211_FC0_VERSION_0 0x00 ++#define IEEE80211_FC0_TYPE_MASK 0x0c ++#define IEEE80211_FC0_TYPE_SHIFT 2 ++#define IEEE80211_FC0_TYPE_MGT 0x00 ++#define IEEE80211_FC0_TYPE_CTL 0x04 ++#define IEEE80211_FC0_TYPE_DATA 0x08 ++ ++#define IEEE80211_FC0_SUBTYPE_MASK 0xf0 ++#define IEEE80211_FC0_SUBTYPE_SHIFT 4 ++/* for TYPE_MGT */ ++#define IEEE80211_FC0_SUBTYPE_ASSOC_REQ 0x00 ++#define IEEE80211_FC0_SUBTYPE_ASSOC_RESP 0x10 ++#define IEEE80211_FC0_SUBTYPE_REASSOC_REQ 0x20 ++#define IEEE80211_FC0_SUBTYPE_REASSOC_RESP 0x30 ++#define IEEE80211_FC0_SUBTYPE_PROBE_REQ 0x40 ++#define IEEE80211_FC0_SUBTYPE_PROBE_RESP 0x50 ++#define IEEE80211_FC0_SUBTYPE_BEACON 0x80 ++#define IEEE80211_FC0_SUBTYPE_ATIM 0x90 ++#define IEEE80211_FC0_SUBTYPE_DISASSOC 0xa0 ++#define IEEE80211_FC0_SUBTYPE_AUTH 0xb0 ++#define IEEE80211_FC0_SUBTYPE_DEAUTH 0xc0 ++#define IEEE80211_FC0_SUBTYPE_ACTION 0xd0 ++/* for TYPE_CTL */ ++#define IEEE80211_FC0_SUBTYPE_PS_POLL 0xa0 ++#define IEEE80211_FC0_SUBTYPE_RTS 0xb0 ++#define IEEE80211_FC0_SUBTYPE_CTS 0xc0 ++#define IEEE80211_FC0_SUBTYPE_ACK 0xd0 ++#define IEEE80211_FC0_SUBTYPE_CF_END 0xe0 ++#define IEEE80211_FC0_SUBTYPE_CF_END_ACK 0xf0 ++/* for TYPE_DATA (bit combination) */ ++#define IEEE80211_FC0_SUBTYPE_DATA 0x00 ++#define IEEE80211_FC0_SUBTYPE_CF_ACK 0x10 ++#define IEEE80211_FC0_SUBTYPE_CF_POLL 0x20 ++#define IEEE80211_FC0_SUBTYPE_CF_ACPL 0x30 ++#define IEEE80211_FC0_SUBTYPE_NODATA 0x40 ++#define IEEE80211_FC0_SUBTYPE_CFACK 0x50 ++#define IEEE80211_FC0_SUBTYPE_CFPOLL 0x60 ++#define IEEE80211_FC0_SUBTYPE_CF_ACK_CF_ACK 0x70 ++#define IEEE80211_FC0_SUBTYPE_QOS 0x80 ++#define IEEE80211_FC0_SUBTYPE_QOS_NULL 0xc0 ++ ++#define IEEE80211_FC1_DIR_MASK 0x03 ++#define IEEE80211_FC1_DIR_NODS 0x00 /* STA->STA */ ++#define IEEE80211_FC1_DIR_TODS 0x01 /* STA->AP */ ++#define IEEE80211_FC1_DIR_FROMDS 0x02 /* AP ->STA */ ++#define IEEE80211_FC1_DIR_DSTODS 0x03 /* AP ->AP */ ++ ++#define IEEE80211_FC1_MORE_FRAG 0x04 ++#define IEEE80211_FC1_RETRY 0x08 ++#define IEEE80211_FC1_PWR_MGT 0x10 ++#define IEEE80211_FC1_MORE_DATA 0x20 ++#define IEEE80211_FC1_PROT 0x40 ++#define IEEE80211_FC1_ORDER 0x80 ++ ++#define IEEE80211_SEQ_FRAG_MASK 0x000f ++#define IEEE80211_SEQ_FRAG_SHIFT 0 ++#define IEEE80211_SEQ_SEQ_MASK 0xfff0 ++#define IEEE80211_SEQ_SEQ_SHIFT 4 ++ ++#define IEEE80211_SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0) ++ ++#define IEEE80211_NWID_LEN 32 ++ ++#define IEEE80211_QOS_TXOP 0x00ff ++/* bit 8 is reserved */ ++#define IEEE80211_QOS_ACKPOLICY 0x60 ++#define IEEE80211_QOS_ACKPOLICY_S 5 ++#define IEEE80211_QOS_EOSP 0x10 ++#define IEEE80211_QOS_EOSP_S 4 ++#define IEEE80211_QOS_TID 0x0f ++ ++/* ++ * Country/Region Codes from MS WINNLS.H ++ * Numbering from ISO 3166 ++ * XXX belongs elsewhere ++ */ ++enum CountryCode { ++ CTRY_ALBANIA = 8, /* Albania */ ++ CTRY_ALGERIA = 12, /* Algeria */ ++ CTRY_ARGENTINA = 32, /* Argentina */ ++ CTRY_ARMENIA = 51, /* Armenia */ ++ CTRY_AUSTRALIA = 36, /* Australia */ ++ CTRY_AUSTRIA = 40, /* Austria */ ++ CTRY_AZERBAIJAN = 31, /* Azerbaijan */ ++ CTRY_BAHRAIN = 48, /* Bahrain */ ++ CTRY_BELARUS = 112, /* Belarus */ ++ CTRY_BELGIUM = 56, /* Belgium */ ++ CTRY_BELIZE = 84, /* Belize */ ++ CTRY_BOLIVIA = 68, /* Bolivia */ ++ CTRY_BRAZIL = 76, /* Brazil */ ++ CTRY_BRUNEI_DARUSSALAM = 96, /* Brunei Darussalam */ ++ CTRY_BULGARIA = 100, /* Bulgaria */ ++ CTRY_CANADA = 124, /* Canada */ ++ CTRY_CHILE = 152, /* Chile */ ++ CTRY_CHINA = 156, /* People's Republic of China */ ++ CTRY_COLOMBIA = 170, /* Colombia */ ++ CTRY_COSTA_RICA = 188, /* Costa Rica */ ++ CTRY_CROATIA = 191, /* Croatia */ ++ CTRY_CYPRUS = 196, ++ CTRY_CZECH = 203, /* Czech Republic */ ++ CTRY_DENMARK = 208, /* Denmark */ ++ CTRY_DOMINICAN_REPUBLIC = 214, /* Dominican Republic */ ++ CTRY_ECUADOR = 218, /* Ecuador */ ++ CTRY_EGYPT = 818, /* Egypt */ ++ CTRY_EL_SALVADOR = 222, /* El Salvador */ ++ CTRY_ESTONIA = 233, /* Estonia */ ++ CTRY_FAEROE_ISLANDS = 234, /* Faeroe Islands */ ++ CTRY_FINLAND = 246, /* Finland */ ++ CTRY_FRANCE = 250, /* France */ ++ CTRY_FRANCE2 = 255, /* France2 */ ++ CTRY_GEORGIA = 268, /* Georgia */ ++ CTRY_GERMANY = 276, /* Germany */ ++ CTRY_GREECE = 300, /* Greece */ ++ CTRY_GUATEMALA = 320, /* Guatemala */ ++ CTRY_HONDURAS = 340, /* Honduras */ ++ CTRY_HONG_KONG = 344, /* Hong Kong S.A.R., P.R.C. */ ++ CTRY_HUNGARY = 348, /* Hungary */ ++ CTRY_ICELAND = 352, /* Iceland */ ++ CTRY_INDIA = 356, /* India */ ++ CTRY_INDONESIA = 360, /* Indonesia */ ++ CTRY_IRAN = 364, /* Iran */ ++ CTRY_IRAQ = 368, /* Iraq */ ++ CTRY_IRELAND = 372, /* Ireland */ ++ CTRY_ISRAEL = 376, /* Israel */ ++ CTRY_ITALY = 380, /* Italy */ ++ CTRY_JAMAICA = 388, /* Jamaica */ ++ CTRY_JAPAN = 392, /* Japan */ ++ CTRY_JAPAN1 = 393, /* Japan (JP1) */ ++ CTRY_JAPAN2 = 394, /* Japan (JP0) */ ++ CTRY_JAPAN3 = 395, /* Japan (JP1-1) */ ++ CTRY_JAPAN4 = 396, /* Japan (JE1) */ ++ CTRY_JAPAN5 = 397, /* Japan (JE2) */ ++ CTRY_JAPAN6 = 399, /* Japan (JP6) */ ++ CTRY_JAPAN7 = 900, /* Japan */ ++ CTRY_JAPAN8 = 901, /* Japan */ ++ CTRY_JAPAN9 = 902, /* Japan */ ++ CTRY_JAPAN10 = 903, /* Japan */ ++ CTRY_JAPAN11 = 904, /* Japan */ ++ CTRY_JAPAN12 = 905, /* Japan */ ++ CTRY_JAPAN13 = 906, /* Japan */ ++ CTRY_JAPAN14 = 907, /* Japan */ ++ CTRY_JAPAN15 = 908, /* Japan */ ++ CTRY_JAPAN16 = 909, /* Japan */ ++ CTRY_JAPAN17 = 910, /* Japan */ ++ CTRY_JAPAN18 = 911, /* Japan */ ++ CTRY_JAPAN19 = 912, /* Japan */ ++ CTRY_JAPAN20 = 913, /* Japan */ ++ CTRY_JAPAN21 = 914, /* Japan */ ++ CTRY_JAPAN22 = 915, /* Japan */ ++ CTRY_JAPAN23 = 916, /* Japan */ ++ CTRY_JAPAN24 = 917, /* Japan */ ++ CTRY_JAPAN25 = 918, /* Japan */ ++ CTRY_JAPAN26 = 919, /* Japan */ ++ CTRY_JAPAN27 = 920, /* Japan */ ++ CTRY_JAPAN28 = 921, /* Japan */ ++ CTRY_JAPAN29 = 922, /* Japan */ ++ CTRY_JAPAN30 = 923, /* Japan */ ++ CTRY_JAPAN31 = 924, /* Japan */ ++ CTRY_JAPAN32 = 925, /* Japan */ ++ CTRY_JAPAN33 = 926, /* Japan */ ++ CTRY_JAPAN34 = 927, /* Japan */ ++ CTRY_JAPAN35 = 928, /* Japan */ ++ CTRY_JAPAN36 = 929, /* Japan */ ++ CTRY_JAPAN37 = 930, /* Japan */ ++ CTRY_JAPAN38 = 931, /* Japan */ ++ CTRY_JAPAN39 = 932, /* Japan */ ++ CTRY_JAPAN40 = 933, /* Japan */ ++ CTRY_JAPAN41 = 934, /* Japan */ ++ CTRY_JAPAN42 = 935, /* Japan */ ++ CTRY_JAPAN43 = 936, /* Japan */ ++ CTRY_JAPAN44 = 937, /* Japan */ ++ CTRY_JAPAN45 = 938, /* Japan */ ++ CTRY_JAPAN46 = 939, /* Japan */ ++ CTRY_JAPAN47 = 940, /* Japan */ ++ CTRY_JAPAN48 = 941, /* Japan */ ++ CTRY_JORDAN = 400, /* Jordan */ ++ CTRY_KAZAKHSTAN = 398, /* Kazakhstan */ ++ CTRY_KENYA = 404, /* Kenya */ ++ CTRY_KOREA_NORTH = 408, /* North Korea */ ++ CTRY_KOREA_ROC = 410, /* South Korea */ ++ CTRY_KOREA_ROC2 = 411, /* South Korea */ ++ CTRY_KUWAIT = 414, /* Kuwait */ ++ CTRY_LATVIA = 428, /* Latvia */ ++ CTRY_LEBANON = 422, /* Lebanon */ ++ CTRY_LIBYA = 434, /* Libya */ ++ CTRY_LIECHTENSTEIN = 438, /* Liechtenstein */ ++ CTRY_LITHUANIA = 440, /* Lithuania */ ++ CTRY_LUXEMBOURG = 442, /* Luxembourg */ ++ CTRY_MACAU = 446, /* Macau */ ++ CTRY_MACEDONIA = 807, /* the Former Yugoslav Republic of Macedonia */ ++ CTRY_MALAYSIA = 458, /* Malaysia */ ++ CTRY_MEXICO = 484, /* Mexico */ ++ CTRY_MONACO = 492, /* Principality of Monaco */ ++ CTRY_MOROCCO = 504, /* Morocco */ ++ CTRY_NETHERLANDS = 528, /* Netherlands */ ++ CTRY_NEW_ZEALAND = 554, /* New Zealand */ ++ CTRY_NICARAGUA = 558, /* Nicaragua */ ++ CTRY_NORWAY = 578, /* Norway */ ++ CTRY_OMAN = 512, /* Oman */ ++ CTRY_PAKISTAN = 586, /* Islamic Republic of Pakistan */ ++ CTRY_PANAMA = 591, /* Panama */ ++ CTRY_PARAGUAY = 600, /* Paraguay */ ++ CTRY_PERU = 604, /* Peru */ ++ CTRY_PHILIPPINES = 608, /* Republic of the Philippines */ ++ CTRY_POLAND = 616, /* Poland */ ++ CTRY_PORTUGAL = 620, /* Portugal */ ++ CTRY_PUERTO_RICO = 630, /* Puerto Rico */ ++ CTRY_QATAR = 634, /* Qatar */ ++ CTRY_ROMANIA = 642, /* Romania */ ++ CTRY_RUSSIA = 643, /* Russia */ ++ CTRY_SAUDI_ARABIA = 682, /* Saudi Arabia */ ++ CTRY_SINGAPORE = 702, /* Singapore */ ++ CTRY_SLOVAKIA = 703, /* Slovak Republic */ ++ CTRY_SLOVENIA = 705, /* Slovenia */ ++ CTRY_SOUTH_AFRICA = 710, /* South Africa */ ++ CTRY_SPAIN = 724, /* Spain */ ++ CTRY_SWEDEN = 752, /* Sweden */ ++ CTRY_SWITZERLAND = 756, /* Switzerland */ ++ CTRY_SYRIA = 760, /* Syria */ ++ CTRY_TAIWAN = 158, /* Taiwan */ ++ CTRY_THAILAND = 764, /* Thailand */ ++ CTRY_TRINIDAD_Y_TOBAGO = 780, /* Trinidad y Tobago */ ++ CTRY_TUNISIA = 788, /* Tunisia */ ++ CTRY_TURKEY = 792, /* Turkey */ ++ CTRY_UAE = 784, /* U.A.E. */ ++ CTRY_UKRAINE = 804, /* Ukraine */ ++ CTRY_UNITED_KINGDOM = 826, /* United Kingdom */ ++ CTRY_UNITED_STATES = 840, /* United States */ ++ CTRY_UNITED_STATES_FCC49 = 842, /* United States (Public Safety)*/ ++ CTRY_URUGUAY = 858, /* Uruguay */ ++ CTRY_UZBEKISTAN = 860, /* Uzbekistan */ ++ CTRY_VENEZUELA = 862, /* Venezuela */ ++ CTRY_VIET_NAM = 704, /* Viet Nam */ ++ CTRY_YEMEN = 887, /* Yemen */ ++ CTRY_ZIMBABWE = 716 /* Zimbabwe */ ++}; ++ ++/* ++ * Generic information element ++ */ ++struct ieee80211_ie { ++ u_int8_t id; ++ u_int8_t len; ++ u_int8_t info[]; ++} __packed; ++ ++/* ++ * Country information element. ++ */ ++#define IEEE80211_COUNTRY_MAX_TRIPLETS (83) ++struct ieee80211_ie_country { ++ u_int8_t country_id; ++ u_int8_t country_len; ++ u_int8_t country_str[3]; ++ u_int8_t country_triplet[IEEE80211_COUNTRY_MAX_TRIPLETS * 3]; ++} __packed; ++ ++/* ++ * Channel Switch Announcement information element. ++ */ ++struct ieee80211_ie_csa { ++ u_int8_t csa_id; /* IEEE80211_ELEMID_CHANSWITCHANN */ ++ u_int8_t csa_len; /* == 3 */ ++ u_int8_t csa_mode; /* Channel Switch Mode: 1 == stop transmission until CS */ ++ u_int8_t csa_chan; /* New Channel Number */ ++ u_int8_t csa_count; /* TBTTs until Channel Switch happens */ ++} __packed; ++ ++/* minimal Channel Switch Count in the initial announcement */ ++#define IEEE80211_CSA_PROTECTION_PERIOD 3 ++ ++/* maximum allowed deviance of measurement of intervals between CSA in Beacons */ ++#define IEEE80211_CSA_SANITY_THRESHOLD 100 ++ ++ ++/* does frame have QoS sequence control data */ ++#define IEEE80211_QOS_HAS_SEQ(wh) \ ++ (((wh)->i_fc[0] & \ ++ (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_QOS)) == \ ++ (IEEE80211_FC0_TYPE_DATA | IEEE80211_FC0_SUBTYPE_QOS)) ++ ++#define WME_QOSINFO_COUNT 0x0f /* Mask for Param Set Count field */ ++/* ++ * WME/802.11e information element. ++ */ ++struct ieee80211_ie_wme { ++ u_int8_t wme_id; /* IEEE80211_ELEMID_VENDOR */ ++ u_int8_t wme_len; /* length in bytes */ ++ u_int8_t wme_oui[3]; /* 0x00, 0x50, 0xf2 */ ++ u_int8_t wme_type; /* OUI type */ ++ u_int8_t wme_subtype; /* OUI subtype */ ++ u_int8_t wme_version; /* spec revision */ ++ u_int8_t wme_info; /* QoS info */ ++} __packed; ++ ++/* ++ * WME/802.11e Tspec Element ++ */ ++struct ieee80211_wme_tspec { ++ u_int8_t ts_id; ++ u_int8_t ts_len; ++ u_int8_t ts_oui[3]; ++ u_int8_t ts_oui_type; ++ u_int8_t ts_oui_subtype; ++ u_int8_t ts_version; ++ u_int8_t ts_tsinfo[3]; ++ u_int8_t ts_nom_msdu[2]; ++ u_int8_t ts_max_msdu[2]; ++ u_int8_t ts_min_svc[4]; ++ u_int8_t ts_max_svc[4]; ++ u_int8_t ts_inactv_intv[4]; ++ u_int8_t ts_susp_intv[4]; ++ u_int8_t ts_start_svc[4]; ++ u_int8_t ts_min_rate[4]; ++ u_int8_t ts_mean_rate[4]; ++ u_int8_t ts_max_burst[4]; ++ u_int8_t ts_min_phy[4]; ++ u_int8_t ts_peak_rate[4]; ++ u_int8_t ts_delay[4]; ++ u_int8_t ts_surplus[2]; ++ u_int8_t ts_medium_time[2]; ++} __packed; ++ ++/* ++ * WME AC parameter field ++ */ ++ ++struct ieee80211_wme_acparams { ++ u_int8_t acp_aci_aifsn; ++ u_int8_t acp_logcwminmax; ++ u_int16_t acp_txop; ++} __packed; ++ ++#define IEEE80211_WME_PARAM_LEN 24 ++#define WME_NUM_AC 4 /* 4 AC categories */ ++ ++#define WME_PARAM_ACI 0x60 /* Mask for ACI field */ ++#define WME_PARAM_ACI_S 5 /* Shift for ACI field */ ++#define WME_PARAM_ACM 0x10 /* Mask for ACM bit */ ++#define WME_PARAM_ACM_S 4 /* Shift for ACM bit */ ++#define WME_PARAM_AIFSN 0x0f /* Mask for aifsn field */ ++#define WME_PARAM_AIFSN_S 0 /* Shift for aifsn field */ ++#define WME_PARAM_LOGCWMIN 0x0f /* Mask for CwMin field (in log) */ ++#define WME_PARAM_LOGCWMIN_S 0 /* Shift for CwMin field */ ++#define WME_PARAM_LOGCWMAX 0xf0 /* Mask for CwMax field (in log) */ ++#define WME_PARAM_LOGCWMAX_S 4 /* Shift for CwMax field */ ++ ++#define WME_AC_TO_TID(_ac) ( \ ++ ((_ac) == WME_AC_VO) ? 6 : \ ++ ((_ac) == WME_AC_VI) ? 5 : \ ++ ((_ac) == WME_AC_BK) ? 1 : \ ++ 0) ++ ++#define TID_TO_WME_AC(_tid) ( \ ++ ((_tid) < 1) ? WME_AC_BE : \ ++ ((_tid) < 3) ? WME_AC_BK : \ ++ ((_tid) < 6) ? WME_AC_VI : \ ++ WME_AC_VO) ++ ++/* ++ * WME Parameter Element ++ */ ++ ++struct ieee80211_wme_param { ++ u_int8_t param_id; ++ u_int8_t param_len; ++ u_int8_t param_oui[3]; ++ u_int8_t param_oui_type; ++ u_int8_t param_oui_sybtype; ++ u_int8_t param_version; ++ u_int8_t param_qosInfo; ++ u_int8_t param_reserved; ++ struct ieee80211_wme_acparams params_acParams[WME_NUM_AC]; ++} __packed; ++ ++/* ++ * WME U-APSD qos info field defines ++ */ ++#define WME_CAPINFO_UAPSD_EN 0x00000080 ++#define WME_CAPINFO_UAPSD_VO 0x00000001 ++#define WME_CAPINFO_UAPSD_VI 0x00000002 ++#define WME_CAPINFO_UAPSD_BK 0x00000004 ++#define WME_CAPINFO_UAPSD_BE 0x00000008 ++#define WME_CAPINFO_UAPSD_ACFLAGS_SHIFT 0 ++#define WME_CAPINFO_UAPSD_ACFLAGS_MASK 0xF ++#define WME_CAPINFO_UAPSD_MAXSP_SHIFT 5 ++#define WME_CAPINFO_UAPSD_MAXSP_MASK 0x3 ++#define WME_CAPINFO_IE_OFFSET 8 ++#define WME_UAPSD_MAXSP(_qosinfo) (((_qosinfo) >> WME_CAPINFO_UAPSD_MAXSP_SHIFT) & WME_CAPINFO_UAPSD_MAXSP_MASK) ++#define WME_UAPSD_AC_ENABLED(_ac, _qosinfo) ( (1<<(3 - (_ac))) & \ ++ (((_qosinfo) >> WME_CAPINFO_UAPSD_ACFLAGS_SHIFT) & WME_CAPINFO_UAPSD_ACFLAGS_MASK) ) ++ ++/* ++ * Atheros Advanced Capability information element. ++ */ ++struct ieee80211_ie_athAdvCap { ++ u_int8_t athAdvCap_id; /* IEEE80211_ELEMID_VENDOR */ ++ u_int8_t athAdvCap_len; /* length in bytes */ ++ u_int8_t athAdvCap_oui[3]; /* 0x00, 0x03, 0x7f */ ++ u_int8_t athAdvCap_type; /* OUI type */ ++ u_int8_t athAdvCap_subtype; /* OUI subtype */ ++ u_int8_t athAdvCap_version; /* spec revision */ ++ u_int8_t athAdvCap_capability; /* Capability info */ ++ u_int16_t athAdvCap_defKeyIndex; ++} __packed; ++ ++/* ++ * Atheros XR information element. ++ */ ++struct ieee80211_xr_param { ++ u_int8_t param_id; ++ u_int8_t param_len; ++ u_int8_t param_oui[3]; ++ u_int8_t param_oui_type; ++ u_int8_t param_oui_sybtype; ++ u_int8_t param_version; ++ u_int8_t param_Info; ++ u_int8_t param_base_bssid[IEEE80211_ADDR_LEN]; ++ u_int8_t param_xr_bssid[IEEE80211_ADDR_LEN]; ++ u_int16_t param_xr_beacon_interval; ++ u_int8_t param_base_ath_capability; ++ u_int8_t param_xr_ath_capability; ++} __packed; ++ ++/* Atheros capabilities */ ++#define IEEE80211_ATHC_TURBOP 0x0001 /* Turbo Prime */ ++#define IEEE80211_ATHC_COMP 0x0002 /* Compression */ ++#define IEEE80211_ATHC_FF 0x0004 /* Fast Frames */ ++#define IEEE80211_ATHC_XR 0x0008 /* Xtended Range support */ ++#define IEEE80211_ATHC_AR 0x0010 /* Advanced Radar support */ ++#define IEEE80211_ATHC_BURST 0x0020 /* Bursting - not negotiated */ ++#define IEEE80211_ATHC_WME 0x0040 /* CWMin tuning */ ++#define IEEE80211_ATHC_BOOST 0x0080 /* Boost */ ++ ++/* ++ * Management Notification Frame ++ */ ++struct ieee80211_mnf { ++ u_int8_t mnf_category; ++ u_int8_t mnf_action; ++ u_int8_t mnf_dialog; ++ u_int8_t mnf_status; ++} __packed; ++#define MNF_SETUP_REQ 0 ++#define MNF_SETUP_RESP 1 ++#define MNF_TEARDOWN 2 ++ ++/* ++ * Control frames. ++ */ ++struct ieee80211_frame_min { ++ u_int8_t i_fc[2]; ++ u_int8_t i_dur[2]; ++ u_int8_t i_addr1[IEEE80211_ADDR_LEN]; ++ u_int8_t i_addr2[IEEE80211_ADDR_LEN]; ++ /* FCS */ ++} __packed; ++ ++struct ieee80211_frame_rts { ++ u_int8_t i_fc[2]; ++ u_int8_t i_dur[2]; ++ u_int8_t i_ra[IEEE80211_ADDR_LEN]; ++ u_int8_t i_ta[IEEE80211_ADDR_LEN]; ++ /* FCS */ ++} __packed; ++ ++struct ieee80211_frame_cts { ++ u_int8_t i_fc[2]; ++ u_int8_t i_dur[2]; ++ u_int8_t i_ra[IEEE80211_ADDR_LEN]; ++ /* FCS */ ++} __packed; ++ ++struct ieee80211_frame_ack { ++ u_int8_t i_fc[2]; ++ u_int8_t i_dur[2]; ++ u_int8_t i_ra[IEEE80211_ADDR_LEN]; ++ /* FCS */ ++} __packed; ++ ++struct ieee80211_frame_pspoll { ++ u_int8_t i_fc[2]; ++ u_int8_t i_aid[2]; ++ u_int8_t i_bssid[IEEE80211_ADDR_LEN]; ++ u_int8_t i_ta[IEEE80211_ADDR_LEN]; ++ /* FCS */ ++} __packed; ++ ++struct ieee80211_frame_cfend { /* NB: also CF-End+CF-Ack */ ++ u_int8_t i_fc[2]; ++ u_int8_t i_dur[2]; /* should be zero */ ++ u_int8_t i_ra[IEEE80211_ADDR_LEN]; ++ u_int8_t i_bssid[IEEE80211_ADDR_LEN]; ++ /* FCS */ ++} __packed; ++ ++/* ++ * BEACON management packets ++ * ++ * octet timestamp[8] ++ * octet beacon interval[2] ++ * octet capability information[2] ++ * information element ++ * octet elemid ++ * octet length ++ * octet information[length] ++ */ ++ ++typedef u_int8_t *ieee80211_mgt_beacon_t; ++ ++#define IEEE80211_BEACON_INTERVAL(beacon) \ ++ ((beacon)[8] | ((beacon)[9] << 8)) ++#define IEEE80211_BEACON_CAPABILITY(beacon) \ ++ ((beacon)[10] | ((beacon)[11] << 8)) ++ ++#define IEEE80211_CAPINFO_ESS 0x0001 ++#define IEEE80211_CAPINFO_IBSS 0x0002 ++#define IEEE80211_CAPINFO_CF_POLLABLE 0x0004 ++#define IEEE80211_CAPINFO_CF_POLLREQ 0x0008 ++#define IEEE80211_CAPINFO_PRIVACY 0x0010 ++#define IEEE80211_CAPINFO_SHORT_PREAMBLE 0x0020 ++#define IEEE80211_CAPINFO_PBCC 0x0040 ++#define IEEE80211_CAPINFO_CHNL_AGILITY 0x0080 ++/* bits 8-9 are reserved (8 now for specturm management) */ ++#define IEEE80211_CAPINFO_SPECTRUM_MGMT 0x0100 ++#define IEEE80211_CAPINFO_SHORT_SLOTTIME 0x0400 ++#define IEEE80211_CAPINFO_RSN 0x0800 ++/* bit 12 is reserved */ ++#define IEEE80211_CAPINFO_DSSSOFDM 0x2000 ++/* bits 14-15 are reserved */ ++ ++/* ++ * 802.11i/WPA information element (maximally sized). ++ */ ++struct ieee80211_ie_wpa { ++ u_int8_t wpa_id; /* IEEE80211_ELEMID_VENDOR */ ++ u_int8_t wpa_len; /* length in bytes */ ++ u_int8_t wpa_oui[3]; /* 0x00, 0x50, 0xf2 */ ++ u_int8_t wpa_type; /* OUI type */ ++ u_int16_t wpa_version; /* spec revision */ ++ u_int32_t wpa_mcipher[1]; /* multicast/group key cipher */ ++ u_int16_t wpa_uciphercnt; /* # pairwise key ciphers */ ++ u_int32_t wpa_uciphers[8]; /* ciphers */ ++ u_int16_t wpa_authselcnt; /* authentication selector cnt*/ ++ u_int32_t wpa_authsels[8]; /* selectors */ ++ u_int16_t wpa_caps; /* 802.11i capabilities */ ++ u_int16_t wpa_pmkidcnt; /* 802.11i pmkid count */ ++ u_int16_t wpa_pmkids[8]; /* 802.11i pmkids */ ++} __packed; ++ ++/* ++ * Management information element payloads. ++ */ ++ ++enum { ++ IEEE80211_ELEMID_SSID = 0, ++ IEEE80211_ELEMID_RATES = 1, ++ IEEE80211_ELEMID_FHPARMS = 2, ++ IEEE80211_ELEMID_DSPARMS = 3, ++ IEEE80211_ELEMID_CFPARMS = 4, ++ IEEE80211_ELEMID_TIM = 5, ++ IEEE80211_ELEMID_IBSSPARMS = 6, ++ IEEE80211_ELEMID_COUNTRY = 7, ++ IEEE80211_ELEMID_REQINFO = 10, ++ IEEE80211_ELEMID_CHALLENGE = 16, ++ /* 17-31 reserved for challenge text extension */ ++ IEEE80211_ELEMID_PWRCNSTR = 32, ++ IEEE80211_ELEMID_PWRCAP = 33, ++ IEEE80211_ELEMID_TPCREQ = 34, ++ IEEE80211_ELEMID_TPCREP = 35, ++ IEEE80211_ELEMID_SUPPCHAN = 36, ++ IEEE80211_ELEMID_CHANSWITCHANN = 37, ++ IEEE80211_ELEMID_MEASREQ = 38, ++ IEEE80211_ELEMID_MEASREP = 39, ++ IEEE80211_ELEMID_QUIET = 40, ++ IEEE80211_ELEMID_IBSSDFS = 41, ++ IEEE80211_ELEMID_ERP = 42, ++ IEEE80211_ELEMID_RSN = 48, ++ IEEE80211_ELEMID_XRATES = 50, ++ /* 128-129 proprietary elements used by Agere chipsets */ ++ IEEE80211_ELEMID_AGERE1 = 128, ++ IEEE80211_ELEMID_AGERE2 = 129, ++ IEEE80211_ELEMID_TPC = 150, ++ IEEE80211_ELEMID_CCKM = 156, ++ IEEE80211_ELEMID_VENDOR = 221, /* vendor private */ ++}; ++ ++#define IEEE80211_CHANSWITCHANN_BYTES 5 ++ ++struct ieee80211_tim_ie { ++ u_int8_t tim_ie; /* IEEE80211_ELEMID_TIM */ ++ u_int8_t tim_len; ++ u_int8_t tim_count; /* DTIM count */ ++ u_int8_t tim_period; /* DTIM period */ ++ u_int8_t tim_bitctl; /* bitmap control */ ++ u_int8_t tim_bitmap[1]; /* variable-length bitmap */ ++} __packed; ++ ++struct ieee80211_country_ie { ++ u_int8_t ie; /* IEEE80211_ELEMID_COUNTRY */ ++ u_int8_t len; ++ u_int8_t cc[3]; /* ISO CC+(I)ndoor/(O)utdoor */ ++ struct { ++ u_int8_t schan; /* starting channel */ ++ u_int8_t nchan; /* number channels */ ++ u_int8_t maxtxpwr; /* tx power cap */ ++ } __packed band[4]; /* up to 4 sub bands */ ++} __packed; ++ ++#define IEEE80211_CHALLENGE_LEN 128 ++ ++#define IEEE80211_SUPPCHAN_LEN 26 ++ ++#define IEEE80211_RATE_BASIC 0x80 ++#define IEEE80211_RATE_VAL 0x7f ++ ++/* EPR information element flags */ ++#define IEEE80211_ERP_NON_ERP_PRESENT 0x01 ++#define IEEE80211_ERP_USE_PROTECTION 0x02 ++#define IEEE80211_ERP_LONG_PREAMBLE 0x04 ++ ++/* Atheros private advanced capabilities info */ ++#define ATHEROS_CAP_TURBO_PRIME 0x01 ++#define ATHEROS_CAP_COMPRESSION 0x02 ++#define ATHEROS_CAP_FAST_FRAME 0x04 ++/* bits 3-6 reserved */ ++#define ATHEROS_CAP_BOOST 0x80 ++ ++#define ATH_OUI 0x7f0300 /* Atheros OUI */ ++#define ATH_OUI_TYPE 0x01 ++#define ATH_OUI_SUBTYPE 0x01 ++#define ATH_OUI_VERSION 0x00 ++#define ATH_OUI_TYPE_XR 0x03 ++#define ATH_OUI_VER_XR 0x01 ++ ++#define WPA_OUI 0xf25000 ++#define WPA_OUI_TYPE 0x01 ++#define WPA_VERSION 1 /* current supported version */ ++ ++#define WPA_CSE_NULL 0x00 ++#define WPA_CSE_WEP40 0x01 ++#define WPA_CSE_TKIP 0x02 ++#define WPA_CSE_CCMP 0x04 ++#define WPA_CSE_WEP104 0x05 ++ ++#define WPA_ASE_NONE 0x00 ++#define WPA_ASE_8021X_UNSPEC 0x01 ++#define WPA_ASE_8021X_PSK 0x02 ++ ++#define RSN_OUI 0xac0f00 ++#define RSN_VERSION 1 /* current supported version */ ++ ++#define RSN_CSE_NULL 0x00 ++#define RSN_CSE_WEP40 0x01 ++#define RSN_CSE_TKIP 0x02 ++#define RSN_CSE_WRAP 0x03 ++#define RSN_CSE_CCMP 0x04 ++#define RSN_CSE_WEP104 0x05 ++ ++#define RSN_ASE_NONE 0x00 ++#define RSN_ASE_8021X_UNSPEC 0x01 ++#define RSN_ASE_8021X_PSK 0x02 ++ ++#define RSN_CAP_PREAUTH 0x01 ++ ++#define WME_OUI 0xf25000 ++#define WME_OUI_TYPE 0x02 ++#define WME_INFO_OUI_SUBTYPE 0x00 ++#define WME_PARAM_OUI_SUBTYPE 0x01 ++#define WME_VERSION 1 ++ ++/* WME stream classes */ ++#define WME_AC_BE 0 /* best effort */ ++#define WME_AC_BK 1 /* background */ ++#define WME_AC_VI 2 /* video */ ++#define WME_AC_VO 3 /* voice */ ++ ++/* ++ * AUTH management packets ++ * ++ * octet algo[2] ++ * octet seq[2] ++ * octet status[2] ++ * octet chal.id ++ * octet chal.length ++ * octet chal.text[253] ++ */ ++ ++typedef u_int8_t *ieee80211_mgt_auth_t; ++ ++#define IEEE80211_AUTH_ALGORITHM(auth) \ ++ ((auth)[0] | ((auth)[1] << 8)) ++#define IEEE80211_AUTH_TRANSACTION(auth) \ ++ ((auth)[2] | ((auth)[3] << 8)) ++#define IEEE80211_AUTH_STATUS(auth) \ ++ ((auth)[4] | ((auth)[5] << 8)) ++ ++#define IEEE80211_AUTH_ALG_OPEN 0x0000 ++#define IEEE80211_AUTH_ALG_SHARED 0x0001 ++#define IEEE80211_AUTH_ALG_LEAP 0x0080 ++ ++enum { ++ IEEE80211_AUTH_OPEN_REQUEST = 1, ++ IEEE80211_AUTH_OPEN_RESPONSE = 2, ++}; ++ ++enum { ++ IEEE80211_AUTH_SHARED_REQUEST = 1, ++ IEEE80211_AUTH_SHARED_CHALLENGE = 2, ++ IEEE80211_AUTH_SHARED_RESPONSE = 3, ++ IEEE80211_AUTH_SHARED_PASS = 4, ++}; ++ ++/* ++ * Reason codes ++ * ++ * Unlisted codes are reserved ++ */ ++ ++enum { ++ IEEE80211_REASON_UNSPECIFIED = 1, ++ IEEE80211_REASON_AUTH_EXPIRE = 2, ++ IEEE80211_REASON_AUTH_LEAVE = 3, ++ IEEE80211_REASON_ASSOC_EXPIRE = 4, ++ IEEE80211_REASON_ASSOC_TOOMANY = 5, ++ IEEE80211_REASON_NOT_AUTHED = 6, ++ IEEE80211_REASON_NOT_ASSOCED = 7, ++ IEEE80211_REASON_ASSOC_LEAVE = 8, ++ IEEE80211_REASON_ASSOC_NOT_AUTHED = 9, ++ ++ IEEE80211_REASON_RSN_REQUIRED = 11, ++ IEEE80211_REASON_RSN_INCONSISTENT = 12, ++ IEEE80211_REASON_IE_INVALID = 13, ++ IEEE80211_REASON_MIC_FAILURE = 14, ++ ++ IEEE80211_STATUS_SUCCESS = 0, ++ IEEE80211_STATUS_UNSPECIFIED = 1, ++ IEEE80211_STATUS_CAPINFO = 10, ++ IEEE80211_STATUS_NOT_ASSOCED = 11, ++ IEEE80211_STATUS_OTHER = 12, ++ IEEE80211_STATUS_ALG = 13, ++ IEEE80211_STATUS_SEQUENCE = 14, ++ IEEE80211_STATUS_CHALLENGE = 15, ++ IEEE80211_STATUS_TIMEOUT = 16, ++ IEEE80211_STATUS_TOOMANY = 17, ++ IEEE80211_STATUS_BASIC_RATE = 18, ++ IEEE80211_STATUS_SP_REQUIRED = 19, ++ IEEE80211_STATUS_PBCC_REQUIRED = 20, ++ IEEE80211_STATUS_CA_REQUIRED = 21, ++ IEEE80211_STATUS_TOO_MANY_STATIONS = 22, ++ IEEE80211_STATUS_RATES = 23, ++ IEEE80211_STATUS_SHORTSLOT_REQUIRED = 25, ++ IEEE80211_STATUS_DSSSOFDM_REQUIRED = 26, ++}; ++ ++#define IEEE80211_WEP_KEYLEN 5 /* 40bit */ ++#define IEEE80211_WEP_IVLEN 3 /* 24bit */ ++#define IEEE80211_WEP_KIDLEN 1 /* 1 octet */ ++#define IEEE80211_WEP_CRCLEN 4 /* CRC-32 */ ++#define IEEE80211_WEP_NKID 4 /* number of key ids */ ++ ++/* ++ * 802.11i defines an extended IV for use with non-WEP ciphers. ++ * When the EXTIV bit is set in the key id byte an additional ++ * 4 bytes immediately follow the IV for TKIP. For CCMP the ++ * EXTIV bit is likewise set but the 8 bytes represent the ++ * CCMP header rather than IV+extended-IV. ++ */ ++#define IEEE80211_WEP_EXTIV 0x20 ++#define IEEE80211_WEP_EXTIVLEN 4 /* extended IV length */ ++#define IEEE80211_WEP_MICLEN 8 /* trailing MIC */ ++ ++#define IEEE80211_CRC_LEN 4 ++ ++/* ++ * Maximum acceptable MTU is: ++ * IEEE80211_MAX_LEN - WEP overhead - CRC - ++ * QoS overhead - RSN/WPA overhead ++ * Min is arbitrarily chosen > IEEE80211_MIN_LEN. The default ++ * mtu is Ethernet-compatible; it's set by ether_ifattach. ++ */ ++#define IEEE80211_MTU_MAX 2290 ++#define IEEE80211_MTU_MIN 32 ++ ++#define IEEE80211_MAX_LEN (2300 + IEEE80211_CRC_LEN + \ ++ (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + IEEE80211_WEP_CRCLEN)) ++#define IEEE80211_ACK_LEN \ ++ (sizeof(struct ieee80211_frame_ack) + IEEE80211_CRC_LEN) ++#define IEEE80211_MIN_LEN \ ++ (sizeof(struct ieee80211_frame_min) + IEEE80211_CRC_LEN) ++ ++/* ++ * The 802.11 spec says at most 2007 stations may be ++ * associated at once. For most AP's this is way more ++ * than is feasible so we use a default of 128. This ++ * number may be overridden by the driver and/or by ++ * user configuration. ++ */ ++#define IEEE80211_AID_MAX 2007 ++#define IEEE80211_AID_DEF 128 ++ ++#define IEEE80211_AID(b) ((b) &~ 0xc000) ++ ++/* ++ * RTS frame length parameters. The default is specified in ++ * the 802.11 spec. The max may be wrong for jumbo frames. ++ */ ++#define IEEE80211_RTS_DEFAULT 512 ++#define IEEE80211_RTS_MIN 1 ++#define IEEE80211_RTS_MAX 2346 ++ ++/* ++ * Regulatory extention identifier for country IE. ++ */ ++#define IEEE80211_REG_EXT_ID 201 ++ ++/* ++ * IEEE 802.11 timer synchronization function (TSF) timestamp length ++ */ ++#define IEEE80211_TSF_LEN 8 ++ ++#endif /* _NET80211_IEEE80211_H_ */ +diff -Nrup wpa_supplicant.orig/driver_madwifi/net80211/ieee80211_ioctl.h wpa_supplicant/driver_madwifi/net80211/ieee80211_ioctl.h +--- wpa_supplicant.orig/driver_madwifi/net80211/ieee80211_ioctl.h 1970-01-01 10:00:00.000000000 +1000 ++++ wpa_supplicant/driver_madwifi/net80211/ieee80211_ioctl.h 2006-10-20 14:16:14.000000000 +1000 +@@ -0,0 +1,659 @@ ++/*- ++ * Copyright (c) 2001 Atsushi Onoe ++ * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The name of the author may not be used to endorse or promote products ++ * derived from this software without specific prior written permission. ++ * ++ * Alternatively, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2 as published by the Free ++ * Software Foundation. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ * ++ * $Id: ieee80211_ioctl.h 1756 2006-10-18 11:41:05Z kelmo $ ++ */ ++#ifndef _NET80211_IEEE80211_IOCTL_H_ ++#define _NET80211_IEEE80211_IOCTL_H_ ++ ++/* ++ * IEEE 802.11 ioctls. ++ */ ++#include ++#include ++#include ++ ++/* ++ * Per/node (station) statistics available when operating as an AP. ++ */ ++struct ieee80211_nodestats { ++ u_int32_t ns_rx_data; /* rx data frames */ ++ u_int32_t ns_rx_mgmt; /* rx management frames */ ++ u_int32_t ns_rx_ctrl; /* rx control frames */ ++ u_int32_t ns_rx_ucast; /* rx unicast frames */ ++ u_int32_t ns_rx_mcast; /* rx multi/broadcast frames */ ++ u_int64_t ns_rx_bytes; /* rx data count (bytes) */ ++ u_int64_t ns_rx_beacons; /* rx beacon frames */ ++ u_int32_t ns_rx_proberesp; /* rx probe response frames */ ++ ++ u_int32_t ns_rx_dup; /* rx discard because it's a dup */ ++ u_int32_t ns_rx_noprivacy; /* rx w/ wep but privacy off */ ++ u_int32_t ns_rx_wepfail; /* rx wep processing failed */ ++ u_int32_t ns_rx_demicfail; /* rx demic failed */ ++ u_int32_t ns_rx_decap; /* rx decapsulation failed */ ++ u_int32_t ns_rx_defrag; /* rx defragmentation failed */ ++ u_int32_t ns_rx_disassoc; /* rx disassociation */ ++ u_int32_t ns_rx_deauth; /* rx deauthentication */ ++ u_int32_t ns_rx_decryptcrc; /* rx decrypt failed on crc */ ++ u_int32_t ns_rx_unauth; /* rx on unauthorized port */ ++ u_int32_t ns_rx_unencrypted; /* rx unecrypted w/ privacy */ ++ ++ u_int32_t ns_tx_data; /* tx data frames */ ++ u_int32_t ns_tx_mgmt; /* tx management frames */ ++ u_int32_t ns_tx_ucast; /* tx unicast frames */ ++ u_int32_t ns_tx_mcast; /* tx multi/broadcast frames */ ++ u_int64_t ns_tx_bytes; /* tx data count (bytes) */ ++ u_int32_t ns_tx_probereq; /* tx probe request frames */ ++ u_int32_t ns_tx_uapsd; /* tx on uapsd queue */ ++ ++ u_int32_t ns_tx_novlantag; /* tx discard due to no tag */ ++ u_int32_t ns_tx_vlanmismatch; /* tx discard due to of bad tag */ ++ ++ u_int32_t ns_tx_eosplost; /* uapsd EOSP retried out */ ++ ++ u_int32_t ns_ps_discard; /* ps discard due to of age */ ++ ++ u_int32_t ns_uapsd_triggers; /* uapsd triggers */ ++ ++ /* MIB-related state */ ++ u_int32_t ns_tx_assoc; /* [re]associations */ ++ u_int32_t ns_tx_assoc_fail; /* [re]association failures */ ++ u_int32_t ns_tx_auth; /* [re]authentications */ ++ u_int32_t ns_tx_auth_fail; /* [re]authentication failures*/ ++ u_int32_t ns_tx_deauth; /* deauthentications */ ++ u_int32_t ns_tx_deauth_code; /* last deauth reason */ ++ u_int32_t ns_tx_disassoc; /* disassociations */ ++ u_int32_t ns_tx_disassoc_code; /* last disassociation reason */ ++ u_int32_t ns_psq_drops; /* power save queue drops */ ++}; ++ ++/* ++ * Summary statistics. ++ */ ++struct ieee80211_stats { ++ u_int32_t is_rx_badversion; /* rx frame with bad version */ ++ u_int32_t is_rx_tooshort; /* rx frame too short */ ++ u_int32_t is_rx_wrongbss; /* rx from wrong bssid */ ++ u_int32_t is_rx_dup; /* rx discard due to it's a dup */ ++ u_int32_t is_rx_wrongdir; /* rx w/ wrong direction */ ++ u_int32_t is_rx_mcastecho; /* rx discard due to of mcast echo */ ++ u_int32_t is_rx_notassoc; /* rx discard due to sta !assoc */ ++ u_int32_t is_rx_noprivacy; /* rx w/ wep but privacy off */ ++ u_int32_t is_rx_unencrypted; /* rx w/o wep and privacy on */ ++ u_int32_t is_rx_wepfail; /* rx wep processing failed */ ++ u_int32_t is_rx_decap; /* rx decapsulation failed */ ++ u_int32_t is_rx_mgtdiscard; /* rx discard mgt frames */ ++ u_int32_t is_rx_ctl; /* rx discard ctrl frames */ ++ u_int32_t is_rx_beacon; /* rx beacon frames */ ++ u_int32_t is_rx_rstoobig; /* rx rate set truncated */ ++ u_int32_t is_rx_elem_missing; /* rx required element missing*/ ++ u_int32_t is_rx_elem_toobig; /* rx element too big */ ++ u_int32_t is_rx_elem_toosmall; /* rx element too small */ ++ u_int32_t is_rx_elem_unknown; /* rx element unknown */ ++ u_int32_t is_rx_badchan; /* rx frame w/ invalid chan */ ++ u_int32_t is_rx_chanmismatch; /* rx frame chan mismatch */ ++ u_int32_t is_rx_nodealloc; /* rx frame dropped */ ++ u_int32_t is_rx_ssidmismatch; /* rx frame ssid mismatch */ ++ u_int32_t is_rx_auth_unsupported;/* rx w/ unsupported auth alg */ ++ u_int32_t is_rx_auth_fail; /* rx sta auth failure */ ++ u_int32_t is_rx_auth_countermeasures;/* rx auth discard due to CM */ ++ u_int32_t is_rx_assoc_bss; /* rx assoc from wrong bssid */ ++ u_int32_t is_rx_assoc_notauth; /* rx assoc w/o auth */ ++ u_int32_t is_rx_assoc_capmismatch;/* rx assoc w/ cap mismatch */ ++ u_int32_t is_rx_assoc_norate; /* rx assoc w/ no rate match */ ++ u_int32_t is_rx_assoc_badwpaie; /* rx assoc w/ bad WPA IE */ ++ u_int32_t is_rx_deauth; /* rx deauthentication */ ++ u_int32_t is_rx_disassoc; /* rx disassociation */ ++ u_int32_t is_rx_badsubtype; /* rx frame w/ unknown subtype*/ ++ u_int32_t is_rx_nobuf; /* rx failed for lack of buf */ ++ u_int32_t is_rx_decryptcrc; /* rx decrypt failed on crc */ ++ u_int32_t is_rx_ahdemo_mgt; /* rx discard ahdemo mgt frame*/ ++ u_int32_t is_rx_bad_auth; /* rx bad auth request */ ++ u_int32_t is_rx_unauth; /* rx on unauthorized port */ ++ u_int32_t is_rx_badkeyid; /* rx w/ incorrect keyid */ ++ u_int32_t is_rx_ccmpreplay; /* rx seq# violation (CCMP) */ ++ u_int32_t is_rx_ccmpformat; /* rx format bad (CCMP) */ ++ u_int32_t is_rx_ccmpmic; /* rx MIC check failed (CCMP) */ ++ u_int32_t is_rx_tkipreplay; /* rx seq# violation (TKIP) */ ++ u_int32_t is_rx_tkipformat; /* rx format bad (TKIP) */ ++ u_int32_t is_rx_tkipmic; /* rx MIC check failed (TKIP) */ ++ u_int32_t is_rx_tkipicv; /* rx ICV check failed (TKIP) */ ++ u_int32_t is_rx_badcipher; /* rx failed due to of key type */ ++ u_int32_t is_rx_nocipherctx; /* rx failed due to key !setup */ ++ u_int32_t is_rx_acl; /* rx discard due to of acl policy */ ++ u_int32_t is_rx_ffcnt; /* rx fast frames */ ++ u_int32_t is_rx_badathtnl; /* driver key alloc failed */ ++ u_int32_t is_tx_nobuf; /* tx failed for lack of buf */ ++ u_int32_t is_tx_nonode; /* tx failed for no node */ ++ u_int32_t is_tx_unknownmgt; /* tx of unknown mgt frame */ ++ u_int32_t is_tx_badcipher; /* tx failed due to of key type */ ++ u_int32_t is_tx_nodefkey; /* tx failed due to no defkey */ ++ u_int32_t is_tx_noheadroom; /* tx failed due to no space */ ++ u_int32_t is_tx_ffokcnt; /* tx fast frames sent success */ ++ u_int32_t is_tx_fferrcnt; /* tx fast frames sent success */ ++ u_int32_t is_scan_active; /* active scans started */ ++ u_int32_t is_scan_passive; /* passive scans started */ ++ u_int32_t is_node_timeout; /* nodes timed out inactivity */ ++ u_int32_t is_crypto_nomem; /* no memory for crypto ctx */ ++ u_int32_t is_crypto_tkip; /* tkip crypto done in s/w */ ++ u_int32_t is_crypto_tkipenmic; /* tkip en-MIC done in s/w */ ++ u_int32_t is_crypto_tkipdemic; /* tkip de-MIC done in s/w */ ++ u_int32_t is_crypto_tkipcm; /* tkip counter measures */ ++ u_int32_t is_crypto_ccmp; /* ccmp crypto done in s/w */ ++ u_int32_t is_crypto_wep; /* wep crypto done in s/w */ ++ u_int32_t is_crypto_setkey_cipher;/* cipher rejected key */ ++ u_int32_t is_crypto_setkey_nokey;/* no key index for setkey */ ++ u_int32_t is_crypto_delkey; /* driver key delete failed */ ++ u_int32_t is_crypto_badcipher; /* unknown cipher */ ++ u_int32_t is_crypto_nocipher; /* cipher not available */ ++ u_int32_t is_crypto_attachfail; /* cipher attach failed */ ++ u_int32_t is_crypto_swfallback; /* cipher fallback to s/w */ ++ u_int32_t is_crypto_keyfail; /* driver key alloc failed */ ++ u_int32_t is_crypto_enmicfail; /* en-MIC failed */ ++ u_int32_t is_ibss_capmismatch; /* merge failed-cap mismatch */ ++ u_int32_t is_ibss_norate; /* merge failed-rate mismatch */ ++ u_int32_t is_ps_unassoc; /* ps-poll for unassoc. sta */ ++ u_int32_t is_ps_badaid; /* ps-poll w/ incorrect aid */ ++ u_int32_t is_ps_qempty; /* ps-poll w/ nothing to send */ ++}; ++ ++/* ++ * Max size of optional information elements. We artificially ++ * constrain this; it's limited only by the max frame size (and ++ * the max parameter size of the wireless extensions). ++ */ ++#define IEEE80211_MAX_OPT_IE 256 ++ ++/* ++ * WPA/RSN get/set key request. Specify the key/cipher ++ * type and whether the key is to be used for sending and/or ++ * receiving. The key index should be set only when working ++ * with global keys (use IEEE80211_KEYIX_NONE for ``no index''). ++ * Otherwise a unicast/pairwise key is specified by the bssid ++ * (on a station) or mac address (on an ap). They key length ++ * must include any MIC key data; otherwise it should be no ++ more than IEEE80211_KEYBUF_SIZE. ++ */ ++struct ieee80211req_key { ++ u_int8_t ik_type; /* key/cipher type */ ++ u_int8_t ik_pad; ++ u_int16_t ik_keyix; /* key index */ ++ u_int8_t ik_keylen; /* key length in bytes */ ++ u_int8_t ik_flags; ++/* NB: IEEE80211_KEY_XMIT and IEEE80211_KEY_RECV defined elsewhere */ ++#define IEEE80211_KEY_DEFAULT 0x80 /* default xmit key */ ++ u_int8_t ik_macaddr[IEEE80211_ADDR_LEN]; ++ u_int64_t ik_keyrsc; /* key receive sequence counter */ ++ u_int64_t ik_keytsc; /* key transmit sequence counter */ ++ u_int8_t ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE]; ++}; ++ ++/* ++ * Delete a key either by index or address. Set the index ++ * to IEEE80211_KEYIX_NONE when deleting a unicast key. ++ */ ++struct ieee80211req_del_key { ++ u_int8_t idk_keyix; /* key index */ ++ u_int8_t idk_macaddr[IEEE80211_ADDR_LEN]; ++}; ++ ++/* ++ * MLME state manipulation request. IEEE80211_MLME_ASSOC ++ * only makes sense when operating as a station. The other ++ * requests can be used when operating as a station or an ++ * ap (to effect a station). ++ */ ++struct ieee80211req_mlme { ++ u_int8_t im_op; /* operation to perform */ ++#define IEEE80211_MLME_ASSOC 1 /* associate station */ ++#define IEEE80211_MLME_DISASSOC 2 /* disassociate station */ ++#define IEEE80211_MLME_DEAUTH 3 /* deauthenticate station */ ++#define IEEE80211_MLME_AUTHORIZE 4 /* authorize station */ ++#define IEEE80211_MLME_UNAUTHORIZE 5 /* unauthorize station */ ++#define IEEE80211_MLME_CLEAR_STATS 6 /* clear station statistic */ ++ u_int8_t im_ssid_len; /* length of optional ssid */ ++ u_int16_t im_reason; /* 802.11 reason code */ ++ u_int8_t im_macaddr[IEEE80211_ADDR_LEN]; ++ u_int8_t im_ssid[IEEE80211_NWID_LEN]; ++}; ++ ++/* ++ * MAC ACL operations. ++ */ ++enum { ++ IEEE80211_MACCMD_POLICY_OPEN = 0, /* set policy: no ACL's */ ++ IEEE80211_MACCMD_POLICY_ALLOW = 1, /* set policy: allow traffic */ ++ IEEE80211_MACCMD_POLICY_DENY = 2, /* set policy: deny traffic */ ++ IEEE80211_MACCMD_FLUSH = 3, /* flush ACL database */ ++ IEEE80211_MACCMD_DETACH = 4, /* detach ACL policy */ ++}; ++ ++/* ++ * Set the active channel list. Note this list is ++ * intersected with the available channel list in ++ * calculating the set of channels actually used in ++ * scanning. ++ */ ++struct ieee80211req_chanlist { ++ u_int8_t ic_channels[IEEE80211_CHAN_BYTES]; ++}; ++ ++/* ++ * Get the active channel list info. ++ */ ++struct ieee80211req_chaninfo { ++ u_int ic_nchans; ++ struct ieee80211_channel ic_chans[IEEE80211_CHAN_MAX]; ++}; ++ ++/* ++ * Retrieve the WPA/RSN information element for an associated station. ++ */ ++struct ieee80211req_wpaie { ++ u_int8_t wpa_macaddr[IEEE80211_ADDR_LEN]; ++ u_int8_t wpa_ie[IEEE80211_MAX_OPT_IE]; ++ u_int8_t rsn_ie[IEEE80211_MAX_OPT_IE]; ++}; ++ ++/* ++ * Retrieve per-node statistics. ++ */ ++struct ieee80211req_sta_stats { ++ union { ++ /* NB: explicitly force 64-bit alignment */ ++ u_int8_t macaddr[IEEE80211_ADDR_LEN]; ++ u_int64_t pad; ++ } is_u; ++ struct ieee80211_nodestats is_stats; ++}; ++ ++/* ++ * Station information block; the mac address is used ++ * to retrieve other data like stats, unicast key, etc. ++ */ ++struct ieee80211req_sta_info { ++ u_int16_t isi_len; /* length (mult of 4) */ ++ u_int16_t isi_freq; /* MHz */ ++ u_int16_t isi_flags; /* channel flags */ ++ u_int16_t isi_state; /* state flags */ ++ u_int8_t isi_authmode; /* authentication algorithm */ ++ u_int8_t isi_rssi; ++ u_int16_t isi_capinfo; /* capabilities */ ++ u_int8_t isi_athflags; /* Atheros capabilities */ ++ u_int8_t isi_erp; /* ERP element */ ++ u_int8_t isi_macaddr[IEEE80211_ADDR_LEN]; ++ u_int8_t isi_nrates; /* negotiated rates */ ++ u_int8_t isi_rates[IEEE80211_RATE_MAXSIZE]; ++ u_int8_t isi_txrate; /* index to isi_rates[] */ ++ u_int16_t isi_ie_len; /* IE length */ ++ u_int16_t isi_associd; /* assoc response */ ++ u_int16_t isi_txpower; /* current tx power */ ++ u_int16_t isi_vlan; /* vlan tag */ ++ u_int16_t isi_txseqs[17]; /* seq to be transmitted */ ++ u_int16_t isi_rxseqs[17]; /* seq previous for qos frames*/ ++ u_int16_t isi_inact; /* inactivity timer */ ++ u_int8_t isi_uapsd; /* UAPSD queues */ ++ u_int8_t isi_opmode; /* sta operating mode */ ++ ++ /* XXX frag state? */ ++ /* variable length IE data */ ++}; ++ ++enum { ++ IEEE80211_STA_OPMODE_NORMAL, ++ IEEE80211_STA_OPMODE_XR ++}; ++ ++/* ++ * Retrieve per-station information; to retrieve all ++ * specify a mac address of ff:ff:ff:ff:ff:ff. ++ */ ++struct ieee80211req_sta_req { ++ union { ++ /* NB: explicitly force 64-bit alignment */ ++ u_int8_t macaddr[IEEE80211_ADDR_LEN]; ++ u_int64_t pad; ++ } is_u; ++ struct ieee80211req_sta_info info[1]; /* variable length */ ++}; ++ ++/* ++ * Get/set per-station tx power cap. ++ */ ++struct ieee80211req_sta_txpow { ++ u_int8_t it_macaddr[IEEE80211_ADDR_LEN]; ++ u_int8_t it_txpow; ++}; ++ ++/* ++ * WME parameters are set and return using i_val and i_len. ++ * i_val holds the value itself. i_len specifies the AC ++ * and, as appropriate, then high bit specifies whether the ++ * operation is to be applied to the BSS or ourself. ++ */ ++#define IEEE80211_WMEPARAM_SELF 0x0000 /* parameter applies to self */ ++#define IEEE80211_WMEPARAM_BSS 0x8000 /* parameter applies to BSS */ ++#define IEEE80211_WMEPARAM_VAL 0x7fff /* parameter value */ ++ ++/* ++ * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS. ++ */ ++struct ieee80211req_scan_result { ++ u_int16_t isr_len; /* length (mult of 4) */ ++ u_int16_t isr_freq; /* MHz */ ++ u_int16_t isr_flags; /* channel flags */ ++ u_int8_t isr_noise; ++ u_int8_t isr_rssi; ++ u_int8_t isr_intval; /* beacon interval */ ++ u_int16_t isr_capinfo; /* capabilities */ ++ u_int8_t isr_erp; /* ERP element */ ++ u_int8_t isr_bssid[IEEE80211_ADDR_LEN]; ++ u_int8_t isr_nrates; ++ u_int8_t isr_rates[IEEE80211_RATE_MAXSIZE]; ++ u_int8_t isr_ssid_len; /* SSID length */ ++ u_int8_t isr_ie_len; /* IE length */ ++ u_int8_t isr_pad[5]; ++ /* variable length SSID followed by IE data */ ++}; ++ ++#ifdef __FreeBSD__ ++/* ++ * FreeBSD-style ioctls. ++ */ ++/* the first member must be matched with struct ifreq */ ++struct ieee80211req { ++ char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */ ++ u_int16_t i_type; /* req type */ ++ int16_t i_val; /* Index or simple value */ ++ int16_t i_len; /* Index or simple value */ ++ void *i_data; /* Extra data */ ++}; ++#define SIOCS80211 _IOW('i', 234, struct ieee80211req) ++#define SIOCG80211 _IOWR('i', 235, struct ieee80211req) ++#define SIOCG80211STATS _IOWR('i', 236, struct ifreq) ++#define SIOC80211IFCREATE _IOWR('i', 237, struct ifreq) ++#define SIOC80211IFDESTROY _IOW('i', 238, struct ifreq) ++ ++#define IEEE80211_IOC_SSID 1 ++#define IEEE80211_IOC_NUMSSIDS 2 ++#define IEEE80211_IOC_WEP 3 ++#define IEEE80211_WEP_NOSUP -1 ++#define IEEE80211_WEP_OFF 0 ++#define IEEE80211_WEP_ON 1 ++#define IEEE80211_WEP_MIXED 2 ++#define IEEE80211_IOC_WEPKEY 4 ++#define IEEE80211_IOC_NUMWEPKEYS 5 ++#define IEEE80211_IOC_WEPTXKEY 6 ++#define IEEE80211_IOC_AUTHMODE 7 ++#define IEEE80211_IOC_STATIONNAME 8 ++#define IEEE80211_IOC_CHANNEL 9 ++#define IEEE80211_IOC_POWERSAVE 10 ++#define IEEE80211_POWERSAVE_NOSUP -1 ++#define IEEE80211_POWERSAVE_OFF 0 ++#define IEEE80211_POWERSAVE_CAM 1 ++#define IEEE80211_POWERSAVE_PSP 2 ++#define IEEE80211_POWERSAVE_PSP_CAM 3 ++#define IEEE80211_POWERSAVE_ON IEEE80211_POWERSAVE_CAM ++#define IEEE80211_IOC_POWERSAVESLEEP 11 ++#define IEEE80211_IOC_RTSTHRESHOLD 12 ++#define IEEE80211_IOC_PROTMODE 13 ++#define IEEE80211_PROTMODE_OFF 0 ++#define IEEE80211_PROTMODE_CTS 1 ++#define IEEE80211_PROTMODE_RTSCTS 2 ++#define IEEE80211_IOC_TXPOWER 14 /* global tx power limit */ ++#define IEEE80211_IOC_BSSID 15 ++#define IEEE80211_IOC_ROAMING 16 /* roaming mode */ ++#define IEEE80211_IOC_PRIVACY 17 /* privacy invoked */ ++#define IEEE80211_IOC_DROPUNENCRYPTED 18 /* discard unencrypted frames */ ++#define IEEE80211_IOC_WPAKEY 19 ++#define IEEE80211_IOC_DELKEY 20 ++#define IEEE80211_IOC_MLME 21 ++#define IEEE80211_IOC_OPTIE 22 /* optional info. element */ ++#define IEEE80211_IOC_SCAN_REQ 23 ++#define IEEE80211_IOC_SCAN_RESULTS 24 ++#define IEEE80211_IOC_COUNTERMEASURES 25 /* WPA/TKIP countermeasures */ ++#define IEEE80211_IOC_WPA 26 /* WPA mode (0,1,2) */ ++#define IEEE80211_IOC_CHANLIST 27 /* channel list */ ++#define IEEE80211_IOC_WME 28 /* WME mode (on, off) */ ++#define IEEE80211_IOC_HIDESSID 29 /* hide SSID mode (on, off) */ ++#define IEEE80211_IOC_APBRIDGE 30 /* AP inter-sta bridging */ ++#define IEEE80211_IOC_MCASTCIPHER 31 /* multicast/default cipher */ ++#define IEEE80211_IOC_MCASTKEYLEN 32 /* multicast key length */ ++#define IEEE80211_IOC_UCASTCIPHERS 33 /* unicast cipher suites */ ++#define IEEE80211_IOC_UCASTCIPHER 34 /* unicast cipher */ ++#define IEEE80211_IOC_UCASTKEYLEN 35 /* unicast key length */ ++#define IEEE80211_IOC_DRIVER_CAPS 36 /* driver capabilities */ ++#define IEEE80211_IOC_KEYMGTALGS 37 /* key management algorithms */ ++#define IEEE80211_IOC_RSNCAPS 38 /* RSN capabilities */ ++#define IEEE80211_IOC_WPAIE 39 /* WPA information element */ ++#define IEEE80211_IOC_STA_STATS 40 /* per-station statistics */ ++#define IEEE80211_IOC_MACCMD 41 /* MAC ACL operation */ ++#define IEEE80211_IOC_TXPOWMAX 43 /* max tx power for channel */ ++#define IEEE80211_IOC_STA_TXPOW 44 /* per-station tx power limit */ ++#define IEEE80211_IOC_STA_INFO 45 /* station/neighbor info */ ++#define IEEE80211_IOC_WME_CWMIN 46 /* WME: ECWmin */ ++#define IEEE80211_IOC_WME_CWMAX 47 /* WME: ECWmax */ ++#define IEEE80211_IOC_WME_AIFS 48 /* WME: AIFSN */ ++#define IEEE80211_IOC_WME_TXOPLIMIT 49 /* WME: txops limit */ ++#define IEEE80211_IOC_WME_ACM 50 /* WME: ACM (bss only) */ ++#define IEEE80211_IOC_WME_ACKPOLICY 51 /* WME: ACK policy (!bss only)*/ ++#define IEEE80211_IOC_DTIM_PERIOD 52 /* DTIM period (beacons) */ ++#define IEEE80211_IOC_BEACON_INTERVAL 53 /* beacon interval (ms) */ ++#define IEEE80211_IOC_ADDMAC 54 /* add sta to MAC ACL table */ ++#define IEEE80211_IOC_DELMAC 55 /* del sta from MAC ACL table */ ++#define IEEE80211_IOC_FF 56 /* ATH fast frames (on, off) */ ++#define IEEE80211_IOC_TURBOP 57 /* ATH turbo' (on, off) */ ++#define IEEE80211_IOC_APPIEBUF 58 /* IE in the management frame */ ++#define IEEE80211_IOC_FILTERFRAME 59 /* management frame filter */ ++ ++/* ++ * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS. ++ */ ++struct ieee80211req_scan_result { ++ u_int16_t isr_len; /* length (mult of 4) */ ++ u_int16_t isr_freq; /* MHz */ ++ u_int16_t isr_flags; /* channel flags */ ++ u_int8_t isr_noise; ++ u_int8_t isr_rssi; ++ u_int8_t isr_intval; /* beacon interval */ ++ u_int16_t isr_capinfo; /* capabilities */ ++ u_int8_t isr_erp; /* ERP element */ ++ u_int8_t isr_bssid[IEEE80211_ADDR_LEN]; ++ u_int8_t isr_nrates; ++ u_int8_t isr_rates[IEEE80211_RATE_MAXSIZE]; ++ u_int8_t isr_ssid_len; /* SSID length */ ++ u_int8_t isr_ie_len; /* IE length */ ++ u_int8_t isr_pad[5]; ++ /* variable length SSID followed by IE data */ ++}; ++ ++#endif /* __FreeBSD__ */ ++ ++#ifdef __linux__ ++/* ++ * Wireless Extensions API, private ioctl interfaces. ++ * ++ * NB: Even-numbered ioctl numbers have set semantics and are privileged! ++ * (regardless of the incorrect comment in wireless.h!) ++ */ ++#ifdef __KERNEL__ ++#include ++#endif ++#define IEEE80211_IOCTL_SETPARAM (SIOCIWFIRSTPRIV+0) ++#define IEEE80211_IOCTL_GETPARAM (SIOCIWFIRSTPRIV+1) ++#define IEEE80211_IOCTL_SETMODE (SIOCIWFIRSTPRIV+2) ++#define IEEE80211_IOCTL_GETMODE (SIOCIWFIRSTPRIV+3) ++#define IEEE80211_IOCTL_SETWMMPARAMS (SIOCIWFIRSTPRIV+4) ++#define IEEE80211_IOCTL_GETWMMPARAMS (SIOCIWFIRSTPRIV+5) ++#define IEEE80211_IOCTL_SETCHANLIST (SIOCIWFIRSTPRIV+6) ++#define IEEE80211_IOCTL_GETCHANLIST (SIOCIWFIRSTPRIV+7) ++#define IEEE80211_IOCTL_CHANSWITCH (SIOCIWFIRSTPRIV+8) ++#define IEEE80211_IOCTL_GET_APPIEBUF (SIOCIWFIRSTPRIV+9) ++#define IEEE80211_IOCTL_SET_APPIEBUF (SIOCIWFIRSTPRIV+10) ++#define IEEE80211_IOCTL_FILTERFRAME (SIOCIWFIRSTPRIV+12) ++#define IEEE80211_IOCTL_GETCHANINFO (SIOCIWFIRSTPRIV+13) ++#define IEEE80211_IOCTL_SETOPTIE (SIOCIWFIRSTPRIV+14) ++#define IEEE80211_IOCTL_GETOPTIE (SIOCIWFIRSTPRIV+15) ++#define IEEE80211_IOCTL_SETMLME (SIOCIWFIRSTPRIV+16) ++#define IEEE80211_IOCTL_SETKEY (SIOCIWFIRSTPRIV+18) ++#define IEEE80211_IOCTL_DELKEY (SIOCIWFIRSTPRIV+20) ++#define IEEE80211_IOCTL_ADDMAC (SIOCIWFIRSTPRIV+22) ++#define IEEE80211_IOCTL_DELMAC (SIOCIWFIRSTPRIV+24) ++#define IEEE80211_IOCTL_WDSADDMAC (SIOCIWFIRSTPRIV+26) ++#define IEEE80211_IOCTL_WDSDELMAC (SIOCIWFIRSTPRIV+28) ++#define IEEE80211_IOCTL_KICKMAC (SIOCIWFIRSTPRIV+30) ++ ++enum { ++ IEEE80211_WMMPARAMS_CWMIN = 1, ++ IEEE80211_WMMPARAMS_CWMAX = 2, ++ IEEE80211_WMMPARAMS_AIFS = 3, ++ IEEE80211_WMMPARAMS_TXOPLIMIT = 4, ++ IEEE80211_WMMPARAMS_ACM = 5, ++ IEEE80211_WMMPARAMS_NOACKPOLICY = 6, ++}; ++enum { ++ IEEE80211_PARAM_TURBO = 1, /* turbo mode */ ++ IEEE80211_PARAM_MODE = 2, /* phy mode (11a, 11b, etc.) */ ++ IEEE80211_PARAM_AUTHMODE = 3, /* authentication mode */ ++ IEEE80211_PARAM_PROTMODE = 4, /* 802.11g protection */ ++ IEEE80211_PARAM_MCASTCIPHER = 5, /* multicast/default cipher */ ++ IEEE80211_PARAM_MCASTKEYLEN = 6, /* multicast key length */ ++ IEEE80211_PARAM_UCASTCIPHERS = 7, /* unicast cipher suites */ ++ IEEE80211_PARAM_UCASTCIPHER = 8, /* unicast cipher */ ++ IEEE80211_PARAM_UCASTKEYLEN = 9, /* unicast key length */ ++ IEEE80211_PARAM_WPA = 10, /* WPA mode (0,1,2) */ ++ IEEE80211_PARAM_ROAMING = 12, /* roaming mode */ ++ IEEE80211_PARAM_PRIVACY = 13, /* privacy invoked */ ++ IEEE80211_PARAM_COUNTERMEASURES = 14, /* WPA/TKIP countermeasures */ ++ IEEE80211_PARAM_DROPUNENCRYPTED = 15, /* discard unencrypted frames */ ++ IEEE80211_PARAM_DRIVER_CAPS = 16, /* driver capabilities */ ++ IEEE80211_PARAM_MACCMD = 17, /* MAC ACL operation */ ++ IEEE80211_PARAM_WMM = 18, /* WMM mode (on, off) */ ++ IEEE80211_PARAM_HIDESSID = 19, /* hide SSID mode (on, off) */ ++ IEEE80211_PARAM_APBRIDGE = 20, /* AP inter-sta bridging */ ++ IEEE80211_PARAM_KEYMGTALGS = 21, /* key management algorithms */ ++ IEEE80211_PARAM_RSNCAPS = 22, /* RSN capabilities */ ++ IEEE80211_PARAM_INACT = 23, /* station inactivity timeout */ ++ IEEE80211_PARAM_INACT_AUTH = 24, /* station auth inact timeout */ ++ IEEE80211_PARAM_INACT_INIT = 25, /* station init inact timeout */ ++ IEEE80211_PARAM_ABOLT = 26, /* Atheros Adv. Capabilities */ ++ IEEE80211_PARAM_DTIM_PERIOD = 28, /* DTIM period (beacons) */ ++ IEEE80211_PARAM_BEACON_INTERVAL = 29, /* beacon interval (ms) */ ++ IEEE80211_PARAM_DOTH = 30, /* 11.h is on/off */ ++ IEEE80211_PARAM_PWRTARGET = 31, /* Current Channel Pwr Constraint */ ++ IEEE80211_PARAM_GENREASSOC = 32, /* Generate a reassociation request */ ++ IEEE80211_PARAM_COMPRESSION = 33, /* compression */ ++ IEEE80211_PARAM_FF = 34, /* fast frames support */ ++ IEEE80211_PARAM_XR = 35, /* XR support */ ++ IEEE80211_PARAM_BURST = 36, /* burst mode */ ++ IEEE80211_PARAM_PUREG = 37, /* pure 11g (no 11b stations) */ ++ IEEE80211_PARAM_AR = 38, /* AR support */ ++ IEEE80211_PARAM_WDS = 39, /* Enable 4 address processing */ ++ IEEE80211_PARAM_BGSCAN = 40, /* bg scanning (on, off) */ ++ IEEE80211_PARAM_BGSCAN_IDLE = 41, /* bg scan idle threshold */ ++ IEEE80211_PARAM_BGSCAN_INTERVAL = 42, /* bg scan interval */ ++ IEEE80211_PARAM_MCAST_RATE = 43, /* Multicast Tx Rate */ ++ IEEE80211_PARAM_COVERAGE_CLASS = 44, /* coverage class */ ++ IEEE80211_PARAM_COUNTRY_IE = 45, /* enable country IE */ ++ IEEE80211_PARAM_SCANVALID = 46, /* scan cache valid threshold */ ++ IEEE80211_PARAM_ROAM_RSSI_11A = 47, /* rssi threshold in 11a */ ++ IEEE80211_PARAM_ROAM_RSSI_11B = 48, /* rssi threshold in 11b */ ++ IEEE80211_PARAM_ROAM_RSSI_11G = 49, /* rssi threshold in 11g */ ++ IEEE80211_PARAM_ROAM_RATE_11A = 50, /* tx rate threshold in 11a */ ++ IEEE80211_PARAM_ROAM_RATE_11B = 51, /* tx rate threshold in 11b */ ++ IEEE80211_PARAM_ROAM_RATE_11G = 52, /* tx rate threshold in 11g */ ++ IEEE80211_PARAM_UAPSDINFO = 53, /* value for qos info field */ ++ IEEE80211_PARAM_SLEEP = 54, /* force sleep/wake */ ++ IEEE80211_PARAM_QOSNULL = 55, /* force sleep/wake */ ++ IEEE80211_PARAM_PSPOLL = 56, /* force ps-poll generation (sta only) */ ++ IEEE80211_PARAM_EOSPDROP = 57, /* force uapsd EOSP drop (ap only) */ ++ IEEE80211_PARAM_MARKDFS = 58, /* mark a dfs interference channel when found */ ++ IEEE80211_PARAM_REGCLASS = 59, /* enable regclass ids in country IE */ ++ IEEE80211_PARAM_DROPUNENC_EAPOL = 60, /* drop unencrypted eapol frames */ ++}; ++ ++#define SIOCG80211STATS (SIOCDEVPRIVATE+2) ++/* NB: require in+out parameters so cannot use wireless extensions, yech */ ++#define IEEE80211_IOCTL_GETKEY (SIOCDEVPRIVATE+3) ++#define IEEE80211_IOCTL_GETWPAIE (SIOCDEVPRIVATE+4) ++#define IEEE80211_IOCTL_STA_STATS (SIOCDEVPRIVATE+5) ++#define IEEE80211_IOCTL_STA_INFO (SIOCDEVPRIVATE+6) ++#define SIOC80211IFCREATE (SIOCDEVPRIVATE+7) ++#define SIOC80211IFDESTROY (SIOCDEVPRIVATE+8) ++#define IEEE80211_IOCTL_SCAN_RESULTS (SIOCDEVPRIVATE+9) ++ ++struct ieee80211_clone_params { ++ char icp_name[IFNAMSIZ]; /* device name */ ++ u_int16_t icp_opmode; /* operating mode */ ++ u_int16_t icp_flags; /* see below */ ++#define IEEE80211_CLONE_BSSID 0x0001 /* allocate unique mac/bssid */ ++#define IEEE80211_NO_STABEACONS 0x0002 /* Do not setup the station beacon timers */ ++}; ++ ++/* APPIEBUF related definitions */ ++ ++/* Management frame type to which application IE is added */ ++enum { ++ IEEE80211_APPIE_FRAME_BEACON = 0, ++ IEEE80211_APPIE_FRAME_PROBE_REQ = 1, ++ IEEE80211_APPIE_FRAME_PROBE_RESP = 2, ++ IEEE80211_APPIE_FRAME_ASSOC_REQ = 3, ++ IEEE80211_APPIE_FRAME_ASSOC_RESP = 4, ++ IEEE80211_APPIE_NUM_OF_FRAME = 5 ++}; ++ ++struct ieee80211req_getset_appiebuf { ++ u_int32_t app_frmtype; /* management frame type for which buffer is added */ ++ u_int32_t app_buflen; /* application-supplied buffer length */ ++ u_int8_t app_buf[]; /* application-supplied IE(s) */ ++}; ++ ++/* Flags ORed by application to set filter for receiving management frames */ ++enum { ++ IEEE80211_FILTER_TYPE_BEACON = 1<<0, ++ IEEE80211_FILTER_TYPE_PROBE_REQ = 1<<1, ++ IEEE80211_FILTER_TYPE_PROBE_RESP = 1<<2, ++ IEEE80211_FILTER_TYPE_ASSOC_REQ = 1<<3, ++ IEEE80211_FILTER_TYPE_ASSOC_RESP = 1<<4, ++ IEEE80211_FILTER_TYPE_AUTH = 1<<5, ++ IEEE80211_FILTER_TYPE_DEAUTH = 1<<6, ++ IEEE80211_FILTER_TYPE_DISASSOC = 1<<7, ++ IEEE80211_FILTER_TYPE_ALL = 0xFF /* used to check the valid filter bits */ ++}; ++ ++struct ieee80211req_set_filter { ++ u_int32_t app_filterype; /* management frame filter type */ ++}; ++ ++ ++#endif /* __linux__ */ ++ ++#endif /* _NET80211_IEEE80211_IOCTL_H_ */ --- wpasupplicant-0.6.0+0.5.8.orig/debian/patches/00list +++ wpasupplicant-0.6.0+0.5.8/debian/patches/00list @@ -0,0 +1,8 @@ +01_config +02_debian_doc_examples +10_orinoco_wep_key_fix +10_silence_siocsiwauth_icotl_failure +10_set_channel_in_adhoc_mode +20_include_madwifi +21_madwifi_r1794_includes +#21_madwifiold_20060207_includes --- wpasupplicant-0.6.0+0.5.8.orig/debian/ifupdown.sh +++ wpasupplicant-0.6.0+0.5.8/debian/ifupdown.sh @@ -0,0 +1,126 @@ +#!/bin/sh + +# Copyright (C) 2006 Debian/Ubuntu wpasupplicant Maintainers +# +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# On Debian GNU/Linux systems, the text of the GPL license can be +# found in /usr/share/common-licenses/GPL. + +if [ -n "$IF_WPA_MAINT_DEBUG" ]; then + set -x +fi + +# quit if we're called for the loopback +if [ "$IFACE" = lo ]; then + exit 0 +fi + +# allow wpa_supplicant interface to be specified via wpa-iface +# useful for starting wpa_supplicant on one interface of a bridge +if [ -n "$IF_WPA_IFACE" ]; then + WPA_IFACE="$IF_WPA_IFACE" +else + WPA_IFACE="$IFACE" +fi + +# source functions +if [ -f /etc/wpa_supplicant/functions.sh ]; then + . /etc/wpa_supplicant/functions.sh +else + exit 0 +fi + +# quit if executables are not installed +if [ ! -x "$WPA_SUP_BIN" ] || [ ! -x "$WPA_CLI_BIN" ]; then + exit 0 +fi + +# quit if wpa_action is active +if test_wpa_cli; then + exit 0 +fi + +# preliminary sanity checks for roaming daemon +if [ -n "$IF_WPA_ROAM" ]; then + if [ "$METHOD" != "manual" ]; then + wpa_msg stderr "wpa-roam can only be used with the \"manual\" inet METHOD" + exit 1 + fi + if [ -n "$IF_WPA_MAPPING_SCRIPT" ]; then + if ! type "$IF_WPA_MAPPING_SCRIPT" >/dev/null; then + wpa_msg stderr "wpa-mapping-script \"$IF_WPA_MAPPING_SCRIPT\" is not valid" + exit 1 + fi + fi + if [ -n "$IF_WPA_MAPPING_SCRIPT_PRIORITY" ] && [ -z "$IF_WPA_MAPPING_SCRIPT" ]; then + wpa_msg stderr "\"wpa-mapping-script-priority 1\" is invalid without a wpa-mapping-script" + exit 1 + fi + IF_WPA_CONF="$IF_WPA_ROAM" + WPA_ACTION_SCRIPT="/sbin/wpa_action" +fi + +# master function; determines if ifupdown.sh should do something or not +if [ -n "$IF_WPA_CONF" ]; then + if [ ! -s "$IF_WPA_CONF" ]; then + wpa_msg stderr "cannot read contents of $IF_WPA_CONF" + exit 1 + fi + WPA_SUP_CONF_CTRL_DIR=$(sed --quiet \ + 's/[[:space:]]*#.*//g;s/[[:space:]]\+.*$//g;s/^\(ctrl_interface\|DIR\)=\(.*\)/\2/p' "$IF_WPA_CONF") + if [ -n "$WPA_SUP_CONF_CTRL_DIR" ]; then + WPA_CTRL_DIR="$WPA_SUP_CONF_CTRL_DIR" + fi + WPA_SUP_CONF="-c $IF_WPA_CONF -C $WPA_CTRL_DIR" +elif set | grep --quiet "^IF_WPA"; then + WPA_SUP_CONF="-C $WPA_CTRL_DIR" +else + exit 0 +fi + +case "$MODE" in + start) + case "$PHASE" in + pre-up) + kill_wpa_supplicant + init_wpa_supplicant || exit 1 + conf_wpa_supplicant || { kill_wpa_supplicant; exit 1; } + ;; + post-up) + init_wpa_cli || { kill_wpa_supplicant; exit 1; } + ;; + esac + ;; + + stop) + case "$PHASE" in + pre-down) + kill_wpa_cli + ;; + post-down) + kill_wpa_supplicant + ;; + *) + wpa_msg stderr "unknown phase: \"$PHASE\"" + exit 1 + ;; + esac + ;; + + *) + wpa_msg stderr "unknown mode: \"$MODE\"" + exit 1 + ;; +esac + +exit 0 --- wpasupplicant-0.6.0+0.5.8.orig/debian/wpagui.manpages +++ wpasupplicant-0.6.0+0.5.8/debian/wpagui.manpages @@ -0,0 +1 @@ +debian/wpa_gui.8 --- wpasupplicant-0.6.0+0.5.8.orig/debian/wpasupplicant.postinst +++ wpasupplicant-0.6.0+0.5.8/debian/wpasupplicant.postinst @@ -0,0 +1,58 @@ +#!/bin/sh -e +# This script can be called in the following ways: +# +# After the package was installed: +# configure +# +# +# If prerm fails during upgrade or fails on failed upgrade: +# abort-upgrade +# +# If prerm fails during deconfiguration of a package: +# abort-deconfigure in-favour +# removing +# +# If prerm fails during replacement due to conflict: +# abort-remove in-favour + + +# Remove a no-longer used conffile +rm_conffile() +{ + CONFFILE="$1" + + if [ -e "$CONFFILE" ]; then + echo "Removing obsolete conffile $CONFFILE" + rm -f "$CONFFILE" + fi +} + + +# Remove init script +rm_init_script() +{ + rm_conffile /etc/default/wpasupplicant + rm_conffile /etc/init.d/wpasupplicant + rm_conffile /etc/wpa_supplicant.conf + update-rc.d -f wpasupplicant remove +} + + +case "$1" in + configure) + if dpkg --compare-versions "$2" lt "0.4.8-1"; then + rm_init_script + fi + ;; + + abort-upgrade|abort-deconfigure|abort-remove) + ;; + + *) + echo "$0 called with unknown argument \`$1'" 1>&2 + exit 1 + ;; +esac + +#DEBHELPER# +exit 0 --- wpasupplicant-0.6.0+0.5.8.orig/debian/NEWS +++ wpasupplicant-0.6.0+0.5.8/debian/NEWS @@ -0,0 +1,111 @@ +wpasupplicant (0.5.4-3) unstable; urgency=low + + Support for random 'wpa-action' scripts has been totally removed for the + following reasons: + + * They were unmaintainable. They were not installed or updated along with + each new package, rather, they were user managed. + * The program code required to support them was relatively crude. + * This functionality is obsoleted by a more comprehensive 'roaming' action + script that controls ifupdown. + + Please refer to /usr/share/doc/wpasupplicant/README.modes and + wpa_action(8) for details about wpa-roam, and how to obtain the + behaviour that wpa-action scripts "tried" to achieve. + + -- Kel Modderman Sun, 30 Jul 2006 05:49:28 +1000 + +wpasupplicant (0.5.3+20060522-3) unstable; urgency=low + + IF YOU ARE CURRENTLY USING -d madwifi THIS UPLOAD BROKE YOUR CONNECTION! + PLEASE UPGRADE YOUR WLAN DRIVERS TO CURRENT MADWIFI! + + Support for the madwifi driver has changed in this release. The so called + 'madwifi-old' driver is no longer supported, instead we included the headers + from madwifi-ng (madwifi.org svn trunk) to allow support for the new private + ioctl's in that codebase. Also note that madwifi-ng supports the 'wext' + ioctl's when compiled and used with a linux kernel >= 2.6.14. + + More information about the new madwifi driver can be found on the + madwifi.org wiki: + + http://madwifi.org/ + + Also visit the pkg-madwifi maintainers page, hosted on madwifi.org's wiki + for information specific to installing and using madwifi-ng on debian: + + http://pkg-madwifi.alioth.debian.org/ + + The madwifi-old headers have been included in the source package for those + people who requires its support. To activate madwifi-old support, please + follow these steps: + + # su + # apt-get update + # apt-get build-dep wpasupplicant + # exit + $ apt-get source wpasupplicant + $ cd wpasupplicant-0.5.3+20060522-3/debian/patches + + Edit '00list' by removing the line: + + 20_madwifing_r1636_includes + + and uncommenting the line with: + + 20_madwifiold_20060207_includes + + $ cd ../../ + $ fakeroot dpkg-buildpackage -us -uc -b + $ cd ../ + # su + # dpkg -i wpa*.deb + + + -- Kel Modderman Tue, 13 Jun 2006 22:33:16 +1000 + +wpasupplicant (0.4.8-1) unstable; urgency=low + + IF YOU HAVE USED WPASUPPLICANT BEFORE, THIS UPGRADE PROBABLY BROKE YOUR + CONNECTION! + + This package does not ship any configuration to wpasupplicant in + /etc/{wpa_supplicant/,}wpa{,_}supplicant.conf anymore. There is no + sensible default configuration which would make sense to be started on + every machine. Therefore, in order to actually use wpasupplicant in + this package, you are required to edit your /etc/network/interfaces in + order to start wpasupplicant. Please read the file README.modes in + /usr/share/doc/wpasupplicant for more information about the supported + stanzas in /etc/network/interfaces. + + Roaming between networks is now supported by a wpa_cli action script. + Please read /usr/share/doc/wpasupplicant/README.modes for a guide on how + to configure wpasupplicant to best suit your requirements. + + -- Reinhard Tartler Fri, 31 Mar 2006 09:43:14 +0200 + +wpasupplicant (0.5.2-1) experimental; urgency=low + + The installed wpa_* binaries have moved. They are installed to the + following locations:- + + /sbin/wpa_cli + /sbin/wpa_supplicant + /usr/bin/wpa_passphrase + + Please adjust your scripts as neccessary. + + -- Kel Modderman Tue, 21 Mar 2006 21:16:57 +1000 + +wpasupplicant (0.4.7-1) unstable; urgency=low + + This version is designed for Wireless Extensions 19 and so will work + with Linux kernel 2.6.14. It works with earlier versions of linux as well. + + WPA support was added in Wireless Extensions 18 and should + therefore exist in new (2.6.14-compliant) drivers, including + ipw2200 v1.0.8. In order to take advantage of this new support you need to + invoke wpasupplicant with the wext driver ("-D wext" in + /etc/default/wpasupplicant for instance, instead of "-D ipw" say). + + -- Reinhard Tartler Fri, 10 Feb 2006 11:15:34 +0100 --- wpasupplicant-0.6.0+0.5.8.orig/debian/wpasupplicant.links +++ wpasupplicant-0.6.0+0.5.8/debian/wpasupplicant.links @@ -0,0 +1,4 @@ +etc/wpa_supplicant/ifupdown.sh /etc/network/if-pre-up.d/wpasupplicant +etc/wpa_supplicant/ifupdown.sh /etc/network/if-up.d/wpasupplicant +etc/wpa_supplicant/ifupdown.sh /etc/network/if-down.d/wpasupplicant +etc/wpa_supplicant/ifupdown.sh /etc/network/if-post-down.d/wpasupplicant --- wpasupplicant-0.6.0+0.5.8.orig/debian/wpa_action.8 +++ wpasupplicant-0.6.0+0.5.8/debian/wpa_action.8 @@ -0,0 +1,150 @@ +.TH WPA_ACTION "8" "26 May 2006" "" "" +.SH NAME +wpa_action \- wpa_cli action script +.SH SYNOPSIS +\fBwpa_action\fR \fIIFACE ACTION\fR +.SH "DESCRIPTION" +\fBwpa_action\fR is a shell script designed to control the \fBifupdown\fR +framework according to \fIACTION\fR events received from \fBwpa_supplicant\fR. +\fBwpa_cli\fR receives \fICONNECTED\fR and \fIDISCONNECTED\fR events from +\fBwpa_supplicant\fR via the crtl_iface socket and gives the \fIACTION\fR event +to the \fBwpa_action\fR script as an argument, along with the \fIIFACE\fR to be +acted upon. +.PP +\fBwpa_action\fR also receives an environment variable from \fBwpa_cli\fR, +\fIWPA_ID_STR\fR, containing an alphanumeric identification string for the +\fICURRENT\fR network block. \fIWPA_ID_STR\fR is provided by the 'id_str' +network block option of \fBwpa_supplicant.conf\fR, and provides a means to map +the \fIACTION\fR to a \fILOGICAL\fR interface configured in the \fBinterfaces\fR +file. +.PP +If either the ifupdown \fBinterfaces\fR or \fIifstate\fR file cannot be found, +\fBwpa_action\fR will exit silently (status 0). \fBwpa_action\fR will search +the following locations for their existance: +.nf + /etc/network/run/ifstate + /var/run/network/ifstate + /etc/network/interfaces +.ni +.PP +.SH IFACE +Network interface to be acted upon, for example 'eth1' or 'wlan0'. +.SH ACTION +An \fIACTION\fR to be performed on the \fIIFACE\fR. +.TP +\fBCONNECTED\fR +\fBwpa_supplicant\fR has completed authentication. +\fBifup\fR \fIIFACE=WPA_ID_STR\fR is invoked and the action is logged to +\fI/var/log/wpa_action.log\fR. Network settings for the \fILOGICAL\fR +interface \fIWPA_ID_STR\fR are applied. +.TP +\fBDISCONNECTED\fR +\fBwpa_supplicant\fR has detected disconnection. +\fBifdown\fR \fIIFACE=WPA_ID_STR\fR is invoked and the action is logged to +\fI/var/log/wpa_action.log\fR. Network settings for the \fILOGICAL\fR +interface \fIWPA_ID_STR\fR are undone. +.TP +\fBstop\fR +The 'stop' \fIACTION\fR is a called manually by the user, to stop the +\fBwpa_cli\fR daemon, invoke \fBifdown\fR \fIIFACE\fR (if the \fIIFACE\fR is +present in the \fIifstate\fR file) and stop the \fBwpa_supplicant\fR daemon. +The action is logged to \fI/var/log/wpa_action.log\fR. 'down' is a +synonym for 'stop' and can be used equally. +.TP +\fBreload\fR +The 'reload' \fIACTION\fR can be used to reload the \fBwpa_supplicant\fR +configuration file specified by \fIwpa-roam\fR . 'restart' is a synonym +for 'reload' and can be used equally. The action is logged to +\fI/var/log/wpa_action.log\fR. +.SH ENVIRONMENT +An alphanumeric identification string provided by the 'id_str' network block +option of \fBwpa_supplicant.conf\fR is exported to \fBwpa_action\fR as an +environment variable, \fIWPA_ID_STR\fR. When 'id_str' is not configured for the +\fICURRENT\fR network block, 'default' is substituted for the absent +\fIWPA_ID_STR\fR environment variable. +.PP +A unique network identifier, \fIWPA_ID\fR, is exported to \fBwpa_action\fR. It +is the number assigned to the \fICURRENT\fR \fBwpa_supplicant\fR network block +(network_id). +.SH USAGE +The only reasons for \fBwpa_action\fR to be explicitly executed by the user is +to stop \fBwpa_cli\fR from controlling \fBifupdown\fR or reload the +\fIwpa_supplicant.conf\fR file after editing. +.PP +.RS +\fBwpa_action\fR \fIeth1 stop\fR +.RE +.PP +Otherwise, \fBwpa_action\fR is given as an argument to a \fBwpa_cli\fR +daemon. +.PP +.RS +\fBwpa_cli\fR \fI-i eth1 -a /sbin/wpa_action -B\fR +.RE +.PP +This can be done by using the \fIwpa-roam\fR option in the \fBinterfaces\fR +file. \fIwpa-roam\fR takes one argument, a user provided +\fBwpa_supplicant.conf\fR file. +.PP +The inet \fIMETHOD\fR must be 'manual' for this interface, as it will +be configured according to \fBwpa_cli\fR action events. Also supply a 'default' +\fBinterfaces\fR stanza using the dhcp inet \fIMETHOD\fR so that networks +without an 'id_str' option can fallback to attempting to receive an ip via +dhcp. If one or more networks requires additional network configuration, +provide an unique 'id_str' for each network, and an \fBinterfaces\fR stanza +using the 'id_str' value as a \fILOGICAL\fR interface. The following interfaces +file is configured to use dhcp for any network without an 'id_str', a static ip +for the network with an 'id_str' of 'home_static' and dhcp plus an additional +post-up command for the network with an 'id_str' of 'uni'. +.PP +An example wpa_supplicant.conf configured to roam between 3 different networks: +.PP +.RS +.nf +network={ + ssid="foo" + id_str="uni" + key_mgmt=NONE +} + +network={ + ssid="bar" + id_str="home_static" + psk=123456789... +} + +network={ + ssid="" + key_mgmt=NONE +} +.fi +.RE +.PP +The corresponding \fBinterfaces\fR file would contain \fILOGICAL\fR interfaces, +that correlate to each unique 'id_str' provided by the configuration file: +.PP +.RS +.nf +iface eth1 inet manual + wpa-driver wext + wpa-roam /path/to/wpa_supplicant.conf + +iface default inet dhcp + +iface uni inet dhcp + +iface home_static inet static + address 192.168.0.20 + netmask 255.255.255.0 + network 192.168.0.0 + broadcast 192.168.0.255 + gateway 192.168.0.1 +.fi +.RE +.PP +.SH SEE ALSO +\fBwpa_cli(8)\fR, \fBwpa_supplicant(8)\fR, \fBwpa_supplicant.conf(5)\fR, +\fBifup(8)\fR, \fBinterfaces(5)\fR +.SH AUTHOR +This manual page was written by Kel Modderman for +the Debian GNU system (but may be used by others). --- wpasupplicant-0.6.0+0.5.8.orig/debian/wpasupplicant.wpa-ifupdown.init +++ wpasupplicant-0.6.0+0.5.8/debian/wpasupplicant.wpa-ifupdown.init @@ -0,0 +1,69 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: wpa-ifupdown +# Required-Start: $network +# Required-Stop: $network +# Should-Start: +# Should-Stop: +# Default-Start: +# Default-Stop: 0 6 +# Short-Description: Stop wpa_supplicant processes started via ifupdown +# Description: Run ifdown on interfaces authenticated via +# wpa_supplicant. Sendsigs terminates wpa_supplicant +# processes before networking is stopped causing each +# network interface authenticated via a wpa_supplicant +# daemon to be terminated abrubtly. +### END INIT INFO + +PATH=/usr/sbin:/usr/bin:/sbin:/bin + +test -d /var/run || exit 0 + +test -x /sbin/ifdown || exit 0 + +. /lib/lsb/init-functions + +stop_wpa_action () { + test -x /sbin/wpa_action || return + unset IFACES + IFACES=$(find /var/run -maxdepth 1 -type f -name 'wpa_action.*.pid' -printf '%P\n' | cut -d'.' -f2) + if test -n "$IFACES"; then + log_daemon_msg "Stopping wpa_action roaming interfaces" + for iface in $IFACES; do + log_progress_msg "$iface" + # wpa_action executes /sbin/ifdown + wpa_action "$iface" stop >/dev/null 2>&1 + done + log_end_msg 0 + fi +} + +stop_wpa_supplicant () { + unset IFACES + IFACES=$(find /var/run -maxdepth 1 -type f -name 'wpa_supplicant.*.pid' -printf '%P\n' | cut -d'.' -f2) + if test -n "$IFACES"; then + log_daemon_msg "Stopping wpa_supplicant interfaces" + for iface in $IFACES; do + log_progress_msg "$iface" + ifdown $iface >/dev/null 2>&1 + done + log_end_msg 0 + fi +} + +case "$1" in + start|restart|force-reload) + # No-op + ;; + stop) + stop_wpa_action + stop_wpa_supplicant + ;; + *) + echo "Usage: $0 {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +exit 0 --- wpasupplicant-0.6.0+0.5.8.orig/debian/compat +++ wpasupplicant-0.6.0+0.5.8/debian/compat @@ -0,0 +1 @@ +5 --- wpasupplicant-0.6.0+0.5.8.orig/debian/wpasupplicant.preinst +++ wpasupplicant-0.6.0+0.5.8/debian/wpasupplicant.preinst @@ -0,0 +1,62 @@ +#!/bin/sh -e +# This script can be called in the following ways: +# +# Before the package is installed: +# install +# +# Before removed package is upgraded: +# install +# +# Before the package is upgraded: +# upgrade +# +# +# If postrm fails during upgrade or fails on failed upgrade: +# abort-upgrade + + +# Prepare to remove a no-longer used conffile +prep_rm_conffile() +{ + CONFFILE="$1" + + if [ -e "$CONFFILE" ]; then + md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" + old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE '{s/ obsolete$//;s/.* //;p}}\" /var/lib/dpkg/status`" + if [ "$md5sum" != "$old_md5sum" ]; then + echo "Obsolete conffile $CONFFILE has been modified by you, renaming to .dpkg-bak" + mv -f "$CONFFILE" "$CONFFILE".dpkg-bak + fi + fi +} + + +# Prepare to remove init script +prep_rm_init_script() +{ + prep_rm_conffile /etc/default/wpasupplicant + prep_rm_conffile /etc/init.d/wpasupplicant + prep_rm_conffile /etc/wpa_supplicant.conf + prep_rm_conffile /etc/network/if-pre-up.d/wpasupplicant + prep_rm_conffile /etc/network/if-post-down.d/wpasupplicant +} + + +case "$1" in + install|upgrade) + if dpkg --compare-versions "$2" lt "0.4.8-1"; then + prep_rm_init_script + fi + ;; + + abort-upgrade) + ;; + + *) + echo "$0 called with unknown argument \`$1'" 1>&2 + exit 1 + ;; +esac + +#DEBHELPER# +exit 0 --- wpasupplicant-0.6.0+0.5.8.orig/debian/wpagui.install +++ wpasupplicant-0.6.0+0.5.8/debian/wpagui.install @@ -0,0 +1 @@ +wpa_gui/wpa_gui usr/sbin/ --- wpasupplicant-0.6.0+0.5.8.orig/debian/wpasupplicant.wpa_action.logrotate +++ wpasupplicant-0.6.0+0.5.8/debian/wpasupplicant.wpa_action.logrotate @@ -0,0 +1,7 @@ +/var/log/wpa_action.log { + rotate 5 + daily + compress + copytruncate + missingok +} --- wpasupplicant-0.6.0+0.5.8.orig/debian/wpa_gui.8 +++ wpasupplicant-0.6.0+0.5.8/debian/wpa_gui.8 @@ -0,0 +1,25 @@ +.TH WPA_GUI 8 02.18.2006 "" "WPA GUI" +.SH NAME +wpa_gui \- WPA GUI client +.SH SYNOPSIS +.B wpa_gui +.I "[\-p] [\-i]" +.SH "DESCRIPTION" +This manual page documents briefly the +.BR wpa_gui +utility. +.SH OPTIONS +A summary of parameters to wpa_gui follows. +.TP +.B \-p +Path to where to find the control interface sockets. Typically this +is /var/run/wpa_supplicant/ +.TP +.B \-i +Interface to listen on, ie, the socket you want to connect to, typically +a file in /var/run/wpa_supplicant/ +.SH "SEE ALSO" +wpa_supplicant(1), wpa_passphrase(1), wpa_cli(1) +.SH AUTHOR +This manual page was written by Kyle McMartin for +the Debian GNU system (but may be used by others). --- wpasupplicant-0.6.0+0.5.8.orig/debian/watch +++ wpasupplicant-0.6.0+0.5.8/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://hostap.epitest.fi/releases/wpa_supplicant-(.*)\.tar\.gz debian --- wpasupplicant-0.6.0+0.5.8.orig/debian/README.modes +++ wpasupplicant-0.6.0+0.5.8/debian/README.modes @@ -0,0 +1,519 @@ +Modes of Operation in wpasupplicant for Debian +============================================== + +The Debian wpasupplicant package provides two (2) convenient modes of operation +that are closely integrated to the core networking infrastructure; ifupdown. + +Table of Contents +================= + +1. Specifying the wpa_supplicant driver backend + - Table of supported drivers + - Common Driver Recommendations + +2. Mode #1: Managed Mode + - Examples + - Table of Common Options + - Important Notes About Managed Mode + - How It Works + +3. Mode #2: Roaming Mode + - wpa_supplicant.conf + - /etc/network/interfaces + - Controlling the Roaming Daemon with wpa_action + - Fine Tuning the Roaming Setup + - The Logfile + - Using External Mapping Scripts (e.g. guessnet) + - /etc/network/interfaces with external mapping + +4. Troubleshooting + - Hidden ssids + +5. Security Considerations + - Configuration File Permissions + + +1. Specifying the wpa_supplicant driver backend +=============================================== + +The wext driver backend will be used for all interfaces that do not explicitly +set 'wpa-driver' to the driver type required for that device. Users of linux +2.4 kernels, or 2.6 kernels less than 2.6.14 will be required to specify a +wpa-driver type. + +Table of supported drivers +========================== + +A summary of supported drivers follows: + +Driver Description +====== =========== +hostap Host AP driver (Intersil Prism2/2.5/3) +madwifi MADWIFI 802.11 support (Atheros, etc.) +atmel ATMEL AT76C5XXx (USB, PCMCIA) +wext Linux wireless extensions (generic) +ndiswrapper Linux ndiswrapper +ipw Intel ipw2100/2200 driver +wired wired Ethernet driver +test test driver + +Common Driver Recommendations +============================= + +The Intel Pro Wireless adapters (ipw2100, ipw2200 and ipw3945) all use the +'wext' backend, unless your kernel is older than 2.6.14. + +Madwifi supports both the 'wext' and 'madwifi' driver backends. 'wext' is +preferred, however 'madwifi' may work better in some circumstances. + +Ndiswrapper NO LONGER SUPPORTS the 'ndiswrapper' driver backend as of version +1.16. Therefore, 'wext' must be used unless you use an antiquated ndiswrapper +release. + +Set the driver type in the interfaces(5) stanza for your device with the +'wpa-driver' option. For example: + +iface eth0 inet dhcp + wpa-driver wext + . . . . . more options + + +2. Mode #1: Managed Mode +======================= + +This mode provides the ability to establish a connection via wpa_supplicant to +one known network. It is similar to how the wireless-tools package works. Each +element required to establish the connection via wpa_supplicant is prefixed +with 'wpa-' and followed by the value that will be used for that element. + +Examples +======== + +NOTE: the 'wpa-psk' value is only valid if: + 1) It is a plaintext (ascii) string between 8 and 63 characters in + length + 2) It is a hexadecimal string of 64 characters + +# Connect to access point of ssid 'NETBEER' with an encryption type of +# WPA-PSK/WPA2-PSK. It assumes the driver will use the 'wext' driver backend +# of wpa_supplicant because no wpa-driver option has been specified. +# The passphrase is given as a ASCII (plaintext) string. DHCP is used to +# obtain a network address. +# +iface wlan0 inet dhcp + wpa-ssid NETBEER + # plaintext passphrase + wpa-psk PlainTextSecret + +# Connect to access point of ssid 'homezone' with an encryption type of +# WPA-PSK/WPA2-PSK, using the 'wext' driver backend of wpa_supplicant. +# The psk is given as an encoded hexadecimal string. DHCP is used to obtain +# a network address. +# +iface wlan0 inet dhcp + wpa-driver wext + wpa-ssid homezone + # hexadecimal psk is encoded from a plaintext passphrase + wpa-psk 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f + +# Connect to access point of ssid 'HotSpot1' and bssid of '00:1a:2b:3c:4d:5e' +# with an encryption type of WPA-PSK/WPA2-PSK, using the the 'madwifi' driver +# backend of wpa_supplicant. The passphrase is given as a plaintext string. +# A static network address assignment is used. +# +iface ath0 inet static + wpa-driver madwifi + wpa-ssid HotSpot1 + wpa-bssid 00:1a:2b:3c:4d:5e + # plaintext passphrase + wpa-psk madhotspot + wpa-key-mgmt WPA-PSK + wpa-pairwise TKIP CCMP + wpa-group TKIP CCMP + wpa-proto WPA RSN + # static ip settings + address 192.168.0.100 + netmask 255.255.255.0 + network 192.168.0.0 + broadcast 192.168.0.255 + gateway 192.168.0.1 + +# User supplied wpa_supplicant.conf is used for eth1. All network information +# is contained within the user supplied wpa_supplicant.conf. No wpa-driver type +# is specified, so wext is used. DHCP is used to obtain a network address. +# +iface eth1 inet dhcp + wpa-conf /path/to/wpa_supplicant.conf + +Table of Common Options +======================= + +A brief summary of common 'wpa-' options that may be used in the +/etc/network/interfaces stanza for a wireless device. See the +'Important Notes About Managed Mode' section for information about +valid and invalid 'wpa-' values. + +NOTE: ALL values are CASE SeNsItVe + +Element Example Value Description +======= ============= =========== +wpa-ssid plaintextstring sets the ssid of your network +wpa-bssid 00:1a:2b:3c:4d:5e the bssid of your AP +wpa-psk 0123456789...... your preshared wpa key. Use + wpa_passphrase(8) to generate your psk + from a passphrase and ssid pair +wpa-key-mgmt NONE, WPA-PSK, WPA-EAP, list of accepted authenticated key + IEEE8021X management protocols +wpa-group CCMP, TKIP, WEP104, list of accepted group ciphers for WPA + WEP40 +wpa-pairwise CCMP, TKIP, NONE list of accepted pairwise ciphers for + WPA +wpa-auth-alg OPEN, SHARED, LEAP list of allowed IEEE 802.11 + authentication algorithms +wpa-proto WPA, RSN list of accepted protocols +wpa-identity myplaintextname administrator provided username + (EAP authentication) +wpa-password myplaintextpassword your password (EAP authentication) +wpa-scan-ssid 0 or 1 toggles scanning of ssid with specific + Probe Request frames +wpa-ap-scan 0 or 1 or 2 adjusts the scanning logic of + wpa_supplicant + +The complete functionality of wpa_cli(8) should be implemented. Anything +missing is considered a bug and should be reported as such. Patches are always +welcome. + +Important Notes About Managed Mode +================================== + +Almost all 'wpa-' options require there is at least a ssid specified. Only a +handful of options have a global effect. These are: 'wpa-ap-scan' and +'wpa-preauthenticate'. + +Any 'wpa-' option given for a device in the interfaces(5) file is sufficient to +trigger the wpa_supplicant daemon into action. + +The wpasupplicant ifupdown script makes assumptions about the 'type' of input +that is valid for each option. For example, it assumes that some input is +plaintext and wraps quotation marks around the input before passing it on +to wpa_cli, which then adds the input to the network block being formed via +the wpa_supplicant ctrl_interface socket. Running ifup manually with the +'--verbose' option will reveal all of the commands used to form the network +block via wpa_cli. If the value you used for any wpa-* option in +/etc/network/interfaces is surrounded by double quotes, than it has been +assumed to be of "plaintext" or "ascii" type input. + +Some input is assumed to be a hexadecimal string (eg. wpa-wep-key*). The value +'type' of the wpa-psk option however, is determined via a simple check for more +than one non hexadecimal character. + + +How It Works +============ + +As mentioned earlier, each wpa_supplicant specific element is prefixed with +'wpa-'. Each element correlates to a property of wpa_supplicant described in +the wpa_supplicant.conf(5), wpa_supplicant(8) and wpa_cli(8) manpages. The +supplicant is launched without any pre-configuration whatsoever, and wpa_cli +forms a network configuration from the input provided by the 'wpa-*' lines. +Initially, wpa_supplicant/wpa_cli does not directly set the properties of the +device (like setting an essid with iwconfig, for example), rather it informs +the device of what access point is suitable to associate with. Once the device +has scanned the area, and found that the suitable access point is available for +use, these properties are set. + +The script that does all the work is located at: + + /etc/wpa_supplicant/ifupdown.sh + +It is executed by run-parts, which in turn is invoked by ifupdown during the +'pre-up', 'pre-down' and 'post-down' phases. + +In the 'pre-up' phase, a wpa_supplicant daemon is launched followed by a series +of wpa_cli commands that set up a network configuration according to what +'wpa-' options were used in /etc/network/interfaces for the physical device. + +If wpa-roam is used, a wpa_cli daemon is lauched in the 'post-up' phase. + +In the 'pre-down' phase, the wpa_cli daemon is killed if it exists. + +In the 'post-down' phase, the wpa_supplicant daemon is killed. + + +3. Mode #2: Roaming Mode +======================== + +A self contained, simplistic roaming mechanism is provided by this package. It +is in the form of a wpa_cli action script, /sbin/wpa_action, and it assumes +control of ifupdown once activated. The wpa_action(8) manpage describes its +technical details in great depth. + +To activate a roaming interface, adapt the following example interfaces(5) +stanza: + +iface eth1 inet manual + wpa-driver wext + wpa-roam /path/to/wpa_supplicant.conf + +Two daemons are spawned from the above example; wpa_supplicant and wpa_cli. It +is required to provide a wpa_supplicant.conf. A good starting point is provided +by an example configuration file: + +cp /usr/share/doc/wpasupplicant/examples/wpa_supplicant.conf.template \ + /etc/wpa_supplicant/wpa_supplicant.conf + +It is required to edit this configuration file, and add the network blocks for +all known networks. If you do not understand what this means, start reading the +wpa_supplicant.conf(5) manpage now. + +For each network, you may specify a special option 'id_str'. It should be set to +a simple text string. This text string forms the basis for network profiling; it +correlates to a logical interface defined in the interfaces(5) file. When no +'id_str' is given for a network, wpa_action assumes it will use the 'default' +logical interface as fallback. The fallback interface can be chosen via the +'wpa-default-iface' option. + +So what does all this mean? Lets illustrate it with a small example taken from +the wpa_action(8) manpage. + +wpa_supplicant.conf +=================== +network={ + ssid="foo" + # this id_str will notify /sbin/wpa_action to 'ifup uni' + id_str="uni" + key_mgmt=NONE +} + +network={ + ssid="bar" + # this id_str will notify /sbin/wpa_action to 'ifup home_static' + id_str="home_static" + psk=123456789... +} + +network={ + ssid="" + # no 'id_str' is given, /sbin/wpa_action will 'ifup default' + key_mgmt=NONE +} + +/etc/network/interfaces +======================= +# the roaming interface MUST use the manual inet method +# 'allow-hotplug' or 'auto' ensures the daemon starts automatically +allow-hotplug eth1 +iface eth1 inet manual + wpa-driver wext + wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf + +# no id_str, 'default' is used as the fallback mapping target +iface default inet dhcp + +# id_str="uni" +iface uni inet dhcp + +# id_str="home_static" +iface home_static inet static + address 192.168.0.20 + netmask 255.255.255.0 + network 192.168.0.0 + broadcast 192.168.0.255 + gateway 192.168.0.1 + +A logical interface is brought up via ifup, and taken down via ifdown, as +wpa_supplicant associates and de-associates with the network associated +to it by the 'id_str' option used in the wpa_supplicant.conf configuration file. + +A log of /sbin/wpa_action's actions is created at /var/log/wpa_action.log, +please attach the log when reporting problems. + +Controlling the Roaming Daemon with wpa_action +============================================== + +Once the roaming daemon is started, it assumes control of ifupdown. That is; +wpa_cli calls ifup when wpa_supplicant has successfully associated with an +access point, and calls ifdown when the connection is lost or terminated. +While the roaming daemon is active, ifupdown should not be controlled directly +by manually issued commands, rather /sbin/wpa_action is supplied to stop and +reload the roaming daemon. For example, to stop the +romaing daemon on the device 'eth1': + + wpa_action eth1 stop + +When it is required to update the roaming daemon with a new networks details, +it can be done without stopping it. Edit the wpa_supplicant.conf file that is +being used by the daemon with the new networks details, add optional network +settings to /etc/network/interfaces that are specific to the new network +(linked by the 'id_str') and then 'reload' the daemon like so: + + wpa_action eth1 reload + +For the complete technical details of what wpa_action can do, read the +wpa_action(8) manpage. + +Fine Tuning the Roaming Setup +============================= + +You may face situations where multiple known access points are in close +proximity. You can choose which one is preferred manually, with wpa_cli or +wpa_gui, or you can give each network its own priority. This is provided by the +'priority' option of wpa_supplicant.conf. + +The Logfile +=========== + +All activity of the roaming dameon is logged to /var/log/wpa_action.log. The +following information is logged: + + * time and date + * interface name and action event + * values of enviromental variables (WPA_ID, WPA_ID_STR, WPA_CTRL_DIR) + * ifupdown command executed + * wpa_cli status (based on WPA-PSK network, may display different info) + - bssid + - ssid + - id + - id_str + - pairwise_cipher + - group_cipher + - key_mgmt + - wpa_state + - ip_address + +Using External Mapping Scripts (e.g. guessnet) +============================================== + +In addition to the internal mapping of logical interfaces via 'id_str', +wpa_action can call external mapping scripts. A mapping script should return +the name of the logical interface which should be brought up. Any mapping +script that works from ifupdowns mapping mechanism (see man interfaces) should +also work when called from wpa_action. + +To call a mapping script add a line 'wpa-mapping-script name-of-the-script' to +the interfaces stanza of the physical roaming device. (You may have to specify +the absolute path to the mapping script.) + +The contents of lines starting with wpa-map are passed to stdin of the mapping +script. Since ifupdown allows only one wpa-map line you can append any number +to wpa-map for additional lines. For example: + +iface wlan0 inet manual + wpa-driver wext + wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf + wpa-mapping-script guessnet-ifupdown + wpa-map0 home + wpa-map1 work + wpa-map2 school + # ... additional wpa-mapX lines as required + + +By default the mapping script will only be used when no 'id_str' is available +for the current network. If you want to completely disable 'id_str' matching +and use only an external mapping script, use the +'wpa-mapping-script-priority 1' option to override default behaviour. + +If the mapping script returns an empty string wpa_action will fallback to using +the 'default' interface, unless an alternative is defined by the +'wpa-roam-default-iface' option. + +Below is an advanced example, using guessnet-ifupdown as the external mapping +script. + +/etc/network/interfaces with external mapping +============================================= + +allow-hotplug wlan0 +iface wlan0 inet manual + wpa-driver wext + wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf + wpa-roam-default-iface default-wparoam + wpa-mapping-script guessnet-ifupdown + wpa-map default: default-guessnet + wpa-map0 home_static + wpa-map1 work_static + +# school can only be chosen via 'id_str' matching +iface school inet dhcp + # resolvconf + dns-nameservers 11.22.33.44 55.66.77.88 + +iface home_static inet static + address 192.168.0.20 + netmask 255.255.255.0 + network 192.168.0.0 + broadcast 192.168.0.255 + gateway 192.168.0.1 + test peer address 192.168.0.1 mac 00:01:02:03:04:05 + +iface work_static inet static + address 192.168.3.200 + netmask 255.255.255.0 + network 192.168.3.0 + broadcast 192.168.3.255 + gateway 192.168.3.1 + test peer address 192.168.3.1 mac 00:01:02:03:04:05 + +iface default-guessnet inet dhcp + +iface default-wparoam inet dhcp + +In this example wpa_action will use guessnet for the selection of a suitable +logical interface only when no 'id_str' option has been provided for the +current network in the provided wpa_supplicant.conf. + +The 'wpa-map' lines provide guessnet with the logical interfaces that are to be +tested as well as the default interface to be used when all tests fail. The +'test' lines of each logical interface are used by guessnet to determine if +we are actually connected to that network. For instance, guessnet will choose +the logical interface 'home_static' if there's a device with an IP address of +192.168.0.1 and MAC of 00:01:02:03:04:05 on the current network. If all tests +fail, the 'default-guessnet' interface will be configured. + +Please, read the guessnet(8) manpage for more information. + + +4. Troubleshooting +================== + +In order to debug connection, association and authentication problems, +we suggest starting `wpa_cli -i ` in a different shell, before +starting the interface. Use the command 'level 0' first, to get all +debug messages. Then use `ifup --verbose ` to get verbose debug +messages from the script starting wpasupplicant. + +Hidden ssids +============ + +For reference, see #358137. In order to be able to associate to hidden ssids, +please try to set the option 'ap_scan=1' in the global section, and +'scan_ssid=1' in your network block section of your wpa_supplicant.conf file. +If you are using the managed mode, you can do so by these stanzas: + +iface eth1 inet dhcp + wpa-conf managed + wpa-ap-scan 1 + wpa-scan-ssid 1 + # ... additional options for your setup + +According to #368770, association can take a very long time to associate to WEP +secured networks. In some cases, setting the parameter 'ap_scan=2' in the +config file, (or using a 'wpa-ap-scan 2' stanza, which is equivalent) can +greatly help to speed up association. + + +5. Security Considerations +========================== + +Configuration File Permissions +============================== +It is important to keep PSK's and other sensitive information concerning your +network settings private, therefore ensure that important configuration files +containing such data are only readable by their owner. For example: + + chmod 0600 /etc/network/interfaces + # substitute the path of your wpa_supplicant.conf file + chmod 0600 /etc/wpa_supplicant/wpa_supplicant.conf + +By default, /etc/network/interfaces is world readable, and thus unsuitable for +containing secret keys and passwords. --- wpasupplicant-0.6.0+0.5.8.orig/debian/wpasupplicant.install +++ wpasupplicant-0.6.0+0.5.8/debian/wpasupplicant.install @@ -0,0 +1,3 @@ +wpa_cli sbin/ +wpa_passphrase usr/bin/ +wpa_supplicant sbin/ --- wpasupplicant-0.6.0+0.5.8.orig/debian/changelog +++ wpasupplicant-0.6.0+0.5.8/debian/changelog @@ -0,0 +1,910 @@ +wpasupplicant (0.6.0+0.5.8-0ubuntu2) hardy; urgency=low + + * 10_set_channel_in_adhoc_mode: make wpasupplicant set the frequency when. + LP: #112009. Patch prepared by Kel Modderman for debian. + * 10_silence_siocsiwauth_icotl_failure: patch taken from upstream. + when using the wext driver, the error message on the SIOCSIWAUTH ioctl + is no longer printed via stderr, but properly in the debug log. + Patch prepared by Kel Modderman for debian. + + -- Reinhard Tartler Wed, 12 Mar 2008 17:40:06 +0100 + +wpasupplicant (0.6.0+0.5.8-0ubuntu1) gutsy; urgency=low + + * New upstream release + * remove patch 11_erroneous_manpage_ref, applied upstream + * remove patch 25_wpas_dbus_unregister_iface_fix, applied upstream + + [ Alexander Sack ] + * bumping upstream version to replace development version 0.6.0 with + this package from stable release branch. + * attempt to fix wierd timeout and high latency issues by going + back to stable upstream version (0.5.9) (LP: #140763, + LP: #141233). + + -- Reinhard Tartler Sun, 26 Aug 2007 16:06:57 +0200 + +wpasupplicant (0.5.7-0ubuntu2) feisty; urgency=low + + * Apply patch from upstream after private email discussion: + http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=commitdiff;h=33673d3f43da6f5ec0f0aa5a8245a1617b6eb2fd#patch1 + Fixes LP: #98895, #98925 + + -- Reinhard Tartler Sun, 1 Apr 2007 10:53:37 +0200 + +wpasupplicant (0.5.7-0ubuntu1) feisty; urgency=low + + * new upstream version, Fixes LP: #91676 + + -- Reinhard Tartler Sat, 24 Mar 2007 10:36:02 +0100 + +wpasupplicant (0.5.5-4) unstable; urgency=low + + * Settings for wired networks are no longer ignored by functions.sh. + (Closes: #401413) + + -- Kel Modderman Sun, 10 Dec 2006 01:25:11 +1000 + +wpasupplicant (0.5.5-3) unstable; urgency=low + + * Make needlessly global shell function variables local. Use local + consistently. [debian/functions.sh] + * Enhance error message when wpa-conf or wpa-roam mode is requested, but the + supplied configuration file is not readable or incorrect. + [debian/ifupdown.sh] + * Exchange bogus copyright holder information of functions.sh, ifupdown.sh + and wpa_action.sh for information reflecting the _group_ behind them. + * Force ap_scan=0 for "wired" IEEE8021X type authentication. + [debian/functions.sh] + * Add debian specific location for example wpa_supplicant.conf files to + wpa_supplicant.conf(8). (Closes: #396005) + * Fix typo in wpa_supplicant(8) that referred to non-existant manpage. + (Closes: #389948) + * Update madwifi private includes to latest (r1794). + * Add XS-X-Vcs-Svn field to debian/control file. + * Shunt env var IFACE to WPA_IFACE in the ifupdown.sh, wpa_action.sh and + function.sh scripts. This allows further flexibility, such as the ability + to start wpa_supplicant on an arbitary interface specified by a + 'wpa-iface' line in /etc/network/interfaces. + + -- Kel Modderman Fri, 10 Nov 2006 11:12:56 +1000 + +wpasupplicant (0.5.5-2) unstable; urgency=low + + * Update madwifi headers to latest SVN. (Closes: #388316) + * Remove failed attempt at action locking. [debian/functions.sh, + debian/wpa_action.sh] + * Add hysteresis checking functions, to avoid "event loops" while + using wpa-roam. [debian/functions.sh, debian/wpa_action.sh] + * Change of co-maintainer email address. + * Add ishex() function to functions.sh to determine wpa-psk value type in + plaintext or hex. This effectively eliminates the need for the bogus and + somewhat confusing wpa-passphrase contruct specific to our scripts and + allows wpa-psk to work with either a 8 to 63 character long plaintext + string or 64 character long hex string. + * Adjust README.modes to not refer to the redundant wpa-passphrase stuff. + * Add big fat NOTE about acceptable wpa-psk's to top of example gallery. + * Strip surrounding quotes from wpa-ssid if present, instead of just whining + about them. + * Update email address in copyright blurb of functions.sh, ifupdown.sh and + wpa_action.sh. + + -- Kel Modderman Thu, 5 Oct 2006 08:04:01 +1000 + +wpasupplicant (0.5.5-1) unstable; urgency=low + + * wpa_supplicant(8) now describes the -P (PID file) line option in the + manpage. (Closes: #381721) + * wpa_passphrase(8) is clearer about describing its purpose. + * Start a paragraph in README.modes containing information about best + security practises while using and configuring wpa_supplicant. For now + it briefly covers the topic of file permissions. (Closes: #382241) + * Implement PSK and ASCII passphrase key sanity checking, and warn user + about suspicious key lengths (managed mode only). + * Add leading example network conf, using wpa-passphrase, to README.modes. + * README.Debian documentation changes as sugested by Eduard Bloch + (Closes: #382314) + - reordered sections by importance for a new user, this ensures wext info + for ipw drivers is obvious (Closes: #384299) + - rewrote the first chapter to give a fluent introduction, refered to + wireless-tools doc + - add missing .gz to README.notes path (Closes: #386603) + * Reshuffle of README.modes, moving How It Works section toward the latter + end to avoid stopping people from missing out on important info. + * Rename 'Notes About Managed Mode' to 'Important Notes About Managed Mode'. + * Clarify the status of madwifi and 'wext' in README.modes. + (Closes: #382651) + * Return exit status of daemon start commands. + * Further cleanup of ifupdown.sh, move functions to head of script. + * wpa-ifupdown no longer checks interface state. + * Touch logfile before redirecting output to it via exec, to make sure it is + writeable. + * Split common code into /etc/wpa_supplicant/ifupdown_common.sh, so that + ifupdown.sh and wpa_action.sh may share it. + * Add 'wpa_action iface check' option, to test if interface is under + influence of wpa_cli or not.. + * Start wpa_cli daemon from post-up to avoid a race condition with the + roaming daemon where association occurred before the master interface + state was recorded. This would cause the mapped logical interface to fail + on ifup, as wpa_action would fail to detect the state of the master + interface, thus not supply the --force option. This is where a stateless + ifupdown would really help. + * Make conf_wpa_supplicant no-act for roaming daemon. This is important, so + that we do not attach wpa_cli to the ctrl_interface socket and initiate + roaming before state is tracked. + * Add hints about 'auto' and 'allow-hotplug' options with respect to the + roaming interface in README.modes. (Closes: #384501) + * Drop patchset for commenting out large wpa_supplicant.conf, use sed + instead. + * Active dbus interface via CONFIG_CTRL_IFACE_DBUS, add build-dep of + libdbus-1-dev to debian/control. + * Upstream now provides a connect-to-open-ssid example in the large + wpa_supplicant.conf file, therefore there is no need to maintain such an + example. Rename wpa_connect_open_ap.conf to wpa_supplicant.conf.template + and adjust docs to use this as a starting point for the wpa-roam daemon. + * Install wpa_passphrase to /usr/bin, there is no need for it in early boot. + * Build qt4 wpa_gui from wpa_gui dir rather than pure qt4 variant + (wpa_gui-qt4) as per Jouni's advice. + * Add versioned dependency on lsb-base >= 3.0-6 for use of log_action_* in + wpa-ifupdown.init. (Closes: #386164) + * Use correct terminology when describing wpa-roam in wpa_action(8). + (Closes: #386813) + + -- Kel Modderman Mon, 11 Sep 2006 19:23:05 +1000 + +wpasupplicant (0.5.4-5) unstable; urgency=low + + * STDIN was not given to external mapping script correctly. Use the power of + eval to fix the issue. [wpa_action.sh] + * Fix stupid debian/control error: duplicate Suggests fields. + + -- Kel Modderman Thu, 10 Aug 2006 01:03:38 +1000 + +wpasupplicant (0.5.4-4) unstable; urgency=low + + * Add support to wpa_action.sh and ifupdown.sh for allowing external mapping + logic to be used as opposed to the id_str logic. Thanks to Felix Homman + for the great insight while implementing this feature. + * Add a timeout loop of max 60s when waiting for an action to finish. + [wpa_action.sh] + * Minor cleanups wrt code comments and function placement in ifupdown.sh. + * Suggest guessnet, now that it can directly "plug in" to wpa_action. Also + demote iproute from Recommends to Suggests, it is not important by any + means and was only added to honour a wishlist request. + * Prepare for ctrl_interface socket changes in 0.5.5. It can be provided by + 'DIR=foo GID=bar' or 'ctrl_interface=foo' in wpa_supplicant.conf. Our sed + check for this path in ifupdown.sh should now support both alternatives. + * Move LOCKFILE and LOGFILE into WPA_ namespace. [wpa_action.sh] + * Use semi-colon instead of comma for verbose output as that seems to be a + standard among many different applications. + + -- Kel Modderman Tue, 8 Aug 2006 20:04:11 +1000 + +wpasupplicant (0.5.4-3) unstable; urgency=low + + * UNRELEASED + * Further optimisation of ifupdown.sh, use return values in + init_wpa_supplicant() to dictate if further commands should follow, rather + than exiting immediately. + * Standardize echo'ing in ifupdown.sh. Add a wpa_msg() function to take care + of "verbose|action|stdout|stderr" messages. + * Add a 5 second timeout loop to init_wpa_supplicant() that waits for the + ctrl_interface socket to be established before allowing wpa_cli to launch, + and avoid a race condition. This means other functions no longer need to + test for existance of the ctrl_interface socket. [ifupdown.sh] + * Rename WPA_DRIVER to WPA_SUP_DRIVER to conform with name scheme of other + similar variables. [ifupdown.sh] + * Add (untested) wpa-bridge support to ifupdown.sh. This is an experimental + upstream feature. + * Major refactoring of wpa_action.sh, with all related commands put into + independent shell functions. + * Improve feedback from wpa_action.sh when used interactively. Give usage + statement instead of simply returning "insufficient parameters". + * 'wpa_action reload' is logged after the action. It is called interactively, + and should also give interactive feedback. Same for 'wpa_action stop'. + * Remove superfluous check for /var/log, and put logging initialisation into + its own function, log_init(). [wpa_action.sh] + * Shut `ip addr flush dev "$IFACE" up', it almost always has nothing to flush. + * wpa-ifupdown init script now takes care of all interfaces while displaying + only one line. + * Don't set -e in wpa_action.sh. wpa-ifupdown script no longer takes exit + status into account, and I'd prefer to account for all possible avenues of + exit possible and log all encountered problems. + * Really fix #375599, by containing the CTRL_IFACE_DIR path in WPA_SUP_CONF + always, customised or not. The WPA_CTRL_IFACE socket was not being created + when ommitted from the wpa_supplicant.conf file. + * Add 'wpa-maint-debug' to enable set -x in ifupdown.sh, so that we can easy + track down vague problems. + * Slightly modify the way in which madwifi is activated. The default config + we apply does not activate madwifi by default any longer, it is done via + seperate patches; 20_include_madwifi modifies the .config file to activate + the driver_madwifi backend, and adds the required CFLAGS to find the + includes that are later added via one of the 21_madwifi*_includes patches. + * Update madwifi includes to that of the current offering in the debian + archive, r1680. + * Implement basic locking for wpa_action action's for when the user callable + "stop" action is executed while wpa_action is busy configuring the device. + The wpa_cli daemon is killed, then wpa_action waits for the current action + to finish gracefully before killing wpa_suppliant. This helps avoid + inconsistencies with ifupdown when volatile conditions are experienced as + part of the roaming setup (for example, driver problems causing connection + loops). + * Rename WPA_CLI_ACTFILE to WPA_CLI_LOCKFILE in ifupdown.sh. + * Condemn the use of wpa-action scripts: + - add NEWS item describing the superior alternative: wpa-roam + - remove example action scripts + - remove conf_wpa_cli() from ifupdown.sh + * Condense README.Debian and NEWS, so that they contain only relevant items, + and do not repeat the same information. + * Massive enhancement of README.modes, in an attempt to relay the + information about how this package, and wpa_supplicant work in debian with + the greatest of clarity. + * Harden tests for daemon pidfiles. No longer be satisfied that a pidfile + exists, but use start-stop-daemon to test its validity by sending a signal + 0. Remove pidfiles that do not pass the test. + * Fix stupid $DAEMON_VEROSITY typo that was used consistently throughout + script. [ifupdown.sh] + * Assoctiate "down" with the stop action of wpa_action. + * Thanks Marc Haber for reading over docs and notifying of some of the + follwoing issues. + - Fix typo "automattically" in README.modes. + - Remove bogus pre-up example from wpa_action(8) and README.modes + - Explain in more detail how /etc/wpa_supplicant/ifupdown.sh works in + README.modes. + * Add "The Logfile" section to README.modes. + * Add patch from upstream to fix writing of stakey, peerkey, and id_str + network configuration variables into the configuration file when + update_config=1 is set. Thanks to Felix for reporting. + + -- Kel Modderman Thu, 3 Aug 2006 15:58:24 +1000 + +wpasupplicant (0.5.4-2) unstable; urgency=low + + [ Kel Modderman ] + * End testing period. The 0.5 branch of wpa_supplicant upstream has proven + to be non disruptive to users' configurations over the past few weeks, + lets now allow this to propogate to testing. (Closes: #374342) + * Clean up the LSB Init header block. Provide all fields as per LSB Init + Script Comment Convention specification. + * Do not use /usr/bin/env to interrogate the environment for IF_WPA + variables, /usr may not be mounted at time of invocation. Use `set' + (shell built-in) instead. (Closes: #376243) + * Exit if IFSTATE_FILE or INTERFACES_FILE do not exist. Also, look for + ifstate file in /var/run/network to remain compatible with Ubuntu's + ifupdown divergence. (lp#51351) + * Add a similar IFSTATE_FILE test to wpa-ifupdown.init, to remain compatible + with Ubuntu. (lp#51351) + * Update wpa_action.8 with the behaviour of wpa_action when IFSTATE_FILE or + INTERFACES_FILE cannot be found, and the pathnames searched for their + existance. + * Mention wpa_cli(8) in Custom Action Script section of README.Debian, as it + contains information about environment variables available to the script + at runtime. + * Also clarify dhclient wpacli-action script usage, to avoid people + mistakenly cp'ing the skeleton script. + * Add some info about howto revert installation of deprecated init script to + NEWS file. + * Add 'wpa-verbosity' switch, so that setting 'wpa-verbosity 1' in an + interfaces stanza will cause wpa_supplicant's ifupdown hook to be loud. + This was overlooked when #361586 was closed some time ago. + * Remove return value hack in wpa_action, use set -e to exit on error + instead. (Closes: #376553) + * Not only flush IFACE when iproute is installed, but also use /sbin/ip to + set 'up' operstate as well. + * Default to wext without exception. Remove the check for wireless extensions + via /proc/net/wireless, and prevent driver type of "wired" from being + selected in the case that the iface may not be "prepared" yet. + (Closes: #376651) + * Remove duplicating pidfile shell var's in wpa_action.sh by simply making + them global. + + [ Reinhard Tartler ] + * Note that ap_scap=2 can help speeding up associations (Closes: #368770) + * wpa_action: flush the ip addr, if the package iproute is installed + * wpa_action: add action 'reload' to reload the wpa_supplicant configuration + * debian/control: add iproute to Recommends + + -- Kel Modderman Wed, 5 Jul 2006 18:42:06 +1000 + +wpasupplicant (0.5.4-1) unstable; urgency=low + + * New upstream release. + * WPA_CRTL_DIR environment variable is now exported to action scripts, we + will use it to print a status report after a CONNECTED event. + * Make logfile contents easier to read by adding a break between each ACTION + event. + * Recommend dhcp3-client, it handles consecutive wpa_action events with more + grace than dhcp-client by not starting multiple dhclient processes on the + same interface. + * Don't remove wpa_action logfile on 'stop'. + * Enhance wpa_action(8) to better explain the concept of a LOGICAL + interface. + * Install wpa_passphrase to /bin. (Closes: #373948) + * Manpages have been slightly enhanced, and now briefly explain wpa_cli + action environment variables and wpa_supplicant -C and -g options. + (Closes: #372615) + * Rename wpa_cli daemon pidfile to wpa_action.IFACE.pid for wpa-roam. + * Further env variable testing cleanups to ifupdown.sh. + * Global rename of WPA_COMMON_CTRL_IFACE to WPA_CTRL_DIR, as this is used + for the same purposes upstream. + * No longer penalise users for not having ctrl_interface explicitly + contained within their wpa_supplicant.conf. (Closes: #375599) + * Move WPA_ACTION_SCRIPT sanity checking into init_wpa_supplicant() to avoid + ifupdown.sh exiting when bringing down an interface when ifup previously + failed due to a missing or non-executable action script. + * Add numerous code comments to ifupdown.sh. + * Move WPA_CLI_OPTIONS and WPA_SUP_OPTIONS into their respective init() + functions. + * wpa_action now logs 'stop' events to file, updated manpage. + * Split wpa_action logging into two parts, event and environment. Only + wpa_cli events will echo env var's. + * wpa_action exits with retval of ifdown command on 'stop' event. + * Add workaround for sendsigs (initscripts) terminating wpa_supplicant + processes before networking is shutdown gracefully. An init script + wpa-ifupdown is called at sequence number 15 in runlevels 0 and 6 to bring + down all interfaces that were started via ifupdown.sh. + + -- Kel Modderman Tue, 27 Jun 2006 20:29:33 +1000 + +wpasupplicant (0.5.3+20060522-3) unstable; urgency=low + + [Reinhard Tartler] + * review and make the warnings in debian/NEWS even more obvious. + * advertise the manpage wpa_action(8) and the implemented roaming solution + better. + + [Kel Modderman] + * Bugfix: /etc/network/ifstate is not guarenteed to exist, we should grep + /etc/network/run/ifstate in wpa_action. (Closes: #373179) + * Include madwifi old development headers and provide a series of steps to + enable support for users of the madwifi-old driver in debian/NEWS. + * Restore init script example and information about its usage. + * Use INTERFACES_FILE and IFSTATE_FILE in wpa_action.sh. Thanks for idea + from Modestas Vainius. + + -- Kel Modderman Wed, 14 Jun 2006 01:13:08 +1000 + +wpasupplicant (0.5.3+20060522-2) experimental; urgency=low + + * Warn user and exit when wpa-roam is not started with manual inet METHOD. + * Remove awk line to "guess" a network_id, instead create the new block and + store output of wpa_cli in WPA_ID. (make sure that -i IFACE is used) + * Rename wpa_cli_wrapper() to wpa_cli() and make it absoluetly generic, + including only the IFACE and path to ctrl_iface socket. + * Introduce wpa_cli_do() and rewrite conf_wpa_supplicant() to enhance + readability and maintainability. + * Make WPA_ID variable local to conf_wpa_supplicant() + * Exit with status 1 when wpa-action fails. + * Move test's into init/conf/kill function header and clean up phase + specific case constructs at the tail of ifupdown.sh. + * Ensure lang barrier does not interfere with wpa_cli, use LC_ALL=C. + * Add patch from Dan Williams that works around a problem specific to wep + keys and orinoco chipsets. + * Update madwifing_includes dpatch to latest madwifi.org svn. + * Add WPAGUI to debian/rules, so that only one change has to be made to use + a different wpa_gui target. Remove $(WPAGUI)/Makefile in clean target. + * Purge and forget about the old init example script. + + -- Kel Modderman Sat, 10 Jun 2006 22:25:58 +1000 + +wpasupplicant (0.5.3+20060522-1) experimental; urgency=low + + * New upstream development snapshot. + * Oops: Disable CONFIG_EAP_SAKE. (Closes: #366937) + * Rename debian/wpasupplicant.ifupdown to debian/ifupdown.sh. There is no + need for that script to be named that way, as it may falsely seem to be + handled by a debhelper target. + * Don't attempt to send terminate signal via wpa_cli when start-stop-daemon + can be used. + * Use debhelper 5 compat level. + * Use wpa_gui-qt4, and build-depend on libqt4-dev. + * Use WPA_ID instead of NW_ID to make variable similar with what upstream + uses for a similar purpose (unique identifier). + * Add ifupdown environment var's to verbose output to assist in debugging. + * Fix some typo's (engine_id, key_id) in ifupdown.sh. + * ifupdown.sh no longer busy-loops when using an action script with + wpa-action-timeout 0. Thanks to Elmar Hoffmann! + * Allow wpa_cli action daemon to engage before configuring wpa_supplicant + via wpa_cli set_network commands to avoid a possibly racy condition. + * Move VERBOSITY variable to the beginning of ifupdown.sh, with the others. + * Indent shell code in wpacli-action-* scripts. + * Bumb Standards-Version to 3.7.2. + * Allow for future PHASE specific stuff in start MODE of ifupdown.sh. + * Move the action script sanity checks out of init_wpa_supplicant into + common section of ifupdown.sh. + * Create wpa_cli_wrapper to assist in major code clean up and future + maintenance of ifupdown.sh. + * Support madwifi-ng private ioctl's with the inclusion of the headers from + madwifi.org svn trunk. (At the expense of not supporting the madwifi-old + driver, which is deprecated by upstream madwifi) + * Add wpa_action.sh to provide /sbin/wpa_action and facilitate roaming via + ifupdown and network settings defined in /etc/network/interfaces (refer to + wpa_action(8) for more details). + + -- Kel Modderman Sun, 28 May 2006 20:33:38 +1000 + +wpasupplicant (0.5.3-1) experimental; urgency=low + + * New upstream development release. + * Orphaned daemons that are spawned during an ifup process that is + manually terminated are now checked for and killed. + * Don't make noise when we are not using the manual inet method and + wpa-action is used. + * Warn about non-executable action script. + * Ensure wpa_cli actfile is destroyed. + * Make start-stop-daemon verbose when VERBOSITY is set. + * Renumber dpatches for sanity. + * Make ifupdown script modular; split into shell functions. + * Fix typo in README.Debian, referring to a non-existant location. + * Disconnect and terminate existing ctrl_interface sockets. + + -- Kel Modderman Sat, 29 Apr 2006 14:53:51 +1000 + +wpasupplicant (0.5.2-3) experimental; urgency=low + + [ Kel Modderman ] + * Remove bad information about wpa-driver-file in docs. + * Actually fall back to wext as DRIVER type in example init script. + * Fix typo in debian/control, remove suggests of dhcp*-client alltogether. + * Remove bogus commands to set eapol_version and fast_reauth. They cannot be + set via wpa_cli. + * Make preauthenticate a global wpa_cli setting, rather than a per-ssid one. + * Kill dhclient process after a DISCONNECT signal in dhclient action script + example. + * Document that the action script must must be executable. + * Fix check for wireless extensions for when there is not whitespace after + $IFACE:. + * grep for $IFACE in /proc/net/dev to verify it is a valid network interface. + * Improve documentation about wpa-driver, and further clarify that all + wpa_cli commands should be supported in e/n/i by prefixing them with + "wpa-". + * Add a note about wpa-action-timeout. + + [ Reinhard Tartler ] + * remove last reference to /etc/default/wpasupplicant. It is gone, don't + revive zombies! + * small cleanups in debian/rules + * further clarifications in README.Debian + + -- Kel Modderman Tue, 11 Apr 2006 22:05:06 +1000 + +wpasupplicant (0.5.2-2) experimental; urgency=low + + [ Kel Modderman ] + * Bump debian revision to upgrade over the previously version uploaded to + experimental, which has sufficiently changed since that time to warrant + rebasing the package upon the 0.4.8-1 release to unstable. + * Make ifupdown script exit silently when binaries are not found or + executable. + * When ifupdown exits with an error status, do not hide the echo'd problem + description behind the VERBOSITY environment variable. + * Remove check for wpa_cli pidfile when executing an action script. This + check was racy, and not always successful. Sometimes, the device was + marked as up without allowing the action script a chance to finish. + * Improve feedback for wpa_cli action script daemon. + * Ensure WPA_CLI_ACTFILE is removed when wpa_cli is terminated. + * Fix typo in ifupdown script that later propogated into some example + information in README.debian (wpa-apscan should have been wpa-ap-scan). + Provide backwards compatibility for this change for those who already + followed the example. + * Check for existing pidfiles before executing daemons via ifupdown. + + [ Reinhard Tartler ] + * enable driver test + * add eap_testing.txt to documentation + * enhance Readme.txt + + -- Kel Modderman Tue, 4 Apr 2006 06:40:35 +1000 + +wpasupplicant (0.4.8-1) unstable; urgency=low + + [ Reinhard Tartler ] + * Finally bringing in the new Upstream version with the ap scan patch for + wpa-cli, required by network-manager (Closes: #356072) + * Dropping Mode 3 (start by init script) (Closes: #356842, #357760) + * add hint for associating to hidden ssids (Closes: #358137) + * add a note for faciliating debugging connection problems + * add this note to README.modes as well. + * remove or backup obsolete conffiles + /etc/network/if-p{re-up,ost-down}.d/wpasupplicant + * install the wpasupplicant.conf(5) manpage (Closes: #358138) + * don't start wpa_supplicant for loopback interface (Closes: #359814) + * add explanation about action scripts, mentioning that we expect now + the action script to create a file indicating that the interface is ready + for use. + * add warning in NEWS.Debian that upgrading to this package requires + manual intervention by the local admin. + * move old 'default configuration' to /usr/share/doc/wpasupplicant/examples + as example for connecting to open APs. + * remove version restriction from preinst. This means that obsoleted + conffiles are always removed! + * moved the ifupdown script to /etc/wpa_supplicant/ifupdown.sh + * added note about binaries beeing moved to /sbin + + [ Scott James Remnant ] + * Undo 0.4.8-0ubuntu2's replacement of the preinst/postinst/postrm triad, + which replaced the upgrade-failure proof and policy compliant code with + "something else". + * Restore change to ifupdown script that makes "wpa-conf" unnecessary. + * Move /etc/wpa_supplicant.conf to /etc/wpa_supplicant/wpa_supplicant.conf + if the user has modified it, otherwise remove it and install the new file. + * Remove 0_ from if-*.d symlink names as we don't force an order or + even serialisation. + + [ Kel Modderman ] + * Remove check for /proc/net/packet. (Closes: M#37121) + * Add timeout loop when launching a wpa_cli action script in conjunction + with the manual inet METHOD, to allow other ifupdown hooks to + post-configure the interface just as they would have if using a standard + method such as dhcp or static. Introduce WPA_CLI_ACTFILE to allow a + wpa_cli action script to signal connected state to ifupdown. + * Add skeleton wpa_cli action script to examples. + * Simplify wpasupplicant.examples. + * Don't install wpa_supplcant.defconf as the default wpa_supplicant conffile, + our users don't want that file interrogated by anyone, even dpkg. + + -- Reinhard Tartler Fri, 31 Mar 2006 10:58:16 +0200 + +wpasupplicant (0.4.8-0ubuntu3) dapper; urgency=low + + * Add 40_ctrl_iface_hide_keys.dpatch to hide passwords and PINs from + our logfiles, preventing an information disclosure vulnerability. + + -- Adam Conrad Wed, 29 Mar 2006 23:49:26 +1100 + +wpasupplicant (0.4.8-0ubuntu2) dapper; urgency=low + + [ Kel Modderman ] - done in debian experimental for version 0.5.2-1 + * New upstream release. + * Add myself to Uploaders. + * Convert to cdbs. + - rewrite debian/rules to take advantage of cdbs + - update control file build-deps + * Update README.modes. + - clarify that wext is used by default, when no driver is specified + - fix exmaple of wpa-psk using a plaintext string + - fix typo's + * Fold pre-up scripts into one, and symlink from + /etc/network/if-{pre-up,down}.d/wpasupplicant + * Use VERBOSITY of ifupdown to assist debugging of wpa stanza's in + /etc/network/interfaces. + * Add support for wpa_cli action scripts. + * Use start-stop-daemon to initiate wpa_supplicant and wpa_cli background + processes. + * Daemons now create pidfiles. + * Quote tested var's in wpasupplicant.init. + * Quote all var's in wpsupplicant.default for uniformity. + * Move wpa_* to /sbin. + * Conffile for wpa_supplicant now installed to + /etc/wpa_supplicant/wpa_supplicant.conf. That directory will hold any + other files that we may require to use wpa_supplicant. + * Don't start wpasupplicant pre-up if the current kernel lacks support for + "Packet Socket" (CONFIG_PACKET=y). + * Fix blunders in the init script. + - typo, $PIFFILE should have been $PIDFILE + - init script exited when a configuration file WAS found + * Force init daemon's pidfile to be the same as wpasupplicant.ifupdown uses, + to avoid duplicate wpa_supplicant processes binding to the same interface. + * Remove the margin for error from the init daemon, by forcing the default + variables to be set. Helpful and informative comments were placed in the + default file. The init script will exit if these variables are not set + correctly. (Closes: #357957) + * Add comment to defconf about ctrl_interface and wpa_cli. + * Add comments to previously uncommented dpatch's. + * Include proof-of-concept dhlcient wpa-action script. Suggest + dhcp(3)-client. + * Thanks to Henrik Brix Andersen from gentoo for the ideas and inspriration + for some of the above changes. + + [ Reinhard Tartler ] + * compile wpa_gui with qt3 rather than qt4. (in order to faciliate + backporting to sarge) + * revert to debhelper 4 + * take the complete packaging from our experimental branch. The last upload + did not document all changes properly (see the list above), and had still + a lot of issues. + * fixing typo in the preinst + + -- Reinhard Tartler Mon, 27 Mar 2006 15:28:22 +0200 + +wpasupplicant (0.5.1-1) experimental; urgency=low + + [ Reinhard Tartler ] + * New Upstream Release. This is the current development branch of + wpasupplicant. + * revised the init script for supporting roaming mode + * introduce README.modes explaining the differnet modes of operation + * install manpage wpa_supplicant.conf(5) (Closes: #358138) + * make wpasupplicant create a PID file (Closes: #355052) + * Revise wpasupplicant.postinst (Closes: #322176) + + [ Kel Modderman ] + * New experimental ifupdown scripts. (Closes: #322176, #356205, #356144) + * Drop wpasupplicant.{postrm,postinst,override,docs}. + * Use dh_installchangelogs to handle upstream changelog. + * Enforce permissions on installed files. + * Clean up handling of madwifi includes + - dpatch contains description of origin + - dpatch does not modify upstream, use CFLAGS to include madwifi headers + * Add wpa_background manpage provided by upstream. + + -- Kel Modderman Tue, 14 Mar 2006 23:00:47 +1000 + +wpasupplicant (0.4.8-0ubuntu1) dapper; urgency=low + + * New upstream release: + - Various bug fixes + - Support for EAP-FAST key derivation using other ciphers than + RC4-128-SHA for authentication and AES128-SHA for provisioning. + - UVF exception granted by Kamion. + + * Packaging and configuration is based on Debian Experimental however, + making this package something of a bastard love child of what's in + Debian. + * Deliberately dropped support for wpasupplicant being run at startup to + make it easier for Ubuntu to support. It's now run on a per-interface + basis when the interface is brought up. + Consult /usr/share/doc/wpasupplicant/README.Debian for documentation + if upgrading from universe. + * Unlike Debian the wpa-conf /etc/network/interfaces is only needed for + explicitly giving a configuration file; simply include any setting + for wpa to be used. + * Binaries moved to /sbin for seb128. + + -- Scott James Remnant Thu, 23 Mar 2006 23:29:57 +0000 + +wpasupplicant (0.4.7-4) unstable; urgency=low + + [Daniel T Chen] + + * Convert rcS.d script to use /etc/network/if-p{ost-down,re-up}.d + instead. Remove the rcS.d script installed in 0.4.7-0ubuntu{1,2}. + If you manually modified /etc/network/interfaces to use the pre-up + and post-down directives with wpasupplicant, please remove them. + Thanks to Scott James Remnant for the guidance. (Closes: #304032) + + [Kel Modderman - submitted via bug #353530] (Closes: #353530) + + * Use upstream manpages. + * added watch file + * cleanups in debian/rules + * Install wpagui manpage to man8 + * Use qmake-qt4 directly, to avoid ftbfs on systems with other qt + versions installed. + + [Reinhard Tartler] + + * Merged with ubuntu package + * added myself to Uploaders + * use debhelper 5 + * remove debian/wpasupplicant.conffiles, debhelper handles this on its own + * renamed ChangeLog.gz to changelog.gz, (Policy 12.7) + * installed lintian override for possible multiple calling of update-rc.d. + This is necessary to support different upgrade paths. + * revised postinst, so that updating initskript links happens in when + configuring the package only + * introduce debian/NEWS, documenting importants bits of debian/changelogs, + and a bit about future development of wpasupplicant + * verified working WPA EAP-TLS on ipw2200. (Closes: #317548) + * /etc/init.d/wpasupplicant is now a initscript which is not started on + startup by default. (see changes by Daniel T Chen). lintian is not happy + about this, so another lintian override was added + + -- Reinhard Tartler Fri, 24 Feb 2006 18:27:52 +0100 + +wpasupplicant (0.4.7-3) unstable; urgency=low + + * Another brown paper bag release. + * Fix mistype of $CONFIG_FILE variable name in default script. Also make + this the same variable checked for existance in the init script, as that + was another bug I missed. (closes: #350900) + + -- Kyle McMartin Wed, 01 Feb 2006 09:21:41 -0500 + +wpasupplicant (0.4.7-2) unstable; urgency=low + + * Brown paper bag release. + * Add description for wpagui binary package... + + -- Kyle McMartin Sat, 28 Jan 2006 16:51:56 -0500 + +wpasupplicant (0.4.7-1) unstable; urgency=low + + * New upstream version. (closes: #347347) + * New binary package, wpa_gui; build-deps on Qt4. (closes: #332654) + * Move wpasupplicant to run in rcS, before networking. This will likely + upset a few people, but as wpasupplicant can wait for the interface to + exist before doing anything, it shouldn't cause any real problems. + (closes: #310136) + * Document in default config file that EAP-FAST will not work + without a patch to OpenSSL. (closes: #322174) + * Comment out most of the default config file, some people kept the + whole file verbatim, causing OpenSSL to try and load some uncommon + libraries people likely didn't have installed, resulting in + wpasupplicant segfaulting (closes: #330138, #336423) + * Also for #336423, Suggest: libengine-pkcs11-openssl, and document why. + * Make more noise when the daemon fails to run. (closes: #346265) + * Don't advertise that -i may not be required in default/wpasupplicant, + this option was removed as it did not scale to handle multiple + interfaces. (closes: #322175) + * Document typical location of config file in manpage. Note, + wpasupplicant no longer implicitly finds a config file. (closes: #315963) + * Add simple WPA-PSK example to default config file. (closes: #331533) + * Split up $OPTIONS in default/wpasupplicant. (closes: #331533) + + -- Kyle McMartin Sat, 28 Jan 2006 02:30:27 -0500 + +wpasupplicant (0.4.6-0.2) unstable; urgency=low + + * New upstream version (closes: #335487). + * This version is designed for Wireless Extensions 19 and so will work + with Linux kernel 2.6.14. Closes: #338131. + * Note that WPA support was added in Wireless Extensions 18 and should + therefore exist in new (2.6.14-compliant) drivers, including + ipw2200 v1.0.8. In order to take advantage of this new support you need to + invoke wpasupplicant with the wext driver ("-D wext" in + /etc/default/wpasupplicant for instance, instead of "-D ipw" say). + Probably closes also #304087 and #317548, but I'm not going to confirm + that just for an NMU. + * Added comments to README.Debian amounting to the above. + * Borrowed some of Norbert Preining's improvements: + - add debhelper token to postrm script + - fix address of FSF in copyright file + - bump standards version to 3.6.2 + (Kyle, when you get back to this package, find Norbert's other changes + upgrading to debhelper 4 in bug #338131). + * Set NMU version to 0.2 for Norbert's convenience. + * Marked /etc/init.d/wpasupplicant as a conffile (should really use + debhelper4 to take care of this, but I'm not going to make the other + changes needed for this). + + -- Drew Parsons Thu, 10 Nov 2005 20:34:35 +1100 + +wpasupplicant (0.4.4-1) unstable; urgency=low + + * New upstream version. + * Ship a default /etc/wpa_supplicant.conf which associates with any + open access point. (closes: #287220, #322171, #315964) + * /etc/default/wpasupplicant is no longer mode 755 (closes: #315031) + * Add a postrm script, oops, overlooked this initially... (closes: #327522) + * Fix hyphen/minus in man pages. (closes: #296310) + * patches/ + - 01_config + + update + + Enable wired driver. (closes: #325296) + + Add EAP_FAST to config, but comment it out. EAP_FAST requires a patch + to openssl before it is compileable. + - 10_madwifi_includes + + update from madwifi CVS. (closes: #326226) + + -- Kyle McMartin Sat, 24 Sep 2005 12:35:02 -0400 + +wpasupplicant (0.4.2-1) unstable; urgency=low + + * New upstream release. + * Add debhelper flag to postinst. + + -- Kyle McMartin Sat, 18 Jun 2005 19:04:02 -0400 + +wpasupplicant (0.4.1-0) unstable; urgency=low + + * New upstream release. + * This release was not uploaded. + + -- Kyle McMartin Sun, 29 May 2005 17:40:11 -0400 + +wpasupplicant (0.4.0-1) unstable; urgency=low + + * New upstream release. + * patches/ + - 12_ipw_open_aps + + remove patch: It seems to cause problems with associating with + open access points. + - 11_madwifi_open_aps + + remove patch, fixed upstream + driver_madwifi: fixed association in plaintext mode + + -- Kyle McMartin Sat, 30 Apr 2005 11:28:01 -0400 + +wpasupplicant (0.3.8-1) unstable; urgency=low + + * New upstream release. + * This release fixes a crash due to a buffer overflow, caused by + a missing validation step on EAPOL-Key frames. Receiving malformed + frames trigger the crash. More information available in the notes: + http://lists.shmoo.com/pipermail/hostap/2005-February/009465.html + * Fix some badness with the init script. Missed the -B option + to daemonize wpa_supplicant... pidfile is not currently being used + as it requires modifying wpa_supplicant. + * patches/ + - 12_ipw_open_aps (closes: #295143) + + merge patch against driver_ipw to fix association with + open access points. + + -- Kyle McMartin Tue, 15 Feb 2005 00:51:28 -0500 + +wpasupplicant (0.3.7-1) unstable; urgency=low + + * New upstream stable release. + * Add preliminary init script for wpasupplicant. Currently it will + start after pcmcia, for obvious reasons. (closes: #287219) + * patches/ + - 11_madwifi_open_aps (closes: #294909) + + merge patch against driver_madwifi to fix association with + open access points. + + -- Kyle McMartin Sat, 12 Feb 2005 22:56:11 -0500 + +wpasupplicant (0.3.2-2) unstable; urgency=low + + * patches/ + - 06_default_ifname + + support a default interface specified in wpa_supplicant.conf + + -- Kyle McMartin Sun, 23 Jan 2005 03:26:01 -0500 + +wpasupplicant (0.3.2-1) unstable; urgency=low + + * New upstream release. + * From upstream changelog, and verified: (closes: #286443) + + fixed private key loading for cases where passphrase is not set + + -- Kyle McMartin Mon, 20 Dec 2004 10:22:11 -0500 + +wpasupplicant (0.3.1-2) unstable; urgency=low + + * Add CONFIG_CTRL_IFACE=y option to maintain old configuration file + compatibility. + + -- Kyle McMartin Sat, 18 Dec 2004 14:03:19 -0500 + +wpasupplicant (0.3.1-1) unstable; urgency=low + + * The "Kyle is a lazy, lazy, lazy hacker" release. + * Removed patch for ipw2100, as it's been integrated + upstream. (closes: #281979) + * Remove default wpa_supplicant.conf from /etc, since we aren't + installing a configuration file that will work by default. Instead, + it has been moved to /usr/share/doc/wpasupplicant/examples. + * Enable a few more options. Unfortunately support for Broadcom's wl.o + must be disabled, since it requires a header file with an + "All Rights Reserved" copyright. LinuxAnt DriverLoader is similarly + disabled, though NDISWrapper is supported. + + -- Kyle McMartin Thu, 16 Dec 2004 12:39:01 -0500 + +wpasupplicant (0.2.5-2) unstable; urgency=low + + * Merged patch from Lorenzo Martignoni, to enable support for + WPA on the Intel IPW2100 wireless chipset (aka: Centrino). + + -- Kyle McMartin Sat, 23 Oct 2004 15:21:11 -0400 + +wpasupplicant (0.2.5-1) unstable; urgency=low + + * New upstream version. (closes: #276368) + + -- Kyle McMartin Tue, 12 Oct 2004 09:10:19 -0400 + +wpasupplicant (0.2.4-2) unstable; urgency=low + + * patches/ + - 01_config + + enable TLS support (and various other non-default configurations) + - 05_default_conf + + patch to use "/etc/wpa_supplicant.conf" by default, instead of + prompting for the configuration on the command line. + * Add Build-Depends on libssl-dev, used by various EAPs. + + -- Kyle McMartin Sun, 12 Sep 2004 11:16:19 -0400 + +wpasupplicant (0.2.4-1) unstable; urgency=low + + * Initial release. + * patches/ + - 01_config + + default configuration + - 10_madwifi + + support for wireless cards using the madwifi driver + + -- Kyle McMartin Sun, 5 Sep 2004 13:19:27 -0400 --- wpasupplicant-0.6.0+0.5.8.orig/debian/wpa_supplicant.conf.template +++ wpasupplicant-0.6.0+0.5.8/debian/wpa_supplicant.conf.template @@ -0,0 +1,23 @@ +# Minimal /etc/wpa_supplicant.conf to associate with open +# access points. Please see +# /usr/share/doc/wpasupplicant/examples/README.wpa_supplicant.conf.gz +# for more complete configuration parameters. +# +# Also see the other files in /usr/share/doc/wpasupplicant/examples/ for +# specific configuration examples. + +# path to UNIX socket control interface +ctrl_interface=/var/run/wpa_supplicant + +### Example of basic WPA-PSK secured AP +#network={ +# ssid="ournet" +# psk="w243sd5f324asdf5123sadf54324" +#} + +### Associate with any open access point +### Scans/ESSID changes can be done with wpa_cli +network={ + key_mgmt=NONE +} + --- wpasupplicant-0.6.0+0.5.8.orig/debian/wpa_supplicant.init-daemon +++ wpasupplicant-0.6.0+0.5.8/debian/wpa_supplicant.init-daemon @@ -0,0 +1,128 @@ +#!/bin/sh + +# Buyer beware! This is really only useful if you want to use +# wpasupplicant in roaming mode. +# +# PLEASE READ /usr/share/doc/wpasupplicant/README.modes for +# details of the modes of operation of wpasupplicant. +# + +# To activate the wpasupplicant daemon, set ENABLE_ROAMING_MODE to 1 + +ENABLE_ROAMING_MODE=0 + +# Location of the wpa_supplicant.conf configuration file to be used +# by the daemon. +# +# See the wpa_supplicant.conf(5) manpage for detailed information +# about the wpa_supplicant configuration file. Example configuration +# files are located at /usr/share/doc/wpasupplicant/examples. +# +# Failure to set CONFIG to the full pathname of your configuration +# file will cause the daemon to exit immediately. + +CONFIG="" + +# Specify the network interface that the daemon will attach to. +# +# Examples: INTERFACE="eth1" +# INTERFACE="ath0" +# +# Failure to set INTERFACE to a valid network interface name will +# cause the daemon to fail or exit immediately. + +INTERFACE="" + +# DRIVER specifies the driver type of the interface defined above. +# +# If DRIVER is not set, the daemon will default to the "wext" driver +# +# Currently, the following drivers are supported: +# hostap = Host AP driver (Intersil Prism2/2.5/3) +# madwifi = MADWIFI 802.11 support (Atheros, etc.) +# atmel = ATMEL AT76C5XXx (USB, PCMCIA) +# wext = Linux wireless extensions (generic, ipw2100/2200/3495, linux >= 2.6.14) +# ndiswrapper = Linux ndiswrapper +# ipw = Intel ipw2100/2200 driver (linux kernels 2.6.13 or older only) +# wired = wpa_supplicant wired Ethernet driver + +DRIVER="" + +# End user defined section + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +DAEMON="/sbin/wpa_supplicant" +PNAME="wpa_supplicant" + +# exit silently if daemon is not installed/executable +[ -x $DAEMON ] || exit 0 + +if [ "$ENABLE_ROAMING_MODE" = "0" ]; then + exit 0; +fi + +if [ -z "$INTERFACE" ]; then + echo "No INTERFACE was defined, not starting."; + exit 1; +fi + +if [ ! -r "$CONFIG" ]; then + echo "No configuration file found, not starting."; + exit 1; +fi + +if [ -z "$DRIVER" ]; then + DRIVER="wext" +fi + +# the pidfile name is important for avoiding unwanted interactions +# with the wpasupplicant pre-up script +PIDFILE="/var/run/wpa_supplicant.$INTERFACE.pid" + +OPTIONS="-B -w -i $INTERFACE -D $DRIVER -c $CONFIG -P $PIDFILE" + +set -e + +case "$1" in + start) + if [ -f "$PIDFILE" ]; then + echo "$PNAME not starting, $PIDFILE already exists." + exit 1 + fi + echo "Starting $PNAME." + start-stop-daemon --start --name $PNAME \ + --oknodo --startas $DAEMON -- $OPTIONS + ;; + stop) + echo "Stopping $PNAME." + start-stop-daemon --stop --name $PNAME \ + --oknodo + if [ -f "$PIDFILE" ]; then + rm -f $PIDFILE; + fi + ;; + reload|force-reload) + echo "Reloading $PNAME." + start-stop-daemon --stop --signal HUP \ + --name $PNAME + ;; + restart) + echo "Stopping $PNAME." + start-stop-daemon --stop --name $PNAME \ + --oknodo + if [ -f "$PIDFILE" ]; then + rm -f $PIDFILE; + fi + + echo "Starting $PNAME." + start-stop-daemon --start --name $PNAME \ + --oknodo --startas $DAEMON -- $OPTIONS + ;; + *) + echo "Usage: wpasupplicant {start|stop|restart|reload|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 --- wpasupplicant-0.6.0+0.5.8.orig/debian/wpa_action.sh +++ wpasupplicant-0.6.0+0.5.8/debian/wpa_action.sh @@ -0,0 +1,92 @@ +#!/bin/sh + +# Copyright (C) 2006 Debian/Ubuntu wpasupplicant Maintainers +# +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# On Debian GNU/Linux systems, the text of the GPL license can be +# found in /usr/share/common-licenses/GPL. + +if [ -n "$IF_WPA_ROAM_MAINT_DEBUG" ]; then + set -x +fi + +if [ -z "$1" ] || [ -z "$2" ]; then + echo "Usage: $0 IFACE ACTION" + exit 1 +fi + +# network interface +WPA_IFACE="$1" +# [CONNECTED|DISCONNECTED|stop|reload|check] +WPA_ACTION="$2" + +if [ -f /etc/wpa_supplicant/functions.sh ]; then + . /etc/wpa_supplicant/functions.sh +else + exit 0 +fi + +case "$WPA_ACTION" in + "CONNECTED") + wpa_log_init + wpa_hysteresis_check || exit 1 + wpa_log_action + wpa_log_environment + if ifupdown_check; then + ifup + fi + wpa_hysteresis_event + wpa_cli status + ;; + + "DISCONNECTED") + wpa_log_init + wpa_hysteresis_check || exit 1 + wpa_log_action + wpa_log_environment + if ifupdown_check; then + ifdown + if_post_down_up + fi + ;; + + "stop"|"down") + test_wpa_supplicant || exit 1 + kill_wpa_cli + if ifupdown_check; then + ifdown + fi + kill_wpa_supplicant + wpa_log_init + wpa_log_action + ;; + + "restart"|"reload") + test_wpa_supplicant || exit 1 + reload_wpa_supplicant + wpa_log_init + wpa_log_action + ;; + + "check") + test_wpa_supplicant || exit 1 + test_wpa_cli || exit 1 + ;; + + *) + echo "Unknown action: \"$WPA_ACTION\"" + exit 1 + ;; +esac + +exit 0