Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(5)

Side by Side Diff: Doc/library/socket.rst

Issue 25041: document AF_PACKET socket address format
Patch Set: Created 4 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :mod:`socket` --- Low-level networking interface 1 :mod:`socket` --- Low-level networking interface
2 ================================================ 2 ================================================
3 3
4 .. module:: socket 4 .. module:: socket
5 :synopsis: Low-level networking interface. 5 :synopsis: Low-level networking interface.
6 6
7 7
8 This module provides access to the BSD *socket* interface. It is available on 8 This module provides access to the BSD *socket* interface. It is available on
9 all modern Unix systems, Windows, MacOS, and probably additional platforms. 9 all modern Unix systems, Windows, MacOS, and probably additional platforms.
10 10
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 a Bluetooth address while everything else expects an integer.) 121 a Bluetooth address while everything else expects an integer.)
122 122
123 .. versionchanged:: 3.2 123 .. versionchanged:: 3.2
124 NetBSD and DragonFlyBSD support added. 124 NetBSD and DragonFlyBSD support added.
125 125
126 - :const:`BTPROTO_SCO` accepts ``bdaddr`` where ``bdaddr`` is a 126 - :const:`BTPROTO_SCO` accepts ``bdaddr`` where ``bdaddr`` is a
127 :class:`bytes` object containing the Bluetooth address in a 127 :class:`bytes` object containing the Bluetooth address in a
128 string format. (ex. ``b'12:23:34:45:56:67'``) This protocol is not 128 string format. (ex. ``b'12:23:34:45:56:67'``) This protocol is not
129 supported under FreeBSD. 129 supported under FreeBSD.
130 130
131 - Certain other address families (:const:`AF_PACKET`, :const:`AF_CAN`) 131 - A tuple ``(interface, eth_prot, pkttype, ha_type, addr, addr_len``, )
berkerpeksag 2015/10/30 08:15:14 addr_len``, ) should read addr_len)``
Martin Panter 2015/10/31 05:01:45 Perhaps use the square bracket notation (as for AF
132 support specific representations. 132 is used for the :const:`AF_PACKET` address family, where ``interface`` is a
berkerpeksag 2015/10/30 08:15:14 Double space before :const:`AF_PACKET`.
berkerpeksag 2015/10/30 08:15:14 ``interface`` -> *interface* ``eth_prot`` -> *eth
133 string specifying the Ethernet interface, ``eth_prot`` is an integer
134 specifying the Ethernet protocol, ``pkttype`` is an optional constant
135 specifying the packet type (for example, ``PACKET_HOST``), ``ha_type``
136 is an optional integer specifying the ARP hardware type, ``addr`` and
Martin Panter 2015/10/31 05:01:45 Not sure but it might be more correct to refer to
137 ``addr_len`` are optional arguments specifying the physical address
Martin Panter 2015/10/31 05:01:45 Address length is implied in the length of “addr”,
138 and its length.
139
133 140
134 .. XXX document them! 141 .. XXX document them!
Martin Panter 2015/10/31 05:01:45 Remove this
135 142
136 For IPv4 addresses, two special forms are accepted instead of a host address: 143 For IPv4 addresses, two special forms are accepted instead of a host address:
137 the empty string represents :const:`INADDR_ANY`, and the string 144 the empty string represents :const:`INADDR_ANY`, and the string
138 ``'<broadcast>'`` represents :const:`INADDR_BROADCAST`. This behavior is not 145 ``'<broadcast>'`` represents :const:`INADDR_BROADCAST`. This behavior is not
139 compatible with IPv6, therefore, you may want to avoid these if you intend 146 compatible with IPv6, therefore, you may want to avoid these if you intend
140 to support IPv6 with your Python programs. 147 to support IPv6 with your Python programs.
141 148
142 If you use a hostname in the *host* portion of IPv4/v6 socket address, the 149 If you use a hostname in the *host* portion of IPv4/v6 socket address, the
143 program may show a nondeterministic behavior, as Python uses the first address 150 program may show a nondeterministic behavior, as Python uses the first address
144 returned from the DNS resolution. The socket address will be resolved 151 returned from the DNS resolution. The socket address will be resolved
(...skipping 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after
1661 1668
1662 - *An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. Lef fler et 1669 - *An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. Lef fler et
1663 al, 1670 al,
1664 1671
1665 both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections 1672 both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections
1666 PS1:7 and PS1:8). The platform-specific reference material for the various 1673 PS1:7 and PS1:8). The platform-specific reference material for the various
1667 socket-related system calls are also a valuable source of information on the 1674 socket-related system calls are also a valuable source of information on the
1668 details of socket semantics. For Unix, refer to the manual pages; for Window s, 1675 details of socket semantics. For Unix, refer to the manual pages; for Window s,
1669 see the WinSock (or Winsock 2) specification. For IPv6-ready APIs, readers m ay 1676 see the WinSock (or Winsock 2) specification. For IPv6-ready APIs, readers m ay
1670 want to refer to :rfc:`3493` titled Basic Socket Interface Extensions for IPv 6. 1677 want to refer to :rfc:`3493` titled Basic Socket Interface Extensions for IPv 6.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+