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/frag.h"
26 #include "net/ipv6/ext/rh.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #define IPV6_EXT_LEN_UNIT (8U)
40 typedef struct __attribute__((packed)) {
41  uint8_t nh;
42  uint8_t len;
44 
52 static inline ipv6_ext_t *ipv6_ext_get_next(ipv6_ext_t *ext)
53 {
54  return (ipv6_ext_t *)((uint8_t *)(ext) + (ext->len * IPV6_EXT_LEN_UNIT) +
56 }
57 
58 #ifdef __cplusplus
59 }
60 #endif
61 
62 #endif /* NET_IPV6_EXT_H */
63 
Fragmentation extension definitions.
uint8_t len
length in 8 octets without first octet
Definition: ext.h:43
static ipv6_ext_t * ipv6_ext_get_next(ipv6_ext_t *ext)
Gets the next extension header in a packet.
Definition: ext.h:53
Routing extension header definitions.
#define IPV6_EXT_LEN_UNIT
Unit in byte for the extension header&#39;s length field.
Definition: ext.h:32
IPv6 extension headers.
Definition: ext.h:41