diff options
author | Chris Lalancette <clalancette@gmail.com> | 2022-09-06 12:23:08 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-06 18:23:08 +0200 |
commit | 70eecaf44d61f2cabcd22ffb407b904242a122c9 (patch) | |
tree | 29d605b10d7cde532d5aade3b9939bc16c94988b /docs | |
parent | 9f9a82d02c901f62512236b44edb050f84cbe5b6 (diff) | |
download | psutil-70eecaf44d61f2cabcd22ffb407b904242a122c9.tar.gz |
Add in support for network interface flags. (#2037)
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/index.rst | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/docs/index.rst b/docs/index.rst index 8d663c7e..c30f7d6a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -735,13 +735,21 @@ Network - **speed**: the NIC speed expressed in mega bits (MB), if it can't be determined (e.g. 'localhost') it will be set to ``0``. - **mtu**: NIC's maximum transmission unit expressed in bytes. + - **flags**: a string of comma-separated flags on the interface (may be an empty string). + Possible flags are: ``up``, ``broadcast``, ``debug``, ``loopback``, + ``pointopoint``, ``notrailers``, ``running``, ``noarp``, ``promisc``, + ``allmulti``, ``master``, ``slave``, ``multicast``, ``portsel``, + ``dynamic``, ``oactive``, ``simplex``, ``link0``, ``link1``, ``link2``, + and ``d2`` (some flags are only available on certain platforms). + + Availability: UNIX Example: >>> import psutil >>> psutil.net_if_stats() - {'eth0': snicstats(isup=True, duplex=<NicDuplex.NIC_DUPLEX_FULL: 2>, speed=100, mtu=1500), - 'lo': snicstats(isup=True, duplex=<NicDuplex.NIC_DUPLEX_UNKNOWN: 0>, speed=0, mtu=65536)} + {'eth0': snicstats(isup=True, duplex=<NicDuplex.NIC_DUPLEX_FULL: 2>, speed=100, mtu=1500, flags='up,broadcast,running,multicast'), + 'lo': snicstats(isup=True, duplex=<NicDuplex.NIC_DUPLEX_UNKNOWN: 0>, speed=0, mtu=65536, flags='up,loopback,running')} Also see `nettop.py`_ and `ifconfig.py`_ for an example application. @@ -749,6 +757,8 @@ Network .. versionchanged:: 5.7.3 `isup` on UNIX also checks whether the NIC is running. + .. versionchanged:: 5.9.3 *flags* field was added on POSIX. + Sensors ------- |