Manage information from different platforms about network adapters. More...
#include <netadapter_if.hpp>
Public Member Functions | |
virtual void | get_first ()=0 |
Load a list of network adapters from the operating system and select its first entry. | |
virtual bool | get_next ()=0 |
Select next entry from the network adapter list that was initial loaded with get_first(). | |
virtual unsigned int | index () const =0 |
Get index number from current selected list entry. | |
virtual std::string | name () const =0 |
Get network adapter name from current selected list entry. | |
virtual void | sockaddr (SSockaddr &a_saddr) const =0 |
Get socket address from current selected list entry. | |
virtual void | socknetmask (SSockaddr &a_snetmask) const =0 |
Get socket address netmask from current selected list entry. | |
virtual unsigned int | bitmask () const =0 |
Get prefix length from the ip address of the current selected local network adapter. | |
virtual void | reset () noexcept=0 |
Reset pointer and point to the first entry of the local network adapter list if available. | |
Manage information from different platforms about network adapters.
Used to get information from the local network adapters. Encapsulate it in a class to get a common C++ interface to the program for different platform realisations, for example on Unix like platforms and on Microsoft Windows. They use different system calls.
Definition at line 44 of file netadapter_if.hpp.
UPnPsdk::INetadapter::INetadapter | ( | ) |
Definition at line 14 of file netadapter_if.cpp.
|
virtual |
Definition at line 18 of file netadapter_if.cpp.
|
pure virtual |
Load a list of network adapters from the operating system and select its first entry.
std::runtime_error | Failed to get information from the network adapters: (detail information appended) |
Implemented in UPnPsdk::CNetadapter_platform, and UPnPsdk::CNetadapter_platform.
|
pure virtual |
Select next entry from the network adapter list that was initial loaded with get_first().
Implemented in UPnPsdk::CNetadapter_platform, and UPnPsdk::CNetadapter_platform.
|
pure virtual |
Get index number from current selected list entry.
This is the unique number of a network adapter as given by the operating system. It is the best way to identify a network adapter. 0 means the unspecified, unavailable adapter.
Implemented in UPnPsdk::CNetadapter_platform, and UPnPsdk::CNetadapter_platform.
|
pure virtual |
Get network adapter name from current selected list entry.
Implemented in UPnPsdk::CNetadapter_platform, and UPnPsdk::CNetadapter_platform.
|
pure virtual |
Get socket address from current selected list entry.
[in,out] | a_saddr | Reference to a socket address object that will be filled with the socket address from the current selected network adapter list entry. |
Implemented in UPnPsdk::CNetadapter_platform, and UPnPsdk::CNetadapter_platform.
|
pure virtual |
Get socket address netmask from current selected list entry.
This netmask belongs to the adapters network address that is current selected.
[in,out] | a_snetmask | Reference to a socket address object that will be filled with the socket address netmask from the current selected network adapter list entry. |
Implemented in UPnPsdk::CNetadapter_platform, and UPnPsdk::CNetadapter_platform.
|
pure virtual |
Get prefix length from the ip address of the current selected local network adapter.
Implemented in UPnPsdk::CNetadapter_platform, and UPnPsdk::CNetadapter_platform.
|
pure virtualnoexcept |
Reset pointer and point to the first entry of the local network adapter list if available.
Implemented in UPnPsdk::CNetadapter_platform.