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"
16 //-----------------------------------------------------------------------------
18 //-----------------------------------------------------------------------------
21 * @brief This class represents the IP version 6 Packet Header.
23 * The IPv6 header format is:
26 * 0 3 4 11 12 15 16 23 24 31
27 * +-------+---------------+--------------------------------------+ ---
29 * |version| traffic class | flow label | |
31 * +-------+---------------+-------+--------------+---------------+ |
33 * | payload length in bytes | next header | hop limit | |
35 * +---------------+---------------+--------------+---------------+ |
41 * | source IPv6 address | |
48 * +--------------------------------------------------------------+ |
54 * | destination IPv6 address | |
61 * +--------------------------------------------------------------+ ---
64 class Ipv6Header : public IpHeader
69 uint8_t get_version() const;
70 uint8_t get_differentiated_services() const;
71 uint32_t get_flow_label() const;
73 uint16_t get_payload_length() const;
74 uint8_t get_next_header() const;
75 uint8_t get_hop_limit() const;
77 uint16_t get_header_length() const;
79 uint16_t get_total_length() const;
81 // in IPv6, this corresponds to the "HOP limit"
82 uint8_t get_time_to_live() const;
84 boost::asio::ip::address get_source_address() const;
85 boost::asio::ip::address get_destination_address() const;
87 friend std::istream &operator>>(
94 #endif // IPV6_HEADER_H