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)
41 typedef struct __attribute__((packed)) {
42  uint8_t nh;
43  uint8_t len;
45 
53 static inline ipv6_ext_t *ipv6_ext_get_next(ipv6_ext_t *ext)
54 {
55  return (ipv6_ext_t *)((uint8_t *)(ext) + (ext->len * IPV6_EXT_LEN_UNIT) +
57 }
58 
59 #ifdef __cplusplus
60 }
61 #endif
62 
63 #endif /* NET_IPV6_EXT_H */
64 
uint8_t len
length in 8 octets without first octet
Definition: ipv6/ext.h:44
static ipv6_ext_t * ipv6_ext_get_next(ipv6_ext_t *ext)
Gets the next extension header in a packet.
Definition: ipv6/ext.h:54
#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:42