30 #ifndef TINS_NETWORK_INTERFACE_H 31 #define TINS_NETWORK_INTERFACE_H 36 #include <tins/macros.h> 37 #include <tins/hw_address.h> 38 #include <tins/ip_address.h> 39 #include <tins/ipv6_address.h> 64 uint32_t prefix_length;
72 std::vector<IPv6Prefix> ipv6_addrs;
86 static std::vector<NetworkInterface> all();
151 std::string name()
const;
171 std::wstring friendly_name()
const;
180 Info addresses()
const;
197 operator bool()
const {
198 return iface_id_ != 0;
205 bool is_loopback()
const;
218 address_type hw_address()
const;
238 std::vector<IPv6Prefix> ipv6_addresses()
const;
246 return iface_id_ == rhs.iface_id_;
255 return !(*
this == rhs);
258 id_type resolve_index(
const char* name);
265 #endif // TINS_NETWORK_INTERFACE_H id_type id() const
Getter for this interface's identifier.
Definition: network_interface.h:138
bool operator==(const NetworkInterface &rhs) const
Compares this interface for equality.
Definition: network_interface.h:245
bool operator!=(const NetworkInterface &rhs) const
Compares this interface for inequality.
Definition: network_interface.h:254
The Tins namespace.
Definition: address_range.h:38
uint32_t id_type
The type used to store the interface's identifier.
Definition: network_interface.h:52
Abstraction of a network interface.
Definition: network_interface.h:47
Abstraction of an IPv4 address.
Definition: ip_address.h:45
Definition: network_interface.h:62
Definition: ipv6_address.h:45
HWAddress< 6 > address_type
The type of this interface's address.
Definition: network_interface.h:57
Struct that holds an interface's addresses.
Definition: network_interface.h:70