ipv6.h File Reference

The IPv6 header. More...

#include "rohc_utils.h"
#include <stdint.h>
#include <stddef.h>
#include "config.h"
Include dependency graph for ipv6.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ipv6_addr
 The IPv6 address. More...
struct  ipv6_hdr
 The IPv6 header. More...
struct  ipv6_opt

Defines

#define IPV6_ADDR_FORMAT   "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x"
#define IPV6_ADDR_IN6(x)   IPV6_ADDR_RAW((x)->u8)
#define IPV6_ADDR_RAW(x)
#define IPV6_ADDR_CMP(x, y)
#define IPV6_VERSION_MASK   0xf0000000U
#define IPV6_TC_MASK   0x0ff00000U
#define IPV6_FLOW_MASK   0x000fffffU
#define IPV6_OPT_HDR_LEN_FIELD_MAX_VAL   0xffU
#define IPV6_OPT_HDR_LEN_MAX   ((IPV6_OPT_HDR_LEN_FIELD_MAX_VAL + 1) * 8)
#define IPV6_OPT_CTXT_LEN_MAX   (IPV6_OPT_HDR_LEN_MAX - 2)

Functions

static uint8_t ipv6_get_tc (const struct ipv6_hdr *const ipv6)
 Get the Traffic Class (TC) of the given IPv6 packet.
static void ipv6_set_tc (struct ipv6_hdr *const ipv6, const uint8_t tc)
 Set the Traffic Class (TC) of the given IPv6 packet.
static void ipv6_set_dscp_ecn (struct ipv6_hdr *const ipv6, const uint8_t dscp, const uint8_t ecn)
 Set the DSCP and ECN of the given IPv6 packet.
static uint8_t ipv6_get_dscp (const struct ipv6_hdr *const ipv6)
 Get the Differentiated Services Code Point (DSCP) of the given IPv6 packet.
static void ipv6_set_dscp (struct ipv6_hdr *const ipv6, const uint8_t dscp)
 Set the Differentiated Services Code Point (DSCP) of the given IPv6 packet.
static uint32_t ipv6_get_flow_label (const struct ipv6_hdr *const ipv6)
 Get the Flow Label of the given IPv6 packet.
static void ipv6_set_flow_label (struct ipv6_hdr *const ipv6, const uint32_t flow_label)
 Set the Flow Label of the given IPv6 packet.
static size_t ipv6_opt_get_length (const struct ipv6_opt *const opt)
 get the length (in bytes) of the IPv6 option header

Detailed Description

The IPv6 header.

Author:
Didier Barvaux <didier@barvaux.org>

Define Documentation

#define IPV6_ADDR_CMP ( x,
 ) 
Value:
((x)->u32[0] == (y)->u32[0] && (x)->u32[1] == (y)->u32[1] && \
         (x)->u32[2] == (y)->u32[2] && (x)->u32[3] == (y)->u32[3])

Compare two IPv6 addresses in (struct ipv6_addr *) format

#define IPV6_ADDR_FORMAT   "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x"

The format to print an IPv6 address

#define IPV6_ADDR_IN6 (  )     IPV6_ADDR_RAW((x)->u8)

The data to print an IPv6 address in (struct ipv6_addr *) format

#define IPV6_ADDR_RAW (  ) 
Value:
(x)[0], (x)[1], (x)[2], (x)[3], (x)[4], (x)[5], (x)[6], (x)[7], \
        (x)[8], (x)[9], (x)[10], (x)[11], (x)[12], (x)[13], (x)[14], (x)[15]

The data to print an IPv6 address in raw format

#define IPV6_FLOW_MASK   0x000fffffU

The mask for the Flow Label field

#define IPV6_OPT_CTXT_LEN_MAX   (IPV6_OPT_HDR_LEN_MAX - 2)

The maximum length for the IPv6 extension header context

#define IPV6_OPT_HDR_LEN_FIELD_MAX_VAL   0xffU

The maximum value of the length field of one IPv6 extension header

#define IPV6_OPT_HDR_LEN_MAX   ((IPV6_OPT_HDR_LEN_FIELD_MAX_VAL + 1) * 8)

The maximum length of one IPv6 extension header

#define IPV6_TC_MASK   0x0ff00000U

The mask for the Traffic Class (TC) field

#define IPV6_VERSION_MASK   0xf0000000U

The mask for the Traffic Class (TC) field


Function Documentation

static uint8_t ipv6_get_dscp ( const struct ipv6_hdr *const   ipv6  )  [inline, static]

Get the Differentiated Services Code Point (DSCP) of the given IPv6 packet.

Parameters:
ipv6 The header of the IPv6 packet
Returns:
The 6-bit DSCP
static uint32_t ipv6_get_flow_label ( const struct ipv6_hdr *const   ipv6  )  [inline, static]

Get the Flow Label of the given IPv6 packet.

Parameters:
ipv6 The header of the IPv6 packet
Returns:
The 20-bit Flow Label
static uint8_t ipv6_get_tc ( const struct ipv6_hdr *const   ipv6  )  [inline, static]

Get the Traffic Class (TC) of the given IPv6 packet.

Parameters:
ipv6 The header of the IPv6 packet
Returns:
The 8-bit Traffic Class (TC)
static size_t ipv6_opt_get_length ( const struct ipv6_opt *const   opt  )  [inline, static]

get the length (in bytes) of the IPv6 option header

Parameters:
opt The IPv6 option header
Returns:
The length (in bytes) of the IPv6 option header
static void ipv6_set_dscp ( struct ipv6_hdr *const   ipv6,
const uint8_t  dscp 
) [inline, static]

Set the Differentiated Services Code Point (DSCP) of the given IPv6 packet.

Parameters:
[in,out] ipv6 The header of the IPv6 packet
dscp The 6-bit DSCP
static void ipv6_set_dscp_ecn ( struct ipv6_hdr *const   ipv6,
const uint8_t  dscp,
const uint8_t  ecn 
) [inline, static]

Set the DSCP and ECN of the given IPv6 packet.

Parameters:
[in,out] ipv6 The header of the IPv6 packet
dscp The 6-bit DSCP
ecn The 2-bit ECN
static void ipv6_set_flow_label ( struct ipv6_hdr *const   ipv6,
const uint32_t  flow_label 
) [inline, static]

Set the Flow Label of the given IPv6 packet.

Parameters:
[in,out] ipv6 The header of the IPv6 packet
flow_label The 20-bit Flow Label
static void ipv6_set_tc ( struct ipv6_hdr *const   ipv6,
const uint8_t  tc 
) [inline, static]

Set the Traffic Class (TC) of the given IPv6 packet.

Parameters:
[in,out] ipv6 The header of the IPv6 packet
tc The 8-bit Traffic Class (TC)

Generated on 4 Jul 2018 for ROHC compression/decompression library by  doxygen 1.6.1