Skip to content

Commit

Permalink
v29
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-kirby committed Oct 11, 2016
1 parent 9ec0f62 commit c7b2e81
Show file tree
Hide file tree
Showing 23 changed files with 6,594 additions and 2,424 deletions.
13 changes: 13 additions & 0 deletions wireless_tools/19-udev-ifrename.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# udev rules to properly integrate ifrename.
# Renaming is done using /etc/iftab, with full ifrename functionality.
# Require udev version 107 or later.
# Please double check the path to ifrename, and make sure its available
# when udev runs (i.e. on boot partition).

# Enable this rule to test with udevtest.
#ENV{UDEV_LOG}=="6", SUBSYSTEM=="net", ACTION=="add", IMPORT="/sbin/ifrename -D -V -u -i %k", NAME:="%k"

# Main ifrename rule.
# If interface is found in /etc/iftab, subsequent rename rules are bypassed.
# If interface is not found in /etc/iftab, subsequent rename rules applies.
SUBSYSTEM=="net", ACTION=="add", IMPORT="/sbin/ifrename -u -i %k", NAME:="%k"
122 changes: 117 additions & 5 deletions wireless_tools/CHANGELOG.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Wireless Tools
*
* Jean II - HPLB 97->99 - HPL 99->04
* Jean II - HPLB 97->99 - HPL 99->07
*
* The changelog...
*
Expand Down Expand Up @@ -625,6 +625,121 @@
* o Add WE-20 headers, compile with that as default
* ---
* o Fix 'inline' for gcc-4 as well. Grrr... [iwlib]
*
* wireless 29 :
* -----------
* o Add new power value : 'power saving' [iwconfig/iwlist/iwlib]
* o Optimise getting iwrange when setting TxPower [iwconfig]
* o Optimise displaying current power values (better loop) [iwlist]
* ---
* o Add modulation bitmasks ioctls [iwconfig/iwlist]
* o Add short and long retries [iwconfig/iwlist/iwlib]
* o Fix 'relative' power saving to not be *1000 [iwconfig/iwlib]
* o iw_print_pm_value() require we_version [iwlib]
* o Optimise displaying range power values (subroutine) [iwlist]
* ---
* o Fix 'relative' retry to not be *1000 [iwconfig/iwlib]
* o iw_print_retry_value() require we_version [iwlib]
* o Optimise getting iwrange when setting PowerSaving [iwconfig]
* o Optimise displaying current retry values (better loop) [iwlist]
* o Optimise displaying range retry values (subroutine) [iwlist]
* ---
* o Fix stupid bug in displaying range retry values [iwlist]
* ---
* o Add support for unicast and broadcast bitrates [iwconfig/iwlist]
* ---
* o Replace spaghetti code with real dispatcher in set_info() [iwconfig]
* Code is more readable, maintainable, and save 700 bytes...
* o Drop 'domain' alias for 'nwid'. Obsolete. [iwconfig]
* o Make iw_usage() use dispatcher data instead of hardcoded [iwconfig]
* o Factor out modifier parsing for retry/power [iwconfig]
* o Fix iwmulticall to compile with new dispatcher above [iwmulticall]
* o Add WE_ESSENTIAL compile option to drop 10kB [Makefile]
* ---
* o Update manpages with new features above [man]
* ---
* o Add temp variable to sscanf() to fix 64 bits issues [iwconfig]
* o De-inline get_pm_value/get_retry_value to reduce footprint [iwlist]
* o Optimise iw_print_ie_cipher/iw_print_ie_auth [iwlist]
* o Add "Memory footprint reduction" section in doc [README]
* o Add 'last' scan option for left-over scan [iwlist]
* (From Stavros Markou <[email protected]>)
* o Add 'essid' scan option for directed scan [iwlist]
* ---
* (Bug reported by Henrik Brix Andersen <[email protected]>)
* o Fix segfault on setting bitrate (parse wrong arg) [iwconfig]
* ---
* o Revert 'CC=gcc' to normal [Makefile]
* o Integrate properly patch below [iwlist]
* (From Brian Eaton <[email protected]>)
* o More WPA support : iwlist auth/wpakeys/genie [iwlist]
* ---
* o Tweak man pages : interface is often optional [iwlist.8/iwspy.8]
* o Drop obsolete port/roam code from [iwpriv]
* (From Pavel Roskin <[email protected]>)
* o Fix bug where all auth masks use iw_auth_capa_name [iwlist]
* (From Dima Ryazanov <[email protected]>)
* o Fix iw_scan()/iw_process_scan() for non-root -> EPERM [iwlib]
* (Bug reported by Arkadiusz Miskiewicz <[email protected]>)
* o Fix "iwconfig nickname" (was abreviated) [iwconfig]
* (Bug reported by Charles Plessy)
* o Invalid mode from driver segfault iwlist scan [iwlist]
* (From Aurelien Jacobs <[email protected]>)
* o Replace index() with strchr() [iwlib/iwconfig/iwpriv]
* (From Jens Thoms Toerring)
* o Parser/printf/sscanf fixes and optimisation [iwconfig]
* ---
* (From Pavel Roskin <[email protected]>)
* o Fix bug extracting mountpoint of sysfs (wrong field) [ifrename]
* (Suggested by Pavel Roskin <[email protected]>)
* o Read sysfs symlinks transparently [ifrename]
* ---
* o Fix README header to talk about ifrename [README]
* o Add 'prevname' selector for udev compatibility [ifrename]
* o Read parent directory names in SYSFS selector [ifrename]
* o Make dry-run output compatible with udev [ifrename]
* o Update man page with useful SYSFS selectors [iftab.5]
* ---
* o Factorise wildcard rewrite '*'->'%d' to hide it from -D -V [ifrename]
* o Reorganise sysfs description, better wording [iftab.5]
* (Suggested by Pavel Roskin <[email protected]>)
* o Enhance explanation of arp and iwproto [iftab.5]
* ---
* (Bug reported by Johannes Berg <[email protected]>)
* o Band-aid for the 64->32bit iwevent/iwscan issues [iwlib]
* ---
* o Better band-aid for the 64->32bit iwevent/iwscan issues [iwlib]
* (Suggested by Kay Sievers <[email protected]>)
* o Add udev compatible output, print new DEVPATH [ifrename]
* ---
* o Fix DEVPATH output to use the real devpath from udev [ifrename]
* o Add udev rules for ifrename integration [19-udev-ifrename.rules]
* ---
* o Add largest bitrate in easy scan API [iwlib]
* ---
* o Debug version : output IW_EV_LCP_LEN [iwlist]
* ---
* (Bug reported by Santiago Gala/Roy Marples)
* o Fix 64->32bit band-aid on 64 bits, target is local aligned [iwlib]
* ---
* (Bug reported by Santiago Gala/Roy Marples)
* o More fix to the 64->32bit band-aid on 64 bits [iwlib]
* ---
* (Bug reported by Dimitris Kogias)
* o Fix GENIE parsing os chipher/key_mngt [iwlist]
* (Bug reported by Guus Sliepen <[email protected]>)
* o Compiler warning on DEBUG code [iwlist]
* ---
* o --version output WE_MAX_VERSION instead of WE_VERSION [iwlib]
* o Change iwstats dBm range to [-192;63] in iw_print_stats() [iwlib.c]
* o Implement iwstats IW_QUAL_RCPI in iw_print_stats() [iwlib.c]
* (Bug reported by Guus Sliepen <[email protected]>)
* o LINUX_VERSION_CODE removed, only use GENERIC_HEADERS [iwlib.h]
* (Bug reported by Johan Danielsson <[email protected]>)
* o Fix OUI type check for WPA 1 IE [iwlist.c]
* ---
* (Bug reported by Florent Daignière)
* o Don't look for "fixed" out of array in set_txpower_info() [iwconfig]
*/

/* ----------------------------- TODO ----------------------------- */
Expand All @@ -635,10 +750,7 @@
* --------
* Make disable a per encryption key modifier if some hardware
* requires it.
*
* iwpriv :
* ------
* Remove 'port' and 'roam' cruft now that we have mode in iwconfig
* IW_QUAL_RCPI
*
* iwspy :
* -----
Expand Down
18 changes: 10 additions & 8 deletions wireless_tools/IFRENAME-VS-XXX.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,21 @@ interfaces, with rules such as :
http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html

Advantages over 'ifrename' :
+ integrated into 'udev'
+ simpler to setup if 'udev' is already properly setup
+ automatically generates persistent rules
Drawbacks compared to 'ifrename' :
- Less selectors that 'ifrename'
- Require kernel 2.6.X or later with sysfs support
- Do no support non-hotplug interfaces
- Require 'udev', not everybody uses it (static /dev, devfs)
- Does not support module on-demand loading
Comments :
o 'udev' support many selectors, basically all those
present in 'sysfs', even if the documentation only show instructions
to use the MAC address (which is problematic with virtual devices some
drivers - see above). 'ifrename' can also use all selectors present in
'sysfs' (like 'udev'), plus some other selectors not present in sysfs
that were found to be useful.
present in 'sysfs' (excluding symlinks), even if the documentation
only show instructions to use the MAC address (which is problematic
with virtual devices some drivers - see above). 'ifrename' can also
use all selectors present in 'sysfs' (like 'udev'), can use sysfs
symlinks and parent directories, plus some other selectors not present
in sysfs that were found to be useful.
o Not all interfaces are managed by hotplug. All
virtual devices, such as tunnels and loopbacks, are not associated
with a hardware bus, and therefore are not managed by hotplug. All
Expand All @@ -102,7 +102,9 @@ hotplug. 'udev' can't deal with those devices.
o It is common practice on embedded system to use a
static /dev and not 'udev' to save space and boot time. And to not use
hotplug for the same reasons.
o 'ifrename' could be better integrated in 'udev', I don't foresee any technical issues.
o 'ifrename' has now a udev compatiblity mode that
enables to trivially integrate it into 'udev' as an IMPORT rule. This
requires udev version 107 or better and ifrename 29-pre17 or better.

SELECTOR AWARE NETWORK SCRIPTS
------------------------------
Expand Down
92 changes: 75 additions & 17 deletions wireless_tools/INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,87 @@ Create a local copy of the tools :
--------------------------------
By default, the package is built with iwlib as a dynamic
library, and the tool will expect to use the default version of libiw
on the system.
on the system. This means you can't use the tools until they are
properly installed.
If you just want to experiment with a "local" version of the
tools, you may want to pass the BUILD_STATIC flag to Makefile. It will
create a self contained version of the tools.
-------------
make clean
make BUILD_STATIC='y'
-------------
-------------
make clean
make BUILD_STATIC='y'
-------------
The resulting binary can be used in the compilation directory
or installed in any place you like.

Other useful Makefile options :
-----------------------------
PREFIX : where the tools will be installed (default : /usr/local)
CC : Compiler to use (defaul : gcc)
BUILD_STATIC : build tools with a static version of the wireless lib
BUILD_NOLIBM : build tools without mathematical lib (slower)
BUILD_STRIPPING : strip symbols from tools/lib.
BUILD_WE_ESSENTIAL : remove less used and obsolete features.

You can pass those options on the command line of make, or
modify the top of the Makefile. You can also set them as environment
variable, but this is not recommended.
If you pass those options on the command line, you should pass
the same command line options for all invocations of make ("make" and
"make install").

Memory footprint reduction :
--------------------------
The Wireless Tools are used in various embedded systems where
memory footprint is a great concern. The Wireless Tools package offer
multiple options to customise the compilation depending on the level
of features you want.
The list below details the must useful combinations of these
options, from the largest footprint to the smallest. Footprint depend
on lot's of factor and is purely indicative (version 29-pre7+, i386,
glibc, gcc 3.3.5).

1) Static build
Command line : make BUILD_STATIC='y'
- : Largest footprint
- : libiw not included (other third party tools may depend on it)
Size : ~280 kB

2) Default build
Command line : make
+ : Fully featured version of the tools
- : Largest footprint (except for static version of tools)
Size : ~190 kB (libiw : ~29 kB ; ifrename : ~29 kB)

3) Stripping (remove function symbols)
Command line : make BUILD_STRIPPING='y'
+ : Fully featured version of the tools
- : Still quite large
Size : ~110 kB (libiw : ~23 kB ; ifrename : ~17 kB)

4) Multicall version (include stripping)
Command line : make iwmulticall ; make install-iwmulticall
+ : Fully featured version of the tools
+ : Small
- : libiw not included (other third party tools may depend on it)
- : ifrename is not included
Size : ~55 kB

5) Multicall + Essential
Command line : make BUILD_WE_ESSENTIAL='y' iwmulticall
+ : Smaller
- : Some less used features are left out
- : libiw not included (other third party tools may depend on it)
- : ifrename is not included
Size : ~44 kB

6) iwconfig only + essential + static
Command line : make BUILD_WE_ESSENTIAL='y' BUILD_STATIC='y' BUILD_STRIPPING='y' iwconfig
+ : Very small
- : Very limited functionality : no scanning, no event, no iwpriv
- : libiw not included (other third party tools may depend on it)
- : ifrename is not included
Size : ~28 kB

Wireless headers (past history) :
-------------------------------
Previous version of the Wireless Tools had to be compiled with
Expand All @@ -63,18 +133,6 @@ you that.
Note that the previous option to make versioned installed of
the tools no longer make sense and therefore is gone.

Other useful Makefile options :
-----------------------------
PREFIX : where the tools will be installed (default : /usr/local)
BUILD_STATIC : build tools with a static version of the wireless lib
BUILD_NOLIBM : build tools without mathematical lib (slower)
Note that you should pass the same command line options for
all invocations of make ("make" and "make install").

If you want the absolute minimal footprint, you may want to
look into the multicall version of the tools. You can build it with
"make iwmulticall" and install it with "make install-iwmulticall".

Old kernel with older Wireless Extensions :
-----------------------------------------
Kernel prior to 2.2.14 : Those kernels include Wireless
Expand Down
24 changes: 17 additions & 7 deletions wireless_tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,36 @@
## Please check the configurion parameters below
##

## Installation directory. By default, go in /usr/local
## Installation directory. By default, go in /usr/local.
## Distributions should probably use /, but they probably know better...
ifndef PREFIX
PREFIX = /usr/local
endif

## Compiler to use (modify this for cross compile)
## Compiler to use (modify this for cross compile).
CC = gcc
## Other tools you need to modify for cross compile (static lib only)
## Other tools you need to modify for cross compile (static lib only).
AR = ar
RANLIB = ranlib

## Uncomment this to build tools using static version of the library
## Uncomment this to build tools using static version of the library.
## Mostly useful for embedded platforms without ldd, or to create
## a local version (non-root).
# BUILD_STATIC = y

## Uncomment this to build without using libm (less efficient)
## Uncomment this to build without using libm (less efficient).
## This is mostly useful for embedded platforms without maths.
# BUILD_NOLIBM = y

## Uncomment this to strip binary from symbols. This reduce binary size
## Uncomment this to strip binary from symbols. This reduce binary size.
## by a few percent but make debug worse...
# BUILD_STRIPPING = y

## Uncomment this to build with only essential functionality.
## This leaves out the less used features and cut in half the tools.
## This is mostly useful for embedded platforms without limited feature needs.
# BUILD_WE_ESSENTIAL = y

# ***************************************************************************
# ***** Most users should not need to change anything beyond this point *****
# ***************************************************************************
Expand Down Expand Up @@ -91,12 +96,17 @@ else
STRIPFLAGS=
endif

# Do we want to build with only essential functionality ?
ifdef BUILD_WE_ESSENTIAL
WEDEF_FLAG= -DWE_ESSENTIAL=y
endif

# Other flags
CFLAGS=-Os -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow \
-Wpointer-arith -Wcast-qual -Winline -I.
#CFLAGS=-O2 -W -Wall -Wstrict-prototypes -I.
DEPFLAGS=-MMD
XCFLAGS=$(CFLAGS) $(DEPFLAGS) $(WARN) $(HEADERS) $(WELIB_FLAG)
XCFLAGS=$(CFLAGS) $(DEPFLAGS) $(WARN) $(HEADERS) $(WELIB_FLAG) $(WEDEF_FLAG)
PICFLAG=-fPIC

# Standard compilation targets
Expand Down
Loading

0 comments on commit c7b2e81

Please sign in to comment.