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

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

Issue 27744: Add AF_ALG (Linux Kernel crypto) to socket module
Patch Set: Created 3 years, 6 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
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 **Source code:** :source:`Lib/socket.py` 7 **Source code:** :source:`Lib/socket.py`
8 8
9 -------------- 9 --------------
10 10
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 interface. (This depends on your OS; NetBSD and DragonFlyBSD expect 123 interface. (This depends on your OS; NetBSD and DragonFlyBSD expect
124 a Bluetooth address while everything else expects an integer.) 124 a Bluetooth address while everything else expects an integer.)
125 125
126 .. versionchanged:: 3.2 126 .. versionchanged:: 3.2
127 NetBSD and DragonFlyBSD support added. 127 NetBSD and DragonFlyBSD support added.
128 128
129 - :const:`BTPROTO_SCO` accepts ``bdaddr`` where ``bdaddr`` is a 129 - :const:`BTPROTO_SCO` accepts ``bdaddr`` where ``bdaddr`` is a
130 :class:`bytes` object containing the Bluetooth address in a 130 :class:`bytes` object containing the Bluetooth address in a
131 string format. (ex. ``b'12:23:34:45:56:67'``) This protocol is not 131 string format. (ex. ``b'12:23:34:45:56:67'``) This protocol is not
132 supported under FreeBSD. 132 supported under FreeBSD.
133
134 - :const:`AF_ALG` is a Linux-only socket based interface to Kernel
135 cryptography. An algorithm socket is configured with a tuple of two to four
136 elements ``(type, name [, feat [, mask]])``, where:
137
138 - *type* is the algorithm type as string, e.g. ``hash``, ``skcipher``
139 or ``rng``.
140
141 - *name* is the algorithm name and operation mode as string, e.g.
142 ``sha256``, ``hmac(sha256)``, ``cbc(aes)`` or ``drbg_nopr_ctr_aes256``.
143
144 - *feat* and *mask* are unsigned int 32 values.
145
146 .. versionadded:: 3.6
133 147
134 - Certain other address families (:const:`AF_PACKET`, :const:`AF_CAN`) 148 - Certain other address families (:const:`AF_PACKET`, :const:`AF_CAN`)
135 support specific representations. 149 support specific representations.
136 150
137 .. XXX document them! 151 .. XXX document them!
138 152
139 For IPv4 addresses, two special forms are accepted instead of a host address: 153 For IPv4 addresses, two special forms are accepted instead of a host address:
140 the empty string represents :const:`INADDR_ANY`, and the string 154 the empty string represents :const:`INADDR_ANY`, and the string
141 ``'<broadcast>'`` represents :const:`INADDR_BROADCAST`. This behavior is not 155 ``'<broadcast>'`` represents :const:`INADDR_BROADCAST`. This behavior is not
142 compatible with IPv6, therefore, you may want to avoid these if you intend 156 compatible with IPv6, therefore, you may want to avoid these if you intend
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 PF_RDS 334 PF_RDS
321 SOL_RDS 335 SOL_RDS
322 RDS_* 336 RDS_*
323 337
324 Many constants of these forms, documented in the Linux documentation, are 338 Many constants of these forms, documented in the Linux documentation, are
325 also defined in the socket module. 339 also defined in the socket module.
326 340
327 Availability: Linux >= 2.6.30. 341 Availability: Linux >= 2.6.30.
328 342
329 .. versionadded:: 3.3 343 .. versionadded:: 3.3
330
331 344
332 .. data:: SIO_RCVALL 345 .. data:: SIO_RCVALL
333 SIO_KEEPALIVE_VALS 346 SIO_KEEPALIVE_VALS
334 SIO_LOOPBACK_FAST_PATH 347 SIO_LOOPBACK_FAST_PATH
335 RCVALL_* 348 RCVALL_*
336 349
337 Constants for Windows' WSAIoctl(). The constants are used as arguments to the 350 Constants for Windows' WSAIoctl(). The constants are used as arguments to the
338 :meth:`~socket.socket.ioctl` method of socket objects. 351 :meth:`~socket.socket.ioctl` method of socket objects.
339 352
340 .. versionchanged:: 3.6 353 .. versionchanged:: 3.6
341 ``SIO_LOOPBACK_FAST_PATH`` was added. 354 ``SIO_LOOPBACK_FAST_PATH`` was added.
342 355
343 356
344 .. data:: TIPC_* 357 .. data:: TIPC_*
345 358
346 TIPC related constants, matching the ones exported by the C socket API. See 359 TIPC related constants, matching the ones exported by the C socket API. See
347 the TIPC documentation for more information. 360 the TIPC documentation for more information.
361
362 .. data:: AF_ALG
363 SO_ALG
364 ALG_*
365 RDS_*
366
367 Constants for Linux Kernel cryptography.
368
369 Availability: Linux >= 2.6.38.
370
371 .. versionadded:: 3.6
348 372
349 .. data:: AF_LINK 373 .. data:: AF_LINK
350 374
351 Availability: BSD, OSX. 375 Availability: BSD, OSX.
352 376
353 .. versionadded:: 3.4 377 .. versionadded:: 3.4
354 378
355 .. data:: has_ipv6 379 .. data:: has_ipv6
356 380
357 This constant contains a boolean value which indicates if IPv6 is supported o n 381 This constant contains a boolean value which indicates if IPv6 is supported o n
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 The newly created socket is :ref:`non-inheritable <fd_inheritance>`. 875 The newly created socket is :ref:`non-inheritable <fd_inheritance>`.
852 876
853 .. versionchanged:: 3.4 877 .. versionchanged:: 3.4
854 The socket is now non-inheritable. 878 The socket is now non-inheritable.
855 879
856 .. versionchanged:: 3.5 880 .. versionchanged:: 3.5
857 If the system call is interrupted and the signal handler does not raise 881 If the system call is interrupted and the signal handler does not raise
858 an exception, the method now retries the system call instead of raising 882 an exception, the method now retries the system call instead of raising
859 an :exc:`InterruptedError` exception (see :pep:`475` for the rationale). 883 an :exc:`InterruptedError` exception (see :pep:`475` for the rationale).
860 884
885 .. method:: socket.algset(op[, iv[, assoclen[, flags]]])
886
887 Set mode, IV, AEAD assoc length and flags for :const:`AF_ALG` socket.
haypo 2016/08/17 13:20:25 "op" or "mode" (or "type" in the C code :-p)? "AE
888
889 .. versionadded:: 3.6
haypo 2016/08/17 13:20:25 Need also: Availability: Linux >= 2.6.38.
861 890
862 .. method:: socket.bind(address) 891 .. method:: socket.bind(address)
863 892
864 Bind the socket to *address*. The socket must not already be bound. (The for mat 893 Bind the socket to *address*. The socket must not already be bound. (The for mat
865 of *address* depends on the address family --- see above.) 894 of *address* depends on the address family --- see above.)
866 895
867 896
868 .. method:: socket.close() 897 .. method:: socket.close()
869 898
870 Mark the socket closed. The underlying system resource (e.g. a file 899 Mark the socket closed. The underlying system resource (e.g. a file
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
1674 1703
1675 - *An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. Lef fler et 1704 - *An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. Lef fler et
1676 al, 1705 al,
1677 1706
1678 both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections 1707 both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections
1679 PS1:7 and PS1:8). The platform-specific reference material for the various 1708 PS1:7 and PS1:8). The platform-specific reference material for the various
1680 socket-related system calls are also a valuable source of information on the 1709 socket-related system calls are also a valuable source of information on the
1681 details of socket semantics. For Unix, refer to the manual pages; for Window s, 1710 details of socket semantics. For Unix, refer to the manual pages; for Window s,
1682 see the WinSock (or Winsock 2) specification. For IPv6-ready APIs, readers m ay 1711 see the WinSock (or Winsock 2) specification. For IPv6-ready APIs, readers m ay
1683 want to refer to :rfc:`3493` titled Basic Socket Interface Extensions for IPv 6. 1712 want to refer to :rfc:`3493` titled Basic Socket Interface Extensions for IPv 6.
OLDNEW
« no previous file with comments | « configure.ac ('k') | Lib/test/test_socket.py » ('j') | Lib/test/test_socket.py » ('J')

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