A 48 bit EUI-48 sub-identifier, see EUI48.
More...
#include <eui48.hpp>
A 48 bit EUI-48 sub-identifier, see EUI48.
Stores value in lb_endian::native byte order.
Definition at line 51 of file eui48.hpp.
◆ EUI48Sub() [1/5]
constexpr jau::EUI48Sub::EUI48Sub |
( |
| ) |
|
|
inlineconstexprnoexcept |
◆ EUI48Sub() [2/5]
Copy len_ address bytes from given source and byte_order, while converting them to lb_endian::native byte order.
- Parameters
-
b_ | sub address bytes in lb_endian::native byte order |
len_ | length |
byte_order | lb_endian::little or lb_endian::big byte order of given sub_address, one may pass lb_endian::native. |
Definition at line 114 of file eui48.cpp.
◆ EUI48Sub() [3/5]
EUI48Sub::EUI48Sub |
( |
const std::string & |
str | ) |
|
Construct a sub EUI48 via given string representation.
Implementation is consistent with EUI48Sub::toString().
- Parameters
-
str | a string of less or equal of 17 characters representing less or equal of 6 bytes as hexadecimal numbers separated via colon, e.g. 01:02:03:0A:0B:0C , 01:02:03:0A , : , (empty). |
- See also
- EUI48Sub::scanEUI48Sub()
-
EUI48Sub::toString()
- Exceptions
-
Definition at line 107 of file eui48.cpp.
◆ EUI48Sub() [4/5]
constexpr jau::EUI48Sub::EUI48Sub |
( |
const EUI48Sub & |
o | ) |
|
|
constexprdefaultnoexcept |
◆ EUI48Sub() [5/5]
jau::EUI48Sub::EUI48Sub |
( |
EUI48Sub && |
o | ) |
|
|
defaultnoexcept |
◆ scanEUI48Sub()
bool EUI48Sub::scanEUI48Sub |
( |
const std::string & |
str, |
|
|
EUI48Sub & |
dest, |
|
|
std::string & |
errmsg |
|
) |
| |
|
static |
Fills given EUI48Sub instance via given string representation.
Implementation is consistent with EUI48Sub::toString().
- Parameters
-
str | a string of less or equal of 17 characters representing less or equal of 6 bytes as hexadecimal numbers separated via colon, e.g. 01:02:03:0A:0B:0C , 01:02:03:0A , : , (empty). |
dest | EUI48Sub to set its value |
errmsg | error parsing message if returning false |
- Returns
- true if successful, otherwise false
- See also
- EUI48Sub::EUI48Sub
-
EUI48Sub::toString()
Definition at line 66 of file eui48.cpp.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ hash_code()
constexpr std::size_t jau::EUI48Sub::hash_code |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ clear()
void jau::EUI48Sub::clear |
( |
| ) |
|
|
inline |
Method clears the underlying byte array b
and sets length to zero.
Definition at line 127 of file eui48.hpp.
◆ indexOf() [1/2]
Find index of needle within haystack in the given byte order.
The returned index will be adjusted for the desired byte order.
- lb_endian::big will return index 0 for the leading byte like the toString() representation from left (MSB) to right (LSB).
- lb_endian::little will return index 5 for the leading byte
- Parameters
-
haystack_b | haystack data |
haystack_length | haystack length |
needle_b | needle data |
needle_length | needle length |
byte_order | byte order will adjust the returned index, lb_endian::big is equivalent with toString() representation from left (MSB) to right (LSB). |
- Returns
- index of first element of needle within haystack or -1 if not found. If the needle length is zero, 0 (found) is returned.
Definition at line 129 of file eui48.cpp.
◆ indexOf() [2/2]
Finds the index of given EUI48Sub needle within this instance haystack in the given byte order.
The returned index will be adjusted for the desired byte order.
- lb_endian::big will return index 0 for the leading byte like the toString() representation from left (MSB) to right (LSB).
- lb_endian::little will return index 5 for the leading byte
- Parameters
-
needle | |
byte_order | byte order will adjust the returned index, lb_endian::big is equivalent with toString() representation from left (MSB) to right (LSB). |
- Returns
- index of first element of needle within this instance haystack or -1 if not found. If the needle length is zero, 0 (found) is returned.
- See also
- indexOf()
Definition at line 163 of file eui48.hpp.
◆ contains()
bool jau::EUI48Sub::contains |
( |
const EUI48Sub & |
needle | ) |
const |
|
inlinenoexcept |
Returns true, if given EUI48Sub needle is contained in this instance haystack.
If the sub is zero, true is returned.
Definition at line 173 of file eui48.hpp.
◆ toString()
std::string EUI48Sub::toString |
( |
| ) |
const |
|
noexcept |
Returns the EUI48 sub-string representation with MSB first (lb_endian::big), less or equal 17 characters representing less or equal 6 bytes as upper case hexadecimal numbers separated via colon, e.g.
01:02:03:0A:0B:0C
, 01:02:03:0A
, :
, (empty).
Definition at line 36 of file eui48.cpp.
◆ ANY_DEVICE
const EUI48Sub jau::EUI48Sub::ANY_DEVICE |
|
static |
EUI48 MAC address matching any device, i.e.
0:0:0:0:0:0
.
Definition at line 54 of file eui48.hpp.
◆ ALL_DEVICE
const EUI48Sub jau::EUI48Sub::ALL_DEVICE |
|
static |
EUI48 MAC address matching all device, i.e.
ff:ff:ff:ff:ff:ff
.
Definition at line 56 of file eui48.hpp.
◆ LOCAL_DEVICE
const EUI48Sub jau::EUI48Sub::LOCAL_DEVICE |
|
static |
EUI48 MAC address matching local device, i.e.
0:0:0:ff:ff:ff
.
Definition at line 58 of file eui48.hpp.
uint8_t jau::EUI48Sub::b[6] |
◆ length
The actual length in bytes of the EUI48 sub-address, less or equal 6 bytes.
Definition at line 68 of file eui48.hpp.
The documentation for this struct was generated from the following files: