From: g0dil Date: Tue, 24 Jul 2007 12:34:46 +0000 (+0000) Subject: Packets/DefaultBundle: Fix packet parser documentation using #ifndef DOXYGEN guards X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=a4e052fb8832499ef5e3ae4e563ea01b834010c2;p=senf.git Packets/DefaultBundle: Fix packet parser documentation using #ifndef DOXYGEN guards git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@346 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Packets/DefaultBundle/EthernetPacket.hh b/Packets/DefaultBundle/EthernetPacket.hh index f40d755..ebb07ae 100644 --- a/Packets/DefaultBundle/EthernetPacket.hh +++ b/Packets/DefaultBundle/EthernetPacket.hh @@ -76,29 +76,30 @@ namespace senf { /** \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
+ Parser implementing an ethernet header. \see EthernetPacketType */ struct Parse_Ethernet : public PacketParserBase { - SENF_PACKET_PARSER_INIT(Parse_Ethernet); + typedef Parse_UInt16 Parse_Type; - /////////////////////////////////////////////////////////////////////////// +# ifndef DOXYGEN - typedef Parse_UInt16 Parse_Type; + SENF_PACKET_PARSER_INIT(Parse_Ethernet); SENF_PACKET_PARSER_DEFINE_FIXED_FIELDS( ((Field)( destination, Parse_MAC )) ((Field)( source, Parse_MAC )) ((Field)( type, Parse_Type )) ); + +# else + + Parse_MAC destination(); + Parse_MAC source(); + Parse_Type type(); + +# endif }; /** \brief EtherType registry @@ -154,32 +155,33 @@ namespace senf { 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); - - /////////////////////////////////////////////////////////////////////////// - typedef Parse_UIntField < 0, 3 > Parse_Priority; typedef Parse_Flag < 3 > Parse_CFI; typedef Parse_UIntField < 4, 16 > Parse_VLanId; typedef Parse_UInt16 Parse_Type; +# ifndef DOXYGEN + + SENF_PACKET_PARSER_INIT(Parse_EthVLan); + SENF_PACKET_PARSER_DEFINE_FIXED_FIELDS( ((OverlayField)( priority, Parse_Priority )) ((OverlayField)( cfi, Parse_CFI )) ((Field )( vlanId, Parse_VLanId )) ((Field )( type, Parse_Type )) ); + +# else + + Parse_Priority priority(); + Parse_CFI cfi(); + Parse_VLanId vlanId(); + Parse_Type type(); + +# endif }; /** \brief Ethernet VLAN tag diff --git a/Packets/DefaultBundle/IpV4Packet.hh b/Packets/DefaultBundle/IpV4Packet.hh index 94a6823..8bd7c69 100644 --- a/Packets/DefaultBundle/IpV4Packet.hh +++ b/Packets/DefaultBundle/IpV4Packet.hh @@ -35,24 +35,6 @@ namespace senf { 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 @@ -60,10 +42,6 @@ namespace senf { */ struct Parse_IpV4 : public PacketParserBase { - SENF_PACKET_PARSER_NO_INIT(Parse_IpV4); - - /////////////////////////////////////////////////////////////////////////// - typedef Parse_UIntField < 0, 4 > Parse_Version; typedef Parse_UIntField < 4, 8 > Parse_IHL; typedef Parse_UInt8 Parse_8bit; @@ -74,6 +52,10 @@ namespace senf { typedef Parse_UIntField < 3, 16 > Parse_Frag; typedef Parse_UInt32 Parse_32bit; +# ifndef DOXYGEN + + SENF_PACKET_PARSER_NO_INIT(Parse_IpV4); + SENF_PACKET_PARSER_DEFINE_FIXED_FIELDS( ((OverlayField)( version, Parse_Version )) ((Field )( ihl, Parse_IHL )) @@ -90,6 +72,25 @@ namespace senf { ((Field )( source, Parse_32bit )) ((Field )( destination, Parse_32bit )) ); +# else + + Parse_Version version(); + Parse_IHL ihl(); + Parse_8bit tos(); + Parse_16bit length(); + Parse_16bit identifier(); + Parse_R reserved(); + Parse_DF df(); + Parse_MF mf(); + Parse_Frag frag(); + Parse_8bit ttl(); + Parse_8bit protocol(); + Parse_16bit crc(); + Parse_32bit source(); + Parse_32bit destination(); + +# endif + void init() { version() = 4; } diff --git a/Packets/DefaultBundle/IpV6Extensions.hh b/Packets/DefaultBundle/IpV6Extensions.hh index 4817348..a0bd5b0 100644 --- a/Packets/DefaultBundle/IpV6Extensions.hh +++ b/Packets/DefaultBundle/IpV6Extensions.hh @@ -36,31 +36,21 @@ namespace senf { 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); - - /////////////////////////////////////////////////////////////////////////// - typedef Parse_UInt8 Parse_8bit; typedef Parse_UIntField < 0, 13 > Parse_Offset; typedef Parse_UIntField < 13, 15 > Parse_Reserved; typedef Parse_Flag < 15 > Parse_More; typedef Parse_UInt32 Parse_32bit; +# ifndef DOXYGEN + + SENF_PACKET_PARSER_INIT(Parse_IpV6Extension_Fragment); + SENF_PACKET_PARSER_DEFINE_FIXED_FIELDS( ((Field )( nextHeader , Parse_8bit )) ((Field )( reserved1 , Parse_8bit )) @@ -68,6 +58,17 @@ namespace senf { ((OverlayField)( reserved2 , Parse_Reserved )) ((Field )( moreFragments , Parse_More )) ((Field )( id , Parse_32bit )) ); + +# else + + Parse_8bit nextHeader(); + Parse_8bit reserved1(); + Parse_Offset fragmentOffset(); + Parse_Reserved reserved2(); + Parse_More moreFragments(); + Parse_32bit id(); + +# endif }; /** \brief IpV6 fragment extension diff --git a/Packets/DefaultBundle/IpV6Packet.hh b/Packets/DefaultBundle/IpV6Packet.hh index 33ccb8b..112afdc 100644 --- a/Packets/DefaultBundle/IpV6Packet.hh +++ b/Packets/DefaultBundle/IpV6Packet.hh @@ -37,27 +37,11 @@ namespace senf { 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); - - /////////////////////////////////////////////////////////////////////////// - typedef Parse_UIntField < 0, 4 > Parse_Version; typedef Parse_UIntField < 4, 12 > Parse_Class; typedef Parse_UIntField < 12, 32 > Parse_FlowLabel; @@ -66,6 +50,10 @@ namespace senf { typedef Parse_Array < 16, Parse_8bit > Parse_Addr; +# ifndef DOXYGEN + + SENF_PACKET_PARSER_NO_INIT(Parse_IpV6); + SENF_PACKET_PARSER_DEFINE_FIXED_FIELDS( ((OverlayField)( version, Parse_Version )) ((OverlayField)( trafficClass, Parse_Class )) @@ -76,6 +64,19 @@ namespace senf { ((Field )( source, Parse_Addr )) ((Field )( destination, Parse_Addr )) ); +# else + + Parse_Version version(); + Parse_Class trafficClass(); + Parse_FlowLabel flowLabel(); + Parse_16bit length(); + Parse_8bit nextHeader(); + Parse_8bit hopLimit(); + Parse_Addr source(); + Parse_Addr destination(); + +# endif + void init() { version() = 6; } diff --git a/Packets/DefaultBundle/UDPPacket.hh b/Packets/DefaultBundle/UDPPacket.hh index 615c530..5ea93db 100644 --- a/Packets/DefaultBundle/UDPPacket.hh +++ b/Packets/DefaultBundle/UDPPacket.hh @@ -35,30 +35,31 @@ namespace senf { 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); + typedef Parse_UInt16 Parse_16bit; - /////////////////////////////////////////////////////////////////////////// +# ifndef DOXYGEN - typedef Parse_UInt16 Parse_16bit; + SENF_PACKET_PARSER_INIT(Parse_UDP); SENF_PACKET_PARSER_DEFINE_FIXED_FIELDS( ((Field)( source, Parse_16bit )) ((Field)( destination, Parse_16bit )) ((Field)( length, Parse_16bit )) ((Field)( crc, Parse_16bit )) ); + +# else + + Parse_16bit source(); + Parse_16bit destination(); + Parse_16bit length(); + Parse_16bit crc(); + +# endif }; /** \brief UDP packet