/[gentoo]/xml/htdocs/doc/en/handbook/hb-net-functions.xml
Gentoo

Diff of /xml/htdocs/doc/en/handbook/hb-net-functions.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.5 Revision 1.6
2<!DOCTYPE sections SYSTEM "/dtd/book.dtd"> 2<!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3 3
4<!-- The content of this document is licensed under the CC-BY-SA license --> 4<!-- The content of this document is licensed under the CC-BY-SA license -->
5<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 5<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6 6
7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-net-functions.xml,v 1.5 2005/06/14 18:34:32 neysx Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-net-functions.xml,v 1.6 2005/12/21 13:27:46 jkt Exp $ -->
8 8
9<sections> 9<sections>
10 10
11<version>1.1</version> 11<version>1.1</version>
12<date>2005-06-14</date> 12<date>2005-06-14</date>
14<section> 14<section>
15<title>Standard function hooks</title> 15<title>Standard function hooks</title>
16<body> 16<body>
17 17
18<p> 18<p>
19Four functions can be defined which will be called surrounding the 19Four functions can be defined which will be called surrounding the start/stop
20start/stop operations. The functions are called with the interface 20operations. The functions are called with the interface name first so that one
21name first so that one function can control multiple adapters. 21function can control multiple adapters.
22</p> 22</p>
23 23
24<p> 24<p>
25The return values for the preup and predown functions should be 0 25The return values for the preup and predown functions should be 0 (success) to
26(success) to indicate that configuration or deconfiguration of the 26indicate that configuration or deconfiguration of the interface can continue.
27interface can continue. If preup returns a non-zero value, then 27If preup returns a non-zero value, then interface configuration will be aborted.
28interface configuration will be aborted. If predown returns a
29non-zero value, then the interface will not be allowed to continue 28If predown returns a non-zero value, then the interface will not be allowed to
30deconfiguration. 29continue deconfiguration.
31</p> 30</p>
32 31
33<p> 32<p>
34The return values for the postup and postdown functions are ignored 33The return values for the postup and postdown functions are ignored since
35since there's nothing to do if they indicate failure. 34there's nothing to do if they indicate failure.
36</p> 35</p>
37 36
38<p> 37<p>
39<c>${IFACE}</c> is set to the interface being brought up/down. 38<c>${IFACE}</c> is set to the interface being brought up/down. <c>${IFVAR}</c>
40<c>${IFVAR}</c> is <c>${IFACE}</c> converted to variable name bash allows 39is <c>${IFACE}</c> converted to variable name bash allows.
41</p> 40</p>
42 41
43<pre caption="pre/post up/down function examples"> 42<pre caption="pre/post up/down function examples">
44preup() { 43preup() {
45 <comment># Test for link on the interface prior to bringing it up. This 44 <comment># Test for link on the interface prior to bringing it up. This
96<title>Wireless Tools function hooks</title> 95<title>Wireless Tools function hooks</title>
97<body> 96<body>
98 97
99<note> 98<note>
100This will not work with WPA Supplicant - but the <c>${ESSID}</c> and 99This will not work with WPA Supplicant - but the <c>${ESSID}</c> and
101<c>${ESSIDVAR}</c> variables are available in the postup() function 100<c>${ESSIDVAR}</c> variables are available in the postup() function.
102</note> 101</note>
103 102
104<p> 103<p>
105Two functions can be defined which will be called surrounding the 104Two functions can be defined which will be called surrounding the associate
106associate function. The functions are called with the interface 105function. The functions are called with the interface name first so that one
107name first so that one function can control multiple adapters. 106function can control multiple adapters.
108</p> 107</p>
109 108
110<p> 109<p>
111The return values for the preassociate function should be 0 110The return values for the preassociate function should be 0 (success) to
112(success) to indicate that configuration or deconfiguration of the 111indicate that configuration or deconfiguration of the interface can continue.
113interface can continue. If preassociate returns a non-zero value, then 112If preassociate returns a non-zero value, then interface configuration will be
114interface configuration will be aborted. 113aborted.
115</p> 114</p>
116 115
117<p> 116<p>
118The return value for the postassociate function is ignored 117The return value for the postassociate function is ignored since there's nothing
119since there's nothing to do if it indicates failure. 118to do if it indicates failure.
120</p> 119</p>
121 120
122<p> 121<p>
123<c>${ESSID}</c> is set to the exact ESSID of the AP you're connecting to. 122<c>${ESSID}</c> is set to the exact ESSID of the AP you're connecting to.
124<c>${ESSIDVAR}</c> is <c>${ESSID}</c> converted to variable name bash allows 123<c>${ESSIDVAR}</c> is <c>${ESSID}</c> converted to variable name bash allows.
125</p> 124</p>
126 125
127<pre caption="pre/post association functions"> 126<pre caption="pre/post association functions">
128preassociate() { 127preassociate() {
129 <comment># The below adds two configuration variables leap_user_ESSID 128 <comment># The below adds two configuration variables leap_user_ESSID
156 return 0 155 return 0
157} 156}
158</pre> 157</pre>
159 158
160<note> 159<note>
161<c>${ESSID}</c> and <c>${ESSIDVAR}</c> are unavailable in predown() and 160<c>${ESSID}</c> and <c>${ESSIDVAR}</c> are unavailable in predown() and
162postdown() functions 161postdown() functions.
163</note> 162</note>
164 163
165</body> 164</body>
166</section> 165</section>
167 166

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.20