Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cNetMacAddr Class Reference

#include <cNetHost.h>

Public Member Functions

 cNetMacAddr () noexcept
 
 cNetMacAddr (const cNetMacAddr &mac) noexcept
 
 cNetMacAddr (const char *pszMac)
 
cStringA get_MacStr () const
 
bool put_MacStr (const char *pszMac)
 
HRESULT SetMacAddrFromAdapter (sa_family_t nAddressFamily=AF_INET, int nAdapterIndex=0)
 

Public Attributes

BYTE m_bAddr [k_SIZE_MAX]
 physical address can be 48 or 64 bits. cUnion64 More...
 

Static Public Attributes

static const size_t k_SIZE_M48 = 6
 MAC-48. More...
 
static const size_t k_SIZE_E48 = 6
 EUI-48. More...
 
static const size_t k_SIZE_E64 = 8
 EUI-64. More...
 
static const size_t k_SIZE_MAX = 8
 

Detailed Description

Physical 48-bit, or 64 bit Ethernet MAC address (Media Access Control) http://en.wikipedia.org/wiki/MAC_address (MAC-48, EUI-48, and EUI-64)

Constructor & Destructor Documentation

◆ cNetMacAddr() [1/3]

GrayLib::cNetMacAddr::cNetMacAddr ( )
inlinenoexcept

◆ cNetMacAddr() [2/3]

GrayLib::cNetMacAddr::cNetMacAddr ( const cNetMacAddr mac)
inlinenoexcept

◆ cNetMacAddr() [3/3]

GrayLib::cNetMacAddr::cNetMacAddr ( const char *  pszMac)
inline

Member Function Documentation

◆ get_MacStr()

cStringA GrayLib::cNetMacAddr::get_MacStr ( ) const

◆ put_MacStr()

bool GrayLib::cNetMacAddr::put_MacStr ( const char *  pszMac)
  • pszMac = "01-23-45-67-89-ab" or "01:23:45:67:89:ab"

◆ SetMacAddrFromAdapter()

HRESULT GrayLib::cNetMacAddr::SetMacAddrFromAdapter ( sa_family_t  nAddressFamily = AF_INET,
int  nAdapterIndex = 0 
)

Set to the MAC address of a local NIC adapter.

  • nAdapterIndex = -1 = default
    Returns
    Number of the adapter.

Member Data Documentation

◆ k_SIZE_E48

const size_t GrayLib::cNetMacAddr::k_SIZE_E48 = 6
static

EUI-48.

◆ k_SIZE_E64

const size_t GrayLib::cNetMacAddr::k_SIZE_E64 = 8
static

EUI-64.

◆ k_SIZE_M48

const size_t GrayLib::cNetMacAddr::k_SIZE_M48 = 6
static

MAC-48.

◆ k_SIZE_MAX

const size_t GrayLib::cNetMacAddr::k_SIZE_MAX = 8
static

◆ m_bAddr

BYTE GrayLib::cNetMacAddr::m_bAddr[k_SIZE_MAX]

physical address can be 48 or 64 bits. cUnion64


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