xorp

IpHeader6 Class Reference

IPv6 packet header. More...

#include <packet.hh>

Inheritance diagram for IpHeader6:
IpHeader6Writer

List of all members.

Public Member Functions

 IpHeader6 (const uint8_t *data)
const uint8_t * data () const
 Get the buffer data.
uint32_t ip_vtc_flow () const
 Methods to get various IP header fields.
uint16_t ip_plen () const
uint8_t ip_nxt () const
uint8_t ip_hlim () const
IPv6 ip_src () const
IPv6 ip_dst () const
uint8_t ip_version () const
 Get the IP protocol version of the header.
uint8_t ip_traffic_class () const
 Get the IPv6 traffic class.
uint32_t ip_flow_label () const
 Get the IPv6 flow label.
bool is_valid_version () const
 Test whether the IP header version is valid.

Static Public Member Functions

static size_t size ()
 Get the IPv6 packet header size.

Static Public Attributes

static const size_t SIZE = 40
static const uint8_t IP_VERSION = 6

Static Protected Attributes

static const uint32_t VERSION_MASK = 0xf0000000
static const uint32_t TRAFFIC_CLASS_MASK = 0x0ff00000
static const uint32_t FLOW_LABEL_MASK = 0x000fffff
static const size_t VERSION_SHIFT = 28
static const size_t TRAFFIC_CLASS_SHIFT = 20
static const size_t FLOW_LABEL_SHIFT = 0
static const size_t _ip_vtc_flow_sizeof = 4
static const size_t _ip_plen_sizeof = 2
static const size_t _ip_nxt_sizeof = 1
static const size_t _ip_hlim_sizeof = 1
static const size_t _ip_src_sizeof = 16
static const size_t _ip_dst_sizeof = 16
static const size_t _ip_vtc_flow_offset = 0
static const size_t _ip_plen_offset = _ip_vtc_flow_offset + _ip_vtc_flow_sizeof
static const size_t _ip_nxt_offset = _ip_plen_offset + _ip_plen_sizeof
static const size_t _ip_hlim_offset = _ip_nxt_offset + _ip_nxt_sizeof
static const size_t _ip_src_offset = _ip_hlim_offset + _ip_hlim_sizeof
static const size_t _ip_dst_offset = _ip_src_offset + _ip_src_sizeof

Private Attributes

const uint8_t * _data
const uint8_t * _ip_vtc_flow
const uint8_t * _ip_plen
const uint8_t * _ip_nxt
const uint8_t * _ip_hlim
const uint8_t * _ip_src
const uint8_t * _ip_dst

Detailed Description

IPv6 packet header.

The IPv6 packet header has the following content:

ip_vtc_flow (4 bytes): // 4 bits vers., 8 bits traf. class, 20 bits flow-ID ip_plen (2 bytes): // Payload length ip_nxt (1 byte): // Next header ip_hlim (1 byte): // Hop limit ip_src (16 bytes): // Source address ip_dst (16 bytes): // Destination address


Member Function Documentation

const uint8_t* IpHeader6::data ( ) const [inline]

Get the buffer data.

Returns:
the buffer data.
uint32_t IpHeader6::ip_flow_label ( ) const [inline]

Get the IPv6 flow label.

Returns:
the IPv6 flow label.
uint8_t IpHeader6::ip_traffic_class ( ) const [inline]

Get the IPv6 traffic class.

Returns:
the IPv6 traffic class.
uint8_t IpHeader6::ip_version ( ) const [inline]

Get the IP protocol version of the header.

Returns:
the IP protocol version of the header.
bool IpHeader6::is_valid_version ( ) const [inline]

Test whether the IP header version is valid.

Returns:
true if the IP header version is valid, otherwise false.
static size_t IpHeader6::size ( ) [inline, static]

Get the IPv6 packet header size.

Note that this is the header size only without any extention headers.

Returns:
the IPv6 packet header size.

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations