A 48 bit EUI-48 sub-identifier, see EUI48.
More...
#include <eui48.hpp>
|
| constexpr | EUI48Sub () noexcept |
| |
| constexpr | EUI48Sub (const EUI48Sub &o) noexcept=default |
| |
| | EUI48Sub (const std::string &str) |
| | Construct a sub EUI48 via given string representation.
|
| |
| | EUI48Sub (const uint8_t *b_, const jau::nsize_t len_, const lb_endian_t byte_order) noexcept |
| | Copy len_ address bytes from given source and byte_order, while converting them to lb_endian::native byte order.
|
| |
| | EUI48Sub (EUI48Sub &&o) noexcept=default |
| |
| void | clear () |
| | Method clears the underlying byte array b and sets length to zero.
|
| |
| bool | contains (const EUI48Sub &needle) const noexcept |
| | Returns true, if given EUI48Sub needle is contained in this instance haystack.
|
| |
| constexpr std::size_t | hash_code () const noexcept |
| |
| jau::snsize_t | indexOf (const EUI48Sub &needle, const lb_endian_t byte_order) const noexcept |
| | Finds the index of given EUI48Sub needle within this instance haystack in the given byte order.
|
| |
| constexpr EUI48Sub & | operator= (const EUI48Sub &o) noexcept=default |
| |
| EUI48Sub & | operator= (EUI48Sub &&o) noexcept=default |
| |
| std::string | 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.
|
| |
A 48 bit EUI-48 sub-identifier, see EUI48.
Stores value in lb_endian::native byte order.
Definition at line 49 of file eui48.hpp.
◆ EUI48Sub() [1/5]
| jau::io::net::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 117 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
-
| jau::IllegalArgumentException | if given string doesn't comply with EUI48 |
Definition at line 110 of file eui48.cpp.
◆ EUI48Sub() [4/5]
| jau::io::net::EUI48Sub::EUI48Sub |
( |
const EUI48Sub & | o | ) |
|
|
constexprdefaultnoexcept |
◆ EUI48Sub() [5/5]
| jau::io::net::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 69 of file eui48.cpp.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ hash_code()
| std::size_t jau::io::net::EUI48Sub::hash_code |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ clear()
| void jau::io::net::EUI48Sub::clear |
( |
| ) |
|
|
inline |
Method clears the underlying byte array b and sets length to zero.
Definition at line 125 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 132 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 161 of file eui48.hpp.
◆ contains()
| bool jau::io::net::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 171 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 39 of file eui48.cpp.
◆ ANY_DEVICE
| const EUI48Sub jau::io::net::EUI48Sub::ANY_DEVICE |
|
static |
EUI48 MAC address matching any device, i.e.
0:0:0:0:0:0.
Definition at line 52 of file eui48.hpp.
◆ ALL_DEVICE
| const EUI48Sub jau::io::net::EUI48Sub::ALL_DEVICE |
|
static |
EUI48 MAC address matching all device, i.e.
ff:ff:ff:ff:ff:ff.
Definition at line 54 of file eui48.hpp.
◆ LOCAL_DEVICE
| const EUI48Sub jau::io::net::EUI48Sub::LOCAL_DEVICE |
|
static |
EUI48 MAC address matching local device, i.e.
0:0:0:ff:ff:ff.
Definition at line 56 of file eui48.hpp.
| uint8_t jau::io::net::EUI48Sub::b[6] |
◆ length
The actual length in bytes of the EUI48 sub-address, less or equal 6 bytes.
Definition at line 66 of file eui48.hpp.
The documentation for this struct was generated from the following files: