moved Sniffer into new Examples directory
[senf.git] / Packets / ParserBase.hh
index cb2ecce..6cf4f8e 100644 (file)
@@ -1,6 +1,6 @@
 // $Id$
 //
-// Copyright (C) 2006 
+// Copyright (C) 2006
 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
 //     Stefan Bund <stefan.bund@fokus.fraunhofer.de>
 #include "ParserBase.ih"
 ///////////////////////////////hh.p////////////////////////////////////////
 
-namespace satcom {
-namespace pkf {
-    
+namespace senf {
+
+
     namespace impl { struct ParserBase; }
 
-    struct nil 
-       : public boost::iterator_facade<nil,char,boost::random_access_traversal_tag>
+    struct nil
+        : public boost::iterator_facade<nil,char,boost::random_access_traversal_tag>
     {
-       // Theese are declared to make nil a valid iterator. All
-       // access to an instance of this iterator however is invalid
-       // (these members are not implemented only declared)
-       char & dereference() const;
-       bool equal(nil other) const;
-       void increment();
-       void decrement();
-       void advance(int n);
-       int distance_to(nil other) const;
+        // Theese are declared to make nil a valid iterator. All
+        // access to an instance of this iterator however is invalid
+        // (these members are not implemented only declared)
+        char & dereference() const;
+        bool equal(nil other) const;
+        void increment();
+        void decrement();
+        void advance(int n);
+        int distance_to(nil other) const;
     };
 
     /** \brief Parser framework
@@ -77,11 +77,11 @@ namespace pkf {
 
         To implement a new parser, write a template implementing the
         following members:
-        
+
         \code
             template <class Iterator=nil, class IPacket=nil>
             struct Parser_Example
-                : protected satcom::pkf::ParserBase<Iterator,IPacket>
+                : protected senf::ParserBase<Iterator,IPacket>
             {
                 // fixed interface of all parser classes
 
@@ -91,7 +91,7 @@ namespace pkf {
 
                 Parse_Example() {}
                 Parse_Example(Iterator const & i) : ParserBase<Iterator,IPacket>(i) {}
-        
+
                 [static] unsigned bytes()
                 {
                     // return the size of the parsed header. This
@@ -107,7 +107,7 @@ namespace pkf {
                     // return true, if the data in the range [begin,end)
                     // can be safely interpreted by the parser without
                     // causing invalid memory access. This means,
-                    // check, wether the data is truncated
+                    // check, whether the data is truncated
                     return static_cast<unsigned>(end-begin) >= bytes();
                 }
 
@@ -141,9 +141,9 @@ namespace pkf {
                 Parse_Field2 field2() const { return Parse_Field2 (this->i()+2); }
             };
         \endcode
-        
+
         Every parser must have some mandatory fixed members which are:
-        
+
         - struct rebind: This structure allows the parser to be
           converted to a parser of the same type but with a different
           iterator. Parser may have more than the two standard
@@ -153,10 +153,10 @@ namespace pkf {
           parameters must be provided from the outside template
 
         - byte_iterator: A typedef for the Iterator class used
-        
+
         - Non Iterator constructor: This constructor is only used when
           the parser is inherited into a Packet class.
-        
+
         - Iterator constructor: This constructor must call the
           corresponding ParserBase constructor.
 
@@ -223,7 +223,7 @@ namespace pkf {
         ///////////////////////////////////////////////////////////////////////////
         ///\name Structors and default members
         ///@{
-        
+
         // default default constructor
         // default copy constructor
         // default copy assignment
@@ -237,7 +237,7 @@ namespace pkf {
         static void init() {};
 
     private:
-        
+
     };
 
     template <class Iterator>
@@ -263,15 +263,15 @@ namespace pkf {
         static void init() {}
         template <class SomePacket>
         static void init(typename SomePacket::ptr) {}
-        
+
     private:
 
         Iterator i_;
     };
 
     /** \brief Addtiional Parser information
-        
-        Parser_traits provids abstract information about an unknown
+
+        Parser_traits provides abstract information about an unknown
         parser. Besides the information already available within the
         Parser it provides an additional 'fixed_sized' member which is
         true if and only if the Parser has a static bytes() member.
@@ -293,8 +293,8 @@ namespace pkf {
 
     template <class Parser>
     unsigned min_bytes();
-    
-}}
+
+}
 
 ///////////////////////////////hh.e////////////////////////////////////////
 //#include "ParserBase.cci"
@@ -305,5 +305,8 @@ namespace pkf {
 \f
 // Local Variables:
 // mode: c++
-// c-file-style: "satcom"
+// fill-column: 100
+// c-file-style: "senf"
+// indent-tabs-mode: nil
+// ispell-local-dictionary: "american"
 // End: