net/ndp define ndp_opt_rdnss_impl_t

The auxiliary struct internalizes the handy but non ISO-C++ compliant pointer to the payload in the packet struct. See PR #11299.
This commit is contained in:
Lasse Lueder 2019-09-26 22:05:20 +02:00
parent 7a818f0433
commit 93fd8b707c

View File

@ -338,6 +338,7 @@ typedef struct __attribute__((packed)) {
* @extends ndp_opt_t
*
* @see [RFC 8106, section 5.1](https://tools.ietf.org/html/rfc8106#section-5.1)
* @see ndp_opt_rdnss_impl_t
*/
typedef struct __attribute__((packed)) {
uint8_t type; /**< option type */
@ -347,6 +348,24 @@ typedef struct __attribute__((packed)) {
ipv6_addr_t addrs[]; /**< addresses of IPv6 recursive DNS servers */
} ndp_opt_rdnss_t;
#ifndef __cplusplus
/**
* @brief Recursive DNS server option format with payload
* @extends ndp_opt_rdnss_t
* @details Auxiliary struct that contains a zero-length array as convenience
* pointer to the addresses. Only for use in C, invalid in ISO-C++.
*
* @see [RFC 8106, section 5.1](https://tools.ietf.org/html/rfc8106#section-5.1)
*/
typedef struct __attribute__((packed)) {
uint8_t type; /**< option type */
uint8_t len; /**< length in units of 8 octets */
network_uint16_t resv; /**< reserved field */
network_uint32_t ltime; /**< lifetime in seconds */
ipv6_addr_t addrs[]; /**< addresses of IPv6 recursive DNS servers */
} ndp_opt_rdnss_impl_t;
#endif
#ifdef __cplusplus
}
#endif