21 #ifndef INCLUDE_OLA_NETWORK_INTERFACE_H_ 22 #define INCLUDE_OLA_NETWORK_INTERFACE_H_ 37 enum { DEFAULT_INDEX = -1 };
46 int32_t index = DEFAULT_INDEX,
47 uint16_t type = ARP_VOID_TYPE);
50 bool operator==(
const Interface &other)
const;
57 std::string
ToString(
const std::string &separator =
", ")
const;
80 static const uint16_t ARP_VOID_TYPE;
81 static const uint16_t ARP_ETHERNET_TYPE;
93 void SetName(
const std::string &name) { m_name = name; }
95 bool SetAddress(
const std::string &ip_address);
97 m_ip_address = ip_address;
100 bool SetBroadcast(
const std::string &broadcast_address);
101 void SetBroadcast(
const IPV4Address &broadcast_address) {
102 m_broadcast_address = broadcast_address;
105 bool SetSubnetMask(
const std::string &mask);
107 m_subnet_mask = mask;
110 void SetHardwareAddress(
const MACAddress &mac_address) {
111 m_hw_address = mac_address;
114 void SetLoopback(
bool loopback);
116 void SetIndex(int32_t index);
118 void SetType(uint16_t type);
133 bool SetAddress(
const std::string &str,
IPV4Address *target);
139 return (if1.index < if2.index);
144 #endif // INCLUDE_OLA_NETWORK_INTERFACE_H_ std::string ToString(const std::string &separator=", ") const
Convert the Interface to a string.
Definition: Interface.cpp:132
Represents a IPv4 Address.
Definition: IPV4Address.h:55
Represents a MAC Address.
Definition: MACAddress.h:50
Definition: Interface.h:35
Represents an IPv4 Address.
Definition: Interface.h:137
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
Represents a MAC Address.
Definition: Interface.h:88
friend std::ostream & operator<<(std::ostream &out, const Interface &iface)
Write the string representation of this Interface to an ostream.
Definition: Interface.h:65