libnick 2024.9.2
A cross-platform base for native Nickvision applications.
Loading...
Searching...
No Matches
Nickvision::Network::MacAddress Class Reference

A model of a MAC address. More...

#include <macaddress.h>

Public Member Functions

 MacAddress (unsigned char oui1, unsigned char oui2, unsigned char oui3, unsigned char nic1, unsigned char nic2, unsigned char nic3)
 Constructs a MacAddress.
 
unsigned char getFirst () const
 Gets the first byte of the address.
 
unsigned char getSecond () const
 Gets the second byte of the address.
 
unsigned char getThird () const
 Gets the third byte of the address.
 
unsigned char getFourth () const
 Gets the fourth byte of the address.
 
unsigned char getFifth () const
 Gets the fifth byte of the address.
 
unsigned char getSixth () const
 Gets the sixth byte of the address.
 
std::string str () const
 Gets the string representation of the address.
 

Static Public Member Functions

static std::optional< MacAddressparse (const std::string &address)
 Parses a MacAddress from a string.
 

Detailed Description

A model of a MAC address.

Constructor & Destructor Documentation

◆ MacAddress()

Nickvision::Network::MacAddress::MacAddress ( unsigned char oui1,
unsigned char oui2,
unsigned char oui3,
unsigned char nic1,
unsigned char nic2,
unsigned char nic3 )

Constructs a MacAddress.

Parameters
oui1The first byte of the OUI
oui2The second byte of the OUI
oui3The third byte of the OUI
nic1The first byte of the NIC
nic2The second byte of the NIC
nic3The third byte of the NIC

Member Function Documentation

◆ getFifth()

unsigned char Nickvision::Network::MacAddress::getFifth ( ) const

Gets the fifth byte of the address.

Returns
The fifth byte of the address

◆ getFirst()

unsigned char Nickvision::Network::MacAddress::getFirst ( ) const

Gets the first byte of the address.

Returns
The first byte of the address

◆ getFourth()

unsigned char Nickvision::Network::MacAddress::getFourth ( ) const

Gets the fourth byte of the address.

Returns
The fourth byte of the address

◆ getSecond()

unsigned char Nickvision::Network::MacAddress::getSecond ( ) const

Gets the second byte of the address.

Returns
The second byte of the address

◆ getSixth()

unsigned char Nickvision::Network::MacAddress::getSixth ( ) const

Gets the sixth byte of the address.

Returns
The sixth byte of the address

◆ getThird()

unsigned char Nickvision::Network::MacAddress::getThird ( ) const

Gets the third byte of the address.

Returns
The third byte of the address

◆ parse()

static std::optional< MacAddress > Nickvision::Network::MacAddress::parse ( const std::string & address)
static

Parses a MacAddress from a string.

Parameters
addressThe string address to parse
Returns
The parsed address if successful, else std::nullopt

◆ str()

std::string Nickvision::Network::MacAddress::str ( ) const

Gets the string representation of the address.

Returns
The string representation of the address

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