libnick 2025.9.1
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) noexcept
 Constructs a MacAddress.
 
unsigned char getFirst () const noexcept
 Gets the first byte of the address.
 
unsigned char getSecond () const noexcept
 Gets the second byte of the address.
 
unsigned char getThird () const noexcept
 Gets the third byte of the address.
 
unsigned char getFourth () const noexcept
 Gets the fourth byte of the address.
 
unsigned char getFifth () const noexcept
 Gets the fifth byte of the address.
 
unsigned char getSixth () const noexcept
 Gets the sixth byte of the address.
 
std::string str () const noexcept
 Gets the string representation of the address.
 

Static Public Member Functions

static std::optional< MacAddressparse (const std::string &address) noexcept
 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 )
noexcept

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
noexcept

Gets the fifth byte of the address.

Returns
The fifth byte of the address

◆ getFirst()

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

Gets the first byte of the address.

Returns
The first byte of the address

◆ getFourth()

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

Gets the fourth byte of the address.

Returns
The fourth byte of the address

◆ getSecond()

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

Gets the second byte of the address.

Returns
The second byte of the address

◆ getSixth()

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

Gets the sixth byte of the address.

Returns
The sixth byte of the address

◆ getThird()

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

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)
staticnoexcept

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
noexcept

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: