~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/kernel/doc/src/inet.xml

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
<erlref>
5
5
  <header>
6
6
    <copyright>
7
 
      <year>1997</year><year>2009</year>
 
7
      <year>1997</year><year>2010</year>
8
8
      <holder>Ericsson AB. All Rights Reserved.</holder>
9
9
    </copyright>
10
10
    <legalnotice>
13
13
      compliance with the License. You should have received a copy of the
14
14
      Erlang Public License along with this software. If not, it can be
15
15
      retrieved online at http://www.erlang.org/.
16
 
    
 
16
 
17
17
      Software distributed under the License is distributed on an "AS IS"
18
18
      basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
19
19
      the License for the specific language governing rights and limitations
20
20
      under the License.
21
 
    
 
21
 
22
22
    </legalnotice>
23
23
 
24
24
    <title>inet</title>
49
49
      might be specified in this way. An example of starting an Erlang
50
50
      node with all sockets using delayed send could look like this:</p>
51
51
    <pre>
52
 
$ <input>erl -sname test -kernel \\</input>
53
 
<input>inet_default_connect_options '[{delay_send,true}]' \\</input>
 
52
$ <input>erl -sname test -kernel \</input>
 
53
<input>inet_default_connect_options '[{delay_send,true}]' \</input>
54
54
<input>inet_default_listen_options '[{delay_send,true}]'</input></pre>
55
55
    <p>Note that the default option <c>{active, true}</c> currently
56
56
      cannot be changed, for internal reasons.</p>
220
220
        <p>Returns the local hostname. Will never fail.</p>
221
221
      </desc>
222
222
    </func>
223
 
    <func>
224
 
      <name>getopts(Socket, Options) -> OptionValues | {error, posix()}</name>
 
223
 
 
224
    <func>
 
225
      <name>getifaddrs() -> {ok,Iflist} | {error,posix}</name>
 
226
      <fsummary>Return a list of interfaces and their addresses</fsummary>
 
227
      <type>
 
228
        <v>Iflist = {Ifname,[Ifopt]}</v>
 
229
        <v>Ifname = string()</v>
 
230
        <v>Ifopt = {flag,[Flag]} | {addr,Addr} | {netmask,Netmask}
 
231
                   | {broadaddr,Broadaddr} | {dstaddr,Dstaddr}
 
232
                   | {hwaddr,Hwaddr}</v>
 
233
        <v>Flag = up | broadcast | loopback | pointtopoint
 
234
                  | running | multicast</v>
 
235
        <v>Addr = Netmask = Broadadddr = Dstaddr = ip_address()</v>
 
236
        <v>Hwaddr = [byte()]</v>
 
237
      </type>
 
238
    </func>
 
239
    <desc>
 
240
      <p>
 
241
        Returns a list of 2-tuples containing interface names and the
 
242
        interface's addresses. <c>Ifname</c> is a Unicode string.
 
243
        <c>Hwaddr</c> is hardware dependent, e.g on Ethernet interfaces
 
244
        it is the 6-byte Ethernet address (MAC address (EUI-48 address)).
 
245
      </p>
 
246
      <p>
 
247
        The <c>{addr,Addr}</c>, <c>{netmask,_}</c> and <c>{broadaddr,_}</c>
 
248
        tuples are repeated in the result list iff the interface has multiple
 
249
        addresses. If you come across an interface that has
 
250
        multiple <c>{flag,_}</c> or <c>{hwaddr,_}</c> tuples you have
 
251
        a really strange interface or possibly a bug in this function.
 
252
        The <c>{flag,_}</c> tuple is mandatory, all other optional.
 
253
      </p>
 
254
      <p>
 
255
        Do not rely too much on the order of <c>Flag</c> atoms or
 
256
        <c>Ifopt</c> tuples. There are some rules, though:
 
257
        <list>
 
258
          <item>
 
259
            Immediately after <c>{addr,_}</c> follows <c>{netmask,_}</c>
 
260
          </item>
 
261
          <item>
 
262
            Immediately thereafter follows <c>{broadaddr,_}</c> if
 
263
            the <c>broadcast</c> flag is <em>not</em> set and the
 
264
            <c>pointtopoint</c>flag <em>is</em> set.
 
265
          </item>
 
266
          <item>
 
267
            Any <c>{netmask,_}</c>, <c>{broadaddr,_}</c> or
 
268
            <c>{dstaddr,_}</c> tuples that follow an <c>{addr,_}</c>
 
269
            tuple concerns that address.
 
270
          </item>
 
271
        </list>
 
272
      </p>
 
273
      <p>
 
274
        The <c>{hwaddr,_}</c> tuple is not returned on Solaris since the
 
275
        hardware address historically belongs to the link layer and only
 
276
        the superuser can read such addresses.
 
277
      </p>
 
278
      <p>
 
279
        On Windows, the data is fetched from quite different OS API
 
280
        functions, so the <c>Netmask</c> and <c>Broadaddr</c>
 
281
        values may be calculated, just as some <c>Flag</c> values.
 
282
        You have been warned. Report flagrant bugs.
 
283
      </p>
 
284
    </desc>
 
285
 
 
286
    <func>
 
287
      <name>getopts(Socket, Options) -> {ok, OptionValues} | {error, posix()}</name>
225
288
      <fsummary>Get one or more options for a socket</fsummary>
226
289
      <type>
227
290
        <v>Socket = term()</v>