r1063 - in trunk: . ATTACHMENTS/wpa-service

tushar at linuxfromscratch.org tushar at linuxfromscratch.org
Sat Nov 11 15:12:06 PST 2006


Author: tushar
Date: 2006-11-11 16:12:05 -0700 (Sat, 11 Nov 2006)
New Revision: 1063

Added:
   trunk/ATTACHMENTS/wpa-service/ifplugd_wrapper-script
   trunk/ATTACHMENTS/wpa-service/wpa-rcscript
   trunk/ATTACHMENTS/wpa-service/wpa-service-iface
   trunk/ATTACHMENTS/wpa-service/wpa-service2
   trunk/ATTACHMENTS/wpa-service/wpa_actions-script
   trunk/ATTACHMENTS/wpa-service/wpa_service.conf
Removed:
   trunk/ATTACHMENTS/wpa-service/autoipd-service
   trunk/ATTACHMENTS/wpa-service/wpa-init
   trunk/ATTACHMENTS/wpa-service/wpa-service
   trunk/ATTACHMENTS/wpa-service/wpa-service-conf
Modified:
   trunk/wpa-service.txt
Log:
Updated: wpa-service

Deleted: trunk/ATTACHMENTS/wpa-service/autoipd-service
===================================================================
--- trunk/ATTACHMENTS/wpa-service/autoipd-service	2006-10-17 04:28:54 UTC (rev 1062)
+++ trunk/ATTACHMENTS/wpa-service/autoipd-service	2006-11-11 23:12:05 UTC (rev 1063)
@@ -1,68 +0,0 @@
-#!/bin/sh
-# Begin $network-devices/services/autoipd-service
-
-# Based upon lfs-bootscripts-1.12 $network_devices/if{down,up}
-# Rewritten by Nathan Coulson <nathan at linuxfromscratch.org>
-# Adapted for autoipd by Eloi Primaux <eloi AT bliscat DOT org>
-
-#$LastChangedBy: eloi $
-#$Date: 2006-03-31 19:48:55 -0300 (Fri, 31 Mar 2006) $
-
-. /etc/sysconfig/rc
-. $rc_functions
-. $IFCONFIG
-
-
-
-
-#Options:
-
-#-h          this help
-#-v          display version information
-#-d          run in debug mode
-#-i ifname   use interface ifname
-#-s addr     start at IP address addr
-#-m addr     use this mac address
-
-PIDFILE="/var/run/autoipd-$1.pid"
-
-case "$2" in
-        up)
-                boot_mesg -n "Starting autoipd on the $1 interface..."
-                # Test to see if there is a stale pid file
-                if [ -f "$PIDFILE" ]
-                then
-                    ps `cat "$PIDFILE"` | grep autoipd > /dev/null
-                    if [ $? != 0 ]
-                    then
-                        rm -f /var/run/autoipd-$1.pid > /dev/null
-                    else
-			boot_mesg "autoipd already running!" ${WARNING}
-                        echo_warning
-                        exit 2
-                    fi
-                fi
-                /sbin/autoipd -i $1 $AUTOIPD_START
-		# Save the return value
-		RET="$?"
-
-			echo ""
-			$(exit "$RET")
-			evaluate_retval
-
-        ;;
-
-        down)
-		boot_mesg -n "Stopping autoipd on the $1 interface..."
-			    echo ""
-			    killproc autoipd
-
-        ;;
-
-        *)
-                echo "Usage: $0 [interface] {up|down}"
-                exit 1
-        ;;
-esac
-
-# End $network_devices/services/autoipd-service

Added: trunk/ATTACHMENTS/wpa-service/ifplugd_wrapper-script
===================================================================
--- trunk/ATTACHMENTS/wpa-service/ifplugd_wrapper-script	                        (rev 0)
+++ trunk/ATTACHMENTS/wpa-service/ifplugd_wrapper-script	2006-11-11 23:12:05 UTC (rev 1063)
@@ -0,0 +1,19 @@
+#!/bin/bash
+# ifplugd-wapper, to use ifplugd with the wpa_actions script
+# Eloi Primaux eloi AT bliscat DOT org
+
+. /etc/sysconfig/wpa_supplicant/wpa_service.conf
+
+if [ -z "$1" ] || [ -z "$2" ] ; then
+	echo "Wrong arguments" > /dev/stderr
+	exit 1
+fi
+
+case "$2" in
+up)
+	$WPA_ACTION_FILE $1 CONNECTED
+	;;
+up)
+	$WPA_ACTION_FILE $1 DISCONNECTED
+	;;
+esac

Deleted: trunk/ATTACHMENTS/wpa-service/wpa-init
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa-init	2006-10-17 04:28:54 UTC (rev 1062)
+++ trunk/ATTACHMENTS/wpa-service/wpa-init	2006-11-11 23:12:05 UTC (rev 1063)
@@ -1,89 +0,0 @@
-#!/bin/sh
-# Begin $rc_base/init.d/wpa-init
-
-# Based on:
-#sysklogd script from LFS-6.1 and earlier.
-#dhcpcd service script from LFS-6.1.1
-# Rewritten by Eloi Primaux
-
-#$LastChangedBy: eloi $
-#$Date: 2006-03-31 -0300 21:03:42 (Fri, 31 Mar 2006) $
-
-. /etc/sysconfig/rc
-. $rc_functions
-. /etc/profile
-
-WPA_GLOBAL_FILE=/var/run/wpa_supplicant-global
-WPA_ACCESS_DIR=/var/run/wpa_supplicant
-WPA_PID_FILE=/var/run/wpa_supplicant.pid
-
-
-#wpa_supplicant process must be unique
-
-
-case "$1" in
-	start)
-		boot_mesg "Starting wpa_supplicant..."
-		if [ -f "$WPA_PID_FILE" ]
-                then
-                ps `cat "$WPA_PID_FILE"` | grep wpa_supplicant > /dev/null
-                    if [ $? != 0 ]
-                    then
-		   	ps -C wpa_supplicant | grep wpa_supplicant > /dev/null
-			if [  $? != 0 ]
-			then
-			boot_mesg "killing old wpa_supplicant daemon..." ${WARNING}
-                   	echo_warning
-COUNT=0
-			 while [ -n "$(ps -C wpa_supplicant | grep wpa_supplicant )" ]
-			 do
-let COUNT=$COUNT+1
-			 killall wpa_supplicant
-if [ $COUNT = 10 ]; then
-exit 2
-fi
-			 done
-		         rm -fr $WPA_GLOBAL_FILE $WPA_PID_FILE $WPA_ACCESS_DIR > /dev/null
-			fi
-                   else
-		   boot_mesg "wpa_supplicant already running!" ${WARNING}
-                   echo_warning
-                   exit 2
-                   fi
-		fi
-			wpa_supplicant -g$WPA_GLOBAL_FILE -P$WPA_PID_FILE -B
-
-		;;
-
-	stop)
-		boot_mesg "Stopping wpa_supplicant..."
-		i=1
-COUNT=0
-		while [ i != 0 ]
-		do
-let COUNT=$COUNT+1
-		ps -C wpa_supplicant | grep wpa_supplicant > /dev/null
-		i=$?
-		killall wpa_supplicant
-if [ $COUNT = 10 ]; then
-exit 2
-fi
-		done
-		rm -fr $WPA_GLOBAL_FILE $WPA_PID_FILE $WPA_ACCESS_DIR > /dev/null
-
-		;;
-
-
-	restart)
-		$0 stop
-		sleep 5
-		$0 start
-		;;
-
-	*)
-		echo "Usage: $0 {start|stop|restart}"
-		exit 1
-		;;
-esac
-
-# End $rc_base/init.d/wpa-init

Added: trunk/ATTACHMENTS/wpa-service/wpa-rcscript
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa-rcscript	                        (rev 0)
+++ trunk/ATTACHMENTS/wpa-service/wpa-rcscript	2006-11-11 23:12:05 UTC (rev 1063)
@@ -0,0 +1,52 @@
+#!/bin/sh
+# Begin $rc_base/init.d/wpa-init
+
+# Based on:
+#sysklogd script from LFS-6.1 and earlier.
+#dhcpcd service script from LFS-6.1.1
+# Rewritten by Eloi Primaux
+
+#$LastChangedBy: eloi $
+#$Date: 2006-03-31 -0100 21:03:42 (Fri, 31 Mar 2006) $
+#$Date: 2006-09-23 -0100 23:05:55
+
+. /etc/sysconfig/rc
+. $rc_functions
+. /etc/profile
+. /etc/sysconfig/wpa_supplicant/wpa_service.conf
+
+#WPA_GLOBAL_FILE=/var/run/wpa_supplicant-global
+#WPA_ACCESS_DIR=/var/run/wpa_supplicant
+#WPA_PID_FILE=/var/run/wpa_supplicant.pid
+
+
+#wpa_supplicant process must be unique
+
+
+case "$1" in
+	start)
+		boot_mesg "Starting wpa_supplicant..."
+		
+		loadproc $WPA_DAEMON_NAME -g$WPA_GLOBAL_FILE -P$WPA_PID_FILE -B
+		;;
+
+	stop)
+		boot_mesg "Stopping wpa_supplicant..."
+		killproc wpa_supplicant
+		rm -fr $WPA_GLOBAL_FILE $WPA_PID_FILE $WPA_ACCESS_DIR > /dev/null
+		;;
+
+
+	restart)
+		$0 stop
+		sleep 5
+		$0 start
+		;;
+
+	*)
+		echo "Usage: $0 {start|stop|restart}"
+		exit 1
+		;;
+esac
+
+# End $rc_base/init.d/wpa-init

Deleted: trunk/ATTACHMENTS/wpa-service/wpa-service
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa-service	2006-10-17 04:28:54 UTC (rev 1062)
+++ trunk/ATTACHMENTS/wpa-service/wpa-service	2006-11-11 23:12:05 UTC (rev 1063)
@@ -1,110 +0,0 @@
-#!/bin/bash
-# Begin $network-devices/services/wpa-service
-
-# Based on dhcpcd script adapted for wpa networks with or without dhcp support
-# Rewritten by Eloi Primaux  - eloi AT bliscat DOT org
-# 2006-02-20 First script, wpa_supplicant is launched here, one wpa_supp per interface
-# 2006-02-21 Only one instance of wpa_supplicant for all interfaces, completely rewrited
-# 2006-02-22 lot of bugs fixed, now it uses the wpa_supplicant.conf format.
-# 2006-03-10 optimizing for (speed) boot process , just set interface up and let wpa_supp alone
-# 2006-03-31 Renaming from wpa_supplicant to wpa-service
-#This service REQUIRE the wpa_supplicant daemon running!
-#Which MUST be launched with the appropriate boot script wpa-init
-
-
-. /etc/sysconfig/rc
-. $rc_functions
-. $IFCONFIG
-
-#This is LFS specific
-	SERVICES_DIRECTORY="/etc/sysconfig/network-devices/services"
-# here is the socket file of wpa_supplicant pseudo network
-	WPA_GLOBAL_FILE="/var/run/wpa_supplicant-global"
-	WPA_GLOBAL_DIR="/var/run/wpa_supplicant"
-case "$2" in
-        up)
-
-# Beautifying....
-	echo -n "" # due to the pre ifconfig process
-
-# Todo...
-# example : if there is no network available...
-# FIXME
-
-
-
-# Here we add the wifi wpa interface, eg 'ifconfig up' but in wpa way
-
-# Add a new interface (no configuration file and enable control interface)
-RET=`$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE interface_add $1 "" $WPA_DRIVER $WPA_GLOBAL_DIR`
-# Reading the wpa config file
-grep -v '#' $WPA_CONFIG_DIR/$WPA_CONFIG_FILE | while read line
-do
-	if [ "$line" = "network={" ]; then
-		# creating a new network configration, saving network number to NETWORK
-		NETWORK=`$WPA_CLIENT_NAME -i$1 add_network`
-	else
-	  	if [ "$line" = "}" ]; then
-	  	# now the network is configured, enabling it
-          	RET=`$WPA_CLIENT_NAME -i$1 enable_network $NETWORK`
-	  	else
-			if [ -n "$( echo "$line" |  grep -v "ctrl_interface")" ]; then
-			# all others lines should be network parameters...
-			# i need to replace the first '=' character by a pace
-			line="`echo "$line" | sed 's,=, ,'`"
-#For debugging (it's always here due to strings substitution) 
-#				echo "setting parameter : $line"
-#				echo "$WPA_CLIENT_NAME -i$1 set_network $NETWORK $line"
-			echo "$WPA_CLIENT_NAME -i$1 set_network $NETWORK $line" | sh > /dev/null # FIXME !!!
-			fi
-		fi
-	fi
-done
-
-
-# When the network is ready wpa_suplicant will answer "wpa_state=COMPLETED"
-# thus we will wait until conection is established to launch the ip service
-
-RET1="`$WPA_CLIENT_NAME -i$1 status | grep 'wpa_state' | cut -f2- -d=`"
-# we run a little loop to wait for wpa_supplicant being ready before launch ip service
-# to not loop undefinetly at boot time if the network is down...
-COUNTER=0
-while [ "$RET1" != "COMPLETED" ]
-do let COUNTER=$COUNTER+1
-        if [ "$COUNTER" = "$WPA_MAXCYCLE" ]; then
-        boot_mesg "interface $1 Timeout " ${WARNING}
-        $0 remove; exit 2
-        fi
-    sleep 5s
-
-    RET1="`$WPA_CLIENT_NAME -i$1 status | grep 'wpa_state' | cut -f2- -d=`"
-    RET="$?"
-        if [ $RET != 0 ]; then exit 2 ; fi
-        echo -n "$RET1... "
-done
-    echo ""
-    evaluate_retval
-$SERVICES_DIRECTORY/$IP_SERVICE_NAME $1 up
-
-
-        ;;
-
-        down)
-
-	$SERVICES_DIRECTORY/$IP_SERVICE_NAME $1 down
-	$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE disconnect $1 > /dev/null
-	$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE interface_remove $1 > /dev/null
-
-        ;;
-
-	remove)
-	$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE disconnect $1 > /dev/null
-	$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE interface_remove $1 > /dev/null
-	;;
-        *)
-                echo "Usage: $0 [interface] {up|down}"
-                exit 1
-        ;;
-esac
-
-# End $network_devices/services/wpa-service

Deleted: trunk/ATTACHMENTS/wpa-service/wpa-service-conf
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa-service-conf	2006-10-17 04:28:54 UTC (rev 1062)
+++ trunk/ATTACHMENTS/wpa-service/wpa-service-conf	2006-11-11 23:12:05 UTC (rev 1063)
@@ -1,37 +0,0 @@
-ONBOOT="yes"
-SERVICE="wpa-service"
-
- # the ip settings (note: only the debug version will print something)
-        IP_SERVICE_NAME="dhcpcd" # , autoipd-service or ipv4-static ... 
-                                 #copy their conf here
- # This is the dhcpcd configuration taken from the BLFS Book
-        DHCP_START="-d "
-        DHCP_STOP="-k "
- # Set PRINTIP="yes" to have the script print
- # the DHCP assigned IP address
-        PRINTIP="no"
- # Set PRINTALL="yes" to print the DHCP assigned values for
- # IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
-        PRINTALL="no"
- # This is the autoipd-service sample configuration
- #AUTOIPD_START="-d -s 10.0.0.25 -m 10:0E:B5:8E:79:48 "
- # -s : to start at this ip
- # -m : to set this mac address
-
- # The wpa settings
-
- #the name of the wpa_supplicant client if it changes
-        WPA_CLIENT_NAME="wpa_cli"
- # here is the directory where wpa_supplicant.conf should be
-        WPA_CONFIG_DIR="/etc/sysconfig/wpa_supplicant"
- # here is the name of your wpa_supplicant.conf file
-        WPA_CONFIG_FILE="wpa_supplicant.conf"
-
-# Here you have to define which wpa driver wpa_supplicant will use for
-this interface
-        WPA_DRIVER="madwifi"
-
-# To avoid boot freezing on this service (truly true with the debug
-version)
-# one cycle each 5 seconds
-        WPA_MAXCYCLE=10

Added: trunk/ATTACHMENTS/wpa-service/wpa-service-iface
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa-service-iface	                        (rev 0)
+++ trunk/ATTACHMENTS/wpa-service/wpa-service-iface	2006-11-11 23:12:05 UTC (rev 1063)
@@ -0,0 +1,15 @@
+ONBOOT="yes"
+SERVICE="wpa-service2"
+VERBOSE="NO"
+	. /etc/sysconfig/wpa_supplicant/wpa_service.conf
+
+IP_FUNCTION="if_plugd"
+# Here you have to define which wpa driver wpa_supplicant will use for
+#this interface
+        WPA_DRIVER="madwifi"
+
+# To avoid boot freezing with this service
+# one cycle each 5 seconds
+        WPA_MAX_WAIT=10
+# or fork anyway in the background:
+ 	FORK_SERVICE="yes"

Added: trunk/ATTACHMENTS/wpa-service/wpa-service2
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa-service2	                        (rev 0)
+++ trunk/ATTACHMENTS/wpa-service/wpa-service2	2006-11-11 23:12:05 UTC (rev 1063)
@@ -0,0 +1,258 @@
+#!/bin/bash
+# Begin $network-devices/services/wpa-service
+# wpa-service 0.2
+# Based on dhcpcd script adapted for wpa networks with or without dhcp support
+# Rewritten by Eloi Primaux  - eloi AT bliscat DOT org
+# 2006-02-20 First script
+# 2006-03-31 wpa-service is functional
+# 2006-08-21 version by Maarten Lankhorst - m.b.lankhorst.(@).gmail.com
+# 2006-10-15 0.2 release by Eloi Primaux
+#	     merging Maarten work into configure_network function
+#	     can use both wpa_cli -a function and ifplugd.
+
+IFACE=$1
+BRING=$2
+
+. /etc/sysconfig/rc
+. $rc_functions
+. $IFCONFIG
+. /etc/sysconfig/wpa_supplicant/wpa_service.conf
+
+function get_real_pid {
+	if [ -e $1 ]; then
+	RET=`fuser $1` &> /dev/null
+	else
+	return 1
+	fi
+}
+
+function wpa_is_up {
+	get_real_pid $WPA_GLOBAL_FILE
+	if [ $? != 0 ]; then
+		return 2
+	fi
+}
+
+function wpa {
+	wpa_is_up
+	if [ $? != 0 ]; then
+		verbose '' "$WPA_DAEMON_NAME isn't running, please check why"
+		exit 1
+	fi
+}
+
+function is_iface_not_managed {
+	[ -n "`get_real_pid $WPA_ACCESS_DIR/$IFACE`" ] && return 2
+}
+
+function verbose {
+	[ "$VERBOSE" == "YES" ] && boot_mesg $1 "$2"
+}
+
+function test_fail {
+	[ "$1" != 0 ] && RET="FAIL:$1"
+	verbose '' " $RET"
+	if [[ $RET = FAIL* ]]; then
+		echo_failure ; return 2
+	else
+		return $1
+	fi
+}
+
+function add_iface {
+	verbose -n "$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE interface_add $IFACE '' $WPA_DRIVER $WPA_ACCESS_DIR :"
+	RET=`$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE interface_add $IFACE '' $WPA_DRIVER $WPA_ACCESS_DIR` &> /dev/null
+	test_fail $?
+}
+
+function ctrl_iface {
+	verbose -n "$WPA_CLIENT_NAME -i$IFACE $@ :"
+	RET=`$WPA_CLIENT_NAME -i$IFACE $@` &> /dev/null
+	test_fail $?
+}
+
+function remove_iface {
+	verbose -n "$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE interface_remove $IFACE :"
+	RET=`$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE interface_remove $IFACE` &> /dev/null
+	test_fail $?
+}
+
+function is_iface_status {
+	ctrl_iface status
+	echo $?
+	verbose '' "Expected status is $1, status is $RET"
+	echo $?
+	if [[ $RET = *$1 ]]; then
+		return 0
+	else
+		return 2
+	fi
+}
+
+function available_netwok {
+	ctrl_iface scan
+	while [ $? != 0 ]
+	do
+		sleep 2
+		is_iface_status SCANNING
+	done
+	ctrl_iface scan_results
+	RET0="`echo "$RET" | cut -f5- -d/`"
+	RET="`echo "$RET0" | cut -f5-`"
+	RET0="`echo "$RET" | grep -v "ssid"`"
+	RET="$RET0"
+	unset RET0
+}
+
+
+function configure_network {
+	#Read the wpa config file
+	LINENUMBER=0
+	CONFIGFILE="$WPA_CONFIG_DIR/$WPA_CONFIG_FILE"
+	LINES="$(wc -l $CONFIGFILE | sed 's/ .*//')"
+	while [ "$LINENUMBER" -lt "$LINES" ]
+	do
+		verbose '' "NETWORK=$NETWORK"
+		# Increase line number
+		let ++LINENUMBER
+		verbose '' "Parsing line ${LINENUMBER}"
+		# Fetch a line
+		preline="$(head -n $LINENUMBER $CONFIGFILE | tail -n 1)"
+		# Remove everything after a '#' (comment)
+		line="$(echo $preline | sed -e 's/#.*//')"
+
+		#echo "Parsing $LINENUMBER: '$preline' => '$line'"
+
+		if [ -z "`echo $line`" ]; then
+		# ignore now empty lines
+			continue
+		elif [ "$line" = "network={" ]; then
+		# creating a new network configuration,
+		# saving network number to NETWORK
+			ctrl_iface add_network
+			NETWORK="$RET"
+		elif [ "$line" = "}" ]; then
+		# now the network is configured, enabling it
+			ctrl_iface "enable_network $NETWORK"
+			unset NETWORK
+		elif [ -n "$( echo "$line" | grep -v "ctrl_interface")" ]; then
+			# all others lines should be network parameters...
+			# i need to replace the first '=' character by a pace
+			line="`echo "$line" | sed 's,=, ,'`"
+			verbose '' "ctrl_iface set_network $NETWORK $line"
+			RET="`$WPA_CLIENT_NAME -i $IFACE set_network $NETWORK $line`"
+			#ctrl_iface set_network $NETWORK $line
+		fi
+		if [[ $RET = FAIL* ]]; then
+			boot_mesg "Parse error on line ${LINENUMBER}"
+			remove_iface 
+			echo_failure
+			return 2
+		fi
+	done
+}
+
+function wait_for_events {
+# This is a new wpa_supplicant function: really usefull
+# but requires an additional action file to handle CONNECTED/DISCONNECTED events
+	ctrl_iface -a$WPA_ACTION_FILE &
+}
+
+
+function wait_for_up_loop {
+	COUNTER=0
+	while (( "$COUNTER" <= "$WPA_MAX_WAIT" ))
+	do let ++COUNTER
+		is_iface_status CONNECTED
+		if [ $? = 0 ]; then
+			return 0
+		fi
+		sleep 2s
+	done
+	return 1
+}
+
+function real_fail {
+	[ "$1" != 0 ] && RET="FAIL:$1"
+	verbose '' " $RET"
+	if [[ $RET = FAIL* ]]; then
+		exit $1
+	else
+		return $1
+	fi
+}
+
+function wait_for_up {
+	wait_for_up
+	real_fail $?
+	$WPA_ACTION_FILE $IFACE CONNECTED
+}
+
+
+function if_plugd {
+# Same as wait_for_event, using ifplugd
+# But requires an ifplugd action file
+	case "$1" in
+	start)
+	ifplugd -Msf -i $IFACE -r $IFPLUGD_WRAPPER
+	;;
+	stop)
+	ifplugd -k -i $IFACE
+	;;
+	esac
+}
+
+function iface_up {
+	wpa
+	is_iface_not_managed
+	if [ $? = 0 ]; then
+		verbose '' "Interface already managed, continuing"
+	else
+		add_iface
+		real_fail $?
+	fi
+	configure_network
+	real_fail $?
+	case "$IP_FUNCTION" in
+	wait_for_up)
+		wait_for_up
+		;;
+	wait_for_events)
+		wait_for_events
+		;;
+	if_plugd)
+		if_plugd start
+		;;
+	esac
+	}
+
+
+function iface_down {
+	wpa
+	ctrl_iface disconnect
+	test_fail $?
+	case "$IP_FUNCTION" in
+	wait_for_up)
+		$WPA_ACTION_FILE $IFACE DISCONNECTED
+		;;
+	wait_for_events)
+		verbose '' "wpa_cli -a will exit when interface will be removed"
+		;;
+	if_plugd)
+		if_plugd stop
+		;;
+	esac
+	test_fail $?
+	wpa_cli -g$WPA_GLOBAL_FILE interface_remove $IFACE
+	test_fail $?	
+}
+
+case "$2" in
+	up)
+	iface_up
+	;;
+	down)
+	iface_down
+	;;
+esac
+

Added: trunk/ATTACHMENTS/wpa-service/wpa_actions-script
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa_actions-script	                        (rev 0)
+++ trunk/ATTACHMENTS/wpa-service/wpa_actions-script	2006-11-11 23:12:05 UTC (rev 1063)
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+IFACE=$1
+EVENT=$2
+
+NETWORKDIR=/etc/sysconfig/wpa_supplicant
+SERVICESDIR=/etc/sysconfig/network-devices/services
+
+. /etc/sysconfig/rc
+. $rc_functions
+#. $IFCONFIG
+
+#. /etc/rc.d/init.d/functions
+. /etc/sysconfig/network-devices/ifconfig.$IFACE/wpa-service
+
+function verbose {
+	[ "$VERBOSE" == "YES" ] && boot_mesg $1 "$2"
+}
+
+function test_fail {
+	[ "$1" != 0 ] && RET="FAIL:$1"
+	verbose '' " $RET"
+	if [[ $RET = FAIL* ]]; then
+		echo_failure ; return 2
+	else
+		return $1
+	fi
+}
+
+function ctrl_iface {
+	verbose -n "$WPA_CLIENT_NAME -i$IFACE $@ :"
+	RET=`$WPA_CLIENT_NAME -i$IFACE $@` &> /dev/null
+	test_fail $?
+}
+
+if [ "$EVENT" == "CONNECTED" ]; then
+	ctrl_iface status
+	test_fail $?
+	SSID=`echo $RET | grep ^ssid= | cut -f2- -d=`
+	# configure network, signal DHCP client, etc.
+	# If special networks definition exist, use it
+	if [ -f "$NETWORKDIR/$SSID" ]; then
+		IFCONFIG="$NETWORKDIR/$SSID"
+		. $IFCONFIG
+		export IFCONFIG
+		$SERVICESDIR/$SERVICE $IFACE up
+	else
+		IFCONFIG="$NETWORKDIR/AUTO"
+		. $IFCONFIG
+		export IFCONFIG
+		$SERVICESDIR/$SERVICE $IFACE up
+	fi
+	exit $?
+fi
+
+if [ "$EVENT" == "DISCONNECTED" ]; then
+    # remove network configuration, if needed
+	ctrl_iface status
+	test_fail $?
+	SSID=`echo $RET | grep ^ssid= | cut -f2- -d=`
+	# configure network, signal DHCP client, etc.
+	# If special networks definition exist, use it
+	if [ -f "$NETWORKDIR/$SSID" ]; then
+		. $NETWORKDIR/$SSID
+		$SERVICESDIR/$SERVICE $IFACE down
+	else
+		$SERVICESDIR/$SERVICE $IFACE down
+	fi
+	exit $?
+fi

Added: trunk/ATTACHMENTS/wpa-service/wpa_service.conf
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa_service.conf	                        (rev 0)
+++ trunk/ATTACHMENTS/wpa-service/wpa_service.conf	2006-11-11 23:12:05 UTC (rev 1063)
@@ -0,0 +1,25 @@
+ # The wpa_supplicant daemon settings
+
+ #the name of the wpa_supplicant client and daemon if they change
+        
+        WPA_CLIENT_NAME="wpa_cli"
+	WPA_DAEMON_NAME="wpa_supplicant"
+	
+ # here is the directory where wpa_supplicant.conf should be
+        
+        WPA_CONFIG_DIR="/etc/sysconfig/wpa_supplicant"
+ 
+ # here is the name of your wpa_supplicant.conf file
+        
+        WPA_CONFIG_FILE="wpa_supplicant.conf"
+ 
+ # here is the name of your action file
+ 	
+ 	WPA_ACTION_FILE=$WPA_CONFIG_DIR/wpa_actions
+ 	IFPLUGD_WRAPPER=$WPA_CONFIG_DIR/ifplugd_wrapper
+ 
+ # This is what need wpa_supplicant
+	
+	WPA_PID_FILE=/var/run/wpa_supplicant.pid
+	WPA_GLOBAL_FILE=/var/run/wpa_supplicant-global
+	WPA_ACCESS_DIR=/var/run/wpa_supplicant

Modified: trunk/wpa-service.txt
===================================================================
--- trunk/wpa-service.txt	2006-10-17 04:28:54 UTC (rev 1062)
+++ trunk/wpa-service.txt	2006-11-11 23:12:05 UTC (rev 1063)
@@ -1,6 +1,6 @@
 AUTHOR: Eloi Primaux eloi AT bliscat dot org
 
-DATE: 2006-03-31
+DATE: 2006-10-13
 
 LICENSE: GNU Free Documentation License Version 2
 
@@ -10,236 +10,207 @@
 
 ATTACHMENTS:
 
-http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/wpa-service
-http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/wpa-service-conf
-http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/wpa-init
-http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/autopid-service
+http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/wpa_service.conf
+http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/wpa-rcscript
+http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/wpa-service2
+http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/wpa-service-iface
+http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/wpa_actions-script
+http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/ifplugd_wrapper-script
 
 
 PREREQUISITES:
 
-1)   A working LFS-6.1 system or newer with wireless capabilities  
-1.a) Linux kernel 2.6.14 or newest                          (0)
-1.b) Wireless Cards Drivers
-2)   An IP service
-2.a) Static IP service                                      (1)
-2.b) Dynamic IP service                                     (1)
-2.c) Static IP discovering helper                           (2)
-3)   Wireless Networks helper programs
-3.a) Wireless tools                           
-3.b) wpa_supplicant    
-4)   This hint with its 4 files                   
-5)   A working firewall
-5.a) Basic firewalling capabilities                         (1)(2)
-5.b) Shoreline firewall                                     (2)
-
-(0) The Linux kernels shipped with LFS-6.1 and 6.1.1 are too old,
-    please consider upgrading to 2.14 or 2.16 kernels.
-    The Linux kernel maintainers have changed some references in
-    the 2.6.16 .config file, thus firewalling capabilities will be disable
-    when using a .config from a 2.14 kernel or older.
-(1) See BLFS book
-(2) Not needed but recommended
+- A working LFS-6.1 system or newer with wireless capabilities  
+- Almost two networks services like ipv4-static/dhcpcd installed
+- wpa_supplicant and wireless drivers
  
 HINT:
 
-1) A working LFS-6.1 system or newer with wireless capabilities
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-1.a) The Wireless Capabilities of the Linux kernel
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Configuring the kernel:
+0) Requirement and Optional tools
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-Networking  ---> 
-[*] Networking support
- <M>   Generic IEEE 802.11 Networking Stack
- <M>     IEEE 802.11 WEP encryption (802.1x)
- <M>     IEEE 802.11i CCMP support
- <M>     IEEE 802.11i TKIP encryption    
-Device Drivers  --->
-    Network device support  --->
-        Wireless LAN (non-hamradio)  --->
-        [*] Wireless LAN drivers (non-hamradio) & Wireless Extensions
-   << and select your driver from the list if shipped with the Linux Kernel >>
-Cryptographic options  --->
- <M>   AES cipher algorithms
+0.a) wpa_supplicant 'The core'
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+This is NOT an usual step if you omit something here you won't be able to attach
+your device to any access point
 
-Now compile, install , enable your new kernel in your boot loader and restart
-using it.
+Please use the 0.4.8 version or newer and NOT the 0.4.7, available at:
+link: http://hostap.epitest.fi/wpa_supplicant
 
-1.b) The Wireless Cards Drivers
-If your driver wasn't shipped with the Linux Kernel then you need to install a
-third party driver.
+Again, i strongly recommend you to read its README before doing anything.
+wpa_supplicant may need the source of your drivers then edit the .config file
+as described in the README and set all constants according to your system.
+also when ready install it by executing :
 
-Be aware that most of those independent driver are in development stage and they
-probably won't be available in tarballs but from a CVS repository or from a
-subversion one. Then you will need those tools to download it, both of cvs and
-svn installations are explained in the BLFS book.
+find ./ -name 'Makefile' -exec sed 's,/usr/local,/usr,g' {} \ &&
+make &&
+make install
 
-Please also consider reading the "Wireless LAN resources for Linux" HOWTO for
-chipsets driver name.
+0.b) ifplugd a daemon which monitor your interface (optional)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+This external program is not required but can drastically simplify our life
+because it won't crash wpa_supplicant
+information can be found here
+	http://0pointer.de/lennart/projects/ifplugd
+and ifplugd (0.28) can be downloaded from:
+	http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.28.tar.gz
 
-As an example, most Artheos cards are supported by the madwifi project: link:
-http://madwifi.org/wiki without doing advertising for them this wiki is full of
-information and links referring to WPA encrypted networks
+installation
+As this package is made with the GNU autotools you should run
+./configure inside the distribution directory for configuring the source tree.
+After that you should run make for compilation
+and make install (as root) for installation of ifplugd.
 
-2) The IP services
-~~~~~~~~~~~~~~~~~~
+./configure --prefix=/usr --sysconfdir=/etc
+make
+make install
 
-You should know that networks interfaces need IP addresses and also that some
-networks have DHCP servers some other don't. Without explaining the benefit of
-having a DHCP server, i will just say that a DHCP server provides IP to all
-attached network interfaces (it also provides the IP of the gateway, the network
-mask and the IP of DNS servers)
+The installation scripts create an init script in ${sysconfdir}/init.d/ifplugd, however no /etc/rc?.d/ links are created for it.
 
-Essentials IP services installation and configuration are in the BLFS Book.  You
-will size the benefit of the wpa-service when you will understand that this
-service only attach your card to an wireless WPA network and when it did it, it
-simply launch the desired IP service as if your system were setting up usual
-network cards.
+ifplugd request two links if you intend to use it out of wpa-service:
 
-Then, you only have to know which IP service your network uses : Is it a STATIC
-or a DYNAMIC network ?
+ln -nsf /etc/sysconfdir/network-devices/{ifup,ifdown} /sbin
 
-2.a) Static IP service
-~~~~~~~~~~~~~~~~~~~~~~
-        IP service will be ipv4-static
-This service is shipped with the LFS Book (6.1 and newer)
+1) This Hints
+~~~~~~~~~~~~~
+wpa_supplicant is designed to be a "daemon" program that runs in the background
+and acts as the back-end component controlling the wireless connection.
+wpa_supplicant supports separate front-end programs and a text-based
+front-end (wpa_cli) is included with wpa_supplicant.
 
-2.b) Dynamic IP service
-~~~~~~~~~~~~~~~~~~~~~~~
-        IP service will be dhcpcd
-This service is described in the BLFS Book (6.1 and newer)
+1.1) Install Files and Directories
 
-2.c) Static IP discovering helper (Zeroconf like)
-Use it when you really don't know what to do
-        IP service will be autoipd-service
-This service is not yet shipped anywhere for LFS systems then i did it
+  install -d /etc/sysconfig/wpa_supplicant
+  install -m644 wpa_service.conf /etc/sysconfig/wpa_supplicant
 
-2.c.1) The Howl installation
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Refer you to :
-link: http://www.porchdogsoft.com/products/howl/InstallUnix.html
-But set the prefix to /usr
+  install -m755 wpa-rcscript /etc/rc.d/init.d/wpa
+  ln -nsf /etc/rc.d/init.d/wpa /etc/rc.d/rc3.d/S15wpa
+  ln -nsf /etc/rc.d/init.d/wpa /etc/rc.d/rc5.d/S15wpa
+  ln -nsf /etc/rc.d/init.d/wpa /etc/rc.d/rc6.d/K85wpa
+  ln -nsf /etc/rc.d/init.d/wpa /etc/rc.d/rc0.d/K85wpa
 
-Now copy the autoipd-service to the network service directory:
+  install -m755 wpa_actions-script /etc/sysconfig/wpa_supplicant/wpa_actions
+  install -m755 ifplugd_wrapper-script /etc/sysconfig/wpa_supplicant/ifplugd_wrapper
+  install -m755 wpa-service2 /etc/sysconfig/network-devices/services
 
-cp autoipd-service /etc/sysconfig/network-devices/services
-And make it executable:
+  install -d /etc/sysconfig/network-devices/ifconfig.<IFACE>
+  install -m644 wpa-service-iface /etc/sysconfig/network-devices/ifconfig.<IFACE>/wpa-service
 
-chmod 755 -c /etc/sysconfig/network-devices/services/autoipd-service
 
-3) Wireless Networks helper programs
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-3.a) Wireless tools
-~~~~~~~~~~~~~~~~~~~
-This helper is not need by the wpa-service but can be really helpful.
+2) Network Configuration
+~~~~~~~~~~~~~~~~~~~~~~~~
+2.1) Choosing the network configuration method
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-Then, download the latest development version of this tool named
-'wireless_tools' execute the following command in its directory :
+All configurations go in the wpa-service-iface
 
-find ./ -name 'Makefile' -exec sed 's,/usr/local,/usr,g' &&
-make &&
-make install
+wpa-service 0.2 can be use to only set up one time or continuously manage your
+interface.
+ This is done by three functions:
+ - wait_for_up     --> a stupid loop waiting for the interface to be ready
+ - wait_for_events --> wpa_supplicant internal 'action' function (wpa-cli -a)
+ - if_plugd        --> an external daemon
 
-3.b) wpa_supplicant 'The core'
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+This choice is done by setting IP_FUNCTION in the wpa-service-iface file
 
-This is NOT an usual step if you omit something here you won't be able to attach
-your device to any access point
+In the case of a static computer, the first function should be used
+wait_for_up:
+ (+)the advantages are : less request to the wpa_supplicant daemon
+                        only one daemon is running : wpa_supplicant.
+ (-)disadvantages      : if network change, you will lost connection
 
-Please use the 0.4.8 version or newer and NOT the 0.4.7, available at: link:
-http://hostap.epitest.fi/wpa_supplicant
+wait_for_events:
+ (+)the advantages are : dynamic network configuration
+                        only one daemon is running : wpa_supplicant.
+ (-)disadvantages      : wpa_supplicant crashes under too much pings
+ 			from wpa_cli , thus you will lost connection
 
-Again, i strongly recommend you to read its README before doing anything.
-wpa_supplicant may need the source of your drivers then edit the .config file as
-described in the README and set all constants according to your system.  also
-when ready install it by executing :
+if_plugd:
+ (+)the advantages are : dynamic network configuration
+ 			less request to the wpa_supplicant daemon
+ 			more reliable and can also be use for wired interface 
+ (-)disadvantages      : require an external daemon
+ 
+i encourage people to use the wait_for_events function, because errors reports
+will go to wpa_supplicant developers ;)
 
-find ./ -name 'Makefile' -exec sed 's,/usr/local,/usr,g' &&
-make &&
-make install
+but if you want a more reliable network, use the if_plugd function.
+ 
+2.2) Network configurations with any of the three functions:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-4) This Hints
-~~~~~~~~~~~~~
+wpa-service can set up your network according to it's SSID, this means that if
+the SSID "DHCP network" manage ip via a dhcp server, wpa-service will use the
+SSID file descriptor to set up you network when connecting to the SSID network.
 
-wpa_supplicant is designed to be a "daemon" program that runs in the background
-and acts as the back-end component controlling the wireless connection.
-wpa_supplicant supports separate front-end programs and a text-based front-end
-(wpa_cli) is included with wpa_supplicant.
+ Those ssid descriptors are named with the name of the SSID they describe,
+ and took place in the /etc/sysconfig/wpa_supplicant directory.
+ 
+ the "AzErTy" SSID descriptor will be /etc/sysconfig/wpa_supplicant/AzeRtY
 
-4.1) The wpa-init file
-~~~~~~~~~~~~~~~~~~~~~~
+2.1) SSID descriptor syntax:
+An SSID descriptor is a regular network configuration file as used in LFS system
+it means that if SSID "IPV4" use ipv4-static, the the descriptor "IPV4" will be
 
-The wpa-service will use the text-based front-end to controls the wpa_supplicant
-daemon. This requires wpa_supplicant daemon running. Thus copy the wpa-init file
-to the init script directory and make it executable:
+	cat > /etc/sysconfig/wpa_supplicant/IPV4 << "EOF"
+	ONBOOT=yes
+	SERVICE=ipv4-static
+	IP=192.168.1.1
+	GATEWAY=192.168.1.2
+	PREFIX=24
+	BROADCAST=192.168.1.255
+	EOF
 
-cp wpa-init /etc/rc.d/init.d
-chmod 755 -c /etc/rc.d/init.d/wpa-init
+or if the "DHCP" SSID use dhcp :
 
-According to the last lfs-bootscript, link it to some run levels:
+	cat > /etc/sysconfig/wpa_supplicant/DHCP << "EOF"
+	ONBOOT="yes"
+	SERVICE="dhcpcd"
+	DHCP_START="-o"
+	DHCP_STOP="-k -o"
 
-ln -sv /etc/rc.d/init.d/wpa-init /etc/rc.d/rc3.d/S15wpa-init
-ln -sv /etc/rc.d/init.d/wpa-init /etc/rc.d/rc5.d/S15wpa-init
-ln -sv /etc/rc.d/init.d/wpa-init /etc/rc.d/rc0.d/K75wpa-init
-ln -sv /etc/rc.d/init.d/wpa-init /etc/rc.d/rc6.d/K65wpa-init
+	# Set PRINTIP="yes" to have the script print
+	# the DHCP assigned IP address
+	PRINTIP="no"
 
-4.2) The wpa-service file
-~~~~~~~~~~~~~~~~~~~~~~~~~
+	# Set PRINTALL="yes" to print the DHCP assigned values for
+	# IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
+	PRINTALL="no"
+	EOF
 
-This step is similar to the autoipd-service:
+for convenience, wpa_actions fall back to /etc/sysconfig/wpa_supplicant/AUTO
+when no SSID descriptor is available,
 
-Copy the wpa-service to the network service directory:
+Then install a common/automatic network configuration:
+I use dhcpcd:   
 
-cp wpa-service /etc/sysconfig/network-devices/services
+	cat > /etc/sysconfig/wpa_supplicant/AUTO << "EOF"
+	ONBOOT="yes"
+	SERVICE="dhcpcd"
+	DHCP_START="-o"
+	DHCP_STOP="-k -o"
 
-And make it executable:
+	# Set PRINTIP="yes" to have the script print
+	# the DHCP assigned IP address
+	PRINTIP="no"
 
-chmod 755 -c /etc/sysconfig/network-devices/services/wpa-service
+	# Set PRINTALL="yes" to print the DHCP assigned values for
+	# IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
+	PRINTALL="no"
+	EOF
 
 
-4.3) Configuring the wireless interface
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-4.3.a) The wireless network config file wpa-service-conf
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-According to your driver manual, you should have a specific device name for your
-interface, it could be eth[X],wlan[X],ath[X],... (where [X] is a number)
-  
-Following the LFS Book, you need to create a directory in the network directory
-where will be placed the wpa-service-conf, here is an example: create the
-directory /etc/sysconfig/network-devices/ifconfig.wlan[X] :
 
-install -d /etc/sysconfig/network-devices/ifconfig.wlan[X]
 
-copy the sample config file wpa-service-conf to the upper created directory:
 
-cp wpa-service-conf /etc/sysconfig/network-devices/ifconfig.wlan[X]
-
-Edit this file to fit with your driver and IP service with the services names
-proposed in section 2)
-
-4.3.b) The wpa_supplicant.conf (The network description) 
+3) The wpa_supplicant.conf (The network keys description) 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-a) Limitations
-~~~~~~~~~~~~~~
+The wpa_supplicant README and wiki explain the composition of this file.
 
-The wpa_supplicant README and wiki explain the composition of this file.  But
-wpa-service have some limitation due to strings substitution. Indeed password or
-protocol list can comport space characters, which may be altered by the service
-script if not correctly quoted and then mess up the wpa_cli front-end. I did'nt
-yet found a script solution but if you take care to correctly quote strings
-containing space characters you won't have any trouble.
-
-b) Specific quoting
-~~~~~~~~~~~~~~~~~~~
-A space string MUST be quoted like that:
-'"This is a string containing some space characters"'
-
-c) File syntax
-~~~~~~~~~~~~~~
-
+3.a) File syntax
+~~~~~~~~~~~~~~~~
 The file syntax is the wpa_supplicant.conf file syntax, it is specific to the
 wpa_supplicant program and only depend of the programmer choice, thus instead of
 explaining you of how this file is read, i will show you a set of command to
@@ -258,8 +229,7 @@
 network={
         ssid="ssid"
         #psk="passphrase"
-
-psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726
+        psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726
 }
 
 Please quote correctly the strings containing the space characters
@@ -279,8 +249,7 @@
 
 Now start the wpa_cli :
 
-wpa_cli -g/var/run/wpa_supplicant-global interface_add wlan[X]
-"" [driver] \
+wpa_cli -g/var/run/wpa_supplicant-global interface_add wlan[X] "" [driver] \
         /var/run/wpa_supplicant
 
 Where wlan[X] is the device name of your network interface and where [driver] is
@@ -309,9 +278,9 @@
 As an example:
 
 
-root at bliscat:/home/eloi# wpa_cli -iath0 -p/var/run/wpa_supplicant
+root at bliscat:/home/eloi# wpa_cli -iath0 -p/var/run/wpa_supplicant
 wpa_cli v0.4.8
-Copyright (c) 2004-2005, Jouni Malinen <jkmaline at cc.hut.fi> and
+Copyright (c) 2004-2005, Jouni Malinen <jkmaline at cc.hut.fi> and
 contributors
 
 This program is free software. You can distribute it and/or modify it
@@ -333,8 +302,8 @@
 00:10:c6:eb:95:11       2457    205     [WEP]   Wanadoo_5441
 
 
-you can see that my network 'My_net' use WPA2-PSK-CCMP which is WPA-PSK with
-CCMP as group and pairwise
+you can see that my network 'My_net' use WPA2-PSK-CCMP which is WPA-PSK
+with CCMP as group and pairwise
 
 type exit to quit wpa_cli
 
@@ -343,28 +312,27 @@
 
 network={
         ssid="ssid"
-        ssid='essid' # please quote '""' when you have a space character
-        scan_ssid=1
         key_mgmt=WPA-PSK
         proto=WPA2
         pairwise=CCMP
         group=CCMP
-        #psk='"passphrase"'
-
-psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726
-character
+        #psk="passphrase"
+        psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726
 }
 
 
-Note if you wish you can only use the human readable pass-phrase, then uncomment
-it and comment the hexadecimal pass-phrase
+Note if you wish you can only use the human readable pass-phrase,
+then comment it out and comment the hexadecimal pass-phrase
 
-Now kill the last instance of the wpa_supplicant:
+Now kill the last instance of the wpa_supplicant daemon :
 
 killall wpa_supplicant
 
 And test your new configuration file:
 
+wpa_supplicant -d[driver] -iwlan[X] -c[configfile] -dd
+
+example:
 wpa_supplicant -dmadwifi -iath0 -c./wpa_supplicant.conf -dd
 
 If you see something like SUCCESS it's done, kill it again and copy the config
@@ -375,24 +343,17 @@
 cp wpa_supplicant.conf /etc/sysconfig/wpa_supplicant/wpa_supplicant.conf
 chmod 600 -c /etc/sysconfig/wpa_supplicant/wpa_supplicant.conf
 
-5) The firewall
-~~~~~~~~~~~~~~~
 
-You should understand that connecting to a network is never secure (even with a
-WPA encrypted network) especially without firewall. Then having a firewall will
-ever be a good thing, i strongly recommend the use of Shorewall.  You will find
-lots of help on its website.
-
-
 6) The End
 ~~~~~~~~~~
 execute:
 
-/etc/rc.d./init.d/wpa-init restart
-/etc/rc.d/init.d/network restart
+/etc/rc.d/init.d/network stop
+/etc/rc.d./init.d/wpa restart
+/etc/rc.d/init.d/network start
 
 if there is no errors, and your system is connected, then you can safely restart
-your computer to see it setting up your wireless card at boot time.
+your computer to see it setting up your wireless card during boot time.
 
 ACKNOWLEDGMENTS:
  The wireless hint
@@ -406,6 +367,7 @@
 2006 03 10 Second release, first send to lfshint
 2006 03 16 added some words to help wpa-supplicant.conf writing
 2006 03 18 fix wrong paths
-2006 03 31 Rewritten and try to match the LFS-standard thank's to
-archaic's help
+2006 03 31 Rewritten and try to match the LFS-standard thank's to archaic's help
+2006 04 01 fix incomplete find commands
+2006 10 15 wpa-service 0.2
 




More information about the hints mailing list