ipv6/ext.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
20 #ifndef NET_IPV6_EXT_H
21 #define NET_IPV6_EXT_H
22 
23 #include <stdint.h>
24 
25 #include "net/ipv6/ext/rh.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #define IPV6_EXT_LEN_UNIT (8U)
39 typedef struct __attribute__((packed)) {
40  uint8_t nh;
41  uint8_t len;
43 
51 static inline ipv6_ext_t *ipv6_ext_get_next(ipv6_ext_t *ext)
52 {
53  return (ipv6_ext_t *)((uint8_t *)(ext) + (ext->len * IPV6_EXT_LEN_UNIT) +
55 }
56 
57 #ifdef __cplusplus
58 }
59 #endif
60 
61 #endif /* NET_IPV6_EXT_H */
62 
uint8_t len
length in 8 octets without first octet
Definition: ipv6/ext.h:42
static ipv6_ext_t * ipv6_ext_get_next(ipv6_ext_t *ext)
Gets the next extension header in a packet.
Definition: ipv6/ext.h:52
#define IPV6_EXT_LEN_UNIT
Unit in byte for the extension header&#39;s length field.
Definition: ipv6/ext.h:31
Routing extension header definitions.
IPv6 extension headers.
Definition: ipv6/ext.h:40