19 #ifndef HWSD_NETINFO_H
20 #define HWSD_NETINFO_H
23 #include <hwsd/nodeInfo.h>
25 #include <lunchbox/debug.h>
36 TYPE_ETHERNET = LB_BIT1,
37 TYPE_INFINIBAND = LB_BIT2,
38 TYPE_LOOPBACK = LB_BIT3,
41 TYPE_UNKNOWN = LB_BIT31,
42 TYPE_ALL = LB_BIT_ALL_32
57 HWSD_API std::string getType()
const;
59 HWSD_API
void setType(
const std::string& strType );
86 inline std::ostream& operator << ( std::ostream& os,
const NetInfo& info )
88 os <<
"NetInfo\n" <<
static_cast< const NodeInfo&
>( info )
89 <<
" Type " << info.getType() << std::endl
90 <<
" Status " << (info.
up ?
"UP" :
"DOWN") << std::endl;
91 if( !info.
name.empty( ))
92 os <<
" Name " << info.
name << std::endl;
94 os <<
" Hostname " << info.
hostname << std::endl;
96 os <<
" HWaddr " << info.
hwAddress << std::endl;
102 os <<
" Linkspeed " << info.
linkspeed <<
"Mbps" << std::endl;
107 #endif // HWSD_NETINFO_H
std::string hostname
The hostname assigned to this interface.
Defines export visibility macros for library hwsd.
static const unsigned defaultValue
A non-enumerated value.
unsigned int linkspeed
The interface link speed in Megabits per second.
bool operator!=(const NetInfo &rhs) const
A structure containing node-specific information.
std::string name
The name of the interface (e.g.
std::string inet6Address
The IPv6 address (':' as separator) of the interface.
A structure containing network-specific information.
Type type
The type of the network interface.
bool up
Whether the interface is up or down.
bool operator==(const NetInfo &rhs) const
NetInfo()
Default constructor pointing to the default display.
std::string hwAddress
The MAC address (':' as separator) of the interface.
std::string inetAddress
The IPv4 address (':' as separator) of the interface.