TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
G3D::NetworkDevice::EthernetAdapter Class Reference

Description of an ethernet or wireless ethernet adapter. More...

#include <NetworkDevice.h>

Public Member Functions

 EthernetAdapter ()
 
void describe (TextOutput &t) const
 

Public Attributes

std::string hostname
 
std::string name
 
uint32 ip
 
uint32 subnet
 
uint32 broadcast
 
uint8 mac [6]
 

Detailed Description

Description of an ethernet or wireless ethernet adapter.

Constructor & Destructor Documentation

G3D::NetworkDevice::EthernetAdapter::EthernetAdapter ( )
177  {
178  name = "";
179  ip = 0;
180  hostname = "";
181  subnet = 0;
182  broadcast = 0;
183  for (int i = 0; i < 6; ++i) {
184  mac[i] = 0;
185  }
186 }
std::string hostname
Definition: NetworkDevice.h:615
uint32 broadcast
Definition: NetworkDevice.h:627
std::string name
Definition: NetworkDevice.h:618
uint32 ip
Definition: NetworkDevice.h:621
uint32 subnet
Definition: NetworkDevice.h:624
uint8 mac[6]
Definition: NetworkDevice.h:630

Member Function Documentation

void G3D::NetworkDevice::EthernetAdapter::describe ( TextOutput t) const

Produces a text description of this adapter

188  {
189  t.writeSymbol("{");
190  t.pushIndent();
191  t.writeNewline();
192 
193  t.writeSymbols("hostname", "=");
194  t.writeString(hostname + ";");
195  t.writeNewline();
196 
197  t.writeSymbols("name", "=");
198  t.writeString(name + ";");
199  t.writeNewline();
200 
201  t.writeSymbols("ip", "=");
202  t.writeSymbol("\"" + formatIP(ip) + "\";");
203  t.writeNewline();
204 
205  t.writeSymbols("subnet", "=");
206  t.writeSymbol("\"" + formatIP(subnet) + "\";");
207  t.writeNewline();
208 
209  t.writeSymbols("broadcast", "=");
210  t.writeSymbol("\"" + formatIP(broadcast) + "\";");
211  t.writeNewline();
212 
213  t.writeSymbols("mac", "=");
214  t.writeSymbol("\"" + formatMAC(mac) + "\";");
215  t.writeNewline();
216 
217  t.popIndent();
218  t.writeSymbol("};");
219  t.writeNewline();
220 }
std::string hostname
Definition: NetworkDevice.h:615
uint32 broadcast
Definition: NetworkDevice.h:627
std::string name
Definition: NetworkDevice.h:618
uint32 ip
Definition: NetworkDevice.h:621
uint32 subnet
Definition: NetworkDevice.h:624
static std::string formatMAC(const uint8 mac[6])
Definition: NetworkDevice.cpp:240
uint8 mac[6]
Definition: NetworkDevice.h:630
static std::string formatIP(uint32 ip)
Definition: NetworkDevice.cpp:234

+ Here is the call graph for this function:

Member Data Documentation

uint32 G3D::NetworkDevice::EthernetAdapter::broadcast

UDP broadcast address in host byte order.

std::string G3D::NetworkDevice::EthernetAdapter::hostname

Reverse-DNS of the ip address.

uint32 G3D::NetworkDevice::EthernetAdapter::ip

IP address in host byte order.

uint8 G3D::NetworkDevice::EthernetAdapter::mac[6]

MAC (hardware) address, if known

std::string G3D::NetworkDevice::EthernetAdapter::name

Name of the adapter

uint32 G3D::NetworkDevice::EthernetAdapter::subnet

Subnet mask in host byte order.


The documentation for this class was generated from the following files: