![]() |
TSDuck v3.46-4930
MPEG Transport Stream Toolkit
|
#include <tsNetworkInterface.h>


Public Member Functions | |
| NetworkInterface ()=default | |
| Default constructor. | |
| virtual UString | toString () const override |
Static Public Member Functions | |
| static bool | GetAll (IPAddressVector &addresses, bool loopback=true, IP gen=IP::Any, bool force_reload=false, Report &report=(ts::CerrReport::Instance())) |
| static bool | GetAll (NetworkInterfaceVector &addresses, bool loopback=true, IP gen=IP::Any, bool force_reload=false, Report &report=(ts::CerrReport::Instance())) |
| static bool | GetAll (std::set< int > &indexes, bool loopback=true, IP gen=IP::Any, bool force_reload=false, Report &report=(ts::CerrReport::Instance())) |
| static bool | IsLocal (const IPAddress &address, bool force_reload=false, Report &report=(ts::CerrReport::Instance())) |
| static bool | ToAddress (IPAddress &address, int index, IP gen=IP::Any, bool force_reload=false, Report &report=(ts::CerrReport::Instance())) |
| static int | ToIndex (const IPAddress &address, bool force_reload=false, Report &report=(ts::CerrReport::Instance())) |
Public Attributes | |
| IPAddressMask | address {} |
| IP address and mask/prefix. | |
| bool | down = false |
| The interface is down, disconnected, not usable, etc. | |
| int | index = -1 |
| Interface index, system specific, negative if meaningless. | |
| bool | link_local = false |
| This is a link-local address. | |
| bool | loopback = false |
| This is a software loopback interface. | |
| UString | name {} |
| Interface name, system specific. | |
Static Public Attributes | |
| static constexpr int | AnyIndex = 0 |
| Interface index value meaning "any interface" in IPv6 system API. | |
Description of a network interface.
The concept of "network interface" is very system-specific. There are physical and virtual interfaces, interface names and addresses. Here, a NetworkInterface instance describes one IP address. Depending on the system, several NetworkInterface instances may have the same interface name.
|
overridevirtual |
Convert to a string object.
Implements ts::StringifyInterface.
|
static |
Get the list of all local network interfaces in the system.
| [out] | addresses | Receives the list of all local IP interfaces. |
| [in] | loopback | If false, the loopback addresses are skipped. |
| [in] | gen | Report addresses for the specified generations only. |
| [in] | force_reload | If true, force a reload of the list of interfaces. By default, the list is loaded once and kept in cache. If no network interface is dynamically added, there is no need to rebuild the list each time. |
| [in] | report | Where to report errors. |
|
static |
Get the list of all local IP addresses in the system.
| [out] | addresses | A vector of IPAddress which receives the list of all local IP addresses. |
| [in] | loopback | If false, the loopback addresses are skipped. |
| [in] | gen | Report addresses for the specified generations only. |
| [in] | force_reload | If true, force a reload of the list of interfaces. By default, the list is loaded once and kept in cache. If no network interface is dynamically added, there is no need to rebuild the list each time. |
| [in] | report | Where to report errors. |
|
static |
Get the list of all local network interfaces by index.
| [out] | indexes | Receives the set of indexes of all local IP interfaces. If an interface has multiple IP addresses, the index is returned only once. If interface indexes are meaningless for that operating system, the returned set is empty. |
| [in] | loopback | If false, the loopback addresses are skipped. |
| [in] | gen | Report addresses for the specified generations only. |
| [in] | force_reload | If true, force a reload of the list of interfaces. By default, the list is loaded once and kept in cache. If no network interface is dynamically added, there is no need to rebuild the list each time. |
| [in] | report | Where to report errors. |
|
static |
Check if a local system interface has a specified IP address.
| [in] | address | The IP address to check. |
| [in] | force_reload | If true, force a reload of the list of interfaces. By default, the list is loaded once and kept in cache. If no network interface is dynamically added, there is no need to rebuild the list each time. |
| [in] | report | Where to report errors. |
|
static |
Find the interface index for a local system interface identified by IP address.
| [in] | address | The IP address to check. |
| [in] | force_reload | If true, force a reload of the list of interfaces. By default, the list is loaded once and kept in cache. If no network interface is dynamically added, there is no need to rebuild the list each time. |
| [in] | report | Where to report errors. |
|
static |
Find the first IP address of a network interface identified by its index.
| [out] | address | The returned IP address. |
| [in] | index | The interface index to find. |
| [in] | gen | Report addresses for the specified generations only. |
| [in] | force_reload | If true, force a reload of the list of interfaces. By default, the list is loaded once and kept in cache. If no network interface is dynamically added, there is no need to rebuild the list each time. |
| [in] | report | Where to report errors. |