diff options
author | Gregory P. Smith <greg@krypto.org> | 2011-05-15 07:26:45 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2011-05-15 07:26:45 (GMT) |
commit | 5ed2e779f175dc648110a1d862e37d6e92bd2560 (patch) | |
tree | aa19fa5461f195aac9c82fca74dba0190bf0909b /Doc/library/socket.rst | |
parent | 1a4de20d9505873beca1e20f948ae0abe875ebb1 (diff) | |
download | cpython-5ed2e779f175dc648110a1d862e37d6e92bd2560.zip cpython-5ed2e779f175dc648110a1d862e37d6e92bd2560.tar.gz cpython-5ed2e779f175dc648110a1d862e37d6e92bd2560.tar.bz2 |
Issue #1746656: Add if_nameindex, if_nametoindex, if_indextoname
methods to the socket module.
Diffstat (limited to 'Doc/library/socket.rst')
-rw-r--r-- | Doc/library/socket.rst | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 0357be7..5b2e6bd 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -536,6 +536,39 @@ The module :mod:`socket` exports the following constants and functions: .. versionadded:: 3.3 +.. function:: if_nameindex() + + Returns a list of network interface information + (index, name as a byte string) tuples. + :exc:`socket.error` if the system call fails for any reason. + + Availability: Unix. + + .. versionadded:: 3.3 + + +.. function:: if_nametoindex(if_name) + + Returns a network interface index number corresponding to an + interface name byte string. + :exc:`socket.error` if no interface with the given name exists. + + Availability: Unix. + + .. versionadded:: 3.3 + + +.. function:: if_indextoname(if_index) + + Returns a network interface name byte string corresponding to a + interface index. + :exc:`socket.error` if no interface with the given index exists. + + Availability: Unix. + + .. versionadded:: 3.3 + + .. data:: SocketType This is a Python type object that represents the socket object type. It is the |