From: g0dil Date: Mon, 23 Jul 2007 14:03:28 +0000 (+0000) Subject: Packets/DefaultBundle: Documentation X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=d53c168dbfd70ffea9ebad8953193163e113ff3a;p=senf.git Packets/DefaultBundle: Documentation git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@338 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Packets/DefaultBundle/EthernetPacket.hh b/Packets/DefaultBundle/EthernetPacket.hh index ffa1f4b..f40d755 100644 --- a/Packets/DefaultBundle/EthernetPacket.hh +++ b/Packets/DefaultBundle/EthernetPacket.hh @@ -33,9 +33,12 @@ 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 { @@ -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 + + + + + + +
Field name Parser type
destination \ref Parse_MAC
source \ref Parse_MAC
type \ref Parse_Type
+ \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 Ethernet numbers + \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 @@ -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 + + + + + + + +
Field nameParser type
priority\ref Parse_Priority
cfi\ref Parse_CFI
vlanId\ref Parse_VLanId
type\ref Parse_Type
+ + \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 @@ -145,9 +216,8 @@ namespace senf { static void dump(packet p, std::ostream & os); }; + /** \brief Ethernet VLAN tag typedef */ typedef EthVLanPacketType::packet EthVLanPacket; - - ///@} } diff --git a/Packets/DefaultBundle/IpV4Packet.hh b/Packets/DefaultBundle/IpV4Packet.hh index 4c3d977..94a6823 100644 --- a/Packets/DefaultBundle/IpV4Packet.hh +++ b/Packets/DefaultBundle/IpV4Packet.hh @@ -31,9 +31,33 @@ namespace senf { - ///\addtogroup protocolbundle_default - ///@{ - + /** \brief Parse an IpV4 packet + + Parser implementing the IpV4 header. The fields implemented are: + + + + + + + + + + + + + + + + + +
Field nameParser type
version\ref Parse_Version
ihl\ref Parse_IHL
tos\ref Parse_8bit
length\ref Parse_16bit
identifier\ref Parse_16bit
reserved\ref Parse_R
df\ref Parse_DF
mf\ref Parse_MF
frag\ref Parse_Frag
ttl\ref Parse_8bit
protocol\ref Parse_8bit
crc\ref Parse_16bit
source\ref Parse_32bit
destination\ref Parse_32bit
+ + \see IpV4PacketType \n + RFC 791 + + \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 Protocol numbers + 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 @@ -96,9 +138,8 @@ namespace senf { static void dump(packet p, std::ostream & os); }; + /** \brief IpV4 packet typedef */ typedef IpV4PacketType::packet IpV4Packet; - - ///@} } diff --git a/Packets/DefaultBundle/IpV6Extensions.hh b/Packets/DefaultBundle/IpV6Extensions.hh index 50ace78..4817348 100644 --- a/Packets/DefaultBundle/IpV6Extensions.hh +++ b/Packets/DefaultBundle/IpV6Extensions.hh @@ -32,10 +32,23 @@ namespace senf { - ///\addtogroup protocolbundle_default - ///@{ - - // See RFC2460 + /** \brief Parse in IpV6 fragment extension header + + Parser implementing the IpV6 fragment extension. The fields implemented are: + + + + + + + + + +
Field nameParser type
nextHeader\ref Parse_8bit
reserved1\ref Parse_8bit
fragmentOffset\ref Parse_Offset
reserved2\ref Parse_Reserved
moreFragments\ref Parse_More
id\ref Parse_32bit
+ + \see IpV6ExtensionType_Fragment \n + RFC 2460 + */ 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 @@ -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//////////////////////////////////////// diff --git a/Packets/DefaultBundle/IpV6Packet.hh b/Packets/DefaultBundle/IpV6Packet.hh index b332a98..33ccb8b 100644 --- a/Packets/DefaultBundle/IpV6Packet.hh +++ b/Packets/DefaultBundle/IpV6Packet.hh @@ -33,10 +33,25 @@ namespace senf { - ///\addtogroup protocolbundle_default - ///@{ - - // See RFC2460 + /** \brief Parse an IpV6 packet + + Parser implementing the IpV6 header. The fields implemented are: + + + + + + + + + + + +
Field nameParser type
version\ref Parse_Version
trafficClass\ref Parse_Class
flowLabel\ref Parse_FlowLabel
length\ref Parse_16bit
nextHeader\ref Parse_8bit
hopLimit\ref Parse_8bit
source\ref Parse_Addr
destination\ref Parse_Addr
+ + \see IpV6PacketType \n + RFC 2460 + */ 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 @@ -85,6 +113,7 @@ namespace senf { static void dump(packet p, std::ostream & os); }; + /** \brief IpV6 packet typedef */ typedef IpV6PacketType::packet IpV6Packet; ///@} diff --git a/Packets/DefaultBundle/DefaultBundle.dox b/Packets/DefaultBundle/Mainpage.dox similarity index 76% rename from Packets/DefaultBundle/DefaultBundle.dox rename to Packets/DefaultBundle/Mainpage.dox index e902443..dce88bf 100644 --- a/Packets/DefaultBundle/DefaultBundle.dox +++ b/Packets/DefaultBundle/Mainpage.dox @@ -20,17 +20,21 @@ /** \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. */ diff --git a/Packets/DefaultBundle/UDPPacket.hh b/Packets/DefaultBundle/UDPPacket.hh index bc3ab1d..615c530 100644 --- a/Packets/DefaultBundle/UDPPacket.hh +++ b/Packets/DefaultBundle/UDPPacket.hh @@ -31,10 +31,21 @@ namespace senf { - ///\addtogroup protocolbundle_default - ///@{ + /** \brief Parse a UDP packet - // See RFC768 + Parser implementing the UDP header. The fields implemented are: + + + + + + + +
Field nameParser type
source\ref Parse_16bit
destination\ref Parse_16bit
length\ref Parse_16bit
crc\ref Parse_16bit
+ + \see UDPPacketType + RFC 768 + */ 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 @@ -65,9 +86,8 @@ namespace senf { static void dump(packet p, std::ostream & os); }; + /** \brief UDP packet typedef */ typedef UDPPacketType::packet UDPPacket; - - ///@} }