1 // Copyright (c) 2003-2010 Christopher M. Kohlhoff
2 // Modifications (c) 2011 by Guilherme Maciel Ferreira / Intra2net AG
4 // Distributed under the Boost Software License, Version 1.0.
5 // (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
12 #include <boost/asio/ip/address_v6.hpp>
14 #include "ip/ipheader.h"
15 #include "host/messagepayload.h"
17 //-----------------------------------------------------------------------------
19 //-----------------------------------------------------------------------------
22 * @brief This class represents the IP version 6 Packet Header.
24 * The IPv6 header format is:
27 * 0 3 4 11 12 15 16 23 24 31
28 * +-------+---------------+--------------------------------------+ ---
30 * |version| traffic class | flow label | |
32 * +-------+---------------+-------+--------------+---------------+ |
34 * | payload length in bytes | next header | hop limit | |
36 * +---------------+---------------+--------------+---------------+ |
42 * | source IPv6 address | |
49 * +--------------------------------------------------------------+ |
55 * | destination IPv6 address | |
62 * +--------------------------------------------------------------+ ---
65 class Ipv6Header : public IpHeader
70 uint8_t get_version() const;
71 uint8_t get_differentiated_services() const;
72 uint32_t get_flow_label() const;
74 uint16_t get_payload_length() const;
75 uint8_t get_next_header() const;
76 uint8_t get_hop_limit() const;
78 uint16_t get_header_length() const;
80 uint16_t get_total_length() const;
82 // in IPv6, this corresponds to the "HOP limit"
83 uint8_t get_time_to_live() const;
85 boost::asio::ip::address get_source_address() const;
86 boost::asio::ip::address get_destination_address() const;
88 friend std::istream &operator>>(
94 MessagePayload Payload;
98 #endif // IPV6_HEADER_H