bpo-37390: Add audit event table to documentations (GH-14406)
Also updates some (unreleased) event names to be consistent with the others.
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index f2e7949..e3ddebd 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -543,7 +543,7 @@
The newly created socket is :ref:`non-inheritable <fd_inheritance>`.
- .. audit-event:: socket.__new__ "self family type protocol"
+ .. audit-event:: socket.__new__ self,family,type,protocol socket.socket
.. versionchanged:: 3.3
The AF_CAN family was added.
@@ -737,7 +737,7 @@
:const:`AF_INET6`), and is meant to be passed to the :meth:`socket.connect`
method.
- .. audit-event:: socket.getaddrinfo "host port family type protocol"
+ .. audit-event:: socket.getaddrinfo host,port,family,type,protocol socket.getaddrinfo
The following example fetches address information for a hypothetical TCP
connection to ``example.org`` on port 80 (results may differ on your
@@ -774,7 +774,7 @@
interface. :func:`gethostbyname` does not support IPv6 name resolution, and
:func:`getaddrinfo` should be used instead for IPv4/v6 dual stack support.
- .. audit-event:: socket.gethostbyname hostname
+ .. audit-event:: socket.gethostbyname hostname socket.gethostbyname
.. function:: gethostbyname_ex(hostname)
@@ -788,7 +788,7 @@
resolution, and :func:`getaddrinfo` should be used instead for IPv4/v6 dual
stack support.
- .. audit-event:: socket.gethostbyname hostname
+ .. audit-event:: socket.gethostbyname hostname socket.gethostbyname_ex
.. function:: gethostname()
@@ -796,7 +796,7 @@
Return a string containing the hostname of the machine where the Python
interpreter is currently executing.
- .. audit-event:: socket.gethostname
+ .. audit-event:: socket.gethostname "" socket.gethostname
Note: :func:`gethostname` doesn't always return the fully qualified domain
name; use :func:`getfqdn` for that.
@@ -812,7 +812,7 @@
domain name, use the function :func:`getfqdn`. :func:`gethostbyaddr` supports
both IPv4 and IPv6.
- .. audit-event:: socket.gethostbyaddr ip_address
+ .. audit-event:: socket.gethostbyaddr ip_address socket.gethostbyaddr
.. function:: getnameinfo(sockaddr, flags)
@@ -827,7 +827,7 @@
For more information about *flags* you can consult :manpage:`getnameinfo(3)`.
- .. audit-event:: socket.getnameinfo sockaddr
+ .. audit-event:: socket.getnameinfo sockaddr socket.getnameinfo
.. function:: getprotobyname(protocolname)
@@ -844,7 +844,7 @@
service. The optional protocol name, if given, should be ``'tcp'`` or
``'udp'``, otherwise any protocol will match.
- .. audit-event:: socket.getservbyname "servicename protocolname"
+ .. audit-event:: socket.getservbyname servicename,protocolname socket.getservbyname
.. function:: getservbyport(port[, protocolname])
@@ -853,7 +853,7 @@
service. The optional protocol name, if given, should be ``'tcp'`` or
``'udp'``, otherwise any protocol will match.
- .. audit-event:: socket.getservbyport "port protocolname"
+ .. audit-event:: socket.getservbyport port,protocolname socket.getservbyport
.. function:: ntohl(x)
@@ -1038,7 +1038,7 @@
Set the machine's hostname to *name*. This will raise an
:exc:`OSError` if you don't have enough rights.
- .. audit-event:: socket.sethostname name
+ .. audit-event:: socket.sethostname name socket.sethostname
.. availability:: Unix.
@@ -1124,7 +1124,7 @@
Bind the socket to *address*. The socket must not already be bound. (The format
of *address* depends on the address family --- see above.)
- .. audit-event:: socket.bind "self address"
+ .. audit-event:: socket.bind self,address socket.socket.bind
.. method:: socket.close()
@@ -1162,7 +1162,7 @@
:exc:`InterruptedError` exception if the connection is interrupted by a
signal (or the exception raised by the signal handler).
- .. audit-event:: socket.connect "self address"
+ .. audit-event:: socket.connect self,address socket.socket.connect
.. versionchanged:: 3.5
The method now waits until the connection completes instead of raising an
@@ -1180,7 +1180,7 @@
:c:data:`errno` variable. This is useful to support, for example, asynchronous
connects.
- .. audit-event:: socket.connect "self address"
+ .. audit-event:: socket.connect self,address socket.socket.connect_ex
.. method:: socket.detach()
@@ -1522,7 +1522,7 @@
bytes sent. (The format of *address* depends on the address family --- see
above.)
- .. audit-event:: socket.sendto "self address"
+ .. audit-event:: socket.sendto self,address socket.socket.sendto
.. versionchanged:: 3.5
If the system call is interrupted and the signal handler does not raise
@@ -1563,7 +1563,7 @@
.. availability:: most Unix platforms, possibly others.
- .. audit-event:: socket.sendmsg "self address"
+ .. audit-event:: socket.sendmsg self,address socket.socket.sendmsg
.. versionadded:: 3.3