1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 10:12:45 +01:00

Merge pull request #20354 from Enoch247/add-ipv4-init-macro

sys/net/ipv4: add IPV4_ADDR_INIT() macro
This commit is contained in:
benpicco 2024-02-07 19:01:54 +00:00 committed by GitHub
commit 82d9e79f21
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,6 +35,18 @@ extern "C" {
*/
#define IPV4_ADDR_MAX_STR_LEN (sizeof("255.255.255.255"))
/**
* @brief Static initializer for an IPv4 address.
* @param[in] a 1st octet
* @param[in] b 2nd octet
* @param[in] c 3rd octet
* @param[in] d 4th octet
*
* @return initialized IPv4 address
*/
#define IPV4_ADDR_INIT(a, b, c, d) { .u8 = {a, b, c, d} }
/**
* @brief Data type to represent an IPv4 address.
*/