├── .gitattributes ├── .gitignore ├── 19-udev-ifrename.rules ├── Android.mk ├── CHANGELOG.h ├── COPYING ├── DISTRIBUTIONS.txt ├── ESSID-BUG.txt ├── HOTPLUG-UDEV.txt ├── IFRENAME-VS-XXX.txt ├── INSTALL ├── Makefile ├── PCMCIA.txt ├── README ├── README.fr ├── bin ├── ifrename ├── iwconfig ├── iwevent ├── iwgetid ├── iwlist ├── iwmulticall ├── iwpriv ├── iwspy └── macaddr ├── cs ├── ifrename.8 ├── iftab.5 ├── iwconfig.8 ├── iwevent.8 ├── iwgetid.8 ├── iwlist.8 ├── iwpriv.8 ├── iwspy.8 └── wireless.7 ├── fr.ISO8859-1 ├── ifrename.8 ├── iftab.5 ├── iwconfig.8 ├── iwevent.8 ├── iwgetid.8 ├── iwlist.8 ├── iwpriv.8 ├── iwspy.8 └── wireless.7 ├── fr.UTF-8 ├── ifrename.8 ├── iftab.5 ├── iwconfig.8 ├── iwevent.8 ├── iwgetid.8 ├── iwlist.8 ├── iwpriv.8 ├── iwspy.8 └── wireless.7 ├── ifrename.8 ├── ifrename.c ├── iftab.5 ├── iw261_restore_full_essid.diff ├── iw262_restore_full_essid.diff ├── iwconfig.8 ├── iwconfig.c ├── iwevent.8 ├── iwevent.c ├── iwgetid.8 ├── iwgetid.c ├── iwlib-private.h ├── iwlib.c ├── iwlib.h ├── iwlist.8 ├── iwlist.c ├── iwmulticall.c ├── iwpriv.8 ├── iwpriv.c ├── iwspy.8 ├── iwspy.c ├── macaddr.c ├── sample_enc.c ├── sample_pm.c ├── sample_priv_addr.c ├── wireless.10.h ├── wireless.11.h ├── wireless.12.h ├── wireless.13.h ├── wireless.14.h ├── wireless.15.h ├── wireless.16.h ├── wireless.17.h ├── wireless.18.h ├── wireless.19.h ├── wireless.20.h ├── wireless.21.h ├── wireless.22.h ├── wireless.7 └── wireless.h /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | 4 | # Libraries 5 | *.lib 6 | *.a 7 | 8 | # Shared objects (inc. Windows DLLs) 9 | *.dll 10 | *.so 11 | *.so.* 12 | *.dylib 13 | 14 | # Executables 15 | *.exe 16 | *.out 17 | *.app 18 | 19 | # Autotools 20 | install-sh 21 | missing 22 | depcomp 23 | Makefile.in 24 | aclocal.m4 25 | autom4te.cache 26 | Makefile 27 | config.h 28 | config.h.in 29 | config.log 30 | config.status 31 | configure 32 | .deps 33 | stamp-h1 34 | 35 | # Documentation 36 | stamp-vti 37 | version.texi 38 | 39 | # Misc 40 | *~ 41 | -------------------------------------------------------------------------------- /19-udev-ifrename.rules: -------------------------------------------------------------------------------- 1 | # udev rules to properly integrate ifrename. 2 | # Renaming is done using /etc/iftab, with full ifrename functionality. 3 | # Require udev version 107 or later. 4 | # Please double check the path to ifrename, and make sure its available 5 | # when udev runs (i.e. on boot partition). 6 | 7 | # Enable this rule to test with udevtest. 8 | #ENV{UDEV_LOG}=="6", SUBSYSTEM=="net", ACTION=="add", IMPORT="/sbin/ifrename -D -V -u -i %k", NAME:="$env{INTERFACE}" 9 | 10 | # Main ifrename rule. 11 | # If interface is found in /etc/iftab, subsequent rename rules are bypassed. 12 | # If interface is not found in /etc/iftab, subsequent rename rules applies. 13 | SUBSYSTEM=="net", ACTION=="add", IMPORT="/sbin/ifrename -u -i %k", NAME:="$env{INTERFACE}" 14 | -------------------------------------------------------------------------------- /Android.mk: -------------------------------------------------------------------------------- 1 | # (c) 2014 KrisWebDev 2 | # License: This file (solely) is licenced under the GNU GPL v2 3 | # > Put sources in external/ folder in CM source root 4 | 5 | LOCAL_PATH:=$(call my-dir) 6 | 7 | 8 | 9 | # GENERAL 10 | MY_CFLAGS := -g -Wall -W -O3 -Wno-unused-but-set-variable -Wno-array-bounds -DANDROID 11 | MY_C_INCLUDES := 12 | MY_SHARED_LIBS := 13 | MY_STATIC_LIBS := 14 | 15 | #WT_VERSION := $(shell sed -ne "/WT_VERSION/{s:\([^0-9]*\)::;p;q;}" < lwe/iwlib.h ) 16 | #WE_VERSION := $(shell sed -ne "/WE_VERSION/{s:\([^0-9]*\)::;p;q;}" < lwe/iwlib.h ) 17 | #WEXT_HEADER := lwe/wireless.$(WE_VERSION).h 18 | # Cross-compilation, manual copy required: cp wireless.21.h wireless.h 19 | MY_SRC_LWE := iwlib.c 20 | #alternative: -DWE_NOLIBM=y 21 | MY_STATIC_LIBS += libm 22 | MY_C_INCLUDES += bionic/libm/include bionic/libm 23 | # removed: -Os -I. -MMD (shared library thing) -fPIC (shared library thing, position-independant code), -Wl,-s for iwmulticall, -Wstrict-prototypes (annoyong other code)-Wmissing-prototypes (annoyong other code) 24 | MY_CFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Winline -fPIC 25 | # /etc/reaver doesn't exist in Android and we should avoid writing in such dirs anyway 26 | # MY_CFLAGS += -DCONF_DIR='"/etc/reaver"' -DREAVER_DATABASE='"/etc/reaver/reaver.db"' 27 | # $(MY_CONFDIR) 28 | 29 | 30 | #> GCC flags help: 31 | # -g: Produce debugging information 32 | # -W: (-Wextra) This enables some extra warning flags that are not enabled by -Wall, inc. -Wunused-parameter. 33 | # -O3: The compiler tries to reduce code size and execution time. Optimize yet more with -O3. 34 | # -Wall: Turns on the warning flags 35 | # -Wno-unused-but-set-variable: Don't warn whenever a local variable is assigned to, but otherwise unused (aside from its declaration). 36 | # -Wno-array-bounds: Don't warn whenever subscripts to arrays that are always out of bounds. This option is only active when -ftree-vrp is active (default for -O2 and above). 37 | # -Idir: Add the directory dir to the head of the list of directories to be searched for header files. 38 | # -D name=definition: The contents of definition are tokenized and processed as if they appeared during translation phase three in a ‘#define’ directive. 39 | # 40 | #> Unused: 41 | # -c: Compile or assemble the source files, but do not link. 42 | # -s: Strip the debug information, so as to make the code as small as possible. 43 | 44 | 45 | include $(CLEAR_VARS) 46 | LOCAL_MODULE := iwconfig 47 | LOCAL_SRC_FILES := $(MY_SRC_LWE) iwconfig.c 48 | LOCAL_CFLAGS += $(MY_CFLAGS) 49 | LOCAL_C_INCLUDES := $(MY_C_INCLUDES) 50 | LOCAL_STATIC_LIBRARIES := $(MY_STATIC_LIBS) 51 | LOCAL_SHARED_LIBRARIES := $(MY_SHARED_LIBS) 52 | include $(BUILD_EXECUTABLE) 53 | 54 | include $(CLEAR_VARS) 55 | LOCAL_MODULE := iwlist 56 | LOCAL_SRC_FILES := $(MY_SRC_LWE) iwlist.c 57 | LOCAL_CFLAGS += $(MY_CFLAGS) 58 | LOCAL_C_INCLUDES := $(MY_C_INCLUDES) 59 | LOCAL_STATIC_LIBRARIES := $(MY_STATIC_LIBS) 60 | LOCAL_SHARED_LIBRARIES := $(MY_SHARED_LIBS) 61 | include $(BUILD_EXECUTABLE) 62 | 63 | include $(CLEAR_VARS) 64 | LOCAL_MODULE := iwpriv 65 | LOCAL_SRC_FILES := $(MY_SRC_LWE) iwpriv.c 66 | LOCAL_CFLAGS += $(MY_CFLAGS) 67 | LOCAL_C_INCLUDES := $(MY_C_INCLUDES) 68 | LOCAL_STATIC_LIBRARIES := $(MY_STATIC_LIBS) 69 | LOCAL_SHARED_LIBRARIES := $(MY_SHARED_LIBS) 70 | include $(BUILD_EXECUTABLE) 71 | 72 | include $(CLEAR_VARS) 73 | LOCAL_MODULE := iwspy 74 | LOCAL_SRC_FILES := $(MY_SRC_LWE) iwspy.c 75 | LOCAL_CFLAGS += $(MY_CFLAGS) 76 | LOCAL_C_INCLUDES := $(MY_C_INCLUDES) 77 | LOCAL_STATIC_LIBRARIES := $(MY_STATIC_LIBS) 78 | LOCAL_SHARED_LIBRARIES := $(MY_SHARED_LIBS) 79 | include $(BUILD_EXECUTABLE) 80 | 81 | include $(CLEAR_VARS) 82 | LOCAL_MODULE := iwgetid 83 | LOCAL_SRC_FILES := $(MY_SRC_LWE) iwgetid.c 84 | LOCAL_CFLAGS += $(MY_CFLAGS) 85 | LOCAL_C_INCLUDES := $(MY_C_INCLUDES) 86 | LOCAL_STATIC_LIBRARIES := $(MY_STATIC_LIBS) 87 | LOCAL_SHARED_LIBRARIES := $(MY_SHARED_LIBS) 88 | include $(BUILD_EXECUTABLE) 89 | 90 | include $(CLEAR_VARS) 91 | LOCAL_MODULE := iwevent 92 | LOCAL_SRC_FILES := $(MY_SRC_LWE) iwevent.c 93 | LOCAL_CFLAGS += $(MY_CFLAGS) 94 | LOCAL_C_INCLUDES := $(MY_C_INCLUDES) 95 | LOCAL_STATIC_LIBRARIES := $(MY_STATIC_LIBS) 96 | LOCAL_SHARED_LIBRARIES := $(MY_SHARED_LIBS) 97 | include $(BUILD_EXECUTABLE) 98 | 99 | include $(CLEAR_VARS) 100 | LOCAL_MODULE := ifrename 101 | LOCAL_SRC_FILES := $(MY_SRC_LWE) ifrename.c 102 | LOCAL_CFLAGS += $(MY_CFLAGS) 103 | LOCAL_C_INCLUDES := $(MY_C_INCLUDES) 104 | LOCAL_STATIC_LIBRARIES := $(MY_STATIC_LIBS) 105 | LOCAL_SHARED_LIBRARIES := $(MY_SHARED_LIBS) 106 | include $(BUILD_EXECUTABLE) 107 | 108 | # error: undefined reference to 'iw_saether_ntop' 109 | # solution: replace #include "iwlib.h" by #include "iwlib-private.h" in macaddr.c 110 | include $(CLEAR_VARS) 111 | LOCAL_MODULE := macaddr 112 | LOCAL_SRC_FILES := $(MY_SRC_LWE) macaddr.c 113 | LOCAL_CFLAGS += $(MY_CFLAGS) 114 | LOCAL_C_INCLUDES := $(MY_C_INCLUDES) 115 | LOCAL_STATIC_LIBRARIES := $(MY_STATIC_LIBS) 116 | LOCAL_SHARED_LIBRARIES := $(MY_SHARED_LIBS) 117 | include $(BUILD_EXECUTABLE) 118 | 119 | include $(CLEAR_VARS) 120 | LOCAL_MODULE := iwmulticall 121 | LOCAL_SRC_FILES := iwmulticall.c 122 | LOCAL_CFLAGS += $(MY_CFLAGS) -Wstrict-prototypes -Wmissing-prototypes -MMD -Wl,-s 123 | LOCAL_C_INCLUDES := $(MY_C_INCLUDES) 124 | LOCAL_STATIC_LIBRARIES := $(MY_STATIC_LIBS) 125 | LOCAL_SHARED_LIBRARIES := $(MY_SHARED_LIBS) 126 | include $(BUILD_EXECUTABLE) 127 | 128 | -------------------------------------------------------------------------------- /CHANGELOG.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/CHANGELOG.h -------------------------------------------------------------------------------- /DISTRIBUTIONS.txt: -------------------------------------------------------------------------------- 1 | Distribution specific notes on Wireless Configuration 2 | ----------------------------------------------------- 3 | 4 | ***** HELP ***** 5 | If people send me information about the specifics of each 6 | distribution, I'll try to collect that here. Don't forget to mention 7 | to which distribution those instructions apply, the tool used (if any) 8 | and the files modified. 9 | Actually, the people packaging my tools for a specific 10 | distribution have a moral obligation to send me the exact detailed 11 | instructions of what they have done. I will list in the wireless.7 12 | man page only distributions that give me an official answer. 13 | ***** HELP ***** 14 | 15 | ----- 16 | 17 | INTRODUCTION 18 | ------------ 19 | The tools enable users to change the card settings at run time 20 | (when running iwconfig, for example). However, most users want the 21 | card to be configured either at boot time or when the card is 22 | activated in the system. 23 | Each distribution has its own configuration scripts, and 24 | therefore is slightly different. Some distributions even add some 25 | graphical setup tool (nice). This file describe the procedure for a 26 | few of them. 27 | Note : if you install the Pcmcia package in source form from 28 | the official Linux-Pcmcia web site (as opposed to precompiled by a 29 | distribution, please use the PCMCIA method). 30 | 31 | Please remember : I don't use your distribution, and I have 32 | absolutely no clue about how your distribution works. I'm just 33 | collecting random information here without beeing able to verify it. 34 | 35 | ----- 36 | 37 | WIRELESS DRIVERS 38 | ---------------- 39 | Most Linux wireless drivers support Wireless Extensions, and 40 | therefore may be configure via Wireless Tools and the methods 41 | described in this file. 42 | 43 | However, a few drivers have no support or limited support for 44 | Wireless Extensions (like read only). In those cases, these are your 45 | options : 46 | o read the driver documentation. 47 | o use the driver specific interface or tools to 48 | configure the card, and try to integrate that in your distribution. 49 | o implement Wireless Extension support in the driver. 50 | In some cases, there are easier workaround. Different version 51 | of the driver may add Wireless Extension (often alongside the 52 | proprietary method). In some other case, there may be another driver 53 | supporting the same card and with support for Wireless Extensions. 54 | 55 | Some Linux wireless drivers don't export all wireless settings 56 | via Wireless Extensions, not even through iwpriv. Those setting may be 57 | available through the driver specific interface. Refer to previous 58 | section for workarounds. 59 | 60 | --------------------------------------------------------------------- 61 | 62 | PCMCIA METHOD 63 | ------------- 64 | (Contributed by Jean Tourrilhes ) 65 | This method work for *all* distributions. 66 | For Pcmcia cards, it is possible to overwrite the Pcmcia 67 | configuration files of the distribution with the original Pcmcia 68 | configuration files from the Pcmcia package (/etc/pcmcia/*). If you 69 | install the Pcmcia package in source form from the official 70 | Linux-Pcmcia web site, this will be done automatically. 71 | Once this is done, you can no longer use the specific tools 72 | and configuration files of the distribution, and are required to use 73 | Pcmcia style of configuration (see Pcmcia Howto). 74 | In such a case, Wireless configuration is done through 75 | wireless.opts, and documented in the file PCMCIA.txt. 76 | 77 | --------------------------------------------------------------------- 78 | 79 | DEBIAN 2.2 (and earlier) 80 | ---------- 81 | (Contributed by Jean Tourrilhes ) 82 | Debian 2.2 (and earlier) doesn't support any Wireless 83 | Configuration. You are required to use the Pcmcia method. Also, the 84 | Wireless Tools package is not part of the standard packages. 85 | 86 | --------------------------------------------------------------------- 87 | 88 | DEBIAN 3.0 (and later) 89 | ---------- 90 | (Contributed by Guus Sliepen ) 91 | Debian also has another way of configuring network devices, 92 | controlled by /etc/network/interfaces. Users can add a wireless 93 | interface to /etc/network/interfaces, using the standard options to 94 | set the address and such, but the wireless-tools package adds new 95 | option statements that can be used to configure keys, channel, 96 | etcetera. 97 | From the README.Debian script that comes with wireless-tools: 98 | 99 | /etc/network/interfaces 100 | ----------------------- 101 | 102 | You can now add extra statements to the iface sections of the files in 103 | /etc/network/interfaces that are specific for wireless interfaces. They 104 | are of the form: 105 | 106 | wireless- 107 | 108 | Before the interface is brought up, such a statement will result in the 109 | execution of the following command: 110 | 111 | iwconfig 112 | 113 | Example: 114 | 115 | iface eth0 inet static 116 | address 192.168.1.2 117 | network 192.168.1.0 118 | netmask 255.255.255.0 119 | broadcast 192.168.1.255 120 | wireless-essid Home 121 | wireless-mode ad-hoc 122 | 123 | The current Debian script support all arguments present in 124 | wireless.opts apart from Nickname. You can check this in the script 125 | /etc/network/if-pre-up.d/wireless-tool. 126 | You will need of course to install the Wireless Tools package 127 | if it's not already done, which is part of the standard package list 128 | (use dselect, dpkg, apt or anything you like to get it). 129 | 130 | ----- 131 | 132 | (Contributed by Joey Hess ) 133 | /etc/network/interfaces is much more flexible than it appears. It can probably 134 | do everything pcmcia schemes can do, and more. Here is part of mine: 135 | 136 | auto wlan0 137 | mapping wlan0 138 | script /usr/local/bin/ifscheme-mapping 139 | 140 | iface wlan0-home inet static 141 | address 192.168.1.5 142 | gateway 192.168.1.1 143 | netmask 255.255.255.0 144 | wireless-mode ad-hoc 145 | wireless-essid wortroot 146 | wireless-nick dragon 147 | wireless-channel 1 148 | 149 | iface wlan0-away inet dhcp 150 | wireless-mode managed 151 | 152 | Now I can type 'ifscheme -s away' when I leave home, rather like 153 | cardctl scheme. 154 | 155 | The ifscheme script is at http://bugs.debian.org/154444. If the request in 156 | bug #154442 is implemented, it will become very flexible indeed.. 157 | 158 | Debian will hopefully be using this same file eventually for pcmcia network 159 | devices too. It's already doable but takes a little work. This is all rather 160 | rough and badly documented so far. 161 | 162 | You can also do mapping based on the MAC address, if you want specific 163 | configuration on specific card. See 164 | /usr/share/doc/ifupdown/examples/get-mac-address.sh and the stanza in 165 | /usr/share/doc/ifupdown/examples/network-interfaces.gz that uses it. 166 | This comes back to the problem I alluded to with mapping scripts not 167 | being "nestable" yet, and bug #154442. You can do what you want today, 168 | but you may need to write your own mapping script which uses a 169 | combination of MAC address and scheme info to return a stanza name to 170 | ifupdown. 171 | 172 | ----- 173 | 174 | (Contributed by Jean Tourrilhes ) 175 | The 'ifscheme' scripts mentionned above are now available in 176 | Debian Sarge, in the 'ifscheme' package. 177 | The MAC address based mapping mentioned above is deprecated, 178 | you should use 'ifrename' to assign a consistent interface name to 179 | each of your network interface. This is documented in 180 | HOTPLUG-UDEV.txt. This enable the combination of MAC address 181 | identification of interfaces with scheme multi-configuration. 182 | 183 | ----- 184 | 185 | If you need automatic wireless configuration, you can look at 186 | the following packages : 187 | o ifupdown-roaming : 188 | http://panopticon.csustan.edu/thood/ifupdown-roaming.html 189 | o waproamd 190 | http://0pointer.de/lennart/projects/waproamd/ 191 | 192 | --------------------------------------------------------------------- 193 | 194 | SuSE 8.0 and later 195 | -------- 196 | (Contributed by Christian Zoz ) 197 | All network configuration is done in the directory 198 | /etc/sysconfig/network. It does not matter if it's a build in NIC or 199 | PCMCIA, USB, etc. The files network.opts and wireless.opts in 200 | /etc/pcmcia are not used any longer. There is /sbin/ifup to set up all 201 | kind of network interface. 202 | There is a file /etc/sysconfig/network/wireless where you may 203 | set most of the options of iwconfig in seperate variables (they are 204 | named like the options). Additionally you may use 205 | WIRELESS_IWCONFIG_OPTIONS e.g. for setting key 2, 3 or 4 or 206 | unsupported iwconfig commands. This file is documented and its 207 | settings are used for any wlan NIC. 208 | Configuration of wireless variable looks like : 209 | WIRELESS_ESSID="" 210 | Every variable from file wireless may be used in the interface 211 | configuration files /etc/sysconfig/network/ifcfg-* as well. As 212 | expectable this overwrites the global setting in wireless. For 213 | sophisticated use of the ifcfg-* files read 'man ifup'. 214 | 215 | Hint for PCMCIA and USB users: 216 | You need not to use the iterface name for the configuration as 217 | this may vary from one plugin to another. You may use a description of 218 | your hardware instead (ifcfg- or ifcfg-pcmcia-1 for card 219 | in Slot 1) 220 | 221 | Some of the variables can be set with YaST2 as well. 222 | 223 | If you miss the 'schemes' functionality from the pcmcia-cs 224 | packages use the tool SCPM (System Configuration Profile Management) 225 | instead. This extends the pcmcia schemes to the whole system 226 | configuration. Read 'info scpm'. Since SuSE 8.1 there also is a YaST2 227 | modul for SCPM. 228 | 229 | --------------------------------------------------------------------- 230 | 231 | RED-HAT 7.2 232 | ----------- 233 | (Grabbed from various source - Google is your friend) 234 | Configuration is done in the file : 235 | /etc/sysconfig/network-scripts/ifcfg-ethN 236 | Where 'ethN' is the name of the wireless interface (such as 237 | eth0, eth1, ...). 238 | The following lines may be added in this file : 239 | MODE= 240 | ESSID="" 241 | RATE= 242 | TXPOWER= 243 | KEY="" 244 | The full list of configuration can be found in the file : 245 | /etc/sysconfig/network-scripts/ifup-wireless 246 | 247 | Note that Brad Allison has other tips for 7.2 : 248 | http://jackal.dnsalias.com:8080/public/misc/wireless/wireless.html 249 | 250 | --------------------------------------------------------------------- 251 | 252 | RED-HAT 7.3 and later 253 | ----------- 254 | (Cut'n'pasted from Brad Allison web page) 255 | http://jackal.dnsalias.com:8080/public/misc/wireless/wireless.html 256 | 257 | If you are running RedHat 7.3, I would tell you to simply run 258 | /usr/bin/redhat-config-network and click "Devices", Click "Add", then 259 | select "Wireless Connection". You can find the full instructions in 260 | RedHat's Customization Guide for RH7.3 in Chapter 6, Network 261 | Configuration: Wireless Connection. 262 | http://www.redhat.com/docs/manuals/linux/ 263 | http://www.redhat.com/docs/manuals/linux/RHL-7.3-Manual/custom-guide/s1-network-config-wireless.html 264 | 265 | However, according to the Errata: The version of the Red Hat 266 | Network Administration Tool that shipped with Red Hat Linux 7.3 did 267 | not include wireless connection in the configuration wizard. An 268 | enhancement errata will be released soon with this feature. You can 269 | download the newest version of redhat-config-network from rpmfind.net. 270 | http://www.redhat.com/docs/errata/RHL-7.3-Manual/ 271 | http://www.rpmfind.net/linux/rpm2html/search.php?query=redhat-config-network&submit=Search+... 272 | 273 | ----- 274 | 275 | (Grabbed from various source - Google is your friend) 276 | The current graphical user interface support : 277 | ESSID, Mode, Freq, Channel, Rate, Key 278 | 279 | Compared to Red-Hat 7.2, the Wireless Setting in the 280 | configuration file have change to include the WIRELESS_ prefix : 281 | WIRELESS_MODE= 282 | WIRELESS_ESSID='' 283 | WIRELESS_ENC_KEY='' 284 | The underlying configuration files and configurations options 285 | seems to be indentical to what is done in Mandrake 8.2 (or vice 286 | versa), so please check the section below. This allow configuration of 287 | additional wireless settings not available in the GUI. 288 | 289 | ----- 290 | 291 | (Extrapolated from web page of Martin Pot ) 292 | http://ii.net/~mpot/wireless/router.cgi 293 | Red-Hat 7.3 also seem to support configuration in 294 | wireless.opts to some extent. But for compatibility with the network 295 | admin tools, I would still recommend to use the above method. 296 | Red-Hat 7.3 seems to load wvlan_cs for Orinoco cards and 297 | friends. The above web page explain how to switch it to orinoco_cs. 298 | 299 | --------------------------------------------------------------------- 300 | 301 | RED-HAT 9.0 and later 302 | ----------- 303 | (Cut'n'pasted from Dax Kelson web page) 304 | http://www.gurulabs.com/RedHatLinux9-review.html 305 | 306 | A little known fact is that newer versions of RHL support 307 | multiple network profiles. This is useful for machines that commonly 308 | plug into different networks (think laptops). The easy way to create 309 | network profiles is to use the redhat-config-network command. The 310 | question then becomes, what happens when you type "ifup eth0"? The 311 | behavior wasn't defined in previous versions, however, now in RHL 9 312 | the following behavior is defined; 313 | 314 | search path for: 315 | # ifup $DEV 316 | is: 317 | /etc/sysconfig/networking/profiles/$CURRENT_PROFILE/ifcfg-$DEV 318 | /etc/sysconfig/networking/profiles/default/ifcfg-$DEV 319 | /etc/sysconfig/network-scripts/ifcfg-$DEV 320 | 321 | A cool trick is to boot your RHL box directly into a profile 322 | from the GRUB boot screen. To do this, create a separate 323 | /etc/boot/grub.conf entry for each network profile, and in each entry 324 | add the kernel argument netprofile=profilename. 325 | 326 | ----- 327 | 328 | I'm pretty certain the profile scheme above also apply to 329 | wireless settings, which is good news... 330 | 331 | --------------------------------------------------------------------- 332 | 333 | MANDRAKE 8.2 and later 334 | ------------ 335 | (Grabbed from various source - Google is your friend) 336 | Configuration is done in the file : 337 | /etc/sysconfig/network-scripts/ifcfg-ethN 338 | Where 'ethN' is the name of the wireless interface (such as 339 | eth0, eth1, ...). 340 | The following lines may be added in this file : 341 | WIRELESS_MODE= 342 | WIRELESS_ESSID= 343 | WIRELESS_NWID= 344 | WIRELESS_FREQ= 345 | WIRELESS_SENS= 346 | WIRELESS_RATE= 347 | WIRELESS_ENC_KEY= 348 | WIRELESS_RTS= 349 | WIRELESS_FRAG= 350 | WIRELESS_IWCONFIG= 351 | WIRELESS_IWSPY= 352 | WIRELESS_IWPRIV= 353 | Most likely, you only need to add a few of those lines and not 354 | all of them. The script doing the configuration and where you can 355 | check the details is : 356 | /etc/network/network-scripts/ifup-wireless 357 | You will of course need the Wireless Tools package : 358 | rpm -Uvh wireless-tools-XX-Xmdk.XXX.rpm 359 | 360 | Mandrake can also have wireless setting added to its 361 | Auto-Install procedure : 362 | http://members.shaw.ca/mandrake/drakx/8.2/HTML/section4-13.html 363 | 364 | ----- 365 | 366 | (in e-mail from Thierry Vignaud ) 367 | You may use the following tool : 368 | o drakconnect 369 | You may read the following documentation : 370 | o ifcfg 371 | 372 | --------------------------------------------------------------------- 373 | 374 | 375 | Have fun... 376 | 377 | Jean 378 | -------------------------------------------------------------------------------- /ESSID-BUG.txt: -------------------------------------------------------------------------------- 1 | The ESSID bug 2 | ------------- 3 | 4 | The latest Linux kernels have a bug in the handling of the 5 | ESSID. The Linux kernel maintainers seems reluctant to fix this 6 | bug. But, I've managed to find a way to workaround it in Wireless 7 | Tools 30.pre7. 8 | 9 | Symptoms : 10 | -------- 11 | 1) There is a trailing '\x00' in the ESSID. 12 | 2) If a ESSID with 32 character is set, it can not be read again. 13 | http://madwifi.org/ticket/930 14 | 3) You can not set an ESSID with a trailing '\x00' 15 | 16 | Resolution : 17 | ---------- 18 | The patch provided in the Wireless Tools package should fix 19 | this problem. This patch remove a backward compatibility hack, and it 20 | is safe as it simplify the code. 21 | The patch need to be applied to the kernel, the kernel 22 | recompiled and reinstalled. 23 | If you have kernel 2.6.19 to 2.6.21 : 24 | use iw261_restore_full_essid.diff 25 | If you have kernel 2.6.22 or later : 26 | use iw262_restore_full_essid.diff 27 | I won't give detailed instructions because only people 28 | confortable with kernel rebuild should attempt this. 29 | 30 | Workaround : 31 | ---------- 32 | Using Wireless Tools 30.pre7 or later will cure syptoms (1) and (2). 33 | Using Wireless Tools 29 or earlier will hide the trailing '\x00' 34 | character (first symptom), but not the second and third symptoms. 35 | 36 | Good luck... 37 | 38 | Jean 39 | 40 | -------------------------------------------------------------------------------- /IFRENAME-VS-XXX.txt: -------------------------------------------------------------------------------- 1 | Network interface renaming comparison 2 | ------------------------------------- 3 | 4 | INTRODUCTION 5 | ------------ 6 | The Wireless Tools package includes 'ifrename', a tool to 7 | rename network interfaces. However, this is not the only solution to 8 | the problem of renaming network interfaces. This document explain the 9 | differences between ifrename and the various alternatives. 10 | The subject of interface renaming may look simple at first 11 | glance, and is simple in 95% of the cases, however there are many 12 | complex scenario and those tools have many features, which explain why 13 | we need to go in more details than just saying 'tool X is better'. 14 | 15 | NAMEIF 16 | ------ 17 | The tool 'nameif' was designed to rename network 18 | interfaces. It either loads mapping from the file /etc/mactab or 19 | accept mapping on the command line. 20 | It is part of the net-tools package : 21 | http://www.tazenda.demon.co.uk/phil/net-tools/ 22 | 23 | Advantages over 'ifrename' : 24 | + More widespread, available in very old distributions 25 | + simpler/smaller 26 | Drawbacks compared to 'ifrename' : 27 | - Only support MAC address selector 28 | - Does not support hotplug invocation 29 | - Does not support module on-demand loading 30 | Comments : 31 | o The fact that nameif does not support selector other 32 | than the MAC address is problematic, as USB-NET devices may not have 33 | MAC addresses and some ethernet/wireless drivers can't query the MAC 34 | address before 'ifconfig up'. 35 | o 'ifrename' was designed as a better 'nameif', and 36 | its concept is very similar. 37 | 38 | IPROUTE 39 | ------- 40 | The tool 'ip' can rename network interfaces with the following 41 | syntax : 42 | > ip link set name 43 | It is part of the 'iproute' package : 44 | http://developer.osdl.org/dev/iproute2/ 45 | 46 | Advantages over 'ifrename' : 47 | + integrated in 'iproute', which most people need anyway 48 | Drawbacks compared to 'ifrename' : 49 | - Do not support any selector, must use old interface name 50 | - No 'batch' mode, must rename each interface manually 51 | Comments : 52 | o 'ip' only provide the most basic facility. To use it 53 | automatically, like in init/hotplug scripts, wrappers adding some 54 | rules/selector must be written. 55 | 56 | DRIVER MODULE PARAMETERS 57 | ------------------------ 58 | Some network driver have module parameters enabling to specify 59 | the network name of all the devices created by the driver. This is 60 | driver specific, so you will need to check your driver. 61 | 62 | Advantages over 'ifrename' : 63 | + very simple to get configured and running 64 | Drawbacks compared to 'ifrename' : 65 | - Not universally supported : few drivers do it 66 | - Fragmented : each driver does it differently 67 | - The only selector available is the driver 68 | Comments : 69 | o This method was never popular with the kernel 70 | people, and this feature is being removed from driver that use to 71 | include it. 72 | 73 | UDEV 74 | ---- 75 | The package 'udev' include facility to rename network 76 | interfaces, with rules such as : 77 | KERNEL="eth*", SYSFS{address}="00:52:8b:d5:04:48", NAME="lan" 78 | This is part of the udev package : 79 | http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html 80 | 81 | Advantages over 'ifrename' : 82 | + simpler to setup if 'udev' is already properly setup 83 | + automatically generates persistent rules 84 | Drawbacks compared to 'ifrename' : 85 | - Less selectors that 'ifrename' 86 | - Require kernel 2.6.X or later with sysfs support 87 | - Do no support non-hotplug interfaces 88 | - Require 'udev', not everybody uses it (static /dev, devfs) 89 | Comments : 90 | o 'udev' support many selectors, basically all those 91 | present in 'sysfs' (excluding symlinks), even if the documentation 92 | only show instructions to use the MAC address (which is problematic 93 | with virtual devices some drivers - see above). 'ifrename' can also 94 | use all selectors present in 'sysfs' (like 'udev'), can use sysfs 95 | symlinks and parent directories, plus some other selectors not present 96 | in sysfs that were found to be useful. 97 | o Not all interfaces are managed by hotplug. All 98 | virtual devices, such as tunnels and loopbacks, are not associated 99 | with a hardware bus, and therefore are not managed by hotplug. All 100 | driver compiled statically into the kernel are not managed by 101 | hotplug. 'udev' can't deal with those devices. 102 | o It is common practice on embedded system to use a 103 | static /dev and not 'udev' to save space and boot time. And to not use 104 | hotplug for the same reasons. 105 | o 'ifrename' has now a udev compatiblity mode that 106 | enables to trivially integrate it into 'udev' as an IMPORT rule. This 107 | requires udev version 107 or better and ifrename 29-pre17 or better. 108 | 109 | SELECTOR AWARE NETWORK SCRIPTS 110 | ------------------------------ 111 | Another method is to not rename the interface at all, and make 112 | the various network script selector aware. The basic idea is to simply 113 | ignore the interface name and have all the network scripts based on 114 | selectors. 115 | The main example is the original Pcmcia network scripts. They 116 | allow you to configure an interface directly based on MAC address and 117 | Pcmcia socket. Another example is the script get-mac-address.sh used 118 | as a mapping in some Debian configuration. On the other hand, Red-Hat 119 | and Fedora scripts don't apply, as they wrap around 'nameif'. 120 | 121 | Advantages over 'ifrename' : 122 | + usually simpler to setup and understand 123 | Drawbacks compared to 'ifrename' : 124 | - Less selectors that 'ifrename' 125 | - Only work for the scripts, other tools left confused 126 | Comments : 127 | o This method is conceptually simpler, and works 128 | well. It eliminates the two steps process of other methods (renaming ; 129 | configuring). 130 | o Unfortunately, this method only apply to the 131 | specific scripts, and not to the majority of the networking tools 132 | which are still based on interface name. This means that when the user 133 | use those other tools, he is left guessing which interface is which. 134 | o Distributions never never really embraced this 135 | method, as they all replaced the original Pcmcia scripts with one 136 | using the interfacename. 137 | 138 | Have fun... 139 | 140 | Jean 141 | 142 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Very important note : 2 | ------------------- 3 | This release of the Wireless Tools is not compatible with 4 | Wireless Extensions earlier than 9. Version 9 and 10 should work fine 5 | but are not recommended. Version 8 and earlier will not work. 6 | Kernels that support this version of the Wireless Tools are 7 | listed below. For all kernels before that, see at the end. 8 | 9 | You need : 10 | -------- 11 | o Compiler and development environment 12 | o A kernel supporting wireless extensions version 11 or higher 13 | -> from 2.4.4 onward (including 2.6.X) 14 | Note : CONFIG_NET_RADIO must be enabled 15 | o (Optional) A Pcmcia package supporting Wireless Extension 16 | o A driver supporting wireless extensions 17 | -> Check my web pages for status of various drivers. 18 | Note : more recent kernels and drivers are likely to support 19 | more wireless extension features... 20 | 21 | Compile wireless tools : 22 | ---------------------- 23 | In theory, a "make" should suffice to create the tools. 24 | 25 | Installation : 26 | ------------ 27 | "make install" should do the right thing for you, and install 28 | the tools, their library and the man pages. You can also uninstall the 29 | tools via "make uninstall". 30 | Note that the default installation is in the directory 31 | '/usr/local/sbin'. This may not be in your path. Also, other version 32 | of the tools may exist on the system, so double check which version is 33 | the default and adjust your path as necessary. 34 | 35 | Create a local copy of the tools : 36 | -------------------------------- 37 | By default, the package is built with iwlib as a dynamic 38 | library, and the tool will expect to use the default version of libiw 39 | on the system. This means you can't use the tools until they are 40 | properly installed. 41 | If you just want to experiment with a "local" version of the 42 | tools, you may want to pass the BUILD_STATIC flag to Makefile. It will 43 | create a self contained version of the tools. 44 | ------------- 45 | make clean 46 | make BUILD_STATIC='y' 47 | ------------- 48 | The resulting binary can be used in the compilation directory 49 | or installed in any place you like. 50 | 51 | Other useful Makefile options : 52 | ----------------------------- 53 | PREFIX : where the tools will be installed (default : /usr/local) 54 | CC : Compiler to use (defaul : gcc) 55 | BUILD_STATIC : build tools with a static version of the wireless lib 56 | BUILD_NOLIBM : build tools without mathematical lib (slower) 57 | BUILD_STRIPPING : strip symbols from tools/lib. 58 | BUILD_WE_ESSENTIAL : remove less used and obsolete features. 59 | 60 | You can pass those options on the command line of make, or 61 | modify the top of the Makefile. You can also set them as environment 62 | variable, but this is not recommended. 63 | If you pass those options on the command line, you should pass 64 | the same command line options for all invocations of make ("make" and 65 | "make install"). 66 | 67 | Memory footprint reduction : 68 | -------------------------- 69 | The Wireless Tools are used in various embedded systems where 70 | memory footprint is a great concern. The Wireless Tools package offer 71 | multiple options to customise the compilation depending on the level 72 | of features you want. 73 | The list below details the must useful combinations of these 74 | options, from the largest footprint to the smallest. Footprint depend 75 | on lot's of factor and is purely indicative (version 29-pre7+, i386, 76 | glibc, gcc 3.3.5). 77 | 78 | 1) Static build 79 | Command line : make BUILD_STATIC='y' 80 | - : Largest footprint 81 | - : libiw not included (other third party tools may depend on it) 82 | Size : ~280 kB 83 | 84 | 2) Default build 85 | Command line : make 86 | + : Fully featured version of the tools 87 | - : Largest footprint (except for static version of tools) 88 | Size : ~190 kB (libiw : ~29 kB ; ifrename : ~29 kB) 89 | 90 | 3) Stripping (remove function symbols) 91 | Command line : make BUILD_STRIPPING='y' 92 | + : Fully featured version of the tools 93 | - : Still quite large 94 | Size : ~110 kB (libiw : ~23 kB ; ifrename : ~17 kB) 95 | 96 | 4) Multicall version (include stripping) 97 | Command line : make iwmulticall ; make install-iwmulticall 98 | + : Fully featured version of the tools 99 | + : Small 100 | - : libiw not included (other third party tools may depend on it) 101 | - : ifrename is not included 102 | Size : ~55 kB 103 | 104 | 5) Multicall + Essential 105 | Command line : make BUILD_WE_ESSENTIAL='y' iwmulticall 106 | + : Smaller 107 | - : Some less used features are left out 108 | - : libiw not included (other third party tools may depend on it) 109 | - : ifrename is not included 110 | Size : ~44 kB 111 | 112 | 6) iwconfig only + essential + static 113 | Command line : make BUILD_WE_ESSENTIAL='y' BUILD_STATIC='y' BUILD_STRIPPING='y' iwconfig 114 | + : Very small 115 | - : Very limited functionality : no scanning, no event, no iwpriv 116 | - : libiw not included (other third party tools may depend on it) 117 | - : ifrename is not included 118 | Size : ~28 kB 119 | 120 | Wireless headers (past history) : 121 | ------------------------------- 122 | Previous version of the Wireless Tools had to be compiled with 123 | the same version of Wireless Extension that the kernel was using, and 124 | that was a major source of troubles. 125 | Starting with version 27, Wireless Tools include all the ugly 126 | code to deal with any version of Wireless Extensions, so now you can 127 | compile a single "generic" version of the tools for any kernel. 128 | Well, there are some limits, Wireless Extensions earlier than 129 | v11 are not supported (v9 and v10 should work fine), and versions 130 | later than the latest definition in the package are not 131 | supported. Once compile, the command "iwconfig --version" should tell 132 | you that. 133 | Note that the previous option to make versioned installed of 134 | the tools no longer make sense and therefore is gone. 135 | 136 | Old kernel with older Wireless Extensions : 137 | ----------------------------------------- 138 | Kernel prior to 2.2.14 : Those kernels include Wireless 139 | Extensions v8 or earlier. Those versions don't have proper support for 140 | 802.11b, so are not very useful. You may want to consider upgrading. 141 | Kernel 2.2.19 to 2.2.25 : Those kernels include Wireless 142 | Extensions v10. The tools should mostly work with it, but many drivers 143 | won't. You can upgrade those kernel to WE v15 with a patch on my web 144 | page. 145 | Kernel 2.2.14 to 2.2.18 : Those kernels include Wireless 146 | Extensions v9. Same as above, you may want to upgrade to a later 2.2.X 147 | kernel and then apply the patch. 148 | Kernel 2.0.X : Those kernels include very old version of 149 | Wireless Extensions. Same deal as old 2.2.X kernels. 150 | 151 | Jean 152 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ## 2 | ## Please check the configurion parameters below 3 | ## 4 | 5 | ## Installation directory. By default, go in /usr/local. 6 | ## Distributions should probably use /, but they probably know better... 7 | ifndef PREFIX 8 | PREFIX = /usr/local 9 | endif 10 | 11 | ## Compiler to use (modify this for cross compile). 12 | CC = gcc 13 | ## Other tools you need to modify for cross compile (static lib only). 14 | AR = ar 15 | RANLIB = ranlib 16 | 17 | ## Uncomment this to build tools using static version of the library. 18 | ## Mostly useful for embedded platforms without ldd, or to create 19 | ## a local version (non-root). 20 | ## Standard distros should comment that option to save space and to 21 | ## build libiw.so used by third parties... 22 | BUILD_STATIC = y 23 | 24 | ## Uncomment this to build without using libm (less efficient). 25 | ## This is mostly useful for embedded platforms without maths. 26 | # BUILD_NOLIBM = y 27 | 28 | ## Uncomment this to strip binary from symbols. This reduce binary size. 29 | ## by a few percent but make debug worse... 30 | # BUILD_STRIPPING = y 31 | 32 | ## Uncomment this to build with only essential functionality. 33 | ## This leaves out the less used features and cut in half the tools. 34 | ## This is mostly useful for embedded platforms without limited feature needs. 35 | # BUILD_WE_ESSENTIAL = y 36 | 37 | # *************************************************************************** 38 | # ***** Most users should not need to change anything beyond this point ***** 39 | # *************************************************************************** 40 | 41 | # Version of the Wireless Tools 42 | WT_VERSION := $(shell sed -ne "/WT_VERSION/{s:\([^0-9]*\)::;p;q;}" < iwlib.h ) 43 | 44 | # Version of Wireless Extensions. 45 | WE_VERSION := $(shell sed -ne "/WE_VERSION/{s:\([^0-9]*\)::;p;q;}" < iwlib.h ) 46 | 47 | # Always use local header for wireless extensions 48 | WEXT_HEADER = wireless.$(WE_VERSION).h 49 | 50 | # Targets to build 51 | STATIC=libiw.a 52 | DYNAMIC=libiw.so.$(WT_VERSION) 53 | PROGS= iwconfig iwlist iwpriv iwspy iwgetid iwevent ifrename 54 | MANPAGES8=iwconfig.8 iwlist.8 iwpriv.8 iwspy.8 iwgetid.8 iwevent.8 ifrename.8 55 | MANPAGES7=wireless.7 56 | MANPAGES5=iftab.5 57 | EXTRAPROGS= macaddr iwmulticall 58 | 59 | # Composition of the library : 60 | OBJS = iwlib.o 61 | 62 | # Select which library to build and to link tool with 63 | ifdef BUILD_STATIC 64 | IWLIB=$(STATIC) 65 | IWLIB_INSTALL=install-static 66 | else 67 | IWLIB=$(DYNAMIC) 68 | IWLIB_INSTALL=install-dynamic 69 | endif 70 | 71 | # Standard name for dynamic library so that the dynamic linker can pick it. 72 | # We will just create a symbolic link to the real thing. 73 | DYNAMIC_LINK= libiw.so 74 | 75 | # Install directories 76 | INSTALL_DIR= $(PREFIX)/sbin 77 | INSTALL_LIB= $(PREFIX)/lib 78 | INSTALL_INC= $(PREFIX)/include 79 | INSTALL_MAN= $(PREFIX)/man 80 | 81 | # Various commands 82 | RM = rm -f 83 | RM_CMD = $(RM) *.BAK *.bak *.d *.o *.so ,* *~ *.a *.orig *.rej *.out 84 | LDCONFIG = ldconfig 85 | 86 | # Do we want to build with or without libm ? 87 | ifdef BUILD_NOLIBM 88 | LIBS= 89 | WELIB_FLAG= -DWE_NOLIBM=y 90 | else 91 | LIBS= -lm 92 | endif 93 | 94 | # Stripping or not ? 95 | ifdef BUILD_STRIPPING 96 | STRIPFLAGS= -Wl,-s 97 | else 98 | STRIPFLAGS= 99 | endif 100 | 101 | # Do we want to build with only essential functionality ? 102 | ifdef BUILD_WE_ESSENTIAL 103 | WEDEF_FLAG= -DWE_ESSENTIAL=y 104 | endif 105 | 106 | # Other flags 107 | CFLAGS=-Os -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow \ 108 | -Wpointer-arith -Wcast-qual -Winline -I. 109 | #CFLAGS=-O2 -W -Wall -Wstrict-prototypes -I. 110 | DEPFLAGS=-MMD 111 | XCFLAGS=$(CFLAGS) $(DEPFLAGS) $(WARN) $(HEADERS) $(WELIB_FLAG) $(WEDEF_FLAG) 112 | PICFLAG=-fPIC 113 | 114 | # Standard compilation targets 115 | all:: $(IWLIB) $(PROGS) 116 | 117 | %: %.o 118 | $(CC) $(LDFLAGS) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LIBS) 119 | %.o: %.c wireless.h 120 | $(CC) $(XCFLAGS) -c $< 121 | %.so: %.c wireless.h 122 | $(CC) $(XCFLAGS) $(PICFLAG) -c -o $@ $< 123 | 124 | iwconfig: iwconfig.o $(IWLIB) 125 | 126 | iwlist: iwlist.o $(IWLIB) 127 | 128 | iwpriv: iwpriv.o $(IWLIB) 129 | 130 | iwspy: iwspy.o $(IWLIB) 131 | 132 | iwgetid: iwgetid.o $(IWLIB) 133 | 134 | iwevent: iwevent.o $(IWLIB) 135 | 136 | ifrename: ifrename.o $(IWLIB) 137 | 138 | macaddr: macaddr.o $(IWLIB) 139 | 140 | # Always do symbol stripping here 141 | iwmulticall: iwmulticall.o 142 | $(CC) $(LDFLAGS) -Wl,-s $(XCFLAGS) -o $@ $^ $(LIBS) 143 | 144 | # It's a kind of magic... 145 | wireless.h: 146 | cp $(WEXT_HEADER) wireless.h 147 | 148 | # Compilation of the dynamic library 149 | $(DYNAMIC): $(OBJS:.o=.so) 150 | $(CC) -shared -o $@ -Wl,-soname,$@ $(STRIPFLAGS) $(LIBS) -lc $^ 151 | 152 | # Compilation of the static library 153 | $(STATIC): $(OBJS:.o=.so) 154 | $(RM) $@ 155 | $(AR) cru $@ $^ 156 | $(RANLIB) $@ 157 | 158 | # Installation : So crude but so effective ;-) 159 | # Less crude thanks to many contributions ;-) 160 | install:: $(IWLIB_INSTALL) install-bin install-hdr install-man 161 | 162 | # Install the dynamic library 163 | install-dynamic:: $(DYNAMIC) 164 | install -m 755 -d $(INSTALL_LIB) 165 | install -m 755 $(DYNAMIC) $(INSTALL_LIB) 166 | ln -sfn $(DYNAMIC) $(INSTALL_LIB)/$(DYNAMIC_LINK) 167 | @echo "*** Don't forget to add $(INSTALL_LIB) to /etc/ld.so.conf, and run ldconfig as root. ***" 168 | @$(LDCONFIG) || echo "*** Could not run ldconfig ! ***" 169 | 170 | # Install the static library 171 | install-static:: $(STATIC) 172 | install -m 755 -d $(INSTALL_LIB) 173 | install -m 644 $(STATIC) $(INSTALL_LIB) 174 | 175 | # All the binaries. Careful, no dependancy on install-dynamic 176 | install-bin:: all 177 | install -m 755 -d $(INSTALL_DIR) 178 | install -m 755 $(PROGS) $(INSTALL_DIR) 179 | 180 | # Headers to go with the wireless lib (dev) 181 | install-hdr:: wireless.h 182 | install -m 755 -d $(INSTALL_INC) 183 | install -m 644 iwlib.h $(INSTALL_INC) 184 | install -m 644 wireless.h $(INSTALL_INC) 185 | 186 | # How could you live without those manapages ? 187 | install-man:: 188 | for lang in . cs fr.*; do \ 189 | install -m 755 -d $(INSTALL_MAN)/$$lang/man8/; \ 190 | install -m 644 $$lang/$(MANPAGES8) $(INSTALL_MAN)/$$lang/man8/; \ 191 | install -m 755 -d $(INSTALL_MAN)/$$lang/man7/; \ 192 | install -m 644 $$lang/$(MANPAGES7) $(INSTALL_MAN)/$$lang/man7/; \ 193 | install -m 755 -d $(INSTALL_MAN)/$$lang/man5/; \ 194 | install -m 644 $$lang/$(MANPAGES5) $(INSTALL_MAN)/$$lang/man5/; \ 195 | done 196 | 197 | install-iwmulticall:: iwmulticall 198 | install -m 755 -d $(INSTALL_DIR) 199 | install -m 755 $< $(INSTALL_DIR)/iwconfig 200 | ( cd $(INSTALL_DIR) ; \ 201 | ln -f -s iwconfig iwlist ; \ 202 | ln -f -s iwconfig iwspy ; \ 203 | ln -f -s iwconfig iwpriv ; \ 204 | ln -f -s iwconfig iwgetid ) 205 | 206 | clean:: 207 | $(RM_CMD) 208 | 209 | realclean:: 210 | $(RM_CMD) 211 | $(RM) $(STATIC) $(DYNAMIC) $(PROGS) $(EXTRAPROGS) libiw* wireless.h 212 | 213 | uninstall:: 214 | for f in $(PROGS); do \ 215 | $(RM) $(INSTALL_DIR)/$$f; \ 216 | done 217 | $(RM) $(INSTALL_LIB)/$(STATIC) 218 | $(RM) $(INSTALL_LIB)/$(DYNAMIC) 219 | $(RM) $(INSTALL_LIB)/$(DYNAMIC_LINK) 220 | $(RM) $(INSTALL_INC)/iwlib.h 221 | $(RM) $(INSTALL_INC)/wireless.h 222 | for lang in . cs fr.*; do \ 223 | for f in $(MANPAGES8); do \ 224 | $(RM) $(INSTALL_MAN)/$$lang/man8/$$f; \ 225 | done; \ 226 | for f in $(MANPAGES7); do \ 227 | $(RM) $(INSTALL_MAN)/$$lang/man7/$$f; \ 228 | done; \ 229 | for f in $(MANPAGES5); do \ 230 | $(RM) $(INSTALL_MAN)/$$lang/man5/$$f; \ 231 | done; \ 232 | done 233 | 234 | # Include dependancies 235 | -include *.d 236 | -------------------------------------------------------------------------------- /PCMCIA.txt: -------------------------------------------------------------------------------- 1 | Pcmcia Wireless configuration 2 | ----------------------------- 3 | 4 | One of the most exciting things having happen after release 20 5 | is the addition of Wireless Tools support in the Pcmcia init 6 | scripts. Here is a quick intro on the subject... 7 | 8 | Pre-requisite : 9 | ------------- 10 | o Pcmcia package with Wireless Extension support : 3.1.15 onward 11 | o A driver with Wireless Extension support 12 | o The tools (iwconfig and co.) installed in the /usr/local/sbin 13 | or /usr/sbin 14 | 15 | Raylink driver : 16 | -------------- 17 | The Raylink driver as of 1.70 doesn't support writable 18 | Wireless Extensions, so enabling wireless.opts on this driver will 19 | make things worse. 20 | On the other hand, the latest version of the Raylink driver 21 | accepts Wireless Extensions at boot time, so the procedure described 22 | below will work. 23 | 24 | Distribution specific notes : 25 | --------------------------- 26 | Most modern distributions don't use wireless.opts and have 27 | their own procedure for wireless configuration, which is usually 28 | compatible with their configuration tools and work for non-Pcmcia 29 | devices. This is documented in DISTRIBUTIONS.txt. 30 | The procedure described here will work only with the original 31 | Pcmcia configuration scripts. If you use a precompiled package part of 32 | a distributions, this is usually not the case (see above). 33 | On the other hand, if you install the Pcmcia package in source 34 | form from the official Linux-Pcmcia web site, it will install the 35 | proper init scripts and those instructions will apply. 36 | 37 | Basic support : 38 | ------------- 39 | The file /etc/pcmcia/wireless.opts contains some templates for 40 | the most common drivers. Just fill in your card configuration in the 41 | template corresponding to your driver configuration. 42 | Then, to activate it, you just need to remove or comment the 4 43 | lines at the top of wireless.opts and restart the Pcmcia package. 44 | 45 | Things to take care of : 46 | The options of wireless.opts will be used directly as 47 | arguments of iwconfig. So, you need iwconfig, and you need to check 48 | the man page of iwconfig to know how to format them. 49 | A quick way to determine the correct options without 50 | restarting Pcmcia is to play a bit with iwconfig directly to see what 51 | is possible and what is the proper setup of the card and to copy that 52 | in wireless.opts. 53 | At the end of wireless.opts, there is also a generic template 54 | containing all the possible options and explaining their meaning. Not 55 | all of them are supported by all cards (actually, most cards support a 56 | limited subset of it). 57 | The current card templates are designed to match the MAC 58 | address of the card. Please check that this matches with your card. 59 | Also, sample describe the most common/useful options available 60 | with the card, for more advance option, borrow options from the 61 | template. You can also remove some options, the card will usually 62 | initialise with a sane value. 63 | 64 | Alternatively, you can also discard the current wireless.opts 65 | and replace it with a file looking like this : 66 | ----------- wireless.opts --------------------- 67 | case "$ADDRESS" in 68 | *,*,*,*) 69 | ESSID="MY_ESSID" 70 | MODE="Managed" 71 | ;; 72 | esac 73 | ----------------------------------------------- 74 | 75 | 76 | Scheme support : 77 | -------------- 78 | The file wireless.opts fully supports schemes. This allow you 79 | to define different configurations (home, work...) and to switch on 80 | the fly between them. 81 | The best way to explain it is to show an example. 82 | Let's say you have an infrastructured setup at work (MY_WORK) 83 | and an Ad-Hoc network at home (MY_HOME). Moreover, when a specific card 84 | is inserted, you want it to be in Ad-Hoc mode (TEST). The work setup 85 | will be the default... 86 | 87 | Each Wireless LAN will have the following configuration : 88 | --------- wireless.opts -------------------- 89 | # Lucent Wavelan IEEE - Ad-Hoc mode for test card 90 | *,*,*,00:60:1D:03:9F:2D) 91 | ESSID="TEST" 92 | MODE="Ad-Hoc" 93 | FREQ="10" 94 | RATE="1M" 95 | ;; 96 | 97 | # Lucent Wavelan IEEE - Ad-Hoc mode at home 98 | home,*,*,00:60:1D:*|home,*,*,00:02:2D:*) 99 | ESSID="MY_HOME" 100 | MODE="Ad-Hoc" 101 | FREQ="5" 102 | ;; 103 | 104 | # Lucent Wavelan IEEE - infrastructured mode at work 105 | *,*,*,00:60:1D:*|*,*,*,00:02:2D:*) 106 | ESSID="MY_WORK" 107 | MODE="Managed" 108 | KEY="s:verysecurekey" 109 | ;; 110 | -------------------------------------------- 111 | 112 | Don't forget the IP configuration : 113 | --------- network.opts --------------------- 114 | # Wavelan IEEE : ad-hoc mode for test card 115 | *,*,*,00:60:1D:03:9F:2D) 116 | DHCP="n" 117 | IPADDR="10.0.0.1" 118 | NETMASK="255.255.255.0" 119 | NETWORK="10.0.0.0" 120 | BROADCAST="10.0.0.255" 121 | ;; 122 | 123 | # Wavelan IEEE : ad-hoc mode at home 124 | home,*,*,00:60:1D:*|home,*,*,00:02:2D:*) 125 | DHCP="n" 126 | IPADDR="10.0.1.19" 127 | NETMASK="255.255.255.0" 128 | NETWORK="10.0.1.0" 129 | BROADCAST="10.0.1.255" 130 | GATEWAY="15.0.1.1" 131 | ;; 132 | 133 | # Wavelan IEEE : infrastructured mode at work 134 | *,*,*,00:60:1D:*|*,*,*,00:02:2D:*) 135 | DHCP="y" 136 | ;; 137 | -------------------------------------------- 138 | 139 | Now, when you are at work you do : 140 | > cardctl scheme default 141 | And at home, you do : 142 | > cardctl scheme home 143 | 144 | I guess you get the idea ;-) 145 | 146 | More elaborated configurations : 147 | ------------------------------ 148 | Some people may need some more complex configurations. For 149 | example, you might want to do one of the following thing : 150 | o cycle through a set of schemes 151 | o autodetect the proper scheme 152 | There is currently no support to do that. However, the 153 | Wireless Tools package contains a tool called "iwgetid" that can help 154 | in this job. The source code contains some hints on how to achieve the 155 | above thing. 156 | If you ever write such a package, please send me the URL. 157 | Good luck ! 158 | 159 | 160 | Jean 161 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Wireless Tools & IfRename 2 | ------------------------- 3 | 4 | This package contains the Wireless tools, used to manipulate 5 | the Wireless Extensions. The Wireless Extensions is an interface 6 | allowing you to set Wireless LAN specific parameters and get the 7 | specific stats. 8 | It also contains the IfRename package, used for advance 9 | renaming of network interfaces. 10 | 11 | web page : 12 | -------- 13 | You'll find a lot of useful info on : 14 | http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html 15 | http://web.hpl.hp.com/personal/Jean_Tourrilhes/Linux/ 16 | 17 | Precompiled version : 18 | ------------------- 19 | Most Linux distributions offer precompiled package containing 20 | these tools. And many of them preinstall them by default. On the other 21 | hand, installation of this package is (now) easy and allows you to get 22 | a more up-to-date version. 23 | 24 | INSTALL 25 | ------- 26 | This file contains installation instructions and requirements. 27 | A *must*-read. 28 | 29 | DISTRIBUTION.txt 30 | ---------------- 31 | This file documents how to configure wireless cards at 32 | boot time with various Linux distributions (using Wireless 33 | Extensions). Please read it carefully before asking questions. 34 | In this file, I try to collect all the specifics of Wireless 35 | Extensions integration in the most common Linux distributions. I need 36 | your help to complete this file. 37 | 38 | HOTPLUG-UDEV.txt 39 | ---------------- 40 | This file documents how to manage and configure removable 41 | wireless cards using Hotplug or uDev. This is more advanced than the 42 | simple procedures of DISTRIBUTION.txt. This is currently mostly Debian 43 | specific, but I hope you will contribute for other distributions. 44 | 45 | PCMCIA.txt 46 | ---------- 47 | This file describes how to use PCMCIA init script to configure 48 | Wireless Extensions and how to use PCMCIA schemes. 49 | 50 | man pages (iwconfig.8, iwlist.8, iwpriv.8, iwspy.8) 51 | --------- 52 | VERY IMPORTANT : I try to keep the man pages up to date, so 53 | you'd better read them before asking questions. 54 | ALSO IMPORTANT : Those man pages describe the capacities of 55 | the tools, no device implements the full range (and drivers usually 56 | implement even less). 57 | 58 | As far as I know, the man pages are the most complete, up to 59 | date and accurate documentation of the wireless tools. An update of 60 | the web page related to Wireless Extensions is long overdue. Send 61 | feedback to me. 62 | The man pages can either be copied into a location where the 63 | command "man" will find them, such as /usr/local/man/man8, or can be 64 | read locally with the command : 65 | nroff -man xxx.8 | less 66 | 67 | localised man pages (fr.ISO8859-1/* ; fr.UTF-8/* ; cs/*) 68 | ------------------- 69 | Localised man pages are not made by me, therefore the only 70 | localisations available are those sent to me by courageous volonteers, 71 | and I expect those man pages to 'lag' compared to the english 72 | version (i.e. not have all the latest updates). Translating man pages 73 | is not a very gratifying task, especially due to my broken english, 74 | and many technical terms don't translate well to other languages, so 75 | refer to the english version when in doubt. 76 | 77 | iwconfig.c 78 | ---------- 79 | The main wireless tool. Used for device configuration and to see 80 | the most common wireless parameters. 81 | 82 | iwlist.c 83 | -------- 84 | Display some large chunk of information not displayed by iwconfig. 85 | For example, all bit rates, all frequencies, all keys... 86 | 87 | iwspy.c 88 | ------- 89 | Mobile IP support test and allows to get stats per MAC 90 | address (instead of globally). Also, for some drivers/devices, this is 91 | the only way to get stats in Ad-Hoc mode. 92 | 93 | iwpriv.c 94 | -------- 95 | Manipulate driver private ioctls : all parameters that are 96 | specific to a driver or a device and therefore not part of iwconfig. 97 | 98 | iwgetid.c 99 | --------- 100 | Output the ESSID or NWID of the specified device. 101 | Can also output it in a form that can be used as a PCMCIA Scheme. 102 | 103 | iwevent.c 104 | --------- 105 | Display Wireless Events. Most recent drivers will support this 106 | relatively new feature, but some older drivers may not support it. 107 | 108 | ifrename.c : 109 | ---------- 110 | Rename network interfaces based on various selectors. 111 | 112 | iwlib.c 113 | ------- 114 | The Wireless Tools helper library. May be useful if you want 115 | to create your own applications using Wireless Extensions. 116 | 117 | iwmulticall.c 118 | ------------- 119 | Multicall version of the tools for embedded systems. 120 | 121 | Changelog, contributions : 122 | ------------------------ 123 | See CHANGELOG.h 124 | 125 | wireless.h 126 | ---------- 127 | Definition of the Wireless Extensions. Remember that the 128 | definition used by the drivers and the tools must match, otherwise 129 | funny things may happen. The tools try to check for that. 130 | Since Wireless Extensions v12, you can no longer drop this 131 | file into your kernel headers to update the Wireless Extensions, you 132 | need to use the full patches available on my web page. So, the use is 133 | more if you plan to do some cross compile or something similar. 134 | Just for your enjoyment, there are various releases of it. If 135 | your kernel/drivers are old, you may want to try the older releases... 136 | 137 | sample_xxx.c : 138 | ------------ 139 | Various samples of code showing how to implement some of the 140 | more tricky features of Wireless Extensions in your driver. 141 | Note that there is no guarantee that this code compiles, let 142 | alone works, but it should point you in the proper direction. 143 | Also, have a look at existing drivers in the Linux kernel. 144 | 145 | 19-udev-ifrename.rules : 146 | ---------------------- 147 | udev rules to integrate properly ifrename (udev >= 107). 148 | 149 | iw26x_restore_full_essid.diff : 150 | ----------------------------- 151 | Current Linux kernel have a few bugs managing ESSID. These 152 | patches fix it. The first patch (iw261_...) is for kernel 2.6.19 to 153 | 2.6.21, the second patch (iw262_...) is for kernel 2.6.22 and later. 154 | 155 | Other tools : 156 | ----------- 157 | My web page lists many other tools using Wireless 158 | Extensions that you may find useful... 159 | http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html#links 160 | 161 | Other questions : 162 | --------------- 163 | You have the source, and it is documented. In 99% of cases, 164 | you will find your answer there. 165 | 166 | Good luck... 167 | 168 | Jean 169 | -------------------------------------------------------------------------------- /README.fr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/README.fr -------------------------------------------------------------------------------- /bin/ifrename: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/bin/ifrename -------------------------------------------------------------------------------- /bin/iwconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/bin/iwconfig -------------------------------------------------------------------------------- /bin/iwevent: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/bin/iwevent -------------------------------------------------------------------------------- /bin/iwgetid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/bin/iwgetid -------------------------------------------------------------------------------- /bin/iwlist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/bin/iwlist -------------------------------------------------------------------------------- /bin/iwmulticall: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/bin/iwmulticall -------------------------------------------------------------------------------- /bin/iwpriv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/bin/iwpriv -------------------------------------------------------------------------------- /bin/iwspy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/bin/iwspy -------------------------------------------------------------------------------- /bin/macaddr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/bin/macaddr -------------------------------------------------------------------------------- /cs/ifrename.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/cs/ifrename.8 -------------------------------------------------------------------------------- /cs/iftab.5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/cs/iftab.5 -------------------------------------------------------------------------------- /cs/iwconfig.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/cs/iwconfig.8 -------------------------------------------------------------------------------- /cs/iwevent.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/cs/iwevent.8 -------------------------------------------------------------------------------- /cs/iwgetid.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/cs/iwgetid.8 -------------------------------------------------------------------------------- /cs/iwlist.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/cs/iwlist.8 -------------------------------------------------------------------------------- /cs/iwpriv.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/cs/iwpriv.8 -------------------------------------------------------------------------------- /cs/iwspy.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/cs/iwspy.8 -------------------------------------------------------------------------------- /cs/wireless.7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/cs/wireless.7 -------------------------------------------------------------------------------- /fr.ISO8859-1/ifrename.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/fr.ISO8859-1/ifrename.8 -------------------------------------------------------------------------------- /fr.ISO8859-1/iftab.5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/fr.ISO8859-1/iftab.5 -------------------------------------------------------------------------------- /fr.ISO8859-1/iwconfig.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/fr.ISO8859-1/iwconfig.8 -------------------------------------------------------------------------------- /fr.ISO8859-1/iwevent.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/fr.ISO8859-1/iwevent.8 -------------------------------------------------------------------------------- /fr.ISO8859-1/iwgetid.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/fr.ISO8859-1/iwgetid.8 -------------------------------------------------------------------------------- /fr.ISO8859-1/iwlist.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/fr.ISO8859-1/iwlist.8 -------------------------------------------------------------------------------- /fr.ISO8859-1/iwpriv.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/fr.ISO8859-1/iwpriv.8 -------------------------------------------------------------------------------- /fr.ISO8859-1/iwspy.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/fr.ISO8859-1/iwspy.8 -------------------------------------------------------------------------------- /fr.ISO8859-1/wireless.7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriswebdev/android_wireless_tools/e39ba831e42d2f778c08a816ebac673f056993b6/fr.ISO8859-1/wireless.7 -------------------------------------------------------------------------------- /fr.UTF-8/ifrename.8: -------------------------------------------------------------------------------- 1 | .\" Jean II - HPL - 2004-2007 2 | .\" ifrename.8 3 | .\" 4 | .\" Traduction 2004/08/25 Maxime CHARPENNE (voir 5 | .\" http://www.delafond.org/traducmanfr/) 6 | .\" 1ère traduction : version 27-pre25 7 | .\" mise à jour 2007/08 : version 29-pre21 8 | .\" mise à jour 2007/10 : version 30-pre1 9 | .\" Mise à jour 2007/10/29 : version 30-pre3 10 | .\" 11 | .TH IFRENAME 8 "26 février 2007" "wireless-tools" "Manuel du programmeur Linux" 12 | .\" 13 | .\" NAME part 14 | .\" 15 | .SH NOM 16 | ifrename \- renomme les interfaces réseau basées sur différents critères 17 | statiques 18 | .\" 19 | .\" SYNOPSIS part 20 | .\" 21 | .SH SYNOPSIS 22 | .B "ifrename [-c fichierconfig] [-p] [-d] [-u] [-v] [-V] [-D] [-C]" 23 | .br 24 | .B "ifrename [-c fichierconfig] [-i interface] [-n nouveaunom]" 25 | .\" 26 | .\" DESCRIPTION part 27 | .\" 28 | .SH DESCRIPTION 29 | .B Ifrename 30 | est un outil vous permettant d'assigner un nom cohérent à chacune de vos 31 | interfaces réseau. 32 | .PP 33 | Par défaut, les noms d'interface sont dynamiques, et à chaque interface réseau 34 | est assigné le premier nom disponible 35 | .RI ( eth0 ", " eth1 "...)." 36 | L'ordre dans lequel les interfaces réseau sont créées peut varier. Pour les 37 | interfaces internes («\ built-in interfaces\ »), l'énumération du noyau au 38 | démarrage peut varier. Pour les interfaces amovibles, l'utilisateur peut les 39 | brancher dans n'importe quel ordre. 40 | .PP 41 | .B Ifrename 42 | permet à l'utilisateur de décider quel nom une interface réseau aura. 43 | .B Ifrename 44 | peut utiliser différents 45 | .I sélecteurs 46 | .RI "(«\ " selectors "\ »)" 47 | pour spécifier comment les noms d'interface correspondent aux interfaces réseau 48 | du système, le plus commun des sélecteurs étant 49 | .RI "l'" "adresse MAC" 50 | de l'interface. 51 | .PP 52 | .B Ifrename 53 | doit être lancé avant que les interfaces ne soient démarrées, raison pour 54 | laquelle il est surtout utile dans divers scripts (init, hotplug), mais il est 55 | rarement utilisé directement par l'utilisateur. Par défaut, 56 | .B ifrename 57 | renomme toutes les interfaces système présentes en utilisant les correspondances 58 | définies dans 59 | .IR /etc/iftab . 60 | .\" 61 | .\" PARAMETER part 62 | .\" 63 | .SH PARAMÈTRES 64 | .TP 65 | .BI "-c " fichierconfig 66 | Fixe le fichier de configuration à utiliser (par défaut 67 | .IR /etc/iftab ). 68 | Le fichier de configuration définit la correspondance entre les sélecteurs et 69 | les noms d'interface, et il est décrit dans 70 | .IR iftab (5). 71 | .br 72 | Si 73 | .I fichierconfig 74 | est «\ -\ », la configuration est lue depuis stdin. 75 | .TP 76 | .B -p 77 | Sonde (charge) les modules noyau avant de renommer les interfaces (NDT\ : 78 | .RI "«\ " p "robe\ »" 79 | en anglais). Par défaut, 80 | .B ifrename 81 | vérifie seulement les interfaces déjà chargées, et ne charge pas 82 | automatiquement les modules noyau requis. Cette option autorise une intégration 83 | en douceur dans les systèmes qui ne chargent pas les modules avant d'appeler 84 | .BR ifrename . 85 | .TP 86 | .B -d 87 | Active divers bidouillages spécifiques à la 88 | .BR Debian . 89 | Combiné avec 90 | .BR -p , 91 | seuls les modules pour les interfaces spécifiées dans 92 | .I /etc/network/interface 93 | sont chargés. 94 | .TP 95 | .BI "-i " interface 96 | Renomme seulement 97 | .RI "l'" interface 98 | spécifiée, par opposition à toutes les interfaces présentes sur le système. Le 99 | nouveau nom de l'interface est affiché. 100 | .TP 101 | .BI "-n " nouveaunom 102 | Si utilisé avec 103 | .IR -i , 104 | spécifie le nouveau nom de l'interface. La liste des correspondances depuis le 105 | fichier de configuration est ignorée, l'interface spécifié avec 106 | .I -i 107 | est directement renommée en 108 | .IR nouveaunom . 109 | Le nouveau nom peut être un joker («\ wildcard\ ») qui contient une seule '*'. 110 | .br 111 | Si utilisé sans 112 | .IR -i , 113 | renomme les interfaces en utilisant seulement les correspondances qui les 114 | renommeraient en 115 | .IR nouveaunom . 116 | Le nouveau nom ne peut pas être un joker. Cette utilisation de ifrename est 117 | déconseillée car inefficace 118 | .RI ( -n " sans " -i ). 119 | Toutes les interfaces du système ont besoin d'être traitée à chaque invocation, 120 | donc dans la plupart des cas il n'est pas plus rapide de simplement laisser 121 | ifrename les renommer toutes (sans les deux 122 | .IR -n " et " -i ). 123 | .TP 124 | .B -t 125 | Active le support de l'absorption («\ takover\ ») de nom. Cela permet 126 | d'échanger un nom d'interface entre deux interfaces ou plus. 127 | .br 128 | L'absorption permet à une interface de «\ voler\ » le nom d'une autre 129 | interface. Cela fonctionne seulement avec le noyau 2.6.X et si l'autre 130 | interface est désactivée. En conséquence, ce n'est pas compatible avec Hotplug. 131 | L'autre interface se voit assigner un nom aléatoire, mais peut être renommée 132 | plus tard avec 133 | .BR ifrename . 134 | .br 135 | Le nombre d'absorptions est limité pour éviter les boucles circulaires, et donc 136 | certaines situations d'échanges de noms complexes ne seront pas complètement 137 | traitées. 138 | .br 139 | Dans tous les cas, l'échange de noms et l'utilisation de cette caractéristique 140 | sont découragés, et vous êtes invités à choisir des noms uniques et sans 141 | ambiguïté pour vos interfaces... 142 | .TP 143 | .B -u 144 | Active le mode de sortie 145 | .IR udev . 146 | Cela permet une intégration propre de 147 | .B ifrename 148 | dans le framework 149 | .IR udev , 150 | .BR udevd (8) 151 | utilisera 152 | .B ifrename 153 | pour assigner les noms d'interfaces présents dans 154 | .IR /etc/iftab . 155 | Dans ce mode, la sortie de ifrename peut être analysée («\ parsed\ ») 156 | directement par 157 | .BR udevd (8) 158 | en tant qu'une action IMPORT. Cela nécessite la version 107 ou plus de 159 | .IR udev . 160 | .TP 161 | .B -D 162 | Mode «\ dry-run\ ». Ifrename ne changera aucune interface et affichera seulement 163 | les nouveaux noms d'interface, si applicable, et sortira. 164 | .br 165 | Dans le mode «\ dry-run\ », le nom joker d'interface est résolu. Le nouveau nom 166 | d'interface est affiché, même s'il est identique à l'ancien. 167 | .br 168 | Faire aussi attention que certains sélecteurs peuvent seulement être lus par 169 | root, (par exemple ceux basés sur 170 | .BR ethtool ), 171 | et ifrename échouera en silence s'il est lancé par un utilisateur normal. En 172 | d'autres termes, le mode «\ dry-run\ » lancé par un utilisateur standard ne 173 | donnera pas forcément le résultat attendu. 174 | .TP 175 | .B -V 176 | Mode verbeux. Ifrename affichera les résultats de l'analyse de son fichier de 177 | configuration et de l'interrogation des séleceurs d'interfaces. Combiné avec 178 | l'option 179 | .RI "«\ " dry-run "\ »," 180 | c'est une bonne manière de déboguer des configurations 181 | complexes ou des problèmes triviaux. 182 | .TP 183 | .B -C 184 | Compte les interfaces qui correspondent. Affiche le nombre d'interfaces 185 | qui correspondent et le retourne comme code retour de ifrename. 186 | .br 187 | Le nombre d'interfaces qui correspondent est le nombre d'interfaces du système 188 | pour lesquelles un lien a été trouvé dans le fichier de config (qui est 189 | différent du numéro de l'interface renommée). 190 | .\" 191 | .\" AUTHOR part 192 | .\" 193 | .SH AUTEUR 194 | Jean Tourrilhes \- jt@hpl.hp.com 195 | .\" 196 | .\" TRADUCTION part 197 | .\" 198 | .SH TRADUCTION 199 | Maxime CHARPENNE, octobre 2007 (wireless_tools.30-pre3). 200 | .\" 201 | .\" AVERTISSEMENT part 202 | .\" 203 | .SH AVERTISSEMENT SUR LA TRADUCTION 204 | Il est possible que cette traduction soit imparfaite ou périmée. En cas de 205 | doute, veuillez vous reporter au document original en langue anglaise fourni 206 | avec le programme. 207 | .\" 208 | .\" FILES part 209 | .\" 210 | .SH FICHIERS 211 | .I /etc/iftab 212 | .\" 213 | .\" SEE ALSO part 214 | .\" 215 | .SH VOIR AUSSI 216 | .BR ifconfig (8), 217 | .BR ip (8), 218 | .BR iftab (5). 219 | -------------------------------------------------------------------------------- /fr.UTF-8/iftab.5: -------------------------------------------------------------------------------- 1 | .\" Jean II - HPL - 2004-2007 2 | .\" iftab.5 3 | .\" 4 | .\" Traduction 2004/08/25 Maxime CHARPENNE (voir 5 | .\" http://www.delafond.org/traducmanfr/) 6 | .\" 1ère traduction : version 27-pre25 7 | .\" Mise à jour 2007/09 : version 29-pre21 8 | .\" Mise à jour 2007/10 : version 30-pre1 9 | .\" Mise à jour 2007/10/29 : version 30-pre3 10 | .\" 11 | .TH IFTAB 5 "26 février 2007" "wireless-tools" "Manuel du Programmeur Linux" 12 | .\" 13 | .\" NAME part 14 | .\" 15 | .SH NOM 16 | iftab \- informations statiques sur les interfaces réseau 17 | .\" 18 | .\" DESCRIPTION part 19 | .\" 20 | .SH DESCRIPTION 21 | Le fichier 22 | .B /etc/iftab 23 | contient de l'information descriptive à propos des diverses interfaces réseau. 24 | .B iftab 25 | n'est utilisé que par le programme 26 | .IR ifrename (8) 27 | pour assigner un nom d'interface réseau cohérent à chaque interface réseau. 28 | .PP 29 | .B /etc/iftab 30 | définit un ensemble de 31 | .IR correspondances " («\ " mappings "\ »)." 32 | Chaque correspondance contient un nom d'interface et un ensemble de sélecteurs 33 | («\ selectors\ »). Les sélecteurs permettent à 34 | .B ifrename 35 | d'identifier chaque interface réseau du système. Si une interface réseau 36 | correspond à tous les descripteurs d'une correspondance, 37 | .B ifrename 38 | essaye de changer le nom de l'interface par le nom de l'interface donné dans la 39 | correspondance. 40 | .\" 41 | .\" MAPPINGS part 42 | .\" 43 | .SH CORRESPONDANCES («\ MAPPINGS\ ») 44 | Chaque correspondance est décrite sur une ligne distincte, elle commence avec 45 | .IR "interface name" " (nom d'interface)," 46 | et contient un ensemble de 47 | .RI "descripteurs («\ " descriptors "\ »)," 48 | séparés par des espaces ou des tabulations. 49 | .PP 50 | La relation entre les descripteurs d'une correspondance est un 51 | .IR "et logique" . 52 | Une correspondance s'applique à une interface réseau seulement si tous les 53 | descripteurs s'appliquent. Si une interface réseau ne supporte pas un 54 | descripteur particulier, elle ne s'appliquera à aucune correspondance qui 55 | utilise ce descripteur. 56 | .PP 57 | Si vous voulez utiliser des descripteurs alternatifs pour un nom d'interface 58 | (ou logique), spécifiez deux correspondances différentes avec le même nom 59 | d'interface (une par ligne). 60 | .B Ifrename 61 | utilise toujours la première correspondance en commençant par la 62 | .I fin 63 | de 64 | .BR iftab , 65 | donc les correspondances les plus restrictives devraient être définies en 66 | dernier. 67 | .\" 68 | .\" INTERFACE NAME part 69 | .\" 70 | .SH NOM D'INTERFACE 71 | La première partie de chaque correspondance est un nom d'interface. Si une 72 | interface réseau correspond à tous les descripteurs d'une correspondance, 73 | .B ifrename 74 | essaye de changer le nom de l'interface par le nom de l'interface donné dans la 75 | correspondance. 76 | .PP 77 | Le nom de l'interface d'une correspondance est soit un nom d'interface complet 78 | (comme 79 | .IR eth2 " ou " wlan1 ) 80 | soit un motif de nom d'interface contenant un seul caractère joker (comme 81 | .IR eth* " ou " wlan* ). 82 | Dans le cas d'un caractère joker («\ wildcard\ »), le noyau remplace le 83 | caractère '*' par le plus petit entier disponible faisant un nom d'interface 84 | unique. Le caractère joker est supporté seulement pour les noyaux 2.6.1 et 85 | 2.4.30 et plus. 86 | .PP 87 | Il est déconseillé d'essayer de faire correspondre des interfaces à des noms 88 | d'interface par défaut tels que 89 | .IR eth0 ", " wlan0 " or " ppp0 . 90 | Le noyau les utilise comme nom par défaut pour toute nouvelle interface, 91 | il est donc très probable qu'une interface portant ce nom existe déjà et 92 | empêche ifrename de les utiliser. Même si vous utilisez ces noms, l'interface 93 | peut déjà être active dans certains cas. Ne pas utiliser ces noms permettra de 94 | détecter sur le champ les interfaces non configurées ou les nouvelles 95 | interfaces. 96 | .br 97 | Les bons noms sont uniques et significatifs, comme 98 | .IR mondsl " or " hubprive , 99 | ou utilisez de plus grand nombre entier, comme 100 | .IR eth5 " or " wlan5 . 101 | Le second type est habituellement plus facile à intégrer dans divers 102 | utilitaires réseau. 103 | .\" 104 | .\" DESCRIPTORS part 105 | .\" 106 | .SH DESCRIPTEURS («\ DESCRIPTORS\ ») 107 | Chaque descripteur est composé d'un nom de descripteur et d'une valeur de 108 | descripteur. Les descripteurs spécifie un attribut statique d'une interface 109 | réseau, le but étant d'identifier de manière unique chaque matériel. 110 | .PP 111 | La plupart des utilisateurs n'utiliseront que le sélecteur 112 | .BR mac , 113 | malgré ses problèmes potentiels, d'autres sélecteurs conviennent à des 114 | paramétrages plus spécialisés. La plupart des sélecteurs acceptent '*' dans la 115 | valeur du sélecteur pour correspondance joker, et la plupart des sélecteurs 116 | sont indifférents à la casse des caractères. 117 | .TP 118 | .BI mac " adresse mac" 119 | Correspond à l'Adresse MAC de l'interface avec l'adresse MAC spécifiée. 120 | L'adresse MAC de l'interface peut être montrée en utilisant 121 | .IR ifconfig (8) 122 | ou 123 | .IR ip (8). 124 | .br 125 | C'est le plus commun des sélecteurs, vu que chaque interface possède une 126 | adresse MAC unique, ce qui permet de les identifier sans ambigüité. 127 | Malgré tout, certaines interfaces n'ont pas d'adresse MAC valide tant qu'elles 128 | ne sont pas activées\ ; dans certains cas, utiliser ce sélecteur est pertinent 129 | ou impossible. 130 | .TP 131 | .BI arp " type arp" 132 | Fait correspondre le Type ARP («\ ARP Type\ ») (aussi appelé «\ Link Type\ ») 133 | de l'interface avec le type ARP spécifié par un nombre. Le Type ARP de 134 | l'interface peut être montré en utilisant 135 | .IR ifconfig (8) 136 | ou 137 | .IR ip (8), 138 | le type 139 | .B link/ether 140 | correspond à 141 | .B 1 142 | et le type 143 | .B link/ieee802.11 144 | correspond à 145 | .BR 801 . 146 | .br 147 | Ce sélecteur est utile quand un pilote crée plusieurs interfaces réseau pour 148 | une seule carte réseau. 149 | .TP 150 | .BI driver " nom de pilote" 151 | Fait correspondre le Nom de Pilote («\ Driver Name\ ») de l'interface avec le 152 | nom de pilote spécifié. Le Nom de Pilote de l'interface peut être montré en 153 | utilisant 154 | .IR "ethtool -i" (8). 155 | .TP 156 | .BI businfo " information de bus" 157 | Fait correspondre l'Information de Bus («\ Bus Information\ ») de l'interface 158 | avec l'information de bus spécifiée. L'Information de Bus de l'interface peut 159 | être montrée en utilisant 160 | .IR "ethtool -i" (8). 161 | .TP 162 | .BI firmware " version firmware " 163 | Fait correspondre la Version Firmware («\ Firmware Revision\ ») de l'interface 164 | avec l'information de la version firmware. La Version Firmware de l'interface 165 | peut être montrée en utilisant 166 | .IR "ethtool -i" (8). 167 | .TP 168 | .BI baseaddress " addresse de base" 169 | Fait correspondre l'Adresse de Base («\ Base Address\ ») de l'interface avec 170 | l'adresse de base spécifiée. L'Adresse de Base de l'interface peut être montrée 171 | en utilisant 172 | .IR ifconfig (8). 173 | .br 174 | Ce sélecteur n'est utile que pour les cartes ISA et EISA car la plupart des 175 | cartes utilisent l'allocation dynamique pour l'Adresse de Base. 176 | .TP 177 | .BI irq " ligne irq" 178 | Fait correspondre la Ligne IRQ (interruption) de l'interface avec la ligne IRQ 179 | spécifiée. La Ligne IRQ de l'interface peut être montrée en utilisant 180 | .IR ifconfig (8). 181 | .br 182 | Ce sélecteur n'est habituellement pas suffisant pour identifier de manière 183 | unique une interface, car les Lignes IRQ peuvent être partagées. 184 | .TP 185 | .BI iwproto " protocole wireless" 186 | Fait correspondre le Protocole Wireless de l'interface avec le protocole 187 | wireless spécifié. Le Protocole Wireless de l'interface peut être montré 188 | en utilisant 189 | .IR iwconfig (8), 190 | ou 191 | .IR iwgetid (8). 192 | .br 193 | Ce sélecteur n'est valable que pour les interfaces wireless et n'est pas 194 | suffisant pour en identifier une de manière unique. 195 | .TP 196 | .BI pcmciaslot " prise pcmcia " 197 | Fait correspondre le numéro de Prise Pcmpcia («\ Pcmcia Socket \ ») de 198 | l'interface. Le numéro de Prise Pcmpcia de l'interface peut être montré en 199 | utilisant 200 | .IR "cardctl ident" (8). 201 | .br 202 | Ce sélecteur est habituellement supporté pour les cartes 16 bits seulement, 203 | pour les cartes 32 bits il est conseillé d'utiliser le sélecteur 204 | .BR businfo . 205 | .TP 206 | .BI prevname " nom interface précédent" 207 | Fait correspondre le nom de l'interface avant qu'elle soit renommée avec 208 | le nom précédent spécifié. 209 | .br 210 | Ce sélecteur devrait être évité car le nom précédent de l'interface peut varier 211 | en fonction de diverses conditions. Une mise à jour système/noyau/pilote peut 212 | changer le nom original. Dès lors, ifrename ou un autre utilitaire peut la 213 | renommer avant l'exécution de ce sélecteur. 214 | .TP 215 | .BI SYSFS{ nomfichier } " valeur" 216 | Fait correspondre le contenu de l'attribut sysfs donné par nomfichier avec la 217 | valeur spécifiée. Pour les liens symboliques et les répertoires parents, fait 218 | correspondre le nom réel du répertoire de l'attribut sysfs donné par nomfichier 219 | avec la valeur spécifiée. 220 | .br 221 | Une liste des attributs sysfs les plus utiles est donnée dans la section 222 | suivante. 223 | .\" 224 | .\" SYSFS DESCRIPTORS part 225 | .\" 226 | .SH DESCRIPTEURS SYSFS 227 | Sur la plupart des systèmes, les attributs sysfs pour une carte donnée sont 228 | situés dans le répertoire nommé après cette interface dans 229 | .IR /sys/class/net/ . 230 | La plupart des attributs sysfs sont des fichiers, et leurs valeurs peuvent 231 | être lues en utilisant 232 | .IR cat "(1) ou " more (1). 233 | Il est aussi possible de faire des correspondances dans les attributs des 234 | sous-répertoires. 235 | .PP 236 | Certains attributs sysfs sont des liens symboliques qui pointent vers d'autres 237 | répertoires sysfs. Si l'attribut nomfichier est un lien symbolique, l'attribut 238 | sysfs sera résolu avec le nom du répertoire pointé par le lien en utilisant 239 | .IR readlink (1). 240 | La localisation du répertoire dans l'arborescence sysfs est importante aussi. 241 | Si l'attribut nomfichier fini par 242 | .IR /.. , 243 | l'attribut sysfs sera résolu avec le nom réel du répertoire parent en utilisant 244 | .IR pwd (1). 245 | .PP 246 | Le système de fichier sysfs est supporté seulement avec les noyaux 2.6.X et a 247 | besoin d'être monté (habituellement dans 248 | .IR /sys ). 249 | Les sélecteurs sysfs ne sont pas aussi efficaces que les autres sélecteurs, et 250 | ne devraient donc pas être employés pour le maximum de performance. 251 | .PP 252 | Ci-après les attributs sysfs communs et leurs descripteurs ifrename équivalents. 253 | .TP 254 | .BI SYSFS{address} " valeur" 255 | Comme le descripteur 256 | .BR mac . 257 | .TP 258 | .BI SYSFS{type} " valeur" 259 | Comme le descripteur 260 | .BR arp . 261 | .TP 262 | .BI SYSFS{device} " valeur" 263 | Valable seulement jusqu'au noyau 2.6.20. Comme le sélecteur 264 | .BR businfo . 265 | .TP 266 | .BI SYSFS{..} " valeur" 267 | Valable seulement depuis le noyau 2.6.21. Comme le sélecteur 268 | .BR businfo . 269 | .TP 270 | .BI SYSFS{device/driver} " valeur" 271 | Valable seulement jusqu'au noyau 2.6.20. Comme le sélecteur 272 | .BR driver . 273 | .TP 274 | .BI SYSFS{../driver} " valeur" 275 | Valable seulement depuis le noyau 2.6.21. Comme le sélecteur 276 | .BR driver . 277 | .TP 278 | .BI SYSFS{device/irq} " valeur" 279 | Valable seulement jusqu'au noyau 2.6.20. Comme le sélecteur 280 | .BR irq . 281 | .TP 282 | .BI SYSFS{../irq} " valeur" 283 | Valable seulement depuis le noyau 2.6.21. Comme le sélecteur 284 | .BR irq . 285 | .\" 286 | .\" EXAMPLES part 287 | .\" 288 | .SH EXEMPLES 289 | # Ceci est un commentaire 290 | .br 291 | eth2 mac 08:00:09:DE:82:0E 292 | .br 293 | eth3 driver wavelan interrupt 15 baseaddress 0x390 294 | .br 295 | eth4 driver pcnet32 businfo 0000:02:05.0 296 | .br 297 | air* mac 00:07:0E:* arp 1 298 | .br 299 | myvpn SYSFS{address} 00:10:83:* SYSFS{type} 1 300 | .br 301 | bcm* SYSFS{device} 0000:03:00.0 SYSFS{device/driver} bcm43xx 302 | .br 303 | bcm* SYSFS{..} 0000:03:00.0 SYSFS{../driver} bcm43xx 304 | .\" 305 | .\" AUTHOR part 306 | .\" 307 | .SH AUTEUR 308 | Jean Tourrilhes \- jt@hpl.hp.com 309 | .\" 310 | .\" TRADUCTION part 311 | .\" 312 | .SH TRADUCTION 313 | Maxime CHARPENNE, octobre 2007 (wireless_tools.30-pre3). 314 | .\" 315 | .\" AVERTISSEMENT part 316 | .\" 317 | .SH AVERTISSEMENT SUR LA TRADUCTION 318 | Il est possible que cette traduction soit imparfaite ou périmée. En cas de 319 | doute, veuillez vous reporter au document original en langue anglaise fourni 320 | avec le programme. 321 | .\" 322 | .\" FILES part 323 | .\" 324 | .SH FICHIERS 325 | .I /etc/iftab 326 | .\" 327 | .\" SEE ALSO part 328 | .\" 329 | .SH VOIR AUSSI 330 | .BR ifrename (8), 331 | .BR ifconfig (8), 332 | .BR ip (8), 333 | .BR ethtool (8), 334 | .BR iwconfig (8). 335 | -------------------------------------------------------------------------------- /fr.UTF-8/iwevent.8: -------------------------------------------------------------------------------- 1 | .\" Jean Tourrilhes - HPL - 2002 - 2004 2 | .\" iwevent.8 3 | .\" 4 | .\" Traduction 2003/08/17 Maxime CHARPENNE (voir 5 | .\" http://www.delafond.org/traducmanfr/) 6 | .\" 1ère traduction : version 26 7 | .\" Manuel identique pour la version 27-pre9 (beta) 8 | .\" Mise à jour 2004/02/26 : version 27-pre11 (alpha) 9 | .\" Mise à jour 2004/08/23 : version 27-pre25 10 | .\" Mise à jour 2007/08 : version 29-pre21 11 | .\" Mise à jour 2007/10 : version 30-pre1 12 | .\" Mise à jour 2007/10/29 : version 30-pre3 13 | .\" 14 | .TH IWEVENT 8 "23 juin 2004" "net-tools" "Manuel du Programmeur Linux" 15 | .\" 16 | .\" NAME part 17 | .\" 18 | .SH NOM 19 | iwevent \- Affiche les Événements Wireless (Wireless Events) générés par les 20 | pilotes et les changements de paramètres. 21 | .\" 22 | .\" SYNOPSIS part 23 | .\" 24 | .SH SYNOPSIS 25 | .BI "iwevent " 26 | .br 27 | .\" 28 | .\" DESCRIPTION part 29 | .\" 30 | .SH DESCRIPTION 31 | .B iwevent 32 | affiche les «\ Wireless Events\ » (événements du système Wireless) reçus par le 33 | socket RTNetlink. Chaque ligne affiche le Wireless Event spécifique qui décrit 34 | ce qui s'est passé sur l'interface sans fil spécifiée. 35 | .br 36 | Cette commande ne prend aucun argument. 37 | .\" 38 | .\" DISPLAY part 39 | .\" 40 | .SH AFFICHAGE 41 | Il y a deux classes de Wireless Events. 42 | .PP 43 | La première classe regroupe les événements relatifs à un changement des 44 | paramètres du sans fil sur l'interface (typiquement fait par 45 | .B iwconfig 46 | ou un script appelant 47 | .BR iwconfig ). 48 | Seuls les paramètres qui peuvent entraîner une perturbation de la connectivité 49 | sont rapportés. Les événements actuellement rapportés changent un des paramètres 50 | suivants\ : 51 | .br 52 | .I " Network ID" 53 | .br 54 | .I " ESSID" 55 | .br 56 | .I " Frequency" 57 | .br 58 | .I " Mode" 59 | .br 60 | .I " Encryption" 61 | .br 62 | Tous ces événements seront générer sur toutes les interfaces sans fil par le 63 | sous-système «\ wireless\ » du noyau (mais seulement si le pilote a été converti 64 | à l'API du nouveau pilote). 65 | .PP 66 | La deuxième classe d'événements concerne ceux générés par le matériel, lorsque 67 | quelque chose arrive ou qu'une tâche s'est terminée. Ces événements incluent\ : 68 | .TP 69 | .B New Access Point/Cell address 70 | L'interface a joint un nouveau Point d'Accès ou Cellule Ad-Hoc, ou a perdu son 71 | association avec un de ces derniers. Il s'agit de la même adresse affichée par 72 | .BR iwconfig . 73 | .TP 74 | .B Scan request completed 75 | Une requête de balayage (scanning) a été achevée, les résultats du «\ scan\ » 76 | sont disponibles (voir 77 | .BR iwlist ). 78 | .TP 79 | .B Tx packet dropped 80 | Un paquet à destination de cette adresse a été rejeté car l'interface croit que 81 | ce nœud ne répond plus (habituellement, le seuil maximum des émissions de la 82 | couche MAC est atteint). C'est habituellement la première indication pouvant 83 | révéler que le nœud a quitté la cellule ou est hors de portée, mais cela peut 84 | être due à une atténuation ou une contention excessive. 85 | .TP 86 | .B Custom driver event 87 | Événement spécifique au pilote. Veuillez consulter la documentation du pilote. 88 | .TP 89 | .B Registered node 90 | L'interface a réussi à enregistrer un nouveau client/paire sans fil. Sera 91 | généré la plupart du temps quand l'interface agit comme un Point d'Accès (mode 92 | Master). 93 | .TP 94 | .B Expired node 95 | L'enregistrement d'un client/paire sur cette interface a expiré. Sera généré la 96 | plupart du temps quand l'interface agit comme un Point d'Accès (mode Master). 97 | .TP 98 | .B Spy threshold crossed 99 | La force du signal pour une des adresses de la «\ spy list\ » (NDT\ : voir 100 | iwspy(8)) est passé en-dessous du seuil bas, ou est passé au-dessus du seuil 101 | haut. 102 | .PP 103 | La plupart des pilotes wireless génèrent seulement un sous-ensemble de ces 104 | événements, pas tous. La liste exacte dépend de la combinaison spécifique 105 | matériel/pilote. Veuillez consulter la documentation du pilote pour les détails 106 | de ce qui les génèrent, et utilisez 107 | .IR iwlist (8) 108 | pour vérifier ce que le pilote supporte. 109 | .\" 110 | .\" AUTHOR part 111 | .\" 112 | .SH AUTEUR 113 | Jean Tourrilhes \- jt@hpl.hp.com 114 | .\" 115 | .\" TRADUCTION part 116 | .\" 117 | .SH TRADUCTION 118 | Maxime CHARPENNE, octobre 2007 (wireless_tools.30-pre3). 119 | .\" 120 | \" AVERTISSEMENT part 121 | .\" 122 | .SH AVERTISSEMENT SUR LA TRADUCTION 123 | Il est possible que cette traduction soit imparfaite ou périmée. En cas de 124 | doute, veuillez vous reporter au document original en langue anglaise fourni 125 | avec le programme. 126 | .\" 127 | .\" SEE ALSO part 128 | .\" 129 | .SH VOIR AUSSI 130 | .BR iwconfig (8), 131 | .BR iwlist (8), 132 | .BR iwspy (8), 133 | .BR iwpriv (8), 134 | .BR wireless (7). 135 | -------------------------------------------------------------------------------- /fr.UTF-8/iwgetid.8: -------------------------------------------------------------------------------- 1 | .\" Guus Sliepen - 2001 2 | .\" Completed and fixed up by Jean Tourrilhes - 2002-2003 3 | .\" iwgetid.8 4 | .\" 5 | .\" Traduction 2003/08/17 Maxime CHARPENNE (voir 6 | .\" http://www.delafond.org/traducmanfr/) 7 | .\" 1ère traduction : version 26 8 | .\" Mise à jour 2004/01/29 : version 27-pre9 (beta) 9 | .\" Manuel identique pour la version 27-pre11 (alpha) 10 | .\" Mise à jour 2004/08/23 : version 27-pre25 11 | .\" Manuel identique pour la version 29-pre21 12 | .\" Manuel identique pour la version 30-pre1 13 | .\" Manuel identique pour la version 30-pre3 14 | .\" 15 | .TH IWGETID 8 "02 décembre 2003" "wireless-tools" "Manuel du Programmeur Linux" 16 | .\" 17 | .\" NAME part 18 | .\" 19 | .SH NOM 20 | iwgetid \- Rapporte le ESSID, NWID ou l'Adresse de l'AP/Cell (Point d'Accès/\ 21 | Cellule) du réseau sans fil. 22 | .\" 23 | .\" SYNOPSIS part 24 | .\" 25 | .SH SYNOPSIS 26 | .BI "iwgetid " [interface] " [--raw] [--scheme] [--ap] [--freq]" 27 | .br 28 | .BI " [--mode] [--protocol] [--channel] 29 | .br 30 | .\" 31 | .\" DESCRIPTION part 32 | .\" 33 | .SH DESCRIPTION 34 | .B iwgetid 35 | est utilisé pour trouver le NWID, ESSID ou l'adresse de l'AP ou cellule du 36 | réseau sans fil utilisé présentement. L'information rapportée est la même 37 | que celle montrée par 38 | .BR iwconfig ", mais " iwgetid 39 | est plus facile à intégrer dans les scripts. 40 | .br 41 | Par défaut, 42 | .B iwgetid 43 | affichera 44 | .RI l' ESSID 45 | de la carte, et si la carte n'a pas d'ESSID, il affichera son 46 | .IR NWID . 47 | .br 48 | Le formatage par défaut de la sortie est embelli. 49 | .\" 50 | .\" OPTIONS part 51 | .\" 52 | .SH OPTIONS 53 | .TP 54 | .B --raw 55 | Cette option désactive l'embellissement de l'affichage de l'information. Cette 56 | option est orthogonale aux autres options (sauf 57 | .BR --scheme ), 58 | donc, avec la combinaison appropriée des options, il est possible d'afficher 59 | en brut l'ESSID, l'Adresse de l'AP ou le Mode. 60 | .br 61 | Ce format est idéal quand on stocke le résultat de iwgetid comme une variable 62 | dans les scripts 63 | .I Shell 64 | ou 65 | .IR Perl , 66 | ou pour passer le résultat comme argument sur la ligne de commande de 67 | .BR iwconfig . 68 | .TP 69 | .B --scheme 70 | Cette option est similaire à la précédente, elle désactive l'embellissement de 71 | l'affichage des données et supprime tous les caractères non alphanumériques 72 | (comme les caractères d'espacement, la ponctuation et les caractères de 73 | contrôle). 74 | .br 75 | La sortie résultante est un identifiant Pcmcia valide («\ Pcmcia scheme 76 | identifer\ ») (qui peut être utilisé comme argument de la commande 77 | .BR "cardctl scheme" ). 78 | Ce format est aussi idéal quand on utilise le résultat de iwgetid comme un 79 | sélecteur («\ selector\ ») dans les scripts 80 | .I Shell 81 | ou 82 | .IR Perl , 83 | ou comme un nom de fichier. 84 | .TP 85 | .B --ap 86 | Affiche l'adresse MAC du 87 | .I Point d'Access 88 | ou de la 89 | .I Cellule 90 | Wireless. 91 | .TP 92 | .B --freq 93 | Affiche la 94 | .I fréquence 95 | ou le 96 | .I canal 97 | courant utilisé par l'interface. 98 | .TP 99 | .B --channel 100 | Affiche le 101 | .IR canal " (" channel ) 102 | courant utilisé par l'interface. Le canal est déterminé en utilisant la 103 | fréquence courante et la liste de fréquences fournie par l'interface. 104 | .TP 105 | .B --mode 106 | Affiche le 107 | .I mode 108 | courant de l'interface. 109 | .TP 110 | .B --protocol 111 | Affiche le 112 | .I nom de protocole 113 | de l'interface. Il permet d'identifer toutes les cartes qui sont compatibles 114 | entre elles et qui acceptent le même type de configuration. 115 | .br 116 | Cela peut aussi être utilisé pour 117 | .I vérifier la compatibilité de Wireless Extension 118 | sur l'interface, car c'est le seul attribut que tous les pilotes supportant 119 | Wireless Extension doivent avoir. 120 | .\" 121 | .\" TRADUCTION part 122 | .\" 123 | .SH TRADUCTION 124 | Maxime CHARPENNE, octobre 2007 (wireless_tools.30-pre3). 125 | .\" 126 | \" AVERTISSEMENT part 127 | .\" 128 | .SH AVERTISSEMENT SUR LA TRADUCTION 129 | Il est possible que cette traduction soit imparfaite ou périmée. En cas de 130 | doute, veuillez vous reporter au document original en langue anglaise fourni 131 | avec le programme. 132 | .\" 133 | .\" SEE ALSO part 134 | .\" 135 | .SH VOIR AUSSI 136 | .BR iwconfig (8), 137 | .BR ifconfig (8), 138 | .BR iwspy (8), 139 | .BR iwpriv (8). 140 | -------------------------------------------------------------------------------- /fr.UTF-8/iwlist.8: -------------------------------------------------------------------------------- 1 | .\" Jean II - HPLB - 96 2 | .\" iwlist.8 3 | .\" 4 | .\" Traduction 2003/08/17 Maxime CHARPENNE (voir 5 | .\" http://www.delafond.org/traducmanfr/) 6 | .\" 1ère traduction : version 26 7 | .\" Mise à jour 2004/01/29 : version 27-pre9 (beta) 8 | .\" Manuel identique pour la version 27-pre11 (alpha) 9 | .\" Mise à jour 2004/08/23 : version 27-pre25 10 | .\" Mise à jour 2007/09 : version 29-pre21 11 | .\" Mise à jour 2007/10 : version 30-pre1 12 | .\" Mise à jour 2007/10/29 : version 30-pre3 13 | .\" 14 | .TH IWLIST 8 "13 avril 2006" "wireless-tools" "Manuel du Programmeur Linux" 15 | .\" 16 | .\" NAME part 17 | .\" 18 | .SH NOM 19 | iwlist \- Obtient plus d'informations wireless détaillées depuis une interface wireless 20 | .\" 21 | .\" SYNOPSIS part 22 | .\" 23 | .SH SYNOPSIS 24 | .BI "iwlist [" interface "] scanning" 25 | .br 26 | .BI "iwlist [" interface "] frequency" 27 | .br 28 | .BI "iwlist [" interface "] rate" 29 | .br 30 | .BI "iwlist [" interface "] keys" 31 | .br 32 | .BI "iwlist [" interface "] power" 33 | .br 34 | .BI "iwlist [" interface "] txpower" 35 | .br 36 | .BI "iwlist [" interface "] retry" 37 | .br 38 | .BI "iwlist [" interface "] event" 39 | .br 40 | .BI "iwlist [" interface "] auth" 41 | .br 42 | .BI "iwlist [" interface "] wpakeys" 43 | .br 44 | .BI "iwlist [" interface "] genie" 45 | .br 46 | .BI "iwlist [" interface "] modulation" 47 | .br 48 | .BI "iwlist --help" 49 | .br 50 | .BI "iwlist --version" 51 | .\" 52 | .\" DESCRIPTION part 53 | .\" 54 | .SH DESCRIPTION 55 | .B Iwlist 56 | est utilisé pour afficher de l'information additionnelle d'une interface réseau 57 | wireless qui n'est pas affichée par 58 | .IR iwconfig (8). 59 | L'argument principal est utilisé pour sélectionner une catégorie d'information, 60 | .B iwlist 61 | affiche dans une forme détaillée toute information relative à cette catégorie, 62 | y compris les informations déjà montrées par 63 | .IR iwconfig (8). 64 | .\" 65 | .\" PARAMETER part 66 | .\" 67 | .SH PARAMÈTRES 68 | .TP 69 | .BR scan [ning] 70 | Donne la liste des Points d'Accès et des cellules Ad-Hoc à portée, et 71 | optionnellement plein d'autres informations à leur propos (ESSID, Quality, 72 | Frequency, Mode...). Le type d'information retourné dépend de ce que la carte 73 | supporte. 74 | .br 75 | Le «\ Triggering scanning\ » est une opération nécessitant les privilèges 76 | de 77 | .IR root 78 | uniquement et les utilisateurs normaux peuvent juste lire les résultats 79 | («\ letf-over scan results\ »). Par défaut, la manière dont le scan est 80 | réalisé (la boucle du scan) dépend de la carte et de ses paramètres. 81 | .br 82 | Cette commande prend des arguments optionnels bien que la plupart des pilotes 83 | les ignoreront. L'option 84 | .B essid 85 | est utilisée pour appliquer le scan sur un ESSID donné. L'option 86 | .B last 87 | ne déclenche pas de scan et lit les résultats du scan («\ letf-over scan 88 | results\ »). 89 | .TP 90 | .BR freq [uency]/ channel 91 | Donne la liste des fréquences disponibles du périphérique et le nombre de canaux 92 | définis. Veuillez noter que, habituellement, le pilote retourne le nombre total 93 | de canaux et seulement les fréquences disponibles dans la région considérée, 94 | donc il n'y a pas correspondance directe entre le nombre de fréquences 95 | affichées et le nombre de canaux. 96 | .TP 97 | .BR rate / bit [rate] 98 | Liste les débits supportés par le périphérique (en b/s). 99 | .TP 100 | .BR keys / enc [ryption] 101 | Liste les tailles des clefs de cryptage supportées et liste toutes 102 | les clefs de cryptage paramétrées dans le périphérique. 103 | .TP 104 | .B power 105 | Liste les différents attributs et modes d'économie d'énergie («\ Power 106 | Management\ ») du périphérique. 107 | .TP 108 | .B txpower 109 | Liste les différentes puissances d'émission («\ Transmit Powers\ ») 110 | disponibles dans le périphérique. 111 | .TP 112 | .B retry 113 | Liste les limites des tentatives de transmissions («\ transmit retry limits\ ») 114 | et la durée de vie des tentatives («\ retry lifetime\ ») du périphériques 115 | (NDT\ : voir la section 116 | .B retry 117 | de iwconfig(8)). 118 | .TP 119 | .BR ap / accesspoint / peers 120 | Donne la liste des Points d'Accès à portée, et optionnellement la qualié de leur 121 | lien. Cette option est 122 | .B obsolète 123 | et est maintenant dépréciée en faveur du support scan (voir ci-dessus), et la 124 | plupart des pilotes ne le supporte pas. 125 | .br 126 | Quelques pilotes peuvent utiliser cette commande pour retourner une 127 | liste spécifique de Paires («\ Peers\ ») ou de Points d'Accès, telle que la 128 | liste des Paires associés/enregistrés avec la carte. Voir la documentation du 129 | pilote pour plus de détails. 130 | .TP 131 | .B event 132 | Liste les événements wireless supportés par le périphérique. 133 | .TP 134 | .B auth 135 | Liste les paramètres courants de l'authentification WPA. 136 | .TP 137 | .BR wpa [keys] 138 | Liste toutes les clefs de cryptage WPA paramétrées dans le matériel. 139 | .TP 140 | .B genie 141 | Liste les éléments génériques d'information («\ Generic Information Elements\ ») 142 | paramétrés dans le matériel (utilisés pour le support WPA). 143 | .TP 144 | .BR modu [lation] 145 | Liste les modulations supportées par le matériel et les modulations actuellement 146 | activées. 147 | .TP 148 | .B --version 149 | Affiche la version des outils, ainsi que les versions courante et recommandée 150 | des Wireless Extensions pour l'outil et les diverses interfaces sans fil. 151 | .TP 152 | .B --help 153 | Affiche un court message d'aide. 154 | .\" 155 | .\" TRADUCTION part 156 | .\" 157 | .SH TRADUCTION 158 | Maxime CHARPENNE, octobre 2007 (wireless_tools.30-pre3). 159 | .\" 160 | \" AVERTISSEMENT part 161 | .\" 162 | .SH AVERTISSEMENT SUR LA TRADUCTION 163 | Il est possible que cette traduction soit imparfaite ou périmée. En cas de 164 | doute, veuillez vous reporter au document original en langue anglaise fourni 165 | avec le programme. 166 | .\" 167 | .\" FILES part 168 | .\" 169 | .SH FICHIERS 170 | .I /proc/net/wireless 171 | .\" 172 | .\" SEE ALSO part 173 | .\" 174 | .SH VOIR AUSSI 175 | .BR iwconfig (8), 176 | .BR iwspy (8). 177 | .BR iwevent (8), 178 | .BR iwpriv (8), 179 | .BR wireless (7). 180 | 181 | -------------------------------------------------------------------------------- /fr.UTF-8/iwpriv.8: -------------------------------------------------------------------------------- 1 | .\" Jean II - HPLB - 96 2 | .\" iwpriv.8 3 | .\" 4 | .\" Traduction 2003/08/17 Maxime CHARPENNE (voir 5 | .\" http://www.delafond.org/traducmanfr/) 6 | .\" 1ère traduction : version 26 7 | .\" Manuel identique pour la version 27-pre9 (beta) 8 | .\" Manuel identique pour la version 27-pre11 (alpha) 9 | .\" Mise à jour 2007/09 : version 29-pre21 10 | .\" Mise à jour 2007/10 : version 30-pre1 11 | .\" Mise à jour 2007/10/29 : version 30-pre3 12 | .\" 13 | .TH IWPRIV 8 "31 octobre 1996" "net-tools" "Manuel du programmeur Linux" 14 | .\" 15 | .\" NAME part 16 | .\" 17 | .SH NOM 18 | iwpriv \- configure les paramètres optionnels (privés) d'une interface réseau 19 | sans fil 20 | .\" 21 | .\" SYNOPSIS part 22 | .\" 23 | .SH SYNOPSIS 24 | .BI "iwpriv [" interface ] 25 | .br 26 | .BI "iwpriv " "interface commande-privée " "[" paramètres-privés ] 27 | .br 28 | .BI "iwpriv " "interface commande-privée " [ I "] [" paramètres-privés ] 29 | .br 30 | .BI "iwpriv " interface " --all" 31 | .\" 32 | .\" DESCRIPTION part 33 | .\" 34 | .SH DESCRIPTION 35 | .B Iwpriv 36 | est l'outil à utiliser avec 37 | .IR iwconfig (8). 38 | .B Iwpriv 39 | traite les paramètres et attributs spécifiques à chaque pilote (contrairement 40 | à 41 | .I iwconfig 42 | qui ne s'occupe que des génériques). 43 | .PP 44 | Sans argument, 45 | .B iwpriv 46 | liste les commandes privées disponibles sur chaque interface, ainsi que les 47 | paramètres qu'elles requièrent. En utilisant ces informations, l'utilisateur 48 | peut appliquer ces commandes particulières sur les interfaces spécifiées. 49 | .PP 50 | En théorie, la documentation de chaque pilote devrait indiquer comment utiliser 51 | ces commandes spécifiques et leurs effets. 52 | .\" 53 | .\" PARAMETER part 54 | .\" 55 | .SH PARAMÈTRES 56 | .TP 57 | .IR commande-privée " [" paramètres-privés ] 58 | Exécute la 59 | .I commande-privée 60 | spécifiée sur l'interface. 61 | .br 62 | La commande peut éventuellement prendre ou nécessiter des arguments, et peut 63 | afficher de l'information. En conséquent, les paramètres de la ligne de 64 | commande peuvent ou peuvent ne pas être nécessaires et doivent correspondre 65 | aux besoins de la commande. La liste des commandes que 66 | .B iwpriv 67 | affiche (quand il est appelé sans paramètre) doit vous donner des indications 68 | sur ces paramètres. 69 | .br 70 | Cependant, vous devriez vous reporter à la documentation du pilote du matériel 71 | pour utiliser les commandes correctement et connaître leurs effets. 72 | .TP 73 | .IR "commande-privée " [ I "] [" paramètres-privés ] 74 | Idem, sauf que 75 | .I I 76 | (un entier) est passé à la commande en tant que 77 | .I "Token Index" 78 | (indication d'index). Seules quelques commandes utiliseront ce «\ Token 79 | Index\ » (la plupart l'ignoreront), et la documentation du pilote devrait 80 | préciser quand il est nécessaire. 81 | .TP 82 | .BR -a / --all 83 | Exécute et affiche toutes les commandes privées qui ne prennent aucun argument 84 | (c.-à-d. en lecture seule). 85 | .\" 86 | .\" DISPLAY part 87 | .\" 88 | .SH AFFICHAGE 89 | Pour chaque matériel qui supporte les commandes privées, 90 | .I iwpriv 91 | affichera la liste des commandes privées disponibles. 92 | .PP 93 | Cela inclut le nom de la commande privée, le nombre d'arguments qui peuvent 94 | être entrés et leur type, ainsi que le nombre d'arguments qui peuvent être 95 | affichés et leur type. 96 | .PP 97 | Par exemple, vous pouvez avoir l'affichage suivant\ : 98 | .br 99 | .B "eth0 Available private ioctl :" 100 | .br 101 | .B " setqualthr (89F0) : set 1 byte & get 0" 102 | .br 103 | .B " gethisto (89F7) : set 0 & get 16 int" 104 | .PP 105 | Cela veut dire que vous pouvez fixer le seuil de qualité et afficher un 106 | histogramme jusqu'à 16 valeurs avec les commandes suivantes\ : 107 | .br 108 | .I " iwpriv eth0 setqualthr 20" 109 | .br 110 | .I " iwpriv eth0 gethisto" 111 | .\" 112 | .\" AUTHOR part 113 | .\" 114 | .SH AUTHOR 115 | Jean Tourrilhes \- jt@hpl.hp.com 116 | .\" 117 | .\" TRADUCTION part 118 | .\" 119 | .SH TRADUCTION 120 | Maxime CHARPENNE, octobre 2007 (wireless_tools.30-pre3). 121 | .\" 122 | \" AVERTISSEMENT part 123 | .\" 124 | .SH AVERTISSEMENT SUR LA TRADUCTION 125 | Il est possible que cette traduction soit imparfaite ou périmée. En cas de 126 | doute, veuillez vous reporter au document original en langue anglaise fourni 127 | avec le programme. 128 | .\" 129 | .\" FILES part 130 | .\" 131 | .SH FILES 132 | .I /proc/net/wireless 133 | .\" 134 | .\" SEE ALSO part 135 | .\" 136 | .SH SEE ALSO 137 | .BR iwconfig (8), 138 | .BR iwlist (8), 139 | .BR iwevent (8), 140 | .BR iwspy (8), 141 | .BR wireless (7). 142 | -------------------------------------------------------------------------------- /fr.UTF-8/iwspy.8: -------------------------------------------------------------------------------- 1 | .\" Jean II - HPLB - 96 2 | .\" iwspy.8 3 | .\" 4 | .\" Traduction 2003/08/18 Maxime CHARPENNE (voir 5 | .\" http://www.delafond.org/traducmanfr/) 6 | .\" 1ère traduction : version 26 7 | .\" Manuel identique pour la version 27-pre9 (beta) 8 | .\" Manuel identique pour la version 27-pre11 (alpha) 9 | .\" Manuel identique pour la version 27-pre11 (alpha) 10 | .\" Mise à jour 2007/09 : version 29-pre21 11 | .\" Mise à jour 2007/10 : version 30-pre1 12 | .\" Mise à jour 2007/10/29 : version 30-pre3 13 | .\" 14 | .TH IWSPY 8 "31 octobre 1996" "net-tools" "Manuel du Programmeur Linux" 15 | .\" 16 | .\" NAME part 17 | .\" 18 | .SH NOM 19 | iwspy \- Obtenir des statistiques wireless depuis des noeuds donnés 20 | .\" 21 | .\" SYNOPSIS part 22 | .\" 23 | .SH SYNOPSIS 24 | .BI "iwspy [" interface ] 25 | .br 26 | .BI "iwspy " interface " [+] " DNSNAME " | " IPADDR " | " HWADDR " [...]" 27 | .br 28 | .BI "iwspy " interface " off" 29 | .br 30 | .BI "iwspy " interface " setthr " "low high" 31 | .br 32 | .BI "iwspy " interface " getthr" 33 | .\" 34 | .\" DESCRIPTION part 35 | .\" 36 | .SH DESCRIPTION 37 | .B Iwspy 38 | est utilisé pour fixer une liste d'adresses à surveiller sur une interface 39 | réseau sans fil, et obtenir des informations sur la qualité du lien pour 40 | chacune d'elles. Ces informations sont les mêmes que celles disponibles dans 41 | .IR /proc/net/wireless "\ :" 42 | qualité du lien, force du signal et niveau du bruit. 43 | .PP 44 | Ces informations sont mises à jour à chaque fois qu'un nouveau paquet est reçu, 45 | donc chaque adresse de la liste ajoute quelques précisions en plus. 46 | .PP 47 | Remarquez que cette fonctionnalité ne marche que pour les noeuds faisant partie 48 | de la cellule sans fil courante, vous ne pouvez pas surveiller un Point d'Accès 49 | avec lequel vous n'êtes pas associé (utiliser Scanning pour ça), ni les noeuds 50 | dans d'autres cellules. En mode Managed, les paquets sont souvent relayés par 51 | le Point d'Accès et, dans ce cas, vous obtiendrez la force du signal du Point 52 | d'Accès. Pour ces raisons cette fonctionnalité est surtout utile pour les 53 | modes Ad-Hoc et Master. 54 | .\" 55 | .\" PARAMETER part 56 | .\" 57 | .SH PARAMÈTRES 58 | Vous pouvez fixer jusqu'à 8 adresses. 59 | .TP 60 | .BR DNSNAME " | " IPADDR 61 | Paramètre une adresse IP, ou dans certains cas un nom DNS (en utilisant le 62 | «\ resolver\ » de nom). Comme le matériel fonctionne avec des adresses 63 | matérielles, 64 | .B iwspy 65 | traduira les adresses IP grâce à 66 | .IR ARP . 67 | Dans certains cas, cette adresse peut ne pas être dans le cache ARP et 68 | .B iwspy 69 | échouera. Dans cette situation, exécuter 70 | .IR ping (8) 71 | vers ces noms/adresses et réessayer. 72 | .TP 73 | .B HWADDR 74 | Paramètre une adresse matérielle (MAC) (cette adresse n'est pas traduite ni 75 | vérifée comme le sont les adresses IP). L'adresse doit contenir deux-points 76 | .RB ( : ) 77 | pour être reconnue comme une adresse matérielle. 78 | .TP 79 | .B + 80 | Ajoute un nouveau jeu d'adresses à la fin de la liste courante au lieu de la 81 | remplacer. La liste d'adresses est unique pour chaque carte, donc chaque 82 | utilisateur devrait utiliser cette option pour éviter les conflits. 83 | .TP 84 | .B off 85 | Enlève la liste d'adresses courante et désactive la fonctionnalité de 86 | surveillance. 87 | .TP 88 | .B setthr 89 | Fixe les seuils de force de signal 90 | .IR low " (bas) et " high " (haut)" 91 | pour les événements iwspy (pour les pilotes qui le supportent). 92 | .br 93 | Chaque fois que la force du signal, pour une des adresses contrôlées avec 94 | iwspy, passe au-dessous du seuil bas ou au-dessus du seuil haut, un Wireless 95 | Event est généré. 96 | .br 97 | Ceci peut être utilisé pour surveiller la qualité du lien sans avoir à lancer 98 | iwspy périodiquement. 99 | .TP 100 | .B getthr 101 | Récupère les seuils 102 | .IR low " (bas) et " high " (haut)" 103 | de la force du signal pour l'événement iwspy. 104 | .\" 105 | \" AVERTISSEMENT part 106 | .\" 107 | .SH AVERTISSEMENT SUR LA TRADUCTION 108 | Il est possible que cette traduction soit imparfaite ou périmée. En cas de 109 | doute, veuillez vous reporter au document original en langue anglaise fourni 110 | avec le programme. 111 | \" 112 | .\" FILES part 113 | .\" 114 | .SH FICHIERS 115 | .I /proc/net/wireless 116 | .\" 117 | .\" SEE ALSO part 118 | .\" 119 | .SH VOIR AUSSI 120 | .BR iwconfig (8), 121 | .BR iwlist (8), 122 | .BR iwevent (8), 123 | .BR iwpriv (8), 124 | .BR wireless (7). 125 | 126 | -------------------------------------------------------------------------------- /fr.UTF-8/wireless.7: -------------------------------------------------------------------------------- 1 | .\" Jean Tourrilhes - HPL - 2002 - 2004 2 | .\" wireless.7 3 | .\" 4 | .\" Traduction 2004/02/26 Maxime CHARPENNE (voir 5 | .\" http://www.delafond.org/traducmanfr/) 6 | .\" 1ère traduction : version 27-pre11 (alpha) 7 | .\" Mise à jour 2004/08/24 : version 27-pre25 8 | .\" Manuel identique pour la version 29-pre21 9 | .\" Manuel identique pour la version 30-pre1 10 | .\" Manuel identique pour la version 30-pre3 11 | .\" 12 | .TH WIRELESS 7 "4 mars 2004" "wireless-tools" "Manuel du Programmeur Linux" 13 | .\" 14 | .\" NAME part 15 | .\" 16 | .SH NOM 17 | wireless \- Wireless Tools et Wireless Extensions 18 | .\" 19 | .\" SYNOPSIS part 20 | .\" 21 | .SH SYNOPSIS 22 | .B iwconfig 23 | .br 24 | .B iwpriv \-a 25 | .br 26 | .\" 27 | .\" DESCRIPTION part 28 | .\" 29 | .SH DESCRIPTION 30 | Les 31 | .B Wireless Extensions 32 | sont une API vous permettant de manipuler les interfaces réseaux Wireless LAN. 33 | Ils sont composés d'une gamme d'outils et de fichiers de configuration. Ils sont 34 | plus amplement détaillés dans le Linux Wireless LAN Howto. 35 | .br 36 | .RB Les " Wireless Tools" 37 | sont utilisés pour changer la configuration des interfaces réseau LAN wireless 38 | à la volée, pour obtenir leur configuration courante, pour avoir des 39 | statistiques et pour les diagnostiquer. Ils sont décrits dans leur propre page 40 | man, voir ci-dessous pour les références. 41 | .br 42 | .RB La " configuration Wireless" 43 | est propre à chaque distribution Linux. Cette page man contiendra à l'avenir 44 | la procédure de configuration pour quelques distributions les plus communes. 45 | Pour le moment, consultez le fichier DISTRIBUTIONS.txt inclus avec le paquetage 46 | Wireless Tools. 47 | .\" 48 | .\" DEBIAN 3.0 part 49 | .\" 50 | .SH DEBIAN 3.0 51 | Dans la Debian 3.0 (et suivante) vous pouvez configurer les périphériques 52 | réseaux LAN wireless en utilisant l'outil de configuration réseau 53 | .BR ifupdown (8). 54 | .TP 55 | .B Fichier : 56 | .I /etc/network/interfaces 57 | .TP 58 | .B Format : 59 | .RI wireless\- " " 60 | .br 61 | wireless\-essid Maison 62 | .br 63 | wireless\-mode Ad\-Hoc 64 | .TP 65 | .B Voir aussi : 66 | .I /etc/network/if\-pre\-up.d/wireless\-tools 67 | .br 68 | .I /usr/share/doc/wireless\-tools/README.Debian 69 | .\" 70 | .\" SuSE 8.0 part 71 | .\" 72 | .SH SuSE 8.0 73 | La SuSE 8.0 (et suivante) a intégré la configuration wireless dans ses 74 | scripts réseaux. 75 | .TP 76 | .B Outils : 77 | .B Yast2 78 | .TP 79 | .B Fichiers : 80 | .I /etc/sysconfig/network/wireless 81 | .br 82 | .I /etc/sysconfig/network/ifcfg\-* 83 | .TP 84 | .B Format : 85 | .RI WIRELESS_ "" = "" 86 | .br 87 | WIRELESS_ESSID="Maison" 88 | .br 89 | WIRELESS_MODE=Ad\-Hoc 90 | .TP 91 | .B Voir aussi : 92 | man ifup 93 | .br 94 | info scpm 95 | .\" 96 | .\" PCMCIA part 97 | .\" 98 | .SH SCRIPTS ORIGINAUX PCMCIA 99 | Si vous utilisez les scripts originaux de configuration du paquetage Pcmcia, 100 | vous pouvez utiliser cette méthode. 101 | .TP 102 | .B Fichier : 103 | .I /etc/pcmcia/wireless.opts 104 | .TP 105 | .B Format : 106 | *,*,*,*) 107 | .br 108 | ESSID="Maison" 109 | .br 110 | MODE="Ad-Hoc" 111 | .br 112 | ;; 113 | .TP 114 | .B Voir aussi : 115 | .I /etc/pcmcia/wireless 116 | .br 117 | Le fichier 118 | .I PCMCIA.txt 119 | qui fait partie du paquetage Wireless Tools. 120 | .\" 121 | .\" AUTHOR part 122 | .\" 123 | .SH AUTEUR 124 | Jean Tourrilhes \- jt@hpl.hp.com 125 | .br 126 | .I http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/ 127 | .\" 128 | .\" TRADUCTION part 129 | .\" 130 | .SH TRADUCTION 131 | Maxime CHARPENNE, octobre 2007 (wireless-tools.30-pre3). 132 | .\" 133 | .\" AVERTISSEMENT part 134 | .\" 135 | .SH AVERTISSEMENT SUR LA TRADUCTION 136 | Il est possible que cette traduction soit imparfaite ou périmée. En cas de 137 | doute, veuillez vous reporter au document original en langue anglaise fourni 138 | avec le programme. 139 | .\" 140 | .\" SEE ALSO part 141 | .\" 142 | .SH VOIR AUSSI 143 | .BR iwconfig (8), 144 | .BR iwlist (8), 145 | .BR iwspy (8), 146 | .BR iwpriv (8), 147 | .BR iwevent (8). 148 | -------------------------------------------------------------------------------- /ifrename.8: -------------------------------------------------------------------------------- 1 | .\" Jean II - HPL - 2004-2007 2 | .\" ifrename.8 3 | .\" 4 | .TH IFRENAME 8 "26 February 2007" "wireless-tools" "Linux Programmer's Manual" 5 | .\" 6 | .\" NAME part 7 | .\" 8 | .SH NAME 9 | ifrename \- rename network interfaces based on various static criteria 10 | .\" 11 | .\" SYNOPSIS part 12 | .\" 13 | .SH SYNOPSIS 14 | .B "ifrename [-c configfile] [-p] [-d] [-u] [-v] [-V] [-D] [-C]" 15 | .br 16 | .B "ifrename [-c configfile] [-i interface] [-n newname]" 17 | .\" 18 | .\" DESCRIPTION part 19 | .\" 20 | .SH DESCRIPTION 21 | .B Ifrename 22 | is a tool allowing you to assign a consistent name to each of your 23 | network interface. 24 | .PP 25 | By default, interface names are dynamic, and each network interface is 26 | assigned the first available name 27 | .RI ( eth0 ", " eth1 "...)." 28 | The order network interfaces are created may vary. For built-in 29 | interfaces, the kernel boot time enumeration may vary. For removable 30 | interface, the user may plug them in any order. 31 | .PP 32 | .B Ifrename 33 | allow the user to decide what name a network interface will have. 34 | .B Ifrename 35 | can use a variety of 36 | .I selectors 37 | to specify how interface names match the network interfaces on the 38 | system, the most common selector is the interface 39 | .IR "MAC address" . 40 | .PP 41 | .B Ifrename 42 | must be run before interfaces are brought up, which is why it's mostly 43 | useful in various scripts (init, hotplug) but is seldom used directly 44 | by the user. By default, 45 | .B ifrename 46 | renames all present system interfaces using mappings defined in 47 | .IR /etc/iftab . 48 | .\" 49 | .\" PARAMETER part 50 | .\" 51 | .SH PARAMETERS 52 | .TP 53 | .BI "-c " configfile 54 | Set the configuration file to be used (by default 55 | .IR /etc/iftab ). 56 | The configuration file define the mapping between selectors and 57 | interface names, and is described in 58 | .IR iftab (5). 59 | .br 60 | If 61 | .I configfile 62 | is "-", the configuration is read from stdin. 63 | .TP 64 | .B -p 65 | Probe (load) kernel modules before renaming interfaces. By default 66 | .B ifrename 67 | only check interfaces already loaded, and doesn't auto-load the 68 | required kernel modules. This option enables smooth integration with 69 | system not loading modules before calling 70 | .BR ifrename . 71 | .TP 72 | .B -d 73 | Enable various 74 | .B Debian 75 | specific hacks. Combined with 76 | .BR -p , 77 | only modules for interfaces specified in 78 | .I /etc/network/interface 79 | are loaded. 80 | .TP 81 | .BI "-i " interface 82 | Only rename the specified 83 | .I interface 84 | as opposed to all interfaces on the system. The new interface name is 85 | printed. 86 | .TP 87 | .BI "-n " newname 88 | When used with 89 | .IR -i , 90 | specify the new name of the interface. The list of mappings from the 91 | configuration file is bypassed, the interface specified with 92 | .I -i 93 | is renamed directly to 94 | .IR newname . 95 | The new name may be a wildcard containing a single '*'. 96 | .br 97 | When used without 98 | .IR -i , 99 | rename interfaces by using only mappings that would rename them to 100 | .IR newname . 101 | The new name may not be a wildcard. This use of ifrename is 102 | discouraged, because inefficient 103 | .RI ( -n " without " -i ). 104 | All the interfaces of the system need to be processed at each 105 | invocation, therefore in most case it is not faster than just letting 106 | ifrename renaming all of them (without both 107 | .IR -n " and " -i ). 108 | .TP 109 | .B -t 110 | Enable name takeover support. This allow interface name swapping 111 | between two or more interfaces. 112 | .br 113 | Takeover enable an interface to 'steal' the name of another 114 | interface. This works only with kernel 2.6.X and if the other 115 | interface is down. Consequently, this is not compatible with 116 | Hotplug. The other interface is assigned a random name, but may be 117 | renamed later with 'ifrename'. 118 | .br 119 | The number of takeovers is limited to avoid circular loops, and 120 | therefore some complex multi-way name swapping situations may not be 121 | fully processed. 122 | .br 123 | In any case, name swapping and the use of this feature is discouraged, 124 | and you are invited to choose unique and unambiguous names for your 125 | interfaces... 126 | .TP 127 | .B -u 128 | Enable 129 | .I udev 130 | output mode. This enables proper integration of 131 | .B ifrename 132 | in the 133 | .I udev 134 | framework, 135 | .BR udevd (8) 136 | will use 137 | .B ifrename 138 | to assign interface names present in 139 | .IR /etc/iftab . 140 | In this mode the output of ifrename can be parsed 141 | directly by 142 | .BR udevd (8) 143 | as an IMPORT action. This requires 144 | .I udev 145 | version 107 or later. 146 | .TP 147 | .B -D 148 | Dry-run mode. Ifrename won't change any interface, it will only print 149 | new interface name, if applicable, and return. 150 | .br 151 | In dry-run mode, interface name wildcards are not resolved. New 152 | interface name is printed, even if it is the same as the old name. 153 | .br 154 | Be also aware that some selectors can only be read by root, for 155 | example those based on 156 | .BR ethtool ), 157 | and will fail silently if run by a normal user. In other words, 158 | dry-run mode under a standard user may not give the expected result. 159 | .TP 160 | .B -V 161 | Verbose mode. Ifrename will display internal results of parsing its 162 | configuration file and querying the interfaces selectors. Combined 163 | with the 164 | .I dry-run 165 | option, this is a good way to debug complex configurations or trivial 166 | problems. 167 | .TP 168 | .B -C 169 | Count matching interfaces. Display the number of interface matched, 170 | and return it as the exit status of ifrename. 171 | .br 172 | The number of interfaces matched is the number of interface on the 173 | system for which a mapping was found in the config file (which is 174 | different from the number of interface renamed). 175 | .\" 176 | .\" AUTHOR part 177 | .\" 178 | .SH AUTHOR 179 | Jean Tourrilhes \- jt@hpl.hp.com 180 | .\" 181 | .\" FILES part 182 | .\" 183 | .SH FILES 184 | .I /etc/iftab 185 | .\" 186 | .\" SEE ALSO part 187 | .\" 188 | .SH SEE ALSO 189 | .BR ifconfig (8), 190 | .BR ip (8), 191 | .BR iftab (5). 192 | -------------------------------------------------------------------------------- /iftab.5: -------------------------------------------------------------------------------- 1 | .\" Jean II - HPL - 2004-2007 2 | .\" iftab.5 3 | .\" 4 | .TH IFTAB 5 "26 February 2007" "wireless-tools" "Linux Programmer's Manual" 5 | .\" 6 | .\" NAME part 7 | .\" 8 | .SH NAME 9 | iftab \- static information about the network interfaces 10 | .\" 11 | .\" DESCRIPTION part 12 | .\" 13 | .SH DESCRIPTION 14 | The file 15 | .B /etc/iftab 16 | contains descriptive information about the various network interfaces. 17 | .B iftab 18 | is only used by the program 19 | .IR ifrename (8) 20 | to assign a consistent network interface name to each network interface. 21 | .PP 22 | .B /etc/iftab 23 | defines a set of 24 | .IR mappings . 25 | Each mapping contains an interface name and a set of selectors. The 26 | selectors allow 27 | .B ifrename 28 | to identify each network interface on the system. If a network 29 | interface matches all descriptors of a mapping, 30 | .B ifrename 31 | attempt to change the name of the interface to the interface name 32 | given by the mapping. 33 | .\" 34 | .\" MAPPINGS part 35 | .\" 36 | .SH MAPPINGS 37 | Each mapping is described on a separate line, it starts with an 38 | .IR "interface name" , 39 | and contains a set of 40 | .IR descriptors , 41 | separated by space or tabs. 42 | .PP 43 | The relationship between descriptors of a mapping is a 44 | .IR "logical and" . 45 | A mapping matches a network interface only is all the descriptors 46 | match. If a network interface doesn't support a specific descriptor, 47 | it won't match any mappings using this descriptor. 48 | .PP 49 | If you want to use alternate descriptors for an interface name 50 | (logical or), specify two different mappings with the same interface 51 | name (one on each line). 52 | .B Ifrename 53 | always use the first matching mapping starting from the 54 | .I end 55 | of 56 | .BR iftab , 57 | therefore more restrictive mapping should be specified last. 58 | .\" 59 | .\" INTERFACE NAME part 60 | .\" 61 | .SH INTERFACE NAME 62 | The first part of each mapping is an interface name. If a network 63 | interface matches all descriptors of a mapping, 64 | .B ifrename 65 | attempt to change the name of the interface to the interface name 66 | given by the mapping. 67 | .PP 68 | The interface name of a mapping is either a plain interface name (such as 69 | .IR eth2 " or " wlan1 ) 70 | or a interface name pattern containing a single wildcard (such as 71 | .IR eth* " or " wlan* ). 72 | In case of wildcard, the kernel replace the '*' with the lowest 73 | available integer making this interface name unique. Note that 74 | wildcard is only supported for kernel 2.6.1 and 2.4.30 and later. 75 | .PP 76 | It is discouraged to try to map interfaces to default interfaces names 77 | such as 78 | .IR eth0 ", " wlan0 " or " ppp0 . 79 | The kernel use those as the default name for any new interface, 80 | therefore most likely an interface will already use this name and 81 | prevent ifrename to use it. Even if you use takeover, the interface 82 | may already be up in some cases. Not using those name will allow you 83 | to immediately spot unconfigured or new interfaces. 84 | .br 85 | Good names are either totally unique and meaningfull, 86 | such as 87 | .IR mydsl " or " privatehub , 88 | or use larger integer, such as 89 | .IR eth5 " or " wlan5 . 90 | The second type is usually easier to integrate in various network utilities. 91 | .\" 92 | .\" DESCRIPTORS part 93 | .\" 94 | .SH DESCRIPTORS 95 | Each descriptor is composed of a descriptor name and descriptor 96 | value. Descriptors specify a static attribute of a network interface, 97 | the goal is to uniquely identify each piece of hardware. 98 | .PP 99 | Most users will only use the 100 | .B mac 101 | selector despite its potential problems, other selectors are for more 102 | specialised setup. Most selectors accept a '*' in the selector value 103 | for wilcard matching, and most selectors are case insensitive. 104 | .TP 105 | .BI mac " mac address" 106 | Matches the MAC Address of the interface with the specified MAC 107 | address. The MAC address of the interface can be shown using 108 | .IR ifconfig (8) 109 | or 110 | .IR ip (8). 111 | .br 112 | This is the most common selector, as most interfaces have a unique MAC 113 | address allowing to identify network interfaces without ambiguity. 114 | However, some interfaces don't have a valid MAC address until they are 115 | brought up, in such case using this selector is tricky or impossible. 116 | .TP 117 | .BI arp " arp type" 118 | Matches the ARP Type (also called Link Type) of the interface with the 119 | specified ARP type as a number. The ARP Type of the interface can be 120 | shown using 121 | .IR ifconfig (8) 122 | or 123 | .IR ip (8), 124 | the 125 | .B link/ether 126 | type correspond to 127 | .B 1 128 | and the 129 | .B link/ieee802.11 130 | type correspond to 131 | .BR 801 . 132 | .br 133 | This selector is useful when a driver create multiple network 134 | interfaces for a single network card. 135 | .TP 136 | .BI driver " driver name" 137 | Matches the Driver Name of the interface with the specified driver 138 | name. The Driver Name of the interface can be shown using 139 | .IR "ethtool -i" (8). 140 | .TP 141 | .BI businfo " bus information" 142 | Matches the Bus Information of the interface with the specified bus 143 | information. The Bus Information of the interface can be shown using 144 | .IR "ethtool -i" (8). 145 | .TP 146 | .BI firmware " firmware revision" 147 | Matches the Firmware Revision of the interface with the firmware 148 | revision information. The Firmware Revision of the interface can be 149 | shown using 150 | .IR "ethtool -i" (8). 151 | .TP 152 | .BI baseaddress " base address" 153 | Matches the Base Address of the interface with the specified base 154 | address. The Base Address of the interface can be shown using 155 | .IR ifconfig (8). 156 | .br 157 | Because most cards use dynamic allocation of the Base Address, this 158 | selector is only useful for ISA and EISA cards. 159 | .TP 160 | .BI irq " irq line" 161 | Matches the IRQ Line (interrupt) of the interface with the specified 162 | IRQ line. The IRQ Line of the interface can be shown using 163 | .IR ifconfig (8). 164 | .br 165 | Because there are IRQ Lines may be shared, this selector is usually 166 | not sufficient to uniquely identify an interface. 167 | .TP 168 | .BI iwproto " wireless protocol" 169 | Matches the Wireless Protocol of the interface with the specified 170 | wireless protocol. The Wireless Protocol of the interface can be shown 171 | using 172 | .IR iwconfig (8) 173 | or 174 | .IR iwgetid (8). 175 | .br 176 | This selector is only supported on wireless interfaces and is not 177 | sufficient to uniquely identify an interface. 178 | .TP 179 | .BI pcmciaslot " pcmcia slot" 180 | Matches the Pcmcia Socket number of the interface with the specified 181 | slot number. Pcmcia Socket number of the interface can be shown 182 | using 183 | .IR "cardctl ident" (8). 184 | .br 185 | This selector is usually only supported on 16 bits cards, for 32 bits 186 | cards it is advised to use the selector 187 | .BR businfo . 188 | .TP 189 | .BI prevname " previous interface name" 190 | Matches the name of the interface prior to renaming with the specified 191 | oldname. 192 | .br 193 | This selector should be avoided as the previous interface name may 194 | vary depending on various condition. A system/kernel/driver update may 195 | change the original name. Then, ifrename or another tool may rename it 196 | prior to the execution of this selector. 197 | .TP 198 | .BI SYSFS{ filename } " value" 199 | Matches the content the sysfs attribute given by filename to the 200 | specified value. For symlinks and parents directories, match the 201 | actual directory name of the sysfs attribute given by filename to the 202 | specified value. 203 | .br 204 | A list of the most useful sysfs attributes is given in the next 205 | section. 206 | .\" 207 | .\" SYSFS DESCRIPTORS part 208 | .\" 209 | .SH SYSFS DESCRIPTORS 210 | Sysfs attributes for a specific interface are located on most systems 211 | in the directory named after that interface at 212 | .IR /sys/class/net/ . 213 | Most sysfs attribute are files, and their values can be read using 214 | .IR cat "(1) or " more (1). 215 | It is also possible to match attributes in subdirectories. 216 | .PP 217 | Some sysfs attributes are symlinks, pointing to another directory in 218 | sysfs. If the attribute filename is a symlink the sysfs attribute 219 | resolves to the name of the directory pointed by the symlink using 220 | .IR readlink (1). 221 | The location is a directory in the sysfs tree is also important. If 222 | the attribute filename ends with 223 | .IR /.. , 224 | the sysfs attribute resolves to the real name of the parent directory 225 | using 226 | .IR pwd (1). 227 | .PP 228 | The sysfs filesystem is only supported with 2.6.X kernel and need to 229 | be mounted (usually in 230 | .IR /sys ). 231 | sysfs selectors are not as efficient as other selectors, therefore 232 | they should be avoided for maximum performance. 233 | .PP 234 | These are common sysfs attributes and their corresponding ifrename 235 | descriptors. 236 | .TP 237 | .BI SYSFS{address} " value" 238 | Same as the 239 | .B mac 240 | descriptor. 241 | .TP 242 | .BI SYSFS{type} " value" 243 | Same as the 244 | .B arp 245 | descriptor. 246 | .TP 247 | .BI SYSFS{device} " value" 248 | Valid only up to kernel 2.6.20. Same as the 249 | .B businfo 250 | descriptor. 251 | .TP 252 | .BI SYSFS{..} " value" 253 | Valid only from kernel 2.6.21. Same as the 254 | .B businfo 255 | descriptor. 256 | .TP 257 | .BI SYSFS{device/driver} " value" 258 | Valid only up to kernel 2.6.20. Same as the 259 | .B driver 260 | descriptor. 261 | .TP 262 | .BI SYSFS{../driver} " value" 263 | Valid only from kernel 2.6.21. Same as the 264 | .B driver 265 | descriptor. 266 | .TP 267 | .BI SYSFS{device/irq} " value" 268 | Valid only up to kernel 2.6.20. Same as the 269 | .B irq 270 | descriptor. 271 | .TP 272 | .BI SYSFS{../irq} " value" 273 | Valid only from kernel 2.6.21. Same as the 274 | .B irq 275 | descriptor. 276 | .\" 277 | .\" EXAMPLES part 278 | .\" 279 | .SH EXAMPLES 280 | # This is a comment 281 | .br 282 | eth2 mac 08:00:09:DE:82:0E 283 | .br 284 | eth3 driver wavelan interrupt 15 baseaddress 0x390 285 | .br 286 | eth4 driver pcnet32 businfo 0000:02:05.0 287 | .br 288 | air* mac 00:07:0E:* arp 1 289 | .br 290 | myvpn SYSFS{address} 00:10:83:* SYSFS{type} 1 291 | .br 292 | bcm* SYSFS{device} 0000:03:00.0 SYSFS{device/driver} bcm43xx 293 | .br 294 | bcm* SYSFS{..} 0000:03:00.0 SYSFS{../driver} bcm43xx 295 | .\" 296 | .\" AUTHOR part 297 | .\" 298 | .SH AUTHOR 299 | Jean Tourrilhes \- jt@hpl.hp.com 300 | .\" 301 | .\" FILES part 302 | .\" 303 | .SH FILES 304 | .I /etc/iftab 305 | .\" 306 | .\" SEE ALSO part 307 | .\" 308 | .SH SEE ALSO 309 | .BR ifrename (8), 310 | .BR ifconfig (8), 311 | .BR ip (8), 312 | .BR ethtool (8), 313 | .BR iwconfig (8). 314 | -------------------------------------------------------------------------------- /iw261_restore_full_essid.diff: -------------------------------------------------------------------------------- 1 | diff -u -p linux/net/core/wireless.j2.c linux/net/core/wireless.c 2 | --- linux/net/core/wireless.j2.c 2007-03-21 14:41:51.000000000 -0700 3 | +++ linux/net/core/wireless.c 2007-03-21 14:41:08.000000000 -0700 4 | @@ -766,39 +766,11 @@ static int ioctl_standard_call(struct ne 5 | int extra_size; 6 | int user_length = 0; 7 | int err; 8 | - int essid_compat = 0; 9 | 10 | /* Calculate space needed by arguments. Always allocate 11 | * for max space. Easier, and won't last long... */ 12 | extra_size = descr->max_tokens * descr->token_size; 13 | 14 | - /* Check need for ESSID compatibility for WE < 21 */ 15 | - switch (cmd) { 16 | - case SIOCSIWESSID: 17 | - case SIOCGIWESSID: 18 | - case SIOCSIWNICKN: 19 | - case SIOCGIWNICKN: 20 | - if (iwr->u.data.length == descr->max_tokens + 1) 21 | - essid_compat = 1; 22 | - else if (IW_IS_SET(cmd) && (iwr->u.data.length != 0)) { 23 | - char essid[IW_ESSID_MAX_SIZE + 1]; 24 | - 25 | - err = copy_from_user(essid, iwr->u.data.pointer, 26 | - iwr->u.data.length * 27 | - descr->token_size); 28 | - if (err) 29 | - return -EFAULT; 30 | - 31 | - if (essid[iwr->u.data.length - 1] == '\0') 32 | - essid_compat = 1; 33 | - } 34 | - break; 35 | - default: 36 | - break; 37 | - } 38 | - 39 | - iwr->u.data.length -= essid_compat; 40 | - 41 | /* Check what user space is giving us */ 42 | if(IW_IS_SET(cmd)) { 43 | /* Check NULL pointer */ 44 | @@ -841,7 +813,6 @@ static int ioctl_standard_call(struct ne 45 | #endif /* WE_IOCTL_DEBUG */ 46 | 47 | /* Create the kernel buffer */ 48 | - /* kzalloc ensures NULL-termination for essid_compat */ 49 | extra = kzalloc(extra_size, GFP_KERNEL); 50 | if (extra == NULL) { 51 | return -ENOMEM; 52 | @@ -866,8 +837,6 @@ static int ioctl_standard_call(struct ne 53 | /* Call the handler */ 54 | ret = handler(dev, &info, &(iwr->u), extra); 55 | 56 | - iwr->u.data.length += essid_compat; 57 | - 58 | /* If we have something to return to the user */ 59 | if (!ret && IW_IS_GET(cmd)) { 60 | /* Check if there is enough buffer up there */ 61 | -------------------------------------------------------------------------------- /iw262_restore_full_essid.diff: -------------------------------------------------------------------------------- 1 | --- linux/net/wireless/wext.j1.c 2007-07-09 13:19:22.000000000 -0700 2 | +++ linux/net/wireless/wext.c 2007-07-09 13:19:59.000000000 -0700 3 | @@ -741,39 +741,11 @@ static int ioctl_standard_call(struct ne 4 | int extra_size; 5 | int user_length = 0; 6 | int err; 7 | - int essid_compat = 0; 8 | 9 | /* Calculate space needed by arguments. Always allocate 10 | * for max space. Easier, and won't last long... */ 11 | extra_size = descr->max_tokens * descr->token_size; 12 | 13 | - /* Check need for ESSID compatibility for WE < 21 */ 14 | - switch (cmd) { 15 | - case SIOCSIWESSID: 16 | - case SIOCGIWESSID: 17 | - case SIOCSIWNICKN: 18 | - case SIOCGIWNICKN: 19 | - if (iwr->u.data.length == descr->max_tokens + 1) 20 | - essid_compat = 1; 21 | - else if (IW_IS_SET(cmd) && (iwr->u.data.length != 0)) { 22 | - char essid[IW_ESSID_MAX_SIZE + 1]; 23 | - 24 | - err = copy_from_user(essid, iwr->u.data.pointer, 25 | - iwr->u.data.length * 26 | - descr->token_size); 27 | - if (err) 28 | - return -EFAULT; 29 | - 30 | - if (essid[iwr->u.data.length - 1] == '\0') 31 | - essid_compat = 1; 32 | - } 33 | - break; 34 | - default: 35 | - break; 36 | - } 37 | - 38 | - iwr->u.data.length -= essid_compat; 39 | - 40 | /* Check what user space is giving us */ 41 | if (IW_IS_SET(cmd)) { 42 | /* Check NULL pointer */ 43 | @@ -811,7 +783,6 @@ static int ioctl_standard_call(struct ne 44 | } 45 | 46 | /* Create the kernel buffer */ 47 | - /* kzalloc ensures NULL-termination for essid_compat */ 48 | extra = kzalloc(extra_size, GFP_KERNEL); 49 | if (extra == NULL) 50 | return -ENOMEM; 51 | @@ -830,8 +801,6 @@ static int ioctl_standard_call(struct ne 52 | /* Call the handler */ 53 | ret = handler(dev, &info, &(iwr->u), extra); 54 | 55 | - iwr->u.data.length += essid_compat; 56 | - 57 | /* If we have something to return to the user */ 58 | if (!ret && IW_IS_GET(cmd)) { 59 | /* Check if there is enough buffer up there */ 60 | -------------------------------------------------------------------------------- /iwevent.8: -------------------------------------------------------------------------------- 1 | .\" Jean Tourrilhes - HPL - 2002 - 2004 2 | .\" iwevent.8 3 | .\" 4 | .TH IWEVENT 8 "23 June 2004" "net-tools" "Linux Programmer's Manual" 5 | .\" 6 | .\" NAME part 7 | .\" 8 | .SH NAME 9 | iwevent \- Display Wireless Events generated by drivers and setting changes 10 | .\" 11 | .\" SYNOPSIS part 12 | .\" 13 | .SH SYNOPSIS 14 | .BI "iwevent " 15 | .br 16 | .\" 17 | .\" DESCRIPTION part 18 | .\" 19 | .SH DESCRIPTION 20 | .B iwevent 21 | displays Wireless Events received through the RTNetlink socket. Each 22 | line displays the specific Wireless Event which describes what has 23 | happened on the specified wireless interface. 24 | .br 25 | This command doesn't take any arguments. 26 | .\" 27 | .\" DISPLAY part 28 | .\" 29 | .SH DISPLAY 30 | There are two classes of Wireless Events. 31 | .PP 32 | The first class is events related to a change of wireless settings on 33 | the interface (typically done through 34 | .B iwconfig 35 | or a script calling 36 | .BR iwconfig ). 37 | Only settings that could result in a disruption of connectivity are 38 | reported. The events currently reported are changing one of the 39 | following setting : 40 | .br 41 | .I " Network ID" 42 | .br 43 | .I " ESSID" 44 | .br 45 | .I " Frequency" 46 | .br 47 | .I " Mode" 48 | .br 49 | .I " Encryption" 50 | .br 51 | All those events will be generated on all wireless interfaces by the 52 | kernel wireless subsystem (but only if the driver has been converted 53 | to the new driver API). 54 | .PP 55 | The second class of events are events generated by the hardware, when 56 | something happens or a task has been finished. Those events include : 57 | .TP 58 | .B New Access Point/Cell address 59 | The interface has joined a new Access Point or Ad-Hoc Cell, or lost 60 | its association with it. This is the same address that is reported 61 | by 62 | .BR iwconfig . 63 | .TP 64 | .B Scan request completed 65 | A scanning request has been completed, results of the scan are 66 | available (see 67 | .BR iwlist ). 68 | .TP 69 | .B Tx packet dropped 70 | A packet directed at this address has been dropped because the 71 | interface believes this node doesn't answer anymore (usually maximum 72 | of MAC level retry exceeded). This is usually an early indication that 73 | the node may have left the cell or gone out of range, but it may be 74 | due to fading or excessive contention. 75 | .TP 76 | .B Custom driver event 77 | Event specific to the driver. Please check the driver documentation. 78 | .TP 79 | .B Registered node 80 | The interface has successfully registered a new wireless 81 | client/peer. Will be generated mostly when the interface acts as an 82 | Access Point (mode Master). 83 | .TP 84 | .B Expired node 85 | The registration of the client/peer on this interface has 86 | expired. Will be generated mostly when the interface acts as an Access 87 | Point (mode Master). 88 | .TP 89 | .B Spy threshold crossed 90 | The signal strength for one of the addresses in the spy list went 91 | under the low threshold or went above the high threshold. 92 | .PP 93 | Most wireless drivers generate only a subset of those events, not all 94 | of them, the exact list depends on the specific hardware/driver 95 | combination. Please refer to driver documentation for details on when 96 | they are generated, and use 97 | .IR iwlist (8) 98 | to check what the driver supports. 99 | .\" 100 | .\" AUTHOR part 101 | .\" 102 | .SH AUTHOR 103 | Jean Tourrilhes \- jt@hpl.hp.com 104 | .\" 105 | .\" SEE ALSO part 106 | .\" 107 | .SH SEE ALSO 108 | .BR iwconfig (8), 109 | .BR iwlist (8), 110 | .BR iwspy (8), 111 | .BR iwpriv (8), 112 | .BR wireless (7). 113 | -------------------------------------------------------------------------------- /iwgetid.8: -------------------------------------------------------------------------------- 1 | .\" Guus Sliepen - 2001 2 | .\" Completed and fixed up by Jean Tourrilhes - 2002-2003 3 | .\" iwgetid.8 4 | .\" 5 | .TH IWGETID 8 "02 December 2003" "wireless-tools" "Linux Programmer's Manual" 6 | .\" 7 | .\" NAME part 8 | .\" 9 | .SH NAME 10 | iwgetid \- Report ESSID, NWID or AP/Cell Address of wireless network 11 | .\" 12 | .\" SYNOPSIS part 13 | .\" 14 | .SH SYNOPSIS 15 | .BI "iwgetid " [interface] " [--raw] [--scheme] [--ap] [--freq]" 16 | .br 17 | .BI " [--mode] [--protocol] [--channel] 18 | .br 19 | .\" 20 | .\" DESCRIPTION part 21 | .\" 22 | .SH DESCRIPTION 23 | .B iwgetid 24 | is used to find out the NWID, ESSID or AP/Cell Address of the wireless 25 | network that is currently used. The information reported is the same 26 | as the one shown by 27 | .BR iwconfig ", but " iwgetid 28 | is easier to integrate in various scripts. 29 | .br 30 | By default, 31 | .B iwgetid 32 | will print the 33 | .I ESSID 34 | of the device, and if the device doesn't have any ESSID it will print 35 | its 36 | .IR NWID . 37 | .br 38 | The default formatting output is pretty-print. 39 | .\" 40 | .\" OPTIONS part 41 | .\" 42 | .SH OPTIONS 43 | .TP 44 | .B --raw 45 | This option disables pretty-printing of the information. This option 46 | is orthogonal to the other options (except 47 | .BR --scheme ), 48 | so with the appropriate combination of options you can print the raw 49 | ESSID, AP Address or Mode. 50 | .br 51 | This format is ideal when storing the result of iwgetid as a 52 | variable in 53 | .I Shell 54 | or 55 | .I Perl 56 | scripts or to pass the result as an argument on the command line of 57 | .BR iwconfig . 58 | .TP 59 | .B --scheme 60 | This option is similar to the previous one, it disables 61 | pretty-printing of the information and removes all characters that are 62 | not alphanumerics (like space, punctuation and control characters). 63 | .br 64 | The resulting output is a valid Pcmcia scheme identifier (that may be 65 | used as an argument of the command 66 | .BR "cardctl scheme" ). 67 | This format is also ideal when using the result of iwgetid as a 68 | selector in 69 | .I Shell 70 | or 71 | .I Perl 72 | scripts, or as a file name. 73 | .TP 74 | .B --ap 75 | Display the MAC address of the Wireless 76 | .I Access Point 77 | or the 78 | .IR Cell . 79 | .TP 80 | .B --freq 81 | Display the current 82 | .I frequency 83 | or 84 | .I channel 85 | used by the interface. 86 | .TP 87 | .B --channel 88 | Display the current 89 | .I channel 90 | used by the interface. The channel is determined using the current 91 | frequency and the frequency list provided by the interface. 92 | .TP 93 | .B --mode 94 | Display the current 95 | .I mode 96 | of the interface. 97 | .TP 98 | .B --protocol 99 | Display the 100 | .I protocol name 101 | of the interface. This allows to identify all the cards that are 102 | compatible with each other and accept the same type of configuration. 103 | .br 104 | This can also be used to 105 | .I check Wireless Extension support 106 | on the interface, as this is the only attribute that all drivers 107 | supporting Wireless Extension are mandated to support. 108 | .\" 109 | .\" SEE ALSO part 110 | .\" 111 | .SH SEE ALSO 112 | .BR iwconfig (8), 113 | .BR ifconfig (8), 114 | .BR iwspy (8), 115 | .BR iwpriv (8). 116 | -------------------------------------------------------------------------------- /iwlib-private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Wireless Tools 3 | * 4 | * Jean II - HPLB 97->99 - HPL 99->09 5 | * 6 | * Private common header for the Wireless Extension library... 7 | * 8 | * This file is released under the GPL license. 9 | * Copyright (c) 1997-2009 Jean Tourrilhes 10 | */ 11 | 12 | #ifndef IWLIB_PRIVATE_H 13 | #define IWLIB_PRIVATE_H 14 | 15 | /*#include "CHANGELOG.h"*/ 16 | 17 | /***************************** INCLUDES *****************************/ 18 | 19 | #include "iwlib.h" /* Public header */ 20 | 21 | /* Make gcc understand that when we say inline, we mean it. 22 | * I really hate when the compiler is trying to be more clever than me, 23 | * because in this case gcc is not able to figure out functions with a 24 | * single call site, so not only I have to tag those functions inline 25 | * by hand, but then it refuse to inline them properly. 26 | * Total saving for iwevent : 150B = 0.7%. 27 | * Fortunately, in gcc 3.4, they now automatically inline static functions 28 | * with a single call site. Hurrah ! 29 | * Jean II */ 30 | #undef IW_GCC_HAS_BROKEN_INLINE 31 | #if __GNUC__ == 3 32 | #if __GNUC_MINOR__ >= 1 && __GNUC_MINOR__ < 4 33 | #define IW_GCC_HAS_BROKEN_INLINE 1 34 | #endif /* __GNUC_MINOR__ */ 35 | #endif /* __GNUC__ */ 36 | /* However, gcc 4.0 has introduce a new "feature", when compiling with 37 | * '-Os', it does not want to inline iw_ether_cmp() and friends. 38 | * So, we need to fix inline again ! 39 | * Jean II */ 40 | #if __GNUC__ == 4 41 | #define IW_GCC_HAS_BROKEN_INLINE 1 42 | #endif /* __GNUC__ */ 43 | /* Now, really fix the inline */ 44 | #ifdef IW_GCC_HAS_BROKEN_INLINE 45 | #ifdef inline 46 | #undef inline 47 | #endif /* inline */ 48 | #define inline inline __attribute__((always_inline)) 49 | #endif /* IW_GCC_HAS_BROKEN_INLINE */ 50 | 51 | #ifdef __cplusplus 52 | extern "C" { 53 | #endif 54 | 55 | /****************************** DEBUG ******************************/ 56 | 57 | //#define DEBUG 1 58 | 59 | /************************ CONSTANTS & MACROS ************************/ 60 | 61 | /* Paths */ 62 | #define PROC_NET_WIRELESS "/proc/net/wireless" 63 | #define PROC_NET_DEV "/proc/net/dev" 64 | 65 | /* Some usefull constants */ 66 | #define KILO 1e3 67 | #define MEGA 1e6 68 | #define GIGA 1e9 69 | /* For doing log10/exp10 without libm */ 70 | #define LOG10_MAGIC 1.25892541179 71 | 72 | /* Backward compatibility for network headers */ 73 | #ifndef ARPHRD_IEEE80211 74 | #define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ 75 | #endif /* ARPHRD_IEEE80211 */ 76 | 77 | #ifndef IW_EV_LCP_PK_LEN 78 | /* Size of the Event prefix when packed in stream */ 79 | #define IW_EV_LCP_PK_LEN (4) 80 | /* Size of the various events when packed in stream */ 81 | #define IW_EV_CHAR_PK_LEN (IW_EV_LCP_PK_LEN + IFNAMSIZ) 82 | #define IW_EV_UINT_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(__u32)) 83 | #define IW_EV_FREQ_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_freq)) 84 | #define IW_EV_PARAM_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_param)) 85 | #define IW_EV_ADDR_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr)) 86 | #define IW_EV_QUAL_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality)) 87 | #define IW_EV_POINT_PK_LEN (IW_EV_LCP_PK_LEN + 4) 88 | #endif /* IW_EV_LCP_PK_LEN */ 89 | 90 | #ifndef IW_EV_LCP_PK2_LEN 91 | struct iw_pk_event 92 | { 93 | __u16 len; /* Real lenght of this stuff */ 94 | __u16 cmd; /* Wireless IOCTL */ 95 | union iwreq_data u; /* IOCTL fixed payload */ 96 | } __attribute__ ((packed)); 97 | struct iw_pk_point 98 | { 99 | void __user *pointer; /* Pointer to the data (in user space) */ 100 | __u16 length; /* number of fields or size in bytes */ 101 | __u16 flags; /* Optional params */ 102 | } __attribute__ ((packed)); 103 | 104 | #define IW_EV_LCP_PK2_LEN (sizeof(struct iw_pk_event) - sizeof(union iwreq_data)) 105 | #define IW_EV_POINT_PK2_LEN (IW_EV_LCP_PK2_LEN + sizeof(struct iw_pk_point) - IW_EV_POINT_OFF) 106 | #endif /* IW_EV_LCP_PK2_LEN */ 107 | 108 | /************************* INLINE FUNTIONS *************************/ 109 | /* 110 | * Functions that are so simple that it's more efficient inlining them 111 | * Most inline are private because gcc is fussy about inline... 112 | */ 113 | 114 | /*------------------------------------------------------------------*/ 115 | /* 116 | * Display an Ethernet Socket Address in readable format. 117 | */ 118 | static inline char * 119 | iw_saether_ntop(const struct sockaddr *sap, char* bufp) 120 | { 121 | iw_ether_ntop((const struct ether_addr *) sap->sa_data, bufp); 122 | return bufp; 123 | } 124 | /*------------------------------------------------------------------*/ 125 | /* 126 | * Input an Ethernet Socket Address and convert to binary. 127 | */ 128 | static inline int 129 | iw_saether_aton(const char *bufp, struct sockaddr *sap) 130 | { 131 | sap->sa_family = ARPHRD_ETHER; 132 | return iw_ether_aton(bufp, (struct ether_addr *) sap->sa_data); 133 | } 134 | 135 | /*------------------------------------------------------------------*/ 136 | /* 137 | * Create an Ethernet broadcast address 138 | */ 139 | static inline void 140 | iw_broad_ether(struct sockaddr *sap) 141 | { 142 | sap->sa_family = ARPHRD_ETHER; 143 | memset((char *) sap->sa_data, 0xFF, ETH_ALEN); 144 | } 145 | 146 | /*------------------------------------------------------------------*/ 147 | /* 148 | * Create an Ethernet NULL address 149 | */ 150 | static inline void 151 | iw_null_ether(struct sockaddr *sap) 152 | { 153 | sap->sa_family = ARPHRD_ETHER; 154 | memset((char *) sap->sa_data, 0x00, ETH_ALEN); 155 | } 156 | 157 | /*------------------------------------------------------------------*/ 158 | /* 159 | * Compare two ethernet addresses 160 | */ 161 | static inline int 162 | iw_ether_cmp(const struct ether_addr* eth1, const struct ether_addr* eth2) 163 | { 164 | return memcmp(eth1, eth2, sizeof(*eth1)); 165 | } 166 | 167 | #ifdef __cplusplus 168 | } 169 | #endif 170 | 171 | #endif /* IWLIB_PRIVATE_H */ 172 | -------------------------------------------------------------------------------- /iwlib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Wireless Tools 3 | * 4 | * Jean II - HPLB 97->99 - HPL 99->09 5 | * 6 | * Common header for the Wireless Extension library... 7 | * 8 | * This file is released under the GPL license. 9 | * Copyright (c) 1997-2009 Jean Tourrilhes 10 | */ 11 | 12 | #ifndef IWLIB_H 13 | #define IWLIB_H 14 | 15 | /***************************** INCLUDES *****************************/ 16 | 17 | /* Standard headers */ 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include /* gethostbyname, getnetbyname */ 29 | #include /* struct ether_addr */ 30 | #include /* struct timeval */ 31 | #include 32 | 33 | /* This is our header selection. Try to hide the mess and the misery :-( 34 | * Don't look, you would go blind ;-) 35 | * Note : compatibility with *old* distributions has been removed, 36 | * you will need Glibc 2.2 and older to compile (which means 37 | * Mandrake 8.0, Debian 2.3, RH 7.1 or older). 38 | */ 39 | 40 | /* Set of headers proposed by Dr. Michael Rietz , 27.3.2 */ 41 | #include /* For ARPHRD_ETHER */ 42 | #include /* For AF_INET & struct sockaddr */ 43 | #include /* For struct sockaddr_in */ 44 | #include 45 | 46 | /* Fixup to be able to include kernel includes in userspace. 47 | * Basically, kill the sparse annotations... Jean II */ 48 | #ifndef __user 49 | #define __user 50 | #endif 51 | 52 | #include /* for "caddr_t" et al */ 53 | 54 | /* Glibc systems headers are supposedly less problematic than kernel ones */ 55 | #include /* for "struct sockaddr" et al */ 56 | #include /* for IFNAMSIZ and co... */ 57 | 58 | /* Private copy of Wireless extensions (in this directoty) */ 59 | #include "wireless.h" 60 | 61 | #ifdef __cplusplus 62 | extern "C" { 63 | #endif 64 | 65 | /************************ CONSTANTS & MACROS ************************/ 66 | 67 | /* Various versions information */ 68 | /* Recommended Wireless Extension version */ 69 | #define WE_VERSION 22 70 | /* Maximum forward compatibility built in this version of WT */ 71 | #define WE_MAX_VERSION 22 72 | /* Version of Wireless Tools */ 73 | #define WT_VERSION 30 74 | 75 | /****************************** TYPES ******************************/ 76 | 77 | /* Shortcuts */ 78 | typedef struct iw_statistics iwstats; 79 | typedef struct iw_range iwrange; 80 | typedef struct iw_param iwparam; 81 | typedef struct iw_freq iwfreq; 82 | typedef struct iw_quality iwqual; 83 | typedef struct iw_priv_args iwprivargs; 84 | typedef struct sockaddr sockaddr; 85 | 86 | /* Structure for storing all wireless information for each device 87 | * This is a cut down version of the one above, containing only 88 | * the things *truly* needed to configure a card. 89 | * Don't add other junk, I'll remove it... */ 90 | typedef struct wireless_config 91 | { 92 | char name[IFNAMSIZ + 1]; /* Wireless/protocol name */ 93 | int has_nwid; 94 | iwparam nwid; /* Network ID */ 95 | int has_freq; 96 | double freq; /* Frequency/channel */ 97 | int freq_flags; 98 | int has_key; 99 | unsigned char key[IW_ENCODING_TOKEN_MAX]; /* Encoding key used */ 100 | int key_size; /* Number of bytes */ 101 | int key_flags; /* Various flags */ 102 | int has_essid; 103 | int essid_on; 104 | char essid[IW_ESSID_MAX_SIZE + 2]; /* ESSID (extended network) */ 105 | int essid_len; 106 | int has_mode; 107 | int mode; /* Operation mode */ 108 | } wireless_config; 109 | 110 | /* Structure for storing all wireless information for each device 111 | * This is pretty exhaustive... */ 112 | typedef struct wireless_info 113 | { 114 | struct wireless_config b; /* Basic information */ 115 | 116 | int has_sens; 117 | iwparam sens; /* sensitivity */ 118 | int has_nickname; 119 | char nickname[IW_ESSID_MAX_SIZE + 2]; /* NickName */ 120 | int has_ap_addr; 121 | sockaddr ap_addr; /* Access point address */ 122 | int has_bitrate; 123 | iwparam bitrate; /* Bit rate in bps */ 124 | int has_rts; 125 | iwparam rts; /* RTS threshold in bytes */ 126 | int has_frag; 127 | iwparam frag; /* Fragmentation threshold in bytes */ 128 | int has_power; 129 | iwparam power; /* Power management parameters */ 130 | int has_txpower; 131 | iwparam txpower; /* Transmit Power in dBm */ 132 | int has_retry; 133 | iwparam retry; /* Retry limit or lifetime */ 134 | 135 | /* Stats */ 136 | iwstats stats; 137 | int has_stats; 138 | iwrange range; 139 | int has_range; 140 | 141 | /* Auth params for WPA/802.1x/802.11i */ 142 | int auth_key_mgmt; 143 | int has_auth_key_mgmt; 144 | int auth_cipher_pairwise; 145 | int has_auth_cipher_pairwise; 146 | int auth_cipher_group; 147 | int has_auth_cipher_group; 148 | } wireless_info; 149 | 150 | /* Structure for storing an entry of a wireless scan. 151 | * This is only a subset of all possible information, the flexible 152 | * structure of scan results make it impossible to capture all 153 | * information in such a static structure. */ 154 | typedef struct wireless_scan 155 | { 156 | /* Linked list */ 157 | struct wireless_scan * next; 158 | 159 | /* Cell identifiaction */ 160 | int has_ap_addr; 161 | sockaddr ap_addr; /* Access point address */ 162 | 163 | /* Other information */ 164 | struct wireless_config b; /* Basic information */ 165 | iwstats stats; /* Signal strength */ 166 | int has_stats; 167 | iwparam maxbitrate; /* Max bit rate in bps */ 168 | int has_maxbitrate; 169 | } wireless_scan; 170 | 171 | /* 172 | * Context used for non-blocking scan. 173 | */ 174 | typedef struct wireless_scan_head 175 | { 176 | wireless_scan * result; /* Result of the scan */ 177 | int retry; /* Retry level */ 178 | } wireless_scan_head; 179 | 180 | /* Structure used for parsing event streams, such as Wireless Events 181 | * and scan results */ 182 | typedef struct stream_descr 183 | { 184 | char * end; /* End of the stream */ 185 | char * current; /* Current event in stream of events */ 186 | char * value; /* Current value in event */ 187 | } stream_descr; 188 | 189 | /* Prototype for handling display of each single interface on the 190 | * system - see iw_enum_devices() */ 191 | typedef int (*iw_enum_handler)(int skfd, 192 | char * ifname, 193 | char * args[], 194 | int count); 195 | 196 | /* Describe a modulation */ 197 | typedef struct iw_modul_descr 198 | { 199 | unsigned int mask; /* Modulation bitmask */ 200 | char cmd[8]; /* Short name */ 201 | char * verbose; /* Verbose description */ 202 | } iw_modul_descr; 203 | 204 | /**************************** PROTOTYPES ****************************/ 205 | /* 206 | * All the functions in iwlib.c 207 | */ 208 | 209 | /* ---------------------- SOCKET SUBROUTINES -----------------------*/ 210 | int 211 | iw_sockets_open(void); 212 | void 213 | iw_enum_devices(int skfd, 214 | iw_enum_handler fn, 215 | char * args[], 216 | int count); 217 | /* --------------------- WIRELESS SUBROUTINES ----------------------*/ 218 | int 219 | iw_get_kernel_we_version(void); 220 | int 221 | iw_print_version_info(const char * toolname); 222 | int 223 | iw_get_range_info(int skfd, 224 | const char * ifname, 225 | iwrange * range); 226 | int 227 | iw_get_priv_info(int skfd, 228 | const char * ifname, 229 | iwprivargs ** ppriv); 230 | int 231 | iw_get_basic_config(int skfd, 232 | const char * ifname, 233 | wireless_config * info); 234 | int 235 | iw_set_basic_config(int skfd, 236 | const char * ifname, 237 | wireless_config * info); 238 | /* --------------------- PROTOCOL SUBROUTINES --------------------- */ 239 | int 240 | iw_protocol_compare(const char * protocol1, 241 | const char * protocol2); 242 | /* ---------------------- ESSID SUBROUTINES ---------------------- */ 243 | void 244 | iw_essid_escape(char * dest, 245 | const char * src, 246 | const int slen); 247 | int 248 | iw_essid_unescape(char * dest, 249 | const char * src); 250 | /* -------------------- FREQUENCY SUBROUTINES --------------------- */ 251 | void 252 | iw_float2freq(double in, 253 | iwfreq * out); 254 | double 255 | iw_freq2float(const iwfreq * in); 256 | void 257 | iw_print_freq_value(char * buffer, 258 | int buflen, 259 | double freq); 260 | void 261 | iw_print_freq(char * buffer, 262 | int buflen, 263 | double freq, 264 | int channel, 265 | int freq_flags); 266 | int 267 | iw_freq_to_channel(double freq, 268 | const struct iw_range * range); 269 | int 270 | iw_channel_to_freq(int channel, 271 | double * pfreq, 272 | const struct iw_range * range); 273 | void 274 | iw_print_bitrate(char * buffer, 275 | int buflen, 276 | int bitrate); 277 | /* ---------------------- POWER SUBROUTINES ----------------------- */ 278 | int 279 | iw_dbm2mwatt(int in); 280 | int 281 | iw_mwatt2dbm(int in); 282 | void 283 | iw_print_txpower(char * buffer, 284 | int buflen, 285 | struct iw_param * txpower); 286 | /* -------------------- STATISTICS SUBROUTINES -------------------- */ 287 | int 288 | iw_get_stats(int skfd, 289 | const char * ifname, 290 | iwstats * stats, 291 | const iwrange * range, 292 | int has_range); 293 | void 294 | iw_print_stats(char * buffer, 295 | int buflen, 296 | const iwqual * qual, 297 | const iwrange * range, 298 | int has_range); 299 | /* --------------------- ENCODING SUBROUTINES --------------------- */ 300 | void 301 | iw_print_key(char * buffer, 302 | int buflen, 303 | const unsigned char * key, 304 | int key_size, 305 | int key_flags); 306 | int 307 | iw_in_key(const char * input, 308 | unsigned char * key); 309 | int 310 | iw_in_key_full(int skfd, 311 | const char * ifname, 312 | const char * input, 313 | unsigned char * key, 314 | __u16 * flags); 315 | /* ----------------- POWER MANAGEMENT SUBROUTINES ----------------- */ 316 | void 317 | iw_print_pm_value(char * buffer, 318 | int buflen, 319 | int value, 320 | int flags, 321 | int we_version); 322 | void 323 | iw_print_pm_mode(char * buffer, 324 | int buflen, 325 | int flags); 326 | /* --------------- RETRY LIMIT/LIFETIME SUBROUTINES --------------- */ 327 | void 328 | iw_print_retry_value(char * buffer, 329 | int buflen, 330 | int value, 331 | int flags, 332 | int we_version); 333 | /* ----------------------- TIME SUBROUTINES ----------------------- */ 334 | void 335 | iw_print_timeval(char * buffer, 336 | int buflen, 337 | const struct timeval * time, 338 | const struct timezone * tz); 339 | /* --------------------- ADDRESS SUBROUTINES ---------------------- */ 340 | int 341 | iw_check_mac_addr_type(int skfd, 342 | const char * ifname); 343 | int 344 | iw_check_if_addr_type(int skfd, 345 | const char * ifname); 346 | char * 347 | iw_mac_ntop(const unsigned char * mac, 348 | int maclen, 349 | char * buf, 350 | int buflen); 351 | void 352 | iw_ether_ntop(const struct ether_addr * eth, 353 | char * buf); 354 | char * 355 | iw_sawap_ntop(const struct sockaddr * sap, 356 | char * buf); 357 | int 358 | iw_mac_aton(const char * orig, 359 | unsigned char * mac, 360 | int macmax); 361 | int 362 | iw_ether_aton(const char* bufp, struct ether_addr* eth); 363 | int 364 | iw_in_inet(char *bufp, struct sockaddr *sap); 365 | int 366 | iw_in_addr(int skfd, 367 | const char * ifname, 368 | char * bufp, 369 | struct sockaddr * sap); 370 | /* ----------------------- MISC SUBROUTINES ------------------------ */ 371 | int 372 | iw_get_priv_size(int args); 373 | 374 | /* ---------------------- EVENT SUBROUTINES ---------------------- */ 375 | void 376 | iw_init_event_stream(struct stream_descr * stream, 377 | char * data, 378 | int len); 379 | int 380 | iw_extract_event_stream(struct stream_descr * stream, 381 | struct iw_event * iwe, 382 | int we_version); 383 | /* --------------------- SCANNING SUBROUTINES --------------------- */ 384 | int 385 | iw_process_scan(int skfd, 386 | char * ifname, 387 | int we_version, 388 | wireless_scan_head * context); 389 | int 390 | iw_scan(int skfd, 391 | char * ifname, 392 | int we_version, 393 | wireless_scan_head * context); 394 | 395 | /**************************** VARIABLES ****************************/ 396 | 397 | /* Modes as human readable strings */ 398 | extern const char * const iw_operation_mode[]; 399 | #define IW_NUM_OPER_MODE 7 400 | #define IW_NUM_OPER_MODE_EXT 8 401 | 402 | /* Modulations as human readable strings */ 403 | extern const struct iw_modul_descr iw_modul_list[]; 404 | #define IW_SIZE_MODUL_LIST 16 405 | 406 | /************************* INLINE FUNTIONS *************************/ 407 | /* 408 | * Functions that are so simple that it's more efficient inlining them 409 | * Most inline are private because gcc is fussy about inline... 410 | */ 411 | 412 | /* 413 | * Note : I've defined wrapper for the ioctl request so that 414 | * it will be easier to migrate to other kernel API if needed 415 | */ 416 | 417 | /*------------------------------------------------------------------*/ 418 | /* 419 | * Wrapper to push some Wireless Parameter in the driver 420 | */ 421 | static inline __attribute__((always_inline)) int 422 | iw_set_ext(int skfd, /* Socket to the kernel */ 423 | const char * ifname, /* Device name */ 424 | int request, /* WE ID */ 425 | struct iwreq * pwrq) /* Fixed part of the request */ 426 | { 427 | /* Set device name */ 428 | strncpy(pwrq->ifr_name, ifname, IFNAMSIZ); 429 | /* Do the request */ 430 | return(ioctl(skfd, request, pwrq)); 431 | } 432 | 433 | /*------------------------------------------------------------------*/ 434 | /* 435 | * Wrapper to extract some Wireless Parameter out of the driver 436 | */ 437 | static inline __attribute__((always_inline)) int 438 | iw_get_ext(int skfd, /* Socket to the kernel */ 439 | const char * ifname, /* Device name */ 440 | int request, /* WE ID */ 441 | struct iwreq * pwrq) /* Fixed part of the request */ 442 | { 443 | /* Set device name */ 444 | strncpy(pwrq->ifr_name, ifname, IFNAMSIZ); 445 | /* Do the request */ 446 | return(ioctl(skfd, request, pwrq)); 447 | } 448 | 449 | /*------------------------------------------------------------------*/ 450 | /* 451 | * Close the socket used for ioctl. 452 | */ 453 | static inline void 454 | iw_sockets_close(int skfd) 455 | { 456 | close(skfd); 457 | } 458 | 459 | #ifdef __cplusplus 460 | } 461 | #endif 462 | 463 | #endif /* IWLIB_H */ 464 | -------------------------------------------------------------------------------- /iwlist.8: -------------------------------------------------------------------------------- 1 | .\" Jean II - HPLB - 96 2 | .\" iwlist.8 3 | .\" 4 | .TH IWLIST 8 "13 April 2006" "wireless-tools" "Linux Programmer's Manual" 5 | .\" 6 | .\" NAME part 7 | .\" 8 | .SH NAME 9 | iwlist \- Get more detailed wireless information from a wireless interface 10 | .\" 11 | .\" SYNOPSIS part 12 | .\" 13 | .SH SYNOPSIS 14 | .BI "iwlist [" interface "] scanning" 15 | .br 16 | .BI "iwlist [" interface "] frequency" 17 | .br 18 | .BI "iwlist [" interface "] rate" 19 | .br 20 | .BI "iwlist [" interface "] keys" 21 | .br 22 | .BI "iwlist [" interface "] power" 23 | .br 24 | .BI "iwlist [" interface "] txpower" 25 | .br 26 | .BI "iwlist [" interface "] retry" 27 | .br 28 | .BI "iwlist [" interface "] event" 29 | .br 30 | .BI "iwlist [" interface "] auth" 31 | .br 32 | .BI "iwlist [" interface "] wpakeys" 33 | .br 34 | .BI "iwlist [" interface "] genie" 35 | .br 36 | .BI "iwlist [" interface "] modulation" 37 | .br 38 | .BI "iwlist --help" 39 | .br 40 | .BI "iwlist --version" 41 | .\" 42 | .\" DESCRIPTION part 43 | .\" 44 | .SH DESCRIPTION 45 | .B Iwlist 46 | is used to display some additional information from a wireless network 47 | interface that is not displayed by 48 | .IR iwconfig (8). 49 | The main argument is used 50 | to select a category of information, 51 | .B iwlist 52 | displays in detailed form all information related to this category, 53 | including information already shown by 54 | .IR iwconfig (8). 55 | .\" 56 | .\" PARAMETER part 57 | .\" 58 | .SH PARAMETERS 59 | .TP 60 | .BR scan [ning] 61 | Give the list of Access Points and Ad-Hoc cells in range, and 62 | optionally a whole bunch of information about them (ESSID, Quality, 63 | Frequency, Mode...). The type of information returned depends on what 64 | the card supports. 65 | .br 66 | Triggering scanning is a privileged operation 67 | .RI ( root 68 | only) and normal users can only read left-over scan results. By 69 | default, the way scanning is done (the scope of the scan) is dependant 70 | on the card and card settings. 71 | .br 72 | This command takes optional arguments, however most drivers will ignore 73 | those. The option 74 | .B essid 75 | is used to specify a scan on a specific ESSID. With some card/driver, 76 | this enables to see hidden networks. The option 77 | .B last 78 | does not trigger a scan and read left-over scan results. 79 | .TP 80 | .BR freq [uency]/ channel 81 | Give the list of available frequencies in the device and the number of 82 | defined channels. Please note that usually the driver returns the 83 | total number of channels and only the frequencies available in the 84 | present locale, so there is no one-to-one mapping between frequencies 85 | displayed and channel numbers. 86 | .TP 87 | .BR rate / bit [rate] 88 | List the bit-rates supported by the device. 89 | .TP 90 | .BR keys / enc [ryption] 91 | List the encryption key sizes supported and list all the encryption 92 | keys set in the device. 93 | .TP 94 | .B power 95 | List the various Power Management attributes and modes of the device. 96 | .TP 97 | .B txpower 98 | List the various Transmit Powers available on the device. 99 | .TP 100 | .B retry 101 | List the transmit retry limits and retry lifetime on the device. 102 | .TP 103 | .BR ap / accesspoint / peers 104 | Give the list of Access Points in range, and optionally the quality of 105 | link to them. This feature is 106 | .B obsolete 107 | and now deprecated in favor of scanning support (above), and most 108 | drivers don't support it. 109 | .br 110 | Some drivers may use this command to return a specific list of Peers 111 | or Access Points, such as the list of Peers associated/registered with 112 | the card. See your driver documentation for details. 113 | .TP 114 | .B event 115 | List the wireless events supported by the device. 116 | .TP 117 | .B auth 118 | List the WPA authentication parametes curently set. 119 | .TP 120 | .BR wpa [keys] 121 | List all the WPA encryption keys set in the device. 122 | .TP 123 | .B genie 124 | List the Generic Information Elements set in the device (used for WPA 125 | support). 126 | .TP 127 | .BR modu [lation] 128 | List the modulations supported by the device and the modulations 129 | currently enabled. 130 | .TP 131 | .B --version 132 | Display the version of the tools, as well as the recommended and 133 | current Wireless Extensions version for the tool and the various 134 | wireless interfaces. 135 | .TP 136 | .B --help 137 | Display short help message. 138 | .\" 139 | .\" FILES part 140 | .\" 141 | .SH FILES 142 | .I /proc/net/wireless 143 | .\" 144 | .\" SEE ALSO part 145 | .\" 146 | .SH SEE ALSO 147 | .BR iwconfig (8), 148 | .BR iwspy (8). 149 | .BR iwevent (8), 150 | .BR iwpriv (8), 151 | .BR wireless (7). 152 | 153 | -------------------------------------------------------------------------------- /iwmulticall.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Wireless Tools 3 | * 4 | * Jean II - HPL 04 5 | * 6 | * Main code for "iwmulticall". This is a wrapper for the multicall version 7 | * of the wireless tools. 8 | * You need to link this code against "-lm". 9 | * Thanks to Ned Ludd for the inspiration... 10 | * 11 | * This file is released under the GPL license. 12 | * Copyright (c) 1997-2004 Jean Tourrilhes 13 | */ 14 | 15 | /***************************** INCLUDES *****************************/ 16 | 17 | #include /* Basename */ 18 | 19 | /**************************** PROTOTYPES ****************************/ 20 | 21 | /* Prototypes of the main of each tool */ 22 | extern int 23 | main_iwconfig(int argc, 24 | char ** argv); 25 | extern int 26 | main_iwlist(int argc, 27 | char ** argv); 28 | extern int 29 | main_iwspy(int argc, 30 | char ** argv); 31 | extern int 32 | main_iwpriv(int argc, 33 | char ** argv); 34 | extern int 35 | main_iwgetid(int argc, 36 | char ** argv); 37 | 38 | /************************** MULTICALL HACK **************************/ 39 | /* 40 | * The idea for multicall is to put all the tools and the library in 41 | * the same binary. This way, you can save the overhead of the library, 42 | * of each tool, can better optimise the code and throw away the stuff 43 | * you don't need from the library. 44 | * This almost divide the size of the tools by two (without stripping). 45 | * On the down side, you no longer have the libiw for other tools to 46 | * use, but for the target systems (embedded), this doesn't matter 47 | * much, as they just need to configure the card... 48 | * Note that splitting the lib and the multicall tools would not 49 | * make sense, as most gains are found in the inclusion of the lib... 50 | * 51 | * Our strategy is to include directly the *.c, rather than compile 52 | * them separatly. This allow to simplify compilation and hide the 53 | * multicall tweaks from the other tools. 54 | * Yeah, this leads to a bit a preprocessor abuse... 55 | * Jean II 56 | */ 57 | 58 | /* We need the library */ 59 | #include "iwlib.c" 60 | 61 | /* Get iwconfig in there. Mandatory. */ 62 | #define main(args...) main_iwconfig(args) 63 | #define iw_usage(args...) iwconfig_usage(args) 64 | #define find_command(args...) iwconfig_find_command(args) 65 | #include "iwconfig.c" 66 | #undef find_command 67 | #undef iw_usage 68 | #undef main 69 | 70 | /* Get iwlist in there. Scanning support is pretty sweet. */ 71 | #define main(args...) main_iwlist(args) 72 | #define iw_usage(args...) iwlist_usage(args) 73 | #define find_command(args...) iwlist_find_command(args) 74 | #include "iwlist.c" 75 | #undef find_command 76 | #undef iw_usage 77 | #undef main 78 | 79 | #ifndef WE_ESSENTIAL 80 | /* Get iwspy in there, it's not that big. */ 81 | #define main(args...) main_iwspy(args) 82 | #include "iwspy.c" 83 | #undef main 84 | #endif /* WE_ESSENTIAL */ 85 | 86 | /* Get iwpriv in there. Mandatory for HostAP and some other drivers. */ 87 | #define main(args...) main_iwpriv(args) 88 | #define iw_usage(args...) iwpriv_usage(args) 89 | #include "iwpriv.c" 90 | #undef iw_usage 91 | #undef main 92 | 93 | /* Do we really need iwgetid ? Well, it's not like it's a big one */ 94 | #define main(args...) main_iwgetid(args) 95 | #define iw_usage(args...) iwgetid_usage(args) 96 | #include "iwgetid.c" 97 | #undef iw_usage 98 | #undef main 99 | 100 | /* iwevent is useless for most people, don't grab it ? */ 101 | 102 | /* ifrename is big and useless for those systems */ 103 | 104 | 105 | /******************************* MAIN ********************************/ 106 | 107 | /*------------------------------------------------------------------*/ 108 | /* 109 | * The main ! 110 | */ 111 | int 112 | main(int argc, 113 | char ** argv) 114 | { 115 | char * call_name = basename(argv[0]); /* Strip path */ 116 | 117 | /* This is a testing hack */ 118 | if(!strcmp(call_name, "iwmulticall") && (argc > 0)) 119 | { 120 | argv++; 121 | argc--; 122 | call_name = basename(argv[0]); 123 | } 124 | 125 | /* Just check the name under which we were called... */ 126 | 127 | if(!strcmp(call_name, "iwconfig")) 128 | return(main_iwconfig(argc, argv)); 129 | if(!strcmp(call_name, "iwlist")) 130 | return(main_iwlist(argc, argv)); 131 | #ifndef WE_ESSENTIAL 132 | if(!strcmp(call_name, "iwspy")) 133 | return(main_iwspy(argc, argv)); 134 | #endif /* WE_ESSENTIAL */ 135 | if(!strcmp(call_name, "iwpriv")) 136 | return(main_iwpriv(argc, argv)); 137 | if(!strcmp(call_name, "iwgetid")) 138 | return(main_iwgetid(argc, argv)); 139 | 140 | /* Uh oh... Not supposed to come here. */ 141 | printf("iwmulticall : you are not supposed to call me this way...\n"); 142 | return(0); 143 | } 144 | -------------------------------------------------------------------------------- /iwpriv.8: -------------------------------------------------------------------------------- 1 | .\" Jean II - HPLB - 96 2 | .\" iwpriv.8 3 | .\" 4 | .TH IWPRIV 8 "31 October 1996" "net-tools" "Linux Programmer's Manual" 5 | .\" 6 | .\" NAME part 7 | .\" 8 | .SH NAME 9 | iwpriv \- configure optionals (private) parameters of a wireless 10 | network interface 11 | .\" 12 | .\" SYNOPSIS part 13 | .\" 14 | .SH SYNOPSIS 15 | .BI "iwpriv [" interface ] 16 | .br 17 | .BI "iwpriv " "interface private-command " "[" private-parameters ] 18 | .br 19 | .BI "iwpriv " "interface private-command " [ I "] [" private-parameters ] 20 | .br 21 | .BI "iwpriv " interface " --all" 22 | .\" 23 | .\" DESCRIPTION part 24 | .\" 25 | .SH DESCRIPTION 26 | .B Iwpriv 27 | is the companion tool to 28 | .IR iwconfig (8). 29 | .B Iwpriv 30 | deals with parameters and setting specific to each driver (as opposed to 31 | .I iwconfig 32 | which deals with generic ones). 33 | .PP 34 | Without any argument, 35 | .B iwpriv 36 | list the available private commands available on each interface, and 37 | the parameters that they require. Using this information, the user may 38 | apply those interface specific commands on the specified interface. 39 | .PP 40 | In theory, the documentation of each device driver should indicate how 41 | to use those interface specific commands and their effect. 42 | .\" 43 | .\" PARAMETER part 44 | .\" 45 | .SH PARAMETERS 46 | .TP 47 | .IR private-command " [" private-parameters ] 48 | Execute the specified 49 | .I private-command 50 | on the interface. 51 | .br 52 | The command may optionally take or require arguments, and may display 53 | information. Therefore, the command line parameters may or may not be 54 | needed and should match the command expectations. The list of commands 55 | that 56 | .B iwpriv 57 | displays (when called without argument) should give you some hints 58 | about those parameters. 59 | .br 60 | However you should refer to the device driver documentation for 61 | information on how to properly use the command and the effect. 62 | .TP 63 | .IR "private-command " [ I "] [" private-parameters ] 64 | Idem, except that 65 | .I I 66 | (an integer) is passed to the command as a 67 | .IR "Token Index" . 68 | Only some command will use the Token Index (most will ignore it), and 69 | the driver documentation should tell you when it's needed. 70 | .TP 71 | .BR -a / --all 72 | Execute and display all the private commands that don't take any 73 | arguments (i.e. read only). 74 | .\" 75 | .\" DISPLAY part 76 | .\" 77 | .SH DISPLAY 78 | For each device which support private commands, 79 | .I iwpriv 80 | will display the list of private commands available. 81 | .PP 82 | This include the name of the private command, the number or arguments 83 | that may be set and their type, and the number or arguments that may 84 | be display and their type. 85 | .PP 86 | For example, you may have the following display : 87 | .br 88 | .B "eth0 Available private ioctl :" 89 | .br 90 | .B " setqualthr (89F0) : set 1 byte & get 0" 91 | .br 92 | .B " gethisto (89F7) : set 0 & get 16 int" 93 | .PP 94 | This indicate that you may set the quality threshold and display an 95 | histogram of up to 16 values with the following commands : 96 | .br 97 | .I " iwpriv eth0 setqualthr 20" 98 | .br 99 | .I " iwpriv eth0 gethisto" 100 | .\" 101 | .\" AUTHOR part 102 | .\" 103 | .SH AUTHOR 104 | Jean Tourrilhes \- jt@hpl.hp.com 105 | .\" 106 | .\" FILES part 107 | .\" 108 | .SH FILES 109 | .I /proc/net/wireless 110 | .\" 111 | .\" SEE ALSO part 112 | .\" 113 | .SH SEE ALSO 114 | .BR iwconfig (8), 115 | .BR iwlist (8), 116 | .BR iwevent (8), 117 | .BR iwspy (8), 118 | .BR wireless (7). 119 | -------------------------------------------------------------------------------- /iwspy.8: -------------------------------------------------------------------------------- 1 | .\" Jean II - HPLB - 96 2 | .\" iwspy.8 3 | .\" 4 | .TH IWSPY 8 "31 October 1996" "net-tools" "Linux Programmer's Manual" 5 | .\" 6 | .\" NAME part 7 | .\" 8 | .SH NAME 9 | iwspy \- Get wireless statistics from specific nodes 10 | .\" 11 | .\" SYNOPSIS part 12 | .\" 13 | .SH SYNOPSIS 14 | .BI "iwspy [" interface ] 15 | .br 16 | .BI "iwspy " interface " [+] " DNSNAME " | " IPADDR " | " HWADDR " [...]" 17 | .br 18 | .BI "iwspy " interface " off" 19 | .br 20 | .BI "iwspy " interface " setthr " "low high" 21 | .br 22 | .BI "iwspy " interface " getthr" 23 | .\" 24 | .\" DESCRIPTION part 25 | .\" 26 | .SH DESCRIPTION 27 | .B Iwspy 28 | is used to set a list of addresses to monitor in a wireless network 29 | interface and to read back quality of link information for each of 30 | those. This information is the same as the one available in 31 | .I /proc/net/wireless 32 | : quality of the link, signal strength and noise level. 33 | .PP 34 | This information is updated each time a new packet is received, so 35 | each address of the list adds some overhead in the driver. 36 | .PP 37 | Note that this functionality works only for nodes part of the current 38 | wireless cell, you can not monitor Access Points you are not 39 | associated with (you can use Scanning for that) and nodes in other 40 | cells. In Managed mode, in most case packets are relayed by the Access 41 | Point, in this case you will get the signal strength of the Access 42 | Point. For those reasons this functionality is mostly useful in Ad-Hoc 43 | and Master mode. 44 | .\" 45 | .\" PARAMETER part 46 | .\" 47 | .SH PARAMETERS 48 | You may set any number of addresses up to 8. 49 | .TP 50 | .BR DNSNAME " | " IPADDR 51 | Set an IP address, or in some cases a DNS name (using the name 52 | resolver). As the hardware works with hardware addresses, 53 | .B iwspy 54 | will translate this IP address through 55 | .IR ARP . 56 | In some case, this address might not be in the ARP cache and 57 | .B iwspy 58 | will fail. In those case, 59 | .IR ping (8) 60 | this name/address and retry. 61 | .TP 62 | .B HWADDR 63 | Set a hardware (MAC) address (this address is not translated & checked 64 | like the IP one). The address must contain a colon 65 | .RB ( : ) 66 | to be recognised as a hardware address. 67 | .TP 68 | .B + 69 | Add the new set of addresses at the end of the current list instead of 70 | replacing it. The address list is unique for each device, so each user 71 | should use this option to avoid conflicts. 72 | .TP 73 | .B off 74 | Remove the current list of addresses and disable the spy functionality 75 | .TP 76 | .B setthr 77 | Set the 78 | .I low 79 | and 80 | .I high 81 | signal strength threshold for the iwspy event (for drivers that 82 | support it). 83 | .br 84 | Every time the signal strength for any of the address monitored 85 | with iwspy goes lower than the low threshold or goes higher than the 86 | high threshold, a Wireless Event will be generated. 87 | .br 88 | This can be used to monitor link outages without having to run iwspy 89 | periodically. 90 | .TP 91 | .B getthr 92 | Retrieve the current 93 | .I low 94 | and 95 | .I high 96 | signal strength threshold for the iwspy event. 97 | \" 98 | .\" FILES part 99 | .\" 100 | .SH FILES 101 | .I /proc/net/wireless 102 | .\" 103 | .\" SEE ALSO part 104 | .\" 105 | .SH SEE ALSO 106 | .BR iwconfig (8), 107 | .BR iwlist (8), 108 | .BR iwevent (8), 109 | .BR iwpriv (8), 110 | .BR wireless (7). 111 | 112 | -------------------------------------------------------------------------------- /iwspy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Wireless Tools 3 | * 4 | * Jean II - HPLB '99 - HPL 99->04 5 | * 6 | * This tool can manipulate the spy list : add addresses and display stat 7 | * You need to link this code against "iwlib.c" and "-lm". 8 | * 9 | * This file is released under the GPL license. 10 | * Copyright (c) 1997-2004 Jean Tourrilhes 11 | */ 12 | 13 | #include "iwlib-private.h" /* Private header */ 14 | 15 | /************************* DISPLAY ROUTINES **************************/ 16 | 17 | /*------------------------------------------------------------------*/ 18 | /* 19 | * Display the spy list of addresses and the associated stats 20 | */ 21 | static int 22 | print_spy_info(int skfd, 23 | char * ifname, 24 | char * args[], 25 | int count) 26 | { 27 | struct iwreq wrq; 28 | char buffer[(sizeof(struct iw_quality) + 29 | sizeof(struct sockaddr)) * IW_MAX_SPY]; 30 | char temp[128]; 31 | struct sockaddr * hwa; 32 | struct iw_quality * qual; 33 | iwrange range; 34 | int has_range = 0; 35 | int n; 36 | int i; 37 | 38 | /* Avoid "Unused parameter" warning */ 39 | args = args; count = count; 40 | 41 | /* Collect stats */ 42 | wrq.u.data.pointer = (caddr_t) buffer; 43 | wrq.u.data.length = IW_MAX_SPY; 44 | wrq.u.data.flags = 0; 45 | if(iw_get_ext(skfd, ifname, SIOCGIWSPY, &wrq) < 0) 46 | { 47 | fprintf(stderr, "%-8.16s Interface doesn't support wireless statistic collection\n\n", ifname); 48 | return(-1); 49 | } 50 | 51 | /* Number of addresses */ 52 | n = wrq.u.data.length; 53 | 54 | /* Check if we have valid mac address type */ 55 | if(iw_check_mac_addr_type(skfd, ifname) < 0) 56 | { 57 | fprintf(stderr, "%-8.16s Interface doesn't support MAC addresses\n\n", ifname); 58 | return(-2); 59 | } 60 | 61 | /* Get range info if we can */ 62 | if(iw_get_range_info(skfd, ifname, &(range)) >= 0) 63 | has_range = 1; 64 | 65 | /* Display it */ 66 | if(n == 0) 67 | printf("%-8.16s No statistics to collect\n", ifname); 68 | else 69 | printf("%-8.16s Statistics collected:\n", ifname); 70 | 71 | /* The two lists */ 72 | hwa = (struct sockaddr *) buffer; 73 | qual = (struct iw_quality *) (buffer + (sizeof(struct sockaddr) * n)); 74 | 75 | for(i = 0; i < n; i++) 76 | { 77 | /* Print stats for each address */ 78 | printf(" %s : ", iw_saether_ntop(&hwa[i], temp)); 79 | iw_print_stats(temp, sizeof(temp), &qual[i], &range, has_range); 80 | printf("%s\n", temp); 81 | } 82 | 83 | if((n > 0) && (has_range) && (range.we_version_compiled > 11)) 84 | { 85 | iwstats stats; 86 | 87 | /* Get /proc/net/wireless */ 88 | if(iw_get_stats(skfd, ifname, &stats, &range, has_range) >= 0) 89 | { 90 | iw_print_stats(temp, sizeof(temp), &stats.qual, &range, has_range); 91 | printf(" Link/Cell/AP : %s\n", temp); 92 | /* Display the static data */ 93 | iw_print_stats(temp, sizeof(temp), 94 | &range.avg_qual, &range, has_range); 95 | printf(" Typical/Reference : %s\n", temp); 96 | } 97 | } 98 | 99 | printf("\n"); 100 | return(0); 101 | } 102 | 103 | /*------------------------------------------------------------------*/ 104 | /* 105 | * Get spy thresholds from the driver and display 106 | */ 107 | static int 108 | get_spy_threshold(int skfd, /* The socket */ 109 | char * ifname, /* Dev name */ 110 | char * args[], /* Command line args */ 111 | int count) /* Args count */ 112 | { 113 | struct iwreq wrq; 114 | struct iw_thrspy threshold; 115 | iwrange range; 116 | int has_range = 0; 117 | 118 | /* Avoid "Unused parameter" warning */ 119 | args = args; count = count; 120 | 121 | /* Time to send thresholds to the driver */ 122 | wrq.u.data.pointer = (caddr_t) &threshold; 123 | wrq.u.data.length = 1; 124 | wrq.u.data.flags = 0; 125 | if(iw_set_ext(skfd, ifname, SIOCGIWTHRSPY, &wrq) < 0) 126 | { 127 | fprintf(stderr, "Interface doesn't support thresholds...\n"); 128 | fprintf(stderr, "SIOCGIWTHRSPY: %s\n", strerror(errno)); 129 | return(-1); 130 | } 131 | 132 | /* Get range info if we can */ 133 | if(iw_get_range_info(skfd, ifname, &(range)) >= 0) 134 | has_range = 1; 135 | 136 | /* Display thresholds */ 137 | if((has_range) && (threshold.low.level)) 138 | { 139 | /* If the statistics are in dBm */ 140 | if(threshold.low.level > range.max_qual.level) 141 | { 142 | /* Statistics are in dBm (absolute power measurement) */ 143 | printf("%-8.16s Low threshold:%d dBm High threshold:%d dBm\n\n", 144 | ifname, 145 | threshold.low.level - 0x100, threshold.high.level - 0x100); 146 | } 147 | else 148 | { 149 | /* Statistics are relative values (0 -> max) */ 150 | printf("%-8.16s Low threshold:%d/%d High threshold:%d/%d\n\n", 151 | ifname, 152 | threshold.low.level, range.max_qual.level, 153 | threshold.high.level, range.max_qual.level); 154 | } 155 | } 156 | else 157 | { 158 | /* We can't read the range, so we don't know... */ 159 | printf("%-8.16s Low threshold:%d High threshold:%d\n\n", 160 | ifname, 161 | threshold.low.level, threshold.high.level); 162 | } 163 | 164 | return(0); 165 | } 166 | 167 | /************************* SETTING ROUTINES **************************/ 168 | 169 | /*------------------------------------------------------------------*/ 170 | /* 171 | * Set list of addresses specified on command line in the driver. 172 | */ 173 | static int 174 | set_spy_info(int skfd, /* The socket */ 175 | char * ifname, /* Dev name */ 176 | char * args[], /* Command line args */ 177 | int count) /* Args count */ 178 | { 179 | struct iwreq wrq; 180 | int i; 181 | int nbr; /* Number of valid addresses */ 182 | struct sockaddr hw_address[IW_MAX_SPY]; 183 | 184 | /* Read command line */ 185 | i = 0; /* first arg to read */ 186 | nbr = 0; /* Number of args read so far */ 187 | 188 | /* "off" : disable functionality (set 0 addresses) */ 189 | if(!strcmp(args[0], "off")) 190 | i = 1; /* skip the "off" */ 191 | else 192 | { 193 | /* "+" : add all addresses already in the driver */ 194 | if(!strcmp(args[0], "+")) 195 | { 196 | char buffer[(sizeof(struct iw_quality) + 197 | sizeof(struct sockaddr)) * IW_MAX_SPY]; 198 | 199 | /* Check if we have valid mac address type */ 200 | if(iw_check_mac_addr_type(skfd, ifname) < 0) 201 | { 202 | fprintf(stderr, "%-8.16s Interface doesn't support MAC addresses\n", ifname); 203 | return(-1); 204 | } 205 | 206 | wrq.u.data.pointer = (caddr_t) buffer; 207 | wrq.u.data.length = IW_MAX_SPY; 208 | wrq.u.data.flags = 0; 209 | if(iw_get_ext(skfd, ifname, SIOCGIWSPY, &wrq) < 0) 210 | { 211 | fprintf(stderr, "Interface doesn't accept reading addresses...\n"); 212 | fprintf(stderr, "SIOCGIWSPY: %s\n", strerror(errno)); 213 | return(-1); 214 | } 215 | 216 | /* Copy old addresses */ 217 | nbr = wrq.u.data.length; 218 | memcpy(hw_address, buffer, nbr * sizeof(struct sockaddr)); 219 | 220 | i = 1; /* skip the "+" */ 221 | } 222 | 223 | /* Read other args on command line */ 224 | while((i < count) && (nbr < IW_MAX_SPY)) 225 | { 226 | /* Get the address and check if the interface supports it */ 227 | if(iw_in_addr(skfd, ifname, args[i++], &(hw_address[nbr])) < 0) 228 | continue; 229 | nbr++; 230 | } 231 | 232 | /* Check the number of addresses */ 233 | if(nbr == 0) 234 | { 235 | fprintf(stderr, "No valid addresses found : exiting...\n"); 236 | return(-1); 237 | } 238 | } 239 | 240 | /* Check if there is some remaining arguments */ 241 | if(i < count) 242 | { 243 | fprintf(stderr, "Got only the first %d arguments, remaining discarded\n", i); 244 | } 245 | 246 | /* Time to do send addresses to the driver */ 247 | wrq.u.data.pointer = (caddr_t) hw_address; 248 | wrq.u.data.length = nbr; 249 | wrq.u.data.flags = 0; 250 | if(iw_set_ext(skfd, ifname, SIOCSIWSPY, &wrq) < 0) 251 | { 252 | fprintf(stderr, "Interface doesn't accept addresses...\n"); 253 | fprintf(stderr, "SIOCSIWSPY: %s\n", strerror(errno)); 254 | return(-1); 255 | } 256 | 257 | return(0); 258 | } 259 | 260 | /*------------------------------------------------------------------*/ 261 | /* 262 | * Set spy thresholds in the driver from command line 263 | */ 264 | static int 265 | set_spy_threshold(int skfd, /* The socket */ 266 | char * ifname, /* Dev name */ 267 | char * args[], /* Command line args */ 268 | int count) /* Args count */ 269 | { 270 | struct iwreq wrq; 271 | struct iw_thrspy threshold; 272 | int low_thr; 273 | int high_thr; 274 | 275 | /* Init */ 276 | memset(&threshold, '\0', sizeof(threshold)); 277 | 278 | /* "off" : disable functionality (set 0 addresses) */ 279 | if(!strcmp(args[0], "off")) 280 | { 281 | /* Just send null threshold, will disable it */ 282 | } 283 | else 284 | { 285 | /* Try to get our threshold */ 286 | if(count < 2) 287 | { 288 | fprintf(stderr, "%-8.16s Need two threshold values\n", ifname); 289 | return(-1); 290 | } 291 | if((sscanf(args[0], "%i", &low_thr) != 1) || 292 | (sscanf(args[1], "%i", &high_thr) != 1)) 293 | { 294 | fprintf(stderr, "%-8.16s Invalid threshold values\n", ifname); 295 | return(-1); 296 | } 297 | /* Basic sanity check */ 298 | if(high_thr < low_thr) 299 | { 300 | fprintf(stderr, "%-8.16s Inverted threshold range\n", ifname); 301 | return(-1); 302 | } 303 | /* Copy thresholds */ 304 | threshold.low.level = low_thr; 305 | threshold.low.updated = 0x2; 306 | threshold.high.level = high_thr; 307 | threshold.high.updated = 0x2; 308 | } 309 | 310 | /* Time to send thresholds to the driver */ 311 | wrq.u.data.pointer = (caddr_t) &threshold; 312 | wrq.u.data.length = 1; 313 | wrq.u.data.flags = 0; 314 | if(iw_set_ext(skfd, ifname, SIOCSIWTHRSPY, &wrq) < 0) 315 | { 316 | fprintf(stderr, "Interface doesn't accept thresholds...\n"); 317 | fprintf(stderr, "SIOCSIWTHRSPY: %s\n", strerror(errno)); 318 | return(-1); 319 | } 320 | 321 | return(0); 322 | } 323 | 324 | /******************************* MAIN ********************************/ 325 | 326 | /*------------------------------------------------------------------*/ 327 | /* 328 | * The main ! 329 | */ 330 | int 331 | main(int argc, 332 | char ** argv) 333 | { 334 | int skfd; /* generic raw socket desc. */ 335 | int goterr = 0; 336 | 337 | /* Create a channel to the NET kernel. */ 338 | if((skfd = iw_sockets_open()) < 0) 339 | { 340 | perror("socket"); 341 | return(-1); 342 | } 343 | 344 | /* No argument : show the list of all device + info */ 345 | if(argc == 1) 346 | iw_enum_devices(skfd, &print_spy_info, NULL, 0); 347 | else 348 | /* Special cases take one... */ 349 | /* Help */ 350 | if((!strcmp(argv[1], "-h")) || (!strcmp(argv[1], "--help"))) 351 | fprintf(stderr, "Usage: iwspy interface [+] [MAC address] [IP address]\n"); 352 | else 353 | /* Version */ 354 | if (!strcmp(argv[1], "-v") || !strcmp(argv[1], "--version")) 355 | goterr = iw_print_version_info("iwspy"); 356 | else 357 | /* The device name must be the first argument */ 358 | /* Name only : show spy list for that device only */ 359 | if(argc == 2) 360 | goterr = print_spy_info(skfd, argv[1], NULL, 0); 361 | else 362 | /* Special commands */ 363 | if(!strcmp(argv[2], "setthr")) 364 | goterr = set_spy_threshold(skfd, argv[1], argv + 3, argc - 3); 365 | else 366 | if(!strcmp(argv[2], "getthr")) 367 | goterr = get_spy_threshold(skfd, argv[1], argv + 3, argc - 3); 368 | else 369 | /* Otherwise, it's a list of address to set in the spy list */ 370 | goterr = set_spy_info(skfd, argv[1], argv + 2, argc - 2); 371 | 372 | /* Close the socket. */ 373 | iw_sockets_close(skfd); 374 | 375 | return(goterr); 376 | } 377 | -------------------------------------------------------------------------------- /macaddr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * macaddr 3 | * 4 | * Program to return the MAC address of an Ethernet 5 | * adapter. This was written to help configure the 6 | * adapter based on the MAC address rather than the 7 | * name. 8 | * 9 | * Version 1.0 Eric Dittman 2001-10-19 10 | * 11 | * This is released unther the GPL license. 12 | */ 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #include "iwlib-private.h" 23 | 24 | int main(int argc, char** argv) 25 | { 26 | 27 | int devsock; 28 | struct ifreq ifbuffer; 29 | char buf[20]; 30 | 31 | if ((argc != 2) || (argv[1][0] == '-')) { 32 | printf("Usage: macaddr interface\n"); 33 | exit(1); 34 | } 35 | 36 | devsock = socket(AF_INET, SOCK_STREAM, 0); 37 | 38 | if (devsock == -1) { 39 | perror("Failed opening socket"); 40 | exit (1); 41 | } 42 | 43 | memset(&ifbuffer, 0, sizeof(ifbuffer)); 44 | strncpy(ifbuffer.ifr_name, argv[1], sizeof(ifbuffer.ifr_name)); 45 | if (ioctl(devsock, SIOCGIFHWADDR, &ifbuffer) == -1) { 46 | fprintf(stderr, "There is no MACADDR for %s\n", argv[1]); 47 | exit(1); 48 | } 49 | close(devsock); 50 | 51 | puts(iw_saether_ntop(&ifbuffer.ifr_ifru.ifru_hwaddr, buf)); 52 | 53 | exit(0); 54 | } 55 | -------------------------------------------------------------------------------- /sample_enc.c: -------------------------------------------------------------------------------- 1 | /* Note : this particular snipset of code is available under 2 | * the LGPL, MPL or BSD license (at your choice). 3 | * Jean II 4 | */ 5 | 6 | /* --------------------------- INCLUDE --------------------------- */ 7 | 8 | #define MAX_KEY_SIZE 16 9 | #define MAX_KEYS 8 10 | int key_on = 0; 11 | int key_open = 1; 12 | int key_current = 0; 13 | char key_table[MAX_KEYS][MAX_KEY_SIZE]; 14 | int key_size[MAX_KEYS]; 15 | 16 | /* --------------------------- HANDLERS --------------------------- */ 17 | 18 | static int ioctl_set_encode(struct net_device *dev, 19 | struct iw_request_info *info, 20 | struct iw_point *erq, 21 | char *key) 22 | { 23 | int index = (erq->flags & IW_ENCODE_INDEX) - 1; 24 | 25 | if (erq->length > 0) 26 | { 27 | /* Check the size of the key */ 28 | if(erq->length > MAX_KEY_SIZE) 29 | return(-EINVAL); 30 | 31 | /* Check the index */ 32 | if((index < 0) || (index >= MAX_KEYS)) 33 | index = key_current; 34 | 35 | /* Copy the key in the driver */ 36 | memcpy(key_table[index], key, erq->length); 37 | key_size[index] = erq->length; 38 | key_on = 1; 39 | } 40 | else 41 | { 42 | /* Do we want to just set the current key ? */ 43 | if((index >= 0) && (index < MAX_KEYS)) 44 | { 45 | if(key_size[index] > 0) 46 | { 47 | key_current = index; 48 | key_on = 1; 49 | } 50 | else 51 | return(-EINVAL); 52 | } 53 | } 54 | 55 | /* Read the flags */ 56 | if(erq->flags & IW_ENCODE_DISABLED) 57 | key_on = 0; /* disable encryption */ 58 | if(erq->flags & IW_ENCODE_RESTRICTED) 59 | key_open = 0; /* disable open mode */ 60 | if(erq->flags & IW_ENCODE_OPEN) 61 | key_open = 1; /* enable open mode */ 62 | 63 | return(0); 64 | } 65 | 66 | static int ioctl_get_encode(struct net_device *dev, 67 | struct iw_request_info *info, 68 | struct iw_point *erq, 69 | char *key) 70 | { 71 | int index = (erq->flags & IW_ENCODE_INDEX) - 1; 72 | 73 | /* Set the flags */ 74 | erq->flags = 0; 75 | if(key_on == 0) 76 | erq->flags |= IW_ENCODE_DISABLED; 77 | if(key_open == 0) 78 | erq->flags |= IW_ENCODE_RESTRICTED; 79 | else 80 | erq->flags |= IW_ENCODE_OPEN; 81 | 82 | /* Which key do we want */ 83 | if((index < 0) || (index >= MAX_KEYS)) 84 | index = key_current; 85 | erq->flags |= index + 1; 86 | 87 | /* Copy the key to the user buffer */ 88 | erq->length = key_size[index]; 89 | memcpy(key, key_table[index], key_size[index]); 90 | 91 | return(0); 92 | } 93 | 94 | static int ioctl_get_range(struct net_device *dev, 95 | struct iw_request_info *info, 96 | struct iw_point *rrq, 97 | char *extra) 98 | { 99 | struct iw_range *range = (struct iw_range *) extra; 100 | 101 | rrq->length = sizeof(struct iw_range); 102 | 103 | memset(range, 0, sizeof(struct iw_range)); 104 | 105 | #if WIRELESS_EXT > 10 106 | /* Version we are compiled with */ 107 | range->we_version_compiled = WIRELESS_EXT; 108 | /* Minimum version we recommend */ 109 | range->we_version_source = 8; 110 | #endif /* WIRELESS_EXT > 10 */ 111 | 112 | #if WIRELESS_EXT > 8 113 | range->encoding_size[0] = 8; /* DES = 64 bits key */ 114 | range->encoding_size[1] = 16; 115 | range->num_encoding_sizes = 2; 116 | range->max_encoding_tokens = 8; 117 | #endif /* WIRELESS_EXT > 8 */ 118 | return(0); 119 | } 120 | 121 | /* --------------------------- BINDING --------------------------- */ 122 | 123 | #if WIRELESS_EXT > 12 124 | static const iw_handler handler_table[] = 125 | { 126 | ... 127 | (iw_handler) ioctl_set_encode, /* SIOCSIWENCODE */ 128 | (iw_handler) ioctl_get_encode, /* SIOCGIWENCODE */ 129 | }; 130 | #else /* WIRELESS_EXT < 12 */ 131 | static int 132 | do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 133 | { 134 | struct iwreq *wrq = (struct iwreq *) ifr; 135 | int err = 0; 136 | 137 | switch (cmd) 138 | { 139 | #if WIRELESS_EXT > 8 140 | case SIOCSIWENCODE: 141 | { 142 | char keybuf[MAX_KEY_SIZE]; 143 | if(wrq->u.encoding.pointer) 144 | { 145 | /* We actually have a key to set */ 146 | if(wrq->u.encoding.length > MAX_KEY_SIZE) 147 | { 148 | err = -E2BIG; 149 | break; 150 | } 151 | if(copy_from_user(keybuf, wrq->u.encoding.pointer, 152 | wrq->u.encoding.length)) 153 | { 154 | err = -EFAULT; 155 | break; 156 | } 157 | } 158 | else 159 | if(wrq->u.encoding.length != 0) 160 | { 161 | err = -EINVAL; 162 | break; 163 | } 164 | err = ioctl_set_encode(dev, NULL, &(wrq->u.encoding), keybuf); 165 | } 166 | break; 167 | 168 | case SIOCGIWENCODE: 169 | /* only super-user can see encryption key */ 170 | if(! capable(CAP_NET_ADMIN)) 171 | { 172 | err = -EPERM; 173 | break; 174 | } 175 | { 176 | char keybuf[MAX_KEY_SIZE]; 177 | err = ioctl_get_encode(dev, NULL, &(wrq->u.encoding), keybuf); 178 | if(wrq->u.encoding.pointer) 179 | { 180 | if (copy_to_user(wrq->u.encoding.pointer, keybuf, 181 | wrq->u.encoding.length)) 182 | err= -EFAULT; 183 | } 184 | } 185 | break; 186 | #endif /* WIRELESS_EXT > 8 */ 187 | } 188 | return(err); 189 | } 190 | #endif /* WIRELESS_EXT < 12 */ 191 | 192 | -------------------------------------------------------------------------------- /sample_pm.c: -------------------------------------------------------------------------------- 1 | /* Note : this particular snipset of code is available under 2 | * the LGPL, MPL or BSD license (at your choice). 3 | * Jean II 4 | */ 5 | 6 | /* --------------------------- INCLUDE --------------------------- */ 7 | 8 | /* Backward compatibility for Wireless Extension 9 */ 9 | #ifndef IW_POWER_MODIFIER 10 | #define IW_POWER_MODIFIER 0x000F /* Modify a parameter */ 11 | #define IW_POWER_MIN 0x0001 /* Value is a minimum */ 12 | #define IW_POWER_MAX 0x0002 /* Value is a maximum */ 13 | #define IW_POWER_RELATIVE 0x0004 /* Value is not in seconds/ms/us */ 14 | #endif IW_POWER_MODIFIER 15 | 16 | struct net_local { 17 | int pm_on; // Power Management enabled 18 | int pm_multi; // Receive multicasts 19 | int pm_period; // Power Management period 20 | int pm_period_auto; // Power Management auto mode 21 | int pm_max_period; // Power Management max period 22 | int pm_min_period; // Power Management min period 23 | int pm_timeout; // Power Management timeout 24 | }; 25 | 26 | /* --------------------------- HANDLERS --------------------------- */ 27 | 28 | static int ioctl_set_power(struct net_device *dev, 29 | struct iw_request_info *info, 30 | struct iw_param *prq, 31 | char *extra) 32 | { 33 | /* Disable it ? */ 34 | if(prq->disabled) 35 | { 36 | local->pm_on = 0; 37 | } 38 | else 39 | { 40 | /* Check mode */ 41 | switch(prq->flags & IW_POWER_MODE) 42 | { 43 | case IW_POWER_UNICAST_R: 44 | local->pm_multi = 0; 45 | local->need_commit = 1; 46 | break; 47 | case IW_POWER_ALL_R: 48 | local->pm_multi = 1; 49 | local->need_commit = 1; 50 | break; 51 | case IW_POWER_ON: /* None = ok */ 52 | break; 53 | default: /* Invalid */ 54 | return(-EINVAL); 55 | } 56 | /* Set period */ 57 | if(prq->flags & IW_POWER_PERIOD) 58 | { 59 | int period = prq->value; 60 | #if WIRELESS_EXT < 21 61 | period /= 1000000; 62 | #endif 63 | /* Hum: check if within bounds... */ 64 | 65 | /* Activate PM */ 66 | local->pm_on = 1; 67 | local->need_commit = 1; 68 | 69 | /* Check min value */ 70 | if(prq->flags & IW_POWER_MIN) 71 | { 72 | local->pm_min_period = period; 73 | local->pm_period_auto = 1; 74 | } 75 | else 76 | /* Check max value */ 77 | if(prq->flags & IW_POWER_MAX) 78 | { 79 | local->pm_max_period = period; 80 | local->pm_period_auto = 1; 81 | } 82 | else 83 | { 84 | /* Fixed value */ 85 | local->pm_period = period; 86 | local->pm_period_auto = 0; 87 | } 88 | } 89 | /* Set timeout */ 90 | if(prq->flags & IW_POWER_TIMEOUT) 91 | { 92 | /* Activate PM */ 93 | local->pm_on = 1; 94 | local->need_commit = 1; 95 | /* Fixed value in ms */ 96 | local->pm_timeout = prq->value/1000; 97 | } 98 | } 99 | 100 | return(0); 101 | } 102 | 103 | static int ioctl_get_power(struct net_device *dev, 104 | struct iw_request_info *info, 105 | struct iw_param *prq, 106 | char *extra) 107 | { 108 | prq->disabled = !local->pm_on; 109 | /* By default, display the period */ 110 | if(!(prq->flags & IW_POWER_TIMEOUT)) 111 | { 112 | int inc_flags = prq->flags; 113 | prq->flags = IW_POWER_PERIOD | IW_POWER_RELATIVE; 114 | /* Check if auto */ 115 | if(local->pm_period_auto) 116 | { 117 | /* By default, the min */ 118 | if(!(inc_flags & IW_POWER_MAX)) 119 | { 120 | prq->value = local->pm_min_period; 121 | #if WIRELESS_EXT < 21 122 | prq->value *= 1000000; 123 | #endif 124 | prq->flags |= IW_POWER_MIN; 125 | } 126 | else 127 | { 128 | prq->value = local->pm_max_period; 129 | #if WIRELESS_EXT < 21 130 | prq->value *= 1000000; 131 | #endif 132 | prq->flags |= IW_POWER_MAX; 133 | } 134 | } 135 | else 136 | { 137 | /* Fixed value. Check the flags */ 138 | if(inc_flags & (IW_POWER_MIN | IW_POWER_MAX)) 139 | return(-EINVAL); 140 | else 141 | { 142 | prq->value = local->pm_period; 143 | #if WIRELESS_EXT < 21 144 | prq->value *= 1000000; 145 | #endif 146 | } 147 | } 148 | } 149 | else 150 | { 151 | /* Deal with the timeout - always fixed */ 152 | prq->flags = IW_POWER_TIMEOUT; 153 | prq->value = local->pm_timeout * 1000; 154 | } 155 | if(local->pm_multi) 156 | prq->flags |= IW_POWER_ALL_R; 157 | else 158 | prq->flags |= IW_POWER_UNICAST_R; 159 | 160 | return(0); 161 | } 162 | 163 | static int ioctl_get_range(struct net_device *dev, 164 | struct iw_request_info *info, 165 | struct iw_point *rrq, 166 | char *extra) 167 | { 168 | struct iw_range *range = (struct iw_range *) extra; 169 | 170 | rrq->length = sizeof(struct iw_range); 171 | 172 | memset(range, 0, sizeof(struct iw_range)); 173 | 174 | #if WIRELESS_EXT > 10 175 | /* Version we are compiled with */ 176 | range->we_version_compiled = WIRELESS_EXT; 177 | /* Minimum version we recommend */ 178 | range->we_version_source = 8; 179 | #endif /* WIRELESS_EXT > 10 */ 180 | 181 | #if WIRELESS_EXT > 9 182 | #if WIRELESS_EXT < 21 183 | range.min_pmp = 1000000; /* 1 units */ 184 | range.max_pmp = 12000000; /* 12 units */ 185 | #else 186 | range.min_pmp = 1; /* 1 units */ 187 | range.max_pmp = 12; /* 12 units */ 188 | #endif 189 | range.min_pmt = 1000; /* 1 ms */ 190 | range.max_pmt = 1000000; /* 1 s */ 191 | range.pmp_flags = IW_POWER_PERIOD | IW_POWER_RELATIVE | 192 | IW_POWER_MIN | IW_POWER_MAX; 193 | range.pmt_flags = IW_POWER_TIMEOUT; 194 | range.pm_capa = IW_POWER_PERIOD | IW_POWER_TIMEOUT | IW_POWER_UNICAST_R; 195 | #endif /* WIRELESS_EXT > 9 */ 196 | return(0); 197 | } 198 | 199 | /* --------------------------- BINDING --------------------------- */ 200 | 201 | #if WIRELESS_EXT > 12 202 | /* Use the new driver API, save overhead */ 203 | static const iw_handler handler_table[] = 204 | { 205 | ... 206 | (iw_handler) ioctl_set_power, /* SIOCSIWPOWER */ 207 | (iw_handler) ioctl_get_power, /* SIOCGIWPOWER */ 208 | }; 209 | #else /* WIRELESS_EXT < 12 */ 210 | /* Use old API in the ioctl handler */ 211 | static int 212 | do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 213 | { 214 | struct iwreq *wrq = (struct iwreq *) ifr; 215 | int err = 0; 216 | 217 | switch (cmd) 218 | { 219 | #if WIRELESS_EXT > 8 220 | /* Set the desired Power Management mode */ 221 | case SIOCSIWPOWER: 222 | err = ioctl_set_power(dev, NULL, &(wrq->u.power), NULL); 223 | break; 224 | 225 | /* Get the power management settings */ 226 | case SIOCGIWPOWER: 227 | err = ioctl_get_power(dev, NULL, &(wrq->u.power), NULL); 228 | break; 229 | #endif /* WIRELESS_EXT > 8 */ 230 | } 231 | return(err); 232 | } 233 | #endif /* WIRELESS_EXT < 12 */ 234 | 235 | -------------------------------------------------------------------------------- /sample_priv_addr.c: -------------------------------------------------------------------------------- 1 | /* Note : this particular snipset of code is available under 2 | * the LGPL, MPL or BSD license (at your choice). 3 | * Jean II 4 | */ 5 | 6 | // Require Wireless Tools 25 for sub-ioctl and addr support 7 | 8 | /* --------------------------- INCLUDE --------------------------- */ 9 | 10 | #if WIRELESS_EXT <= 12 11 | /* Wireless extensions backward compatibility */ 12 | 13 | /* We need the full definition for private ioctls */ 14 | struct iw_request_info 15 | { 16 | __u16 cmd; /* Wireless Extension command */ 17 | __u16 flags; /* More to come ;-) */ 18 | }; 19 | #endif /* WIRELESS_EXT <= 12 */ 20 | 21 | #ifndef IW_PRIV_TYPE_ADDR 22 | #define IW_PRIV_TYPE_ADDR 0x6000 23 | #endif /* IW_PRIV_TYPE_ADDR */ 24 | 25 | /* --------------------------- HANDLERS --------------------------- */ 26 | 27 | /* First method : using sub-ioctls. 28 | * Note that sizeof(int + struct sockaddr) = 20 > 16, therefore the 29 | * data is passed in (char *) extra, and sub-ioctl in data->flags. */ 30 | static int sample_ioctl_set_mac(struct net_device *dev, 31 | struct iw_request_info *info, 32 | struct iw_point *data, 33 | struct sockaddr *mac_addr) 34 | { 35 | unsigned char * addr = (char *) &mac_addr->sa_data; 36 | 37 | switch(data->flags) { 38 | case 0: 39 | printk(KERN_DEBUG "%s: mac_add %02X:%02X:%02X:%02X:%02X:%02X\n", dev->name, addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); 40 | break; 41 | case 1: 42 | printk(KERN_DEBUG "%s: mac_del %02X:%02X:%02X:%02X:%02X:%02X\n", dev->name, addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); 43 | break; 44 | case 2: 45 | printk(KERN_DEBUG "%s: mac_kick %02X:%02X:%02X:%02X:%02X:%02X\n", dev->name, addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); 46 | break; 47 | default: 48 | printk(KERN_DEBUG "%s: mac_undefined %02X:%02X:%02X:%02X:%02X:%02X\n", dev->name, addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); 49 | break; 50 | } 51 | 52 | return 0; 53 | } 54 | 55 | /* Second method : bind single handler to multiple ioctls. 56 | * Note that sizeof(struct sockaddr) = 16 <= 16, therefore the 57 | * data is passed in (struct iwreq) (and also mapped in extra). 58 | */ 59 | static int sample_ioctl_set_addr(struct net_device *dev, 60 | struct iw_request_info *info, 61 | struct sockaddr *mac_addr, char *extra) 62 | { 63 | unsigned char * addr = (char *) &mac_addr->sa_data; 64 | 65 | switch(info->cmd) { 66 | case SIOCIWFIRSTPRIV + 28: 67 | printk(KERN_DEBUG "%s: addr_add %02X:%02X:%02X:%02X:%02X:%02X\n", dev->name, addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); 68 | break; 69 | case SIOCIWFIRSTPRIV + 30: 70 | printk(KERN_DEBUG "%s: addr_del %02X:%02X:%02X:%02X:%02X:%02X\n", dev->name, addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); 71 | break; 72 | default: 73 | printk(KERN_DEBUG "%s: mac_undefined %02X:%02X:%02X:%02X:%02X:%02X\n", dev->name, addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); 74 | break; 75 | } 76 | 77 | return 0; 78 | } 79 | 80 | // Extra fun for testing 81 | static int sample_ioctl_get_mac(struct net_device *dev, 82 | struct iw_request_info *info, 83 | struct iw_point *data, 84 | struct sockaddr *mac_addr) 85 | { 86 | unsigned char fake_addr[6]; 87 | int i; 88 | int j; 89 | 90 | for(i = 0; i < 16; i++) { 91 | /* Create a fake address */ 92 | for(j = 0; j < 6; j++) 93 | fake_addr[j] = (unsigned char) ((j << 4) + i); 94 | /* Put in in the table */ 95 | memcpy(&(mac_addr[i]).sa_data, fake_addr, ETH_ALEN); 96 | mac_addr[i].sa_family = ARPHRD_ETHER; 97 | } 98 | data->length = 16; 99 | 100 | return 0; 101 | } 102 | 103 | static int sample_ioctl_set_float(struct net_device *dev, 104 | struct iw_request_info *info, 105 | struct iw_freq *freq, char *extra) 106 | { 107 | printk(KERN_DEBUG "%s: set_float %d;%d\n", 108 | dev->name, freq->m, freq->e); 109 | 110 | return 0; 111 | } 112 | 113 | /* --------------------------- BINDING --------------------------- */ 114 | 115 | static const struct iw_priv_args sample_priv[] = { 116 | // *** Method 1 : using sub-ioctls *** 117 | /* --- sub-ioctls handler --- */ 118 | { SIOCIWFIRSTPRIV + 0, 119 | IW_PRIV_TYPE_ADDR | IW_PRIV_SIZE_FIXED | 1, 0, "" }, 120 | /* --- sub-ioctls definitions --- */ 121 | { 0, 122 | IW_PRIV_TYPE_ADDR | IW_PRIV_SIZE_FIXED | 1, 0, "macadd" }, 123 | { 1, 124 | IW_PRIV_TYPE_ADDR | IW_PRIV_SIZE_FIXED | 1, 0, "macdel" }, 125 | { 2, 126 | IW_PRIV_TYPE_ADDR | IW_PRIV_SIZE_FIXED | 1, 0, "mackick" }, 127 | // *** Method 2 : binding one handler to multiple ioctls *** 128 | { SIOCIWFIRSTPRIV + 2, 129 | IW_PRIV_TYPE_ADDR | IW_PRIV_SIZE_FIXED | 1, 0, "addradd" }, 130 | { SIOCIWFIRSTPRIV + 4, 131 | IW_PRIV_TYPE_ADDR | IW_PRIV_SIZE_FIXED | 1, 0, "addrdel" }, 132 | // *** Extra fun *** 133 | { SIOCIWFIRSTPRIV + 1, 134 | 0, IW_PRIV_TYPE_ADDR | 16, "macget" }, 135 | { SIOCIWFIRSTPRIV + 6, 136 | IW_PRIV_TYPE_FLOAT | IW_PRIV_SIZE_FIXED | 1, 0, "setfloat" }, 137 | }; 138 | 139 | static const iw_handler sample_private_handler[] = 140 | { /* SIOCIWFIRSTPRIV + */ 141 | #if WIRELESS_EXT >= 15 142 | /* Various little annoying bugs in the new API before 143 | * version 15 make it difficult to use the new API for those ioctls. 144 | * For example, it doesn't know about the new data type. 145 | * Rather than littering the code with workarounds, 146 | * let's use the regular ioctl handler. - Jean II */ 147 | (iw_handler) sample_ioctl_set_mac, /* 0 */ 148 | (iw_handler) sample_ioctl_get_mac, /* 1 */ 149 | (iw_handler) sample_ioctl_set_addr, /* 2 */ 150 | (iw_handler) NULL, /* 3 */ 151 | (iw_handler) sample_ioctl_set_addr, /* 4 */ 152 | (iw_handler) NULL, /* 5 */ 153 | (iw_handler) sample_ioctl_set_float, /* 6 */ 154 | #endif /* WIRELESS_EXT >= 15 */ 155 | }; 156 | 157 | #if WIRELESS_EXT < 15 158 | /* Various little annoying bugs in the new API before 159 | * version 15 make it difficult to use those ioctls. 160 | * For example, it doesn't know about the new data type. 161 | * Rather than littering the code with workarounds, 162 | * let's use this code that just works. - Jean II */ 163 | case SIOCIWFIRSTPRIV + 0: 164 | if (wrq->u.data.length > 1) 165 | ret = -E2BIG; 166 | else if (wrq->u.data.pointer) { 167 | struct sockaddr mac_addr; 168 | if (copy_from_user(&mac_addr, wrq->u.data.pointer, 169 | sizeof(struct sockaddr))) { 170 | ret = -EFAULT; 171 | break; 172 | } 173 | ret = sample_ioctl_set_mac(dev, NULL, &wrq->u.data, 174 | &mac_addr); 175 | } 176 | break; 177 | case SIOCIWFIRSTPRIV + 2: 178 | case SIOCIWFIRSTPRIV + 4: 179 | if (!capable(CAP_NET_ADMIN)) 180 | ret = -EPERM; 181 | else { 182 | struct iw_request_info info; 183 | info.cmd = cmd; 184 | ret = sample_ioctl_set_addr(dev, &info, 185 | &wrq->u.ap_addr, 186 | NULL); 187 | } 188 | break; 189 | case SIOCIWFIRSTPRIV + 1: 190 | if (wrq->u.essid.pointer) { 191 | struct sockaddr mac_addr[16]; 192 | char nickbuf[IW_ESSID_MAX_SIZE + 1]; 193 | ret = sample_ioctl_get_mac(dev, NULL, &wrq->u.data, 194 | mac_addr); 195 | if (copy_to_user(wrq->u.data.pointer, nickbuf, 196 | wrq->u.data.length * 197 | sizeof(struct sockaddr))) 198 | ret = -EFAULT; 199 | } 200 | break; 201 | case SIOCIWFIRSTPRIV + 6: 202 | if (!capable(CAP_NET_ADMIN)) 203 | ret = -EPERM; 204 | else { 205 | ret = sample_ioctl_set_float(dev, NULL, 206 | &wrq->u.freq, 207 | NULL); 208 | } 209 | break; 210 | #endif /* WIRELESS_EXT < 15 */ 211 | -------------------------------------------------------------------------------- /wireless.7: -------------------------------------------------------------------------------- 1 | .\" Jean Tourrilhes - HPL - 2002 - 2004 2 | .\" wireless.7 3 | .\" 4 | .TH WIRELESS 7 "4 March 2004" "wireless-tools" "Linux Programmer's Manual" 5 | .\" 6 | .\" NAME part 7 | .\" 8 | .SH NAME 9 | wireless \- Wireless Tools and Wireless Extensions 10 | .\" 11 | .\" SYNOPSIS part 12 | .\" 13 | .SH SYNOPSIS 14 | .B iwconfig 15 | .br 16 | .B iwpriv \-a 17 | .br 18 | .\" 19 | .\" DESCRIPTION part 20 | .\" 21 | .SH DESCRIPTION 22 | The 23 | .B Wireless Extensions 24 | is an API allowing you manipulate Wireless LAN networking interfaces. 25 | It is composed of a variety of tools and configuration files. It is 26 | documented in more detail in the Linux Wireless LAN Howto. 27 | .br 28 | The 29 | .B Wireless Tools 30 | are used to change the configuration of wireless LAN networking 31 | interfaces on the fly, to get their current configuration, to get 32 | statistics and diagnose them. They are described in their own man 33 | page, see below for references. 34 | .br 35 | .B Wireless configuration 36 | is specific to each Linux distribution. This man page will contain in 37 | the future the configuration procedure for a few common 38 | distributions. For the time being, check the file DISTRIBUTIONS.txt 39 | included with the Wireless Tools package. 40 | .\" 41 | .\" DEBIAN 3.0 part 42 | .\" 43 | .SH DEBIAN 3.0 44 | In Debian 3.0 (and later) you can configure wireless LAN networking 45 | devices using the network configuration tool 46 | .BR ifupdown (8). 47 | .TP 48 | .B File : 49 | .I /etc/network/interfaces 50 | .TP 51 | .B Form : 52 | .RI wireless\- " " 53 | .br 54 | wireless\-essid Home 55 | .br 56 | wireless\-mode Ad\-Hoc 57 | .TP 58 | .B See also : 59 | .I /etc/network/if\-pre\-up.d/wireless\-tools 60 | .br 61 | .I /usr/share/doc/wireless\-tools/README.Debian 62 | .\" 63 | .\" SuSE 8.0 part 64 | .\" 65 | .SH SuSE 8.0 66 | SuSE 8.0 (and later) has integrated wireless configuration in their 67 | network scripts. 68 | .TP 69 | .B Tool : 70 | .B Yast2 71 | .TP 72 | .B File : 73 | .I /etc/sysconfig/network/wireless 74 | .br 75 | .I /etc/sysconfig/network/ifcfg\-* 76 | .TP 77 | .B Form : 78 | .RI WIRELESS_ "" = "" 79 | .br 80 | WIRELESS_ESSID="Home" 81 | .br 82 | WIRELESS_MODE=Ad\-Hoc 83 | .TP 84 | .B See also : 85 | man ifup 86 | .br 87 | info scpm 88 | .\" 89 | .\" PCMCIA part 90 | .\" 91 | .SH ORIGINAL PCMCIA SCRIPTS 92 | If you are using the original configuration scripts from the Pcmcia 93 | package, you can use this method. 94 | .TP 95 | .B File : 96 | .I /etc/pcmcia/wireless.opts 97 | .TP 98 | .B Form : 99 | *,*,*,*) 100 | .br 101 | ESSID="Home" 102 | .br 103 | MODE="Ad-Hoc" 104 | .br 105 | ;; 106 | .TP 107 | .B See also : 108 | .I /etc/pcmcia/wireless 109 | .br 110 | File 111 | .I PCMCIA.txt 112 | part of Wireless Tools package 113 | .\" 114 | .\" AUTHOR part 115 | .\" 116 | .SH AUTHOR 117 | Jean Tourrilhes \- jt@hpl.hp.com 118 | .br 119 | .I http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/ 120 | .\" 121 | .\" SEE ALSO part 122 | .\" 123 | .SH SEE ALSO 124 | .BR iwconfig (8), 125 | .BR iwlist (8), 126 | .BR iwspy (8), 127 | .BR iwpriv (8), 128 | .BR iwevent (8). 129 | --------------------------------------------------------------------------------