-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3594 from authmillenon/ipv6/api/disentengle-hdr-ext
ipv6: move non-GNRC types and functions in their own module
- Loading branch information
Showing
40 changed files
with
731 additions
and
555 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de> | ||
* | ||
* This file is subject to the terms and conditions of the GNU Lesser | ||
* General Public License v2.1. See the file LICENSE in the top level | ||
* directory for more details. | ||
*/ | ||
|
||
/** | ||
* @defgroup net_ipv6_ext IPv6 extension headers | ||
* @ingroup net_ipv6 | ||
* @brief Provides IPv6 extension header definitions and helper functions. | ||
* @{ | ||
* | ||
* @file | ||
* @brief IPv6 extension header definitions. | ||
* | ||
* @author Martine Lenders <mlenders@inf.fu-berlin.de> | ||
*/ | ||
#ifndef IPV6_EXT_H_ | ||
#define IPV6_EXT_H_ | ||
|
||
#include <stdint.h> | ||
|
||
#include "net/ipv6/ext/rh.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#define IPV6_EXT_LEN_UNIT (8U) /**< Unit in byte for the extension header's | ||
* length field */ | ||
|
||
/** | ||
* @brief IPv6 extension headers. | ||
* | ||
* @see <a href="https://tools.ietf.org/html/rfc2460#section-4"> | ||
* RFC 2460, section 4.1 | ||
* </a> | ||
*/ | ||
typedef struct __attribute__((packed)) { | ||
uint8_t nh; /**< next header */ | ||
uint8_t len; /**< length in 8 octets without first octet */ | ||
} ipv6_ext_t; | ||
|
||
/** | ||
* @brief Gets the next extension header in a packet. | ||
* | ||
* @param[in] ext The current extension header. | ||
* | ||
* @return The next extension header. | ||
*/ | ||
static inline ipv6_ext_t *ipv6_ext_get_next(ipv6_ext_t *ext) | ||
{ | ||
return (ipv6_ext_t *)((uint8_t *)(ext) + (ext->len * IPV6_EXT_LEN_UNIT) + | ||
IPV6_EXT_LEN_UNIT); | ||
} | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* IPV6_EXT_H_ */ | ||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.