libnick 2024.12.0
A cross-platform base for native Nickvision applications.
Loading...
Searching...
No Matches
macaddress.h
Go to the documentation of this file.
1
23#ifndef MACADDRESS_H
24#define MACADDRESS_H
25
26#include <optional>
27#include <string>
28
29namespace Nickvision::Network
30{
35 {
36 public:
46 MacAddress(unsigned char oui1, unsigned char oui2, unsigned char oui3, unsigned char nic1, unsigned char nic2, unsigned char nic3);
51 unsigned char getFirst() const;
56 unsigned char getSecond() const;
61 unsigned char getThird() const;
66 unsigned char getFourth() const;
71 unsigned char getFifth() const;
76 unsigned char getSixth() const;
81 std::string str() const;
87 static std::optional<MacAddress> parse(const std::string& address);
88
89 private:
90 unsigned char m_oui1;
91 unsigned char m_oui2;
92 unsigned char m_oui3;
93 unsigned char m_nic1;
94 unsigned char m_nic2;
95 unsigned char m_nic3;
96 };
97}
98
99#endif //MACADDRESS_H
A model of a MAC address.
Definition macaddress.h:35
unsigned char getSixth() const
Gets the sixth byte of the address.
std::string str() const
Gets the string representation of the address.
unsigned char getFifth() const
Gets the fifth byte of the address.
MacAddress(unsigned char oui1, unsigned char oui2, unsigned char oui3, unsigned char nic1, unsigned char nic2, unsigned char nic3)
Constructs a MacAddress.
unsigned char getSecond() const
Gets the second byte of the address.
unsigned char getThird() const
Gets the third byte of the address.
unsigned char getFirst() const
Gets the first byte of the address.
static std::optional< MacAddress > parse(const std::string &address)
Parses a MacAddress from a string.
unsigned char getFourth() const
Gets the fourth byte of the address.
Definition curleasy.h:33