Packets/DefaultBundle: Documentation
g0dil [Mon, 23 Jul 2007 14:03:28 +0000 (14:03 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@338 270642c3-0616-0410-b53a-bc976706d245

Packets/DefaultBundle/EthernetPacket.hh
Packets/DefaultBundle/IpV4Packet.hh
Packets/DefaultBundle/IpV6Extensions.hh
Packets/DefaultBundle/IpV6Packet.hh
Packets/DefaultBundle/Mainpage.dox [moved from Packets/DefaultBundle/DefaultBundle.dox with 76% similarity]
Packets/DefaultBundle/UDPPacket.hh

index ffa1f4b..f40d755 100644 (file)
 
 namespace senf {
 
-    ///\addtogroup protocolbundle_default
-    ///@{
+    /** \brief Ethernet MAC address
+        
+        The Ethernet MAC is modelled as a fixed-size container/sequence of 6 bytes.
 
+        \todo Move to someplace else when implementing the addressing classes
+     */
     struct MACAddress
         : boost::array<PacketParserBase::byte,6>
     {
@@ -47,6 +50,13 @@ namespace senf {
         { virtual char const * what() const throw() { return "invalid mac address syntax"; } };
     };
 
+    /** \brief Parse an Ethernet MAC address 
+
+        The ethernet MAC is returned by value as a 6-byte sequence
+
+        \see MACAddress \n
+            EthernetPacket
+     */
     struct Parse_MAC : public PacketParserBase
     {
         Parse_MAC(data_iterator i, state_type s) : PacketParserBase(i,s,fixed_bytes) {}
@@ -63,7 +73,20 @@ namespace senf {
 
         Parse_MAC const & operator= (value_type const & other) { value(other); return *this; }
     };
+    
+    /** \brief Parse an Ethernet packet
+
+        Parser implementing an ethernet header. The fields implemented are
+
+        <table class="senf">
+        <tr> <th>Field name</th>  <th>Parser type</th>     </tr>
+        <tr> <td>destination</td> <td>\ref Parse_MAC</td>  </tr>
+        <tr> <td>source</td>      <td>\ref Parse_MAC</td>  </tr>
+        <tr> <td>type</td>        <td>\ref Parse_Type</td> </tr>
+        </table>
 
+        \see EthernetPacketType
+     */
     struct Parse_Ethernet : public PacketParserBase
     {
         SENF_PACKET_PARSER_INIT(Parse_Ethernet);
@@ -78,11 +101,31 @@ namespace senf {
             ((Field)( type,        Parse_Type )) );
     };
 
+    /** \brief EtherType registry
+
+        This registry registers packet types with their EtherType number.
+        
+        \see <a href="http://www.iana.org/assignments/ethernet-numbers">Ethernet numbers</a>
+         \ref PacketRegistry
+     */
     struct EtherTypes {
-        // See http://www.iana.org/assignments/ethernet-numbers
+        // See 
         typedef boost::uint16_t key_t;
     };
 
+    /** \brief Ethernet packet
+
+        \par Packet type (typedef):
+            \ref EthernetPacket
+
+        \par Fields:
+            \ref Parse_Ethernet
+
+        \par Associated registries:
+            \ref EtherTypes
+
+        \ingroup protocolbundle_default
+     */
     struct EthernetPacketType
         : public PacketTypeBase,
           public PacketTypeMixin<EthernetPacketType, EtherTypes>
@@ -104,8 +147,23 @@ namespace senf {
         static void dump(packet p, std::ostream & os);
     };
 
+    /** \brief Ethernet packet typedef */
     typedef EthernetPacketType::packet EthernetPacket;
 
+    /** \brief Parse an ethernet VLAN tag
+        
+        Parser interpreting the ethernet VLAN tag. Fields are
+
+        <table class="senf">
+        <tr> <th>Field name</th><th>Parser type</th></tr>
+        <tr><td>priority</td><td>\ref Parse_Priority</td></tr>
+        <tr><td>cfi</td><td>\ref Parse_CFI</td></tr>
+        <tr><td>vlanId</td><td>\ref Parse_VLanId</td></tr>
+        <tr><td>type</td><td>\ref Parse_Type</td></tr>
+        </table>
+
+        \see EthVLanPacketType
+     */
     struct Parse_EthVLan : public PacketParserBase
     {
         SENF_PACKET_PARSER_INIT(Parse_EthVLan);
@@ -124,6 +182,19 @@ namespace senf {
             ((Field       )( type,     Parse_Type     )) );
     };
 
+    /** \brief Ethernet VLAN tag
+
+        \par Packet type (typedef):
+            \ref EthVLanPacket
+
+        \par Fields:
+            \ref Parse_EthVLan
+
+        \par Associated registries:
+            \ref EtherTypes
+
+        \ingroup protocolbundle_default
+     */
     struct EthVLanPacketType
         : public PacketTypeBase, 
           public PacketTypeMixin<EthVLanPacketType, EtherTypes>
@@ -145,9 +216,8 @@ namespace senf {
         static void dump(packet p, std::ostream & os);
     };
 
+    /** \brief Ethernet VLAN tag typedef */
     typedef EthVLanPacketType::packet EthVLanPacket;
-
-    ///@}
 }
 
 
index 4c3d977..94a6823 100644 (file)
 
 namespace senf {
 
-    ///\addtogroup protocolbundle_default
-    ///@{
-
+    /** \brief Parse an IpV4 packet
+
+        Parser implementing the IpV4 header. The fields implemented are:
+
+        <table class="senf">
+            <tr><th>Field name</th><th>Parser type</th></tr>
+            <tr><td>version</td><td>\ref Parse_Version</td></tr>
+            <tr><td>ihl</td><td>\ref Parse_IHL</td></tr>
+            <tr><td>tos</td><td>\ref Parse_8bit</td></tr>
+            <tr><td>length</td><td>\ref Parse_16bit</td></tr>
+            <tr><td>identifier</td><td>\ref Parse_16bit</td></tr>
+            <tr><td>reserved</td><td>\ref Parse_R</td></tr>
+            <tr><td>df</td><td>\ref Parse_DF</td></tr>
+            <tr><td>mf</td><td>\ref Parse_MF</td></tr>
+            <tr><td>frag</td><td>\ref Parse_Frag</td></tr>
+            <tr><td>ttl</td><td>\ref Parse_8bit</td></tr>
+            <tr><td>protocol</td><td>\ref Parse_8bit</td></tr>
+            <tr><td>crc</td><td>\ref Parse_16bit</td></tr>
+            <tr><td>source</td><td>\ref Parse_32bit</td></tr>
+            <tr><td>destination</td><td>\ref Parse_32bit</td></tr>
+        </table>
+
+        \see IpV4PacketType \n
+            <a href="http://tools.ietf.org/html/rfc791">RFC 791</a>
+
+        \todo Implement options
+     */
     struct Parse_IpV4 : public PacketParserBase
     {
         SENF_PACKET_PARSER_NO_INIT(Parse_IpV4);
@@ -71,12 +95,30 @@ namespace senf {
         }
     };
 
+    /** \brief IP protocol number registry
+
+        This registeres packets with their IP protocol number.
+
+        \see <a href="http://www.iana.org/assignments/protocol-numbers">Protocol numbers</a>
+            PacketRegistry
+     */
     struct IpTypes {
-        // See http://www.iana.org/assignments/protocol-numbers
-        // Also used by IPv6
         typedef boost::uint16_t key_t;
     };
 
+    /** \brief IpV4 packet
+        
+        \par Packet type (typedef):
+            \ref IpV4Packet
+
+        \par Fields:
+            \ref Parse_IpV4
+
+        \par Associated registries:
+            \ref IpTypes
+
+        \ingroup protocolbundle_default
+     */
     struct IpV4PacketType
         : public PacketTypeBase,
           public PacketTypeMixin<IpV4PacketType, IpTypes>
@@ -96,9 +138,8 @@ namespace senf {
         static void dump(packet p, std::ostream & os);
     };
         
+    /** \brief IpV4 packet typedef */
     typedef IpV4PacketType::packet IpV4Packet;
-
-    ///@}
 }
 
 
index 50ace78..4817348 100644 (file)
 
 namespace senf {
 
-    ///\addtogroup protocolbundle_default
-    ///@{
-
-    // See RFC2460
+    /** \brief Parse in IpV6 fragment extension header
+        
+        Parser implementing the IpV6 fragment extension. The fields implemented are:
+
+        <table class="senf">
+            <tr><th>Field name</th><th>Parser type</th></tr>
+            <tr><td>nextHeader</td><td>\ref Parse_8bit</td></tr>
+            <tr><td>reserved1</td><td>\ref Parse_8bit</td></tr>
+            <tr><td>fragmentOffset</td><td>\ref Parse_Offset</td></tr>
+            <tr><td>reserved2</td><td>\ref Parse_Reserved</td></tr>
+            <tr><td>moreFragments</td><td>\ref Parse_More</td></tr>
+            <tr><td>id</td><td>\ref Parse_32bit</td></tr>
+        </table>
+
+        \see IpV6ExtensionType_Fragment \n
+            <a href="http://tools.ietf.org/html/rfc2460">RFC 2460</a>
+     */
     struct Parse_IpV6Extension_Fragment : public PacketParserBase
     {
         SENF_PACKET_PARSER_INIT(Parse_IpV6Extension_Fragment);
@@ -57,6 +70,19 @@ namespace senf {
             ((Field       )( id             , Parse_32bit    )) );
     };
 
+    /** \brief IpV6 fragment extension
+
+        \par Packet type (typedef):
+            \ref IpV6Extension_Fragment
+
+        \par Fields:
+            \ref Parse_IpV6Extension_Fragment
+        
+        \par Associated registries:
+            \par IpTypes
+        
+        \ingroup protocolbundle_default
+     */
     struct IpV6ExtensionType_Fragment
         : public PacketTypeBase,
           public PacketTypeMixin<IpV6ExtensionType_Fragment, IpTypes>
@@ -76,9 +102,8 @@ namespace senf {
         static void dump(packet p, std::ostream & os);
     };
 
+    /** \brief IpV6 fragment extension packet typedef */
     typedef IpV6ExtensionType_Fragment::packet IpV6Extension_Fragment;
-
-    ///@}
 }
 
 ///////////////////////////////hh.e////////////////////////////////////////
index b332a98..33ccb8b 100644 (file)
 
 namespace senf {
 
-    ///\addtogroup protocolbundle_default
-    ///@{
-
-    // See RFC2460
+    /** \brief Parse an IpV6 packet
+
+        Parser implementing the IpV6 header. The fields implemented are:
+
+        <table class="senf">
+            <tr><th>Field name</th><th>Parser type</th></tr>
+            <tr><td>version</td><td>\ref Parse_Version</td></tr>
+            <tr><td>trafficClass</td><td>\ref Parse_Class</td></tr>
+            <tr><td>flowLabel</td><td>\ref Parse_FlowLabel</td></tr>
+            <tr><td>length</td><td>\ref Parse_16bit</td></tr>
+            <tr><td>nextHeader</td><td>\ref Parse_8bit</td></tr>
+            <tr><td>hopLimit</td><td>\ref Parse_8bit</td></tr>
+            <tr><td>source</td><td>\ref Parse_Addr</td></tr>
+            <tr><td>destination</td><td>\ref Parse_Addr</td></tr>
+        </table>
+
+        \see IpV6PacketType \n
+            <a href="http://tools.ietf.org/html/rfc2460">RFC 2460</a>
+     */
     struct Parse_IpV6 : public PacketParserBase
     {
         SENF_PACKET_PARSER_NO_INIT(Parse_IpV6);
@@ -66,6 +81,19 @@ namespace senf {
         }
     };
 
+    /** \brief IpV6 packet
+
+        \par Packet type (typedef):
+            \ref IpV6Packet
+        
+        \par Fields:
+            \ref Parse_IpV6
+
+        \par Associated registries:
+            \ref IpTypes
+
+        \ingroup protocolbundle_default
+     */
     struct IpV6PacketType
         : public PacketTypeBase,
           public PacketTypeMixin<IpV6PacketType, IpTypes>
@@ -85,6 +113,7 @@ namespace senf {
         static void dump(packet p, std::ostream & os);
     };
 
+    /** \brief IpV6 packet typedef */
     typedef IpV6PacketType::packet IpV6Packet;
 
     ///@}
similarity index 76%
rename from Packets/DefaultBundle/DefaultBundle.dox
rename to Packets/DefaultBundle/Mainpage.dox
index e902443..dce88bf 100644 (file)
 
 /** \mainpage The Default Bundle
 
-    The default bundle combines a set of basic low level protocols like Ethernet or IP. You can find
-    the list of implemented protocols at \ref protocolbundle_default (see the list of typedefs)
+    The default bundle combines a set of basic low level protocols like Ethernet or IP. Find the
+    list of protocols implemented at \ref protocolbundle_default
  */
 
-/** \defgroup protocolbundle_default Protocols of the default bundle
+/** \defgroup protocolbundle_default Protocols contained in the DefaultBundle
 
     Each protocol consists of several objects
 
     \li The packet \c typedef symbol. This is the only object explicitly accessed from the outside
     \li The associated parser object. This is, where the field names are documented
     \li The internal packet type object
+
+    Below you find a list of the internal packet type object for each of the implemented
+    protocols. You will never use this type directly, however the documentation will reference the
+    packet typedef to use and will document the parser used to parse the packet's fields.
  */
 
 \f
index bc3ab1d..615c530 100644 (file)
 
 namespace senf {
 
-    ///\addtogroup protocolbundle_default
-    ///@{
+    /** \brief Parse a UDP packet
 
-    // See RFC768
+        Parser implementing the UDP header. The fields implemented are:
+
+        <table class="senf">
+            <tr><th>Field name</th><th>Parser type</th></tr>
+            <tr><td>source</td><td>\ref Parse_16bit</td></tr>
+            <tr><td>destination</td><td>\ref Parse_16bit</td></tr>
+            <tr><td>length</td><td>\ref Parse_16bit</td></tr>
+            <tr><td>crc</td><td>\ref Parse_16bit</td></tr>
+        </table>
+
+        \see UDPPacketType
+            <a href="http://tools.ietf.org/html/rfc768">RFC 768</a>
+     */
     struct Parse_UDP : public PacketParserBase
     {
         SENF_PACKET_PARSER_INIT(Parse_UDP);
@@ -50,6 +61,16 @@ namespace senf {
             ((Field)( crc,         Parse_16bit )) );
     };
 
+    /** \brief UDP packet
+        
+        \par Packet type (typedef):
+            \ref UDPPacket
+
+        \par Fields:
+            \ref Parse_UDP
+
+        \ingroup protocolbundle_default
+     */
     struct UDPPacketType
         : public PacketTypeBase,
           public PacketTypeMixin<UDPPacketType>
@@ -65,9 +86,8 @@ namespace senf {
         static void dump(packet p, std::ostream & os);
     };
 
+    /** \brief UDP packet typedef */
     typedef UDPPacketType::packet UDPPacket;
-
-    ///@}
 }