// $Id: EthernetPacket.hh 299 2007-07-10 21:23:49Z g0dil $
//
// Copyright (C) 2007
-// Fraunhofer Institute for Open Communication Systems (FOKUS)
-// Competence Center NETwork research (NET), St. Augustin, GERMANY
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
// Stefan Bund <g0dil@berlios.de>
//
// This program is free software; you can redistribute it and/or modify
/** \file
\brief IPv6Packet public header */
-#ifndef HH_IPv6Packet_
-#define HH_IPv6Packet_ 1
+#ifndef HH_SENF_Packets_DefaultBundle_IPv6Packet_
+#define HH_SENF_Packets_DefaultBundle_IPv6Packet_ 1
// Custom includes
#include "../../Socket/Protocols/INet/INet6Address.hh"
value_type value() const { return value_type::from_data(i()); }
void value(value_type const & v) { std::copy(v.begin(), v.end(), i()); }
- operator value_type() { return value(); }
- byte & operator[](size_type index) { return *boost::next(i(),index); }
+ operator value_type() const { return value(); }
+ byte & operator[](size_type index) const { return *boost::next(i(),index); }
INet6AddressParser const & operator= (value_type const & other)
{ value(other); return *this; }
};
/** \brief Parse an IPv6 packet
+ \image html IPv6Packet.png
\see IPv6PacketType \n
<a href="http://tools.ietf.org/html/rfc2460">RFC 2460</a>
*/
\par Fields:
\ref IPv6PacketParser
+ <table class="packet" cellpadding="5" cellspacing="1" border="1">
+ <tr>
+ <th width="12.5%">0</th> <th width="12.5%">4</th> <th width="12.5%">8</th>
+ <th width="12.5%">12</th> <th width="12.5%">16</th> <th width="12.5%">20</th>
+ <th width="12.5%">24</th> <th width="6.5%">28</th>
+ <th style="text-align:right" width="6%">31</th>
+ </tr><tr>
+ <td>\ref IPv6PacketParser::version() "Version"</td>
+ <td colspan="2">\ref IPv6PacketParser::trafficClass() "Traffic Class"</td>
+ <td colspan="6">\ref IPv6PacketParser::flowLabel() "Flow Label"</td>
+ </tr><tr>
+ <td colspan="4">\ref IPv6PacketParser::length() "Payload Length"</td>
+ <td colspan="2">\ref IPv6PacketParser::nextHeader() "Next Header"</td>
+ <td colspan="3">\ref IPv6PacketParser::hopLimit() "Hop Limit"</td>
+ </tr><tr>
+ <td colspan="9" style="height:8em">
+ \ref IPv6PacketParser::source() "Source Address"</td>
+ </tr><tr>
+ <td colspan="9" style="height:8em">
+ \ref IPv6PacketParser::destination() "Destination Address"</td>
+ </tr>
+ </table>
+
\par Associated registries:
\ref IpTypes
\par Finalize action:
- Set \a length from payload size\n
- Set \a nextHeader from type of next packet if found in \ref IpTypes
+ \copydetails finalize()
\ingroup protocolbundle_default
*/
{
#ifndef DOXYGEN
typedef PacketTypeMixin<IPv6PacketType, IpTypes> mixin;
- typedef ConcretePacket<IPv6PacketType> packet;
- typedef IPv6PacketParser parser;
#endif
+ typedef ConcretePacket<IPv6PacketType> packet; ///< IPv6 packet typedef
+ typedef IPv6PacketParser parser; ///< typedef to the parser of IPv6 packet
+
using mixin::nextPacketRange;
using mixin::nextPacketType;
using mixin::initSize;
using mixin::init;
- static registry_key_t nextPacketKey(packet p)
+ static key_t nextPacketKey(packet p)
{ return p->nextHeader(); }
- static void dump(packet p, std::ostream & os);
-
- static void finalize(packet p);
+ /** \brief Dump given IPv6Packet in readable form to given output stream */
+ static void dump(packet p, std::ostream & os);
+
+ static void finalize(packet p); ///< Finalize packet.
+ /**< \li set \ref IPv6PacketParser::length() "length"
+ from payload size
+ \li set \ref IPv6PacketParser::nextHeader()
+ "nextHeader" from type of next packet if found
+ in \ref IpTypes */
};
/** \brief IPv6 packet typedef */