mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 05:12:57 +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:
commit
82d9e79f21
@ -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.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user