Packets: Completely restructured #includes, introduced central Packets.hh file
[senf.git] / Packets / PacketParser.hh
index 21858ba..b963955 100644 (file)
@@ -74,9 +74,7 @@
 #include <boost/optional.hpp>
 #include "Utils/SafeBool.hh"
 #include "PacketTypes.hh"
-#define HH_PacketData_DeclOnly
 #include "PacketData.hh"
-#undef HH_PacketData_DeclOnly
 
 #include "PacketParser.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
@@ -325,27 +323,11 @@ namespace senf {
 
         These macros simplify providing the above defined interface. A typical packet declaration
         using these macros has the following form (This is a concrete example from the definition of
-        the ethernet packet in <tt>DefaultBundle//EthernetPacket.hh</tt>)
-        \code
-            struct Parse_EthVLan : public senf::PacketParserBase
-            {
-                SENF_PACKET_PARSER_INIT(Parse_EthVLan);
-
-                // ////////////////////////////////////////////////////////////////////////
-
-                typedef senf::Parse_UIntField < 0,  3 > Parse_Priority;
-                typedef senf::Parse_Flag          < 3 > Parse_CFI;
-                typedef senf::Parse_UIntField < 4, 16 > Parse_VLanId;
-                typedef senf::Parse_UInt16              Parse_Type;
-
-                SENF_PACKET_PARSER_DEFINE_FIXED_FIELDS(
-                    ((OverlayField)( priority, Parse_Priority ))
-                    ((OverlayField)( cfi,      Parse_CFI      ))
-                    ((Field       )( vlanId,   Parse_VLanId   ))
-                    ((Field       )( type,     Parse_Type     )) 
-                );
-            };
-        \endcode
+        the ethernet packet in <tt>DefaultBundle/EthernetPacket.hh</tt>)
+    
+        \dontinclude EthernetPacket.hh
+        \skipline struct Parse_EthVLan : public PacketParserBase
+        \until };
 
         The macros take care of the following:
         \li They define the accessor functions returning parsers of the given type.
@@ -475,7 +457,7 @@ namespace senf {
         \code
            struct ExtendedParser : public BaseParser
            {
-               SENF_PACKET_PARSER_NO_INIT(ExtendedParser);
+               ExtendedParser(data_iterator i, state_type s) : BaseParser(i,s) {}
         
                SENF_PACKET_PARSER_DEFINE_FIELDS_OFFSET(senf::bytes(BaseParser(*this)),
                  ( ... fields ... ) );
@@ -515,7 +497,7 @@ namespace senf {
         \code
            struct ExtendedParser : public BaseParser
            {
-               SENF_PACKET_PARSER_NO_INIT(ExtendedParser);
+               ExtendedParser(data_iterator i, state_type s) : BaseParser(i,s) {}
 
                SENF_PACKET_PARSER_DEFINE_FIXED_FIELDS_OFFSET(BaseParser::fixed_bytes,
                  ( ... fields ... ) );
@@ -598,6 +580,9 @@ namespace senf {
 }
 
 ///////////////////////////////hh.e////////////////////////////////////////
+#endif
+#if !defined(SENF_PACKETS_DECL_ONLY) && !defined(HH_PacketParser_i_)
+#define HH_PacketParser_i_
 #include "PacketParser.cci"
 #include "PacketParser.ct"
 #include "PacketParser.cti"