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);
Represents a hardware address.
Definition hw_address.h:91
Abstraction of an IPv4 address.
Definition ip_address.h:45
Definition ipv6_address.h:45
static NetworkInterface from_index(id_type identifier)
Definition network_interface.cpp:216
uint32_t id_type
The type used to store the interface's identifier.
Definition network_interface.h:52
HWAddress< 6 > address_type
The type of this interface's address.
Definition network_interface.h:57
bool operator!=(const NetworkInterface &rhs) const
Compares this interface for inequality.
Definition network_interface.h:254
NetworkInterface()
Definition network_interface.cpp:211
bool operator==(const NetworkInterface &rhs) const
Compares this interface for equality.
Definition network_interface.h:245
id_type id() const
Getter for this interface's identifier.
Definition network_interface.h:138
static NetworkInterface default_interface()
Definition network_interface.cpp:198
std::string name() const
Retrieves this interface's name.
Definition network_interface.cpp:289
static std::vector< NetworkInterface > all()
Definition network_interface.cpp:202
The Tins namespace.
Definition address_range.h:38
Definition network_interface.h:62
Struct that holds an interface's addresses.
Definition network_interface.h:70