24 #ifndef NDN_NET_NETWORK_INTERFACE_HPP 25 #define NDN_NET_NETWORK_INTERFACE_HPP 29 #include "../util/signal.hpp" 77 mutable util::Signal<NetworkInterface, uint32_t , uint32_t >
onMtuChanged;
141 return m_etherAddress;
149 return m_etherBrdAddress;
154 const std::set<NetworkAddress>&
157 return m_netAddresses;
165 return (m_flags & IFF_LOOPBACK) != 0;
173 return (m_flags & IFF_POINTOPOINT) != 0;
181 return (m_flags & IFF_BROADCAST) != 0;
189 return (m_flags & IFF_MULTICAST) != 0;
197 return (m_flags & IFF_UP) != 0;
211 setName(
const std::string&
name);
217 setFlags(uint32_t flags);
220 setState(InterfaceState state);
223 setMtu(uint32_t mtu);
239 InterfaceState m_state;
243 std::set<NetworkAddress> m_netAddresses;
254 #endif // NDN_NET_NETWORK_INTERFACE_HPP interface is administratively down
Copyright (c) 2011-2015 Regents of the University of California.
interface can be used to send and receive packets
bool isLoopback() const
Returns true if the interface is a loopback interface.
interface is administratively up but has no carrier
bool canMulticast() const
Returns true if the interface supports multicast communication.
uint32_t getMtu() const
Returns the MTU (maximum transmission unit) of the interface.
util::Signal< NetworkInterface, InterfaceState, InterfaceState > onStateChanged
Fires when interface state changes.
InterfaceType
Indicates the hardware type of a network interface.
util::Signal< NetworkInterface, uint32_t, uint32_t > onMtuChanged
Fires when interface mtu changes.
InterfaceState
Indicates the state of a network interface.
util::Signal< NetworkInterface, NetworkAddress > onAddressRemoved
Fires when a network-layer address is removed from the interface.
ethernet::Address getEthernetBroadcastAddress() const
Returns the link-layer (Ethernet) broadcast address of the interface.
Represents one network interface attached to the host.
Stores one IP address supported by a network interface.
int getIndex() const
Returns an opaque ID that uniquely identifies the interface on the system.
InterfaceType getType() const
Returns the hardware type of the interface.
std::string getName() const
Returns the name of the interface, unique on the system.
const std::set< NetworkAddress > & getNetworkAddresses() const
Returns a list of all network-layer addresses present on the interface.
interface has a carrier but it cannot send or receive normal user traffic yet
represents an Ethernet hardware address
uint32_t getFlags() const
Returns a bitset of platform-specific flags enabled on the interface.
bool isUp() const
Returns true if the interface is administratively up.
std::ostream & operator<<(std::ostream &os, AddressScope scope)
ethernet::Address getEthernetAddress() const
Returns the link-layer (Ethernet) address of the interface.
bool isPointToPoint() const
Returns true if the interface is a point-to-point interface.
InterfaceState getState() const
Returns the current state of the interface.
bool canBroadcast() const
Returns true if the interface supports broadcast communication.
util::Signal< NetworkInterface, NetworkAddress > onAddressAdded
Fires when a network-layer address is added to the interface.