|
oveRTOS C++ API
C++20 RAII wrappers for the oveRTOS C API
|
Lightweight wrapper around ove_sockaddr_t.
More...
#include <net.hpp>
Public Member Functions | |
| Address () | |
| Default-constructs a zeroed address. | |
| uint16_t | port () const |
| Returns the port in host byte order. | |
| Address & | set_port (uint16_t p) |
| Sets the port, returning a reference for chaining. | |
Static Public Member Functions | |
| static Address | ipv4 (uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint16_t port) |
| Creates an IPv4 address from individual octets and a port. | |
Public Attributes | |
| ove_sockaddr_t | raw |
| The underlying C sockaddr. | |
Lightweight wrapper around ove_sockaddr_t.
A copyable value type that holds an IP address and port. Use the ipv4() factory to construct from individual octets, or access the raw member directly for advanced use.
|
inlinestatic |
Creates an IPv4 address from individual octets and a port.
| [in] | a | First octet. |
| [in] | b | Second octet. |
| [in] | c | Third octet. |
| [in] | d | Fourth octet. |
| [in] | port | Port number in host byte order. |
Address.
|
inline |
Returns the port in host byte order.
|
inline |
Sets the port, returning a reference for chaining.
Fluent-builder style, matching NetIfConfig. Useful when an Address was constructed without a port (e.g. from a DNS resolution result) and you want to attach one inline.
| [in] | p | Port number in host byte order. |