mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Add info members directly into NetworkInterface
This commit is contained in:
@@ -201,6 +201,31 @@ public:
|
||||
*/
|
||||
bool is_up() const;
|
||||
|
||||
/**
|
||||
* \brief Retrieves the hardware address for this interface.
|
||||
*/
|
||||
address_type hw_address() const;
|
||||
|
||||
/**
|
||||
* \brief Retrieves the IPv4 address for this interface.
|
||||
*/
|
||||
IPv4Address ipv4_address() const;
|
||||
|
||||
/**
|
||||
* \brief Retrieves the IPv4 netmask for this interface.
|
||||
*/
|
||||
IPv4Address ipv4_mask() const;
|
||||
|
||||
/**
|
||||
* \brief Retrieves the broadcast IPv4 address for this interface.
|
||||
*/
|
||||
IPv4Address ipv4_broadcast() const;
|
||||
|
||||
/**
|
||||
* \brief Retrieves the IPv6 addresses for this interface.
|
||||
*/
|
||||
std::vector<IPv6Prefix> ipv6_addresses() const;
|
||||
|
||||
/**
|
||||
* \brief Compares this interface for equality.
|
||||
*
|
||||
|
||||
@@ -319,11 +319,31 @@ NetworkInterface::Info NetworkInterface::info() const {
|
||||
}
|
||||
|
||||
bool NetworkInterface::is_loopback() const {
|
||||
return addresses().ip_addr.is_loopback();
|
||||
return info().ip_addr.is_loopback();
|
||||
}
|
||||
|
||||
bool NetworkInterface::is_up() const {
|
||||
return addresses().is_up;
|
||||
return info().is_up;
|
||||
}
|
||||
|
||||
NetworkInterface::address_type NetworkInterface::hw_address() const {
|
||||
return info().hw_addr;
|
||||
}
|
||||
|
||||
IPv4Address NetworkInterface::ipv4_address() const {
|
||||
return info().ip_addr;
|
||||
}
|
||||
|
||||
IPv4Address NetworkInterface::ipv4_mask() const {
|
||||
return info().netmask;
|
||||
}
|
||||
|
||||
IPv4Address NetworkInterface::ipv4_broadcast() const {
|
||||
return info().bcast_addr;
|
||||
}
|
||||
|
||||
vector<NetworkInterface::IPv6Prefix> NetworkInterface::ipv6_addresses() const {
|
||||
return info().ipv6_addrs;
|
||||
}
|
||||
|
||||
NetworkInterface::id_type NetworkInterface::resolve_index(const char* name) {
|
||||
|
||||
Reference in New Issue
Block a user