Packets: Fix VariantParser invalid parser access bug
[senf.git] / Packets / DefaultBundle / IPv4Packet.hh
index 1a27b27..c1e367b 100644 (file)
@@ -1,8 +1,8 @@
 // $Id$
 //
 // Copyright (C) 2006
-// Fraunhofer Institute for Open Communication Systems (FOKUS) 
-// Competence Center NETwork research (NET), St. Augustin, GERMANY 
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
 //     Stefan Bund <g0dil@berlios.de>
 //
 // This program is free software; you can redistribute it and/or modify
@@ -23,8 +23,8 @@
 /** \file
     \brief IPv4Packet public header */
 
-#ifndef HH_IPv4Packet_
-#define HH_IPv4Packet_ 1
+#ifndef HH_SENF_Packets_DefaultBundle_IPv4Packet_
+#define HH_SENF_Packets_DefaultBundle_IPv4Packet_ 1
 
 // Custom includes
 #include "../../Socket/Protocols/INet/INet4Address.hh"
@@ -50,8 +50,8 @@ namespace senf {
 
         value_type value() const { return value_type::from_data(i()); }
         void value(value_type const & v) { std::copy(v.begin(), v.end(), i()); }
-        operator value_type() { return value(); }
-        byte & operator[](size_type index) { return *boost::next(i(),index); }
+        operator value_type() const { return value(); }
+        byte & operator[](size_type index) const { return *boost::next(i(),index); }
         INet4AddressParser const & operator= (value_type const & other) 
             { value(other); return *this; }
     };
@@ -174,7 +174,7 @@ namespace senf {
         using mixin::initSize;
         using mixin::init;
 
-        static registry_key_t nextPacketKey(packet p) 
+        static key_t nextPacketKey(packet p) 
             { return p->protocol(); }
 
         static void dump(packet p, std::ostream & os);