diff --git a/src/python/of10/class_maps.py b/src/python/of10/class_maps.py
index 89226b4..b638eec 100644
--- a/src/python/of10/class_maps.py
+++ b/src/python/of10/class_maps.py
@@ -27,6 +27,10 @@
                                        'matched_count'
                                       ],
     'ofp_flow_removed'              : [
+                                       'version',
+                                       'type',
+                                       'length',
+                                       'xid',
                                        'match',
                                        'cookie',
                                        'priority',
@@ -68,15 +72,29 @@
                                        'port_no'
                                       ],
     'ofp_stats_request'             : [
+                                       'version',
+                                       'type',
+                                       'length',
+                                       'xid',
                                        'stats_type',
                                        'flags'
                                       ],
+    'ofp_hello'                     : [
+                                       'version',
+                                       'type',
+                                       'length',
+                                       'xid'
+                                      ],
     'ofp_aggregate_stats_request'   : [
                                        'match',
                                        'table_id',
                                        'out_port'
                                       ],
     'ofp_port_status'               : [
+                                       'version',
+                                       'type',
+                                       'length',
+                                       'xid',
                                        'reason',
                                        'desc'
                                       ],
@@ -85,6 +103,10 @@
                                        'len'
                                       ],
     'ofp_port_mod'                  : [
+                                       'version',
+                                       'type',
+                                       'length',
+                                       'xid',
                                        'port_no',
                                        'hw_addr',
                                        'config',
@@ -103,6 +125,10 @@
                                        'max_len'
                                       ],
     'ofp_switch_config'             : [
+                                       'version',
+                                       'type',
+                                       'length',
+                                       'xid',
                                        'flags',
                                        'miss_send_len'
                                       ],
@@ -112,9 +138,17 @@
                                        'nw_tos'
                                       ],
     'ofp_queue_get_config_reply'    : [
+                                       'version',
+                                       'type',
+                                       'length',
+                                       'xid',
                                        'port'
                                       ],
     'ofp_packet_in'                 : [
+                                       'version',
+                                       'type',
+                                       'length',
+                                       'xid',
                                        'buffer_id',
                                        'total_len',
                                        'in_port',
@@ -144,6 +178,10 @@
                                        'vendor'
                                       ],
     'ofp_stats_reply'               : [
+                                       'version',
+                                       'type',
+                                       'length',
+                                       'xid',
                                        'stats_type',
                                        'flags'
                                       ],
@@ -159,6 +197,10 @@
                                        'dp_desc'
                                       ],
     'ofp_queue_get_config_request'  : [
+                                       'version',
+                                       'type',
+                                       'length',
+                                       'xid',
                                        'port'
                                       ],
     'ofp_packet_queue'              : [
@@ -185,6 +227,10 @@
                                        'queue_id'
                                       ],
     'ofp_switch_features'           : [
+                                       'version',
+                                       'type',
+                                       'length',
+                                       'xid',
                                        'datapath_id',
                                        'n_buffers',
                                        'n_tables',
@@ -213,9 +259,17 @@
                                        'xid'
                                       ],
     'ofp_vendor_header'             : [
+                                       'version',
+                                       'type',
+                                       'length',
+                                       'xid',
                                        'vendor'
                                       ],
     'ofp_packet_out'                : [
+                                       'version',
+                                       'type',
+                                       'length',
+                                       'xid',
                                        'buffer_id',
                                        'in_port',
                                        'actions_len'
@@ -231,6 +285,10 @@
                                        'vlan_pcp'
                                       ],
     'ofp_flow_mod'                  : [
+                                       'version',
+                                       'type',
+                                       'length',
+                                       'xid',
                                        'match',
                                        'cookie',
                                        'command',
@@ -242,6 +300,10 @@
                                        'flags'
                                       ],
     'ofp_error_msg'                 : [
+                                       'version',
+                                       'type',
+                                       'length',
+                                       'xid',
                                        'err_type',
                                        'code'
                                       ],
diff --git a/src/python/of10/cstruct.py b/src/python/of10/cstruct.py
index 3d2c638..ede9b31 100644
--- a/src/python/of10/cstruct.py
+++ b/src/python/of10/cstruct.py
@@ -312,6 +312,10 @@
         """Initialize
         Declare members and default values
         """
+        self.version = 0
+        self.type = 0
+        self.length = 0
+        self.xid = 0
         self.match = ofp_match()
         self.cookie = 0
         self.priority = 0
@@ -343,6 +347,7 @@
             if(not self.__assert()[0]):
                 return None
         packed = ""
+        packed += struct.pack("!BBHL", self.version, self.type, self.length, self.xid)
         packed += self.match.pack()
         packed += struct.pack("!QHBBLLH", self.cookie, self.priority, self.reason, self.pad, self.duration_sec, self.duration_nsec, self.idle_timeout)
         packed += struct.pack("!BB", self.pad2[0], self.pad2[1])
@@ -354,33 +359,41 @@
         Do not unpack empty array used as placeholder
         since they can contain heterogeneous type
         """
-        if (len(binaryString) < 80):
+        if (len(binaryString) < 88):
             return binaryString
-        self.match.unpack(binaryString[0:])
+        fmt = '!BBHL'
+        start = 0
+        end = start + struct.calcsize(fmt)
+        (self.version, self.type, self.length, self.xid) = struct.unpack(fmt,  binaryString[start:end])
+        self.match.unpack(binaryString[8:])
         fmt = '!QHBBLLH'
-        start = 40
+        start = 48
         end = start + struct.calcsize(fmt)
         (self.cookie, self.priority, self.reason, self.pad, self.duration_sec, self.duration_nsec, self.idle_timeout) = struct.unpack(fmt,  binaryString[start:end])
         fmt = '!BB'
-        start = 62
+        start = 70
         end = start + struct.calcsize(fmt)
         (self.pad2[0], self.pad2[1]) = struct.unpack(fmt, binaryString[start:end])
         fmt = '!QQ'
-        start = 64
+        start = 72
         end = start + struct.calcsize(fmt)
         (self.packet_count, self.byte_count) = struct.unpack(fmt,  binaryString[start:end])
-        return binaryString[80:]
+        return binaryString[88:]
 
     def __len__(self):
         """Return length of message
         """
-        l = 80
+        l = 88
         return l
 
     def __eq__(self, other):
         """Return True if self and other have same values
         """
         if type(self) != type(other): return False
+        if self.version !=  other.version: return False
+        if self.type !=  other.type: return False
+        if self.length !=  other.length: return False
+        if self.xid !=  other.xid: return False
         if self.match !=  other.match: return False
         if self.cookie !=  other.cookie: return False
         if self.priority !=  other.priority: return False
@@ -400,6 +413,10 @@
         """Generate string showing basic members of structure
         """
         outstr = ''
+        outstr += prefix + 'version: ' + str(self.version) + '\n'
+        outstr += prefix + 'type: ' + str(self.type) + '\n'
+        outstr += prefix + 'length: ' + str(self.length) + '\n'
+        outstr += prefix + 'xid: ' + str(self.xid) + '\n'
         outstr += prefix + 'match: \n' 
         outstr += self.match.show(prefix + '  ')
         outstr += prefix + 'cookie: ' + str(self.cookie) + '\n'
@@ -797,6 +814,10 @@
         """Initialize
         Declare members and default values
         """
+        self.version = 0
+        self.type = 0
+        self.length = 0
+        self.xid = 0
         self.stats_type = 0
         self.flags = 0
 
@@ -813,7 +834,7 @@
             if(not self.__assert()[0]):
                 return None
         packed = ""
-        packed += struct.pack("!HH", self.stats_type, self.flags)
+        packed += struct.pack("!BBHLHH", self.version, self.type, self.length, self.xid, self.stats_type, self.flags)
         return packed
 
     def unpack(self, binaryString):
@@ -821,24 +842,28 @@
         Do not unpack empty array used as placeholder
         since they can contain heterogeneous type
         """
-        if (len(binaryString) < 4):
+        if (len(binaryString) < 12):
             return binaryString
-        fmt = '!HH'
+        fmt = '!BBHLHH'
         start = 0
         end = start + struct.calcsize(fmt)
-        (self.stats_type, self.flags) = struct.unpack(fmt,  binaryString[start:end])
-        return binaryString[4:]
+        (self.version, self.type, self.length, self.xid, self.stats_type, self.flags) = struct.unpack(fmt,  binaryString[start:end])
+        return binaryString[12:]
 
     def __len__(self):
         """Return length of message
         """
-        l = 4
+        l = 12
         return l
 
     def __eq__(self, other):
         """Return True if self and other have same values
         """
         if type(self) != type(other): return False
+        if self.version !=  other.version: return False
+        if self.type !=  other.type: return False
+        if self.length !=  other.length: return False
+        if self.xid !=  other.xid: return False
         if self.stats_type !=  other.stats_type: return False
         if self.flags !=  other.flags: return False
         return True
@@ -849,6 +874,10 @@
         """Generate string showing basic members of structure
         """
         outstr = ''
+        outstr += prefix + 'version: ' + str(self.version) + '\n'
+        outstr += prefix + 'type: ' + str(self.type) + '\n'
+        outstr += prefix + 'length: ' + str(self.length) + '\n'
+        outstr += prefix + 'xid: ' + str(self.xid) + '\n'
         outstr += prefix + 'stats_type: ' + str(self.stats_type) + '\n'
         outstr += prefix + 'flags: ' + str(self.flags) + '\n'
         return outstr
@@ -866,6 +895,10 @@
         """Initialize
         Declare members and default values
         """
+        self.version = 0
+        self.type = 0
+        self.length = 0
+        self.xid = 0
 
     def __assert(self):
         """Sanity check
@@ -880,6 +913,7 @@
             if(not self.__assert()[0]):
                 return None
         packed = ""
+        packed += struct.pack("!BBHL", self.version, self.type, self.length, self.xid)
         return packed
 
     def unpack(self, binaryString):
@@ -887,20 +921,28 @@
         Do not unpack empty array used as placeholder
         since they can contain heterogeneous type
         """
-        if (len(binaryString) < 0):
+        if (len(binaryString) < 8):
             return binaryString
-        return binaryString[0:]
+        fmt = '!BBHL'
+        start = 0
+        end = start + struct.calcsize(fmt)
+        (self.version, self.type, self.length, self.xid) = struct.unpack(fmt,  binaryString[start:end])
+        return binaryString[8:]
 
     def __len__(self):
         """Return length of message
         """
-        l = 0
+        l = 8
         return l
 
     def __eq__(self, other):
         """Return True if self and other have same values
         """
         if type(self) != type(other): return False
+        if self.version !=  other.version: return False
+        if self.type !=  other.type: return False
+        if self.length !=  other.length: return False
+        if self.xid !=  other.xid: return False
         return True
 
     def __ne__(self, other): return not self.__eq__(other)
@@ -909,6 +951,10 @@
         """Generate string showing basic members of structure
         """
         outstr = ''
+        outstr += prefix + 'version: ' + str(self.version) + '\n'
+        outstr += prefix + 'type: ' + str(self.type) + '\n'
+        outstr += prefix + 'length: ' + str(self.length) + '\n'
+        outstr += prefix + 'xid: ' + str(self.xid) + '\n'
         return outstr
 
 
@@ -1003,6 +1049,10 @@
         """Initialize
         Declare members and default values
         """
+        self.version = 0
+        self.type = 0
+        self.length = 0
+        self.xid = 0
         self.reason = 0
         self.pad= [0,0,0,0,0,0,0]
         self.desc = ofp_phy_port()
@@ -1026,7 +1076,7 @@
             if(not self.__assert()[0]):
                 return None
         packed = ""
-        packed += struct.pack("!B", self.reason)
+        packed += struct.pack("!BBHLB", self.version, self.type, self.length, self.xid, self.reason)
         packed += struct.pack("!BBBBBBB", self.pad[0], self.pad[1], self.pad[2], self.pad[3], self.pad[4], self.pad[5], self.pad[6])
         packed += self.desc.pack()
         return packed
@@ -1036,29 +1086,33 @@
         Do not unpack empty array used as placeholder
         since they can contain heterogeneous type
         """
-        if (len(binaryString) < 56):
+        if (len(binaryString) < 64):
             return binaryString
-        fmt = '!B'
+        fmt = '!BBHLB'
         start = 0
         end = start + struct.calcsize(fmt)
-        (self.reason,) = struct.unpack(fmt, binaryString[start:end])
+        (self.version, self.type, self.length, self.xid, self.reason) = struct.unpack(fmt,  binaryString[start:end])
         fmt = '!BBBBBBB'
-        start = 1
+        start = 9
         end = start + struct.calcsize(fmt)
         (self.pad[0], self.pad[1], self.pad[2], self.pad[3], self.pad[4], self.pad[5], self.pad[6]) = struct.unpack(fmt, binaryString[start:end])
-        self.desc.unpack(binaryString[8:])
-        return binaryString[56:]
+        self.desc.unpack(binaryString[16:])
+        return binaryString[64:]
 
     def __len__(self):
         """Return length of message
         """
-        l = 56
+        l = 64
         return l
 
     def __eq__(self, other):
         """Return True if self and other have same values
         """
         if type(self) != type(other): return False
+        if self.version !=  other.version: return False
+        if self.type !=  other.type: return False
+        if self.length !=  other.length: return False
+        if self.xid !=  other.xid: return False
         if self.reason !=  other.reason: return False
         if self.pad !=  other.pad: return False
         if self.desc !=  other.desc: return False
@@ -1070,6 +1124,10 @@
         """Generate string showing basic members of structure
         """
         outstr = ''
+        outstr += prefix + 'version: ' + str(self.version) + '\n'
+        outstr += prefix + 'type: ' + str(self.type) + '\n'
+        outstr += prefix + 'length: ' + str(self.length) + '\n'
+        outstr += prefix + 'xid: ' + str(self.xid) + '\n'
         outstr += prefix + 'reason: ' + str(self.reason) + '\n'
         outstr += prefix + 'desc: \n' 
         outstr += self.desc.show(prefix + '  ')
@@ -1168,6 +1226,10 @@
         """Initialize
         Declare members and default values
         """
+        self.version = 0
+        self.type = 0
+        self.length = 0
+        self.xid = 0
         self.port_no = 0
         self.hw_addr= [0,0,0,0,0,0]
         self.config = 0
@@ -1196,7 +1258,7 @@
             if(not self.__assert()[0]):
                 return None
         packed = ""
-        packed += struct.pack("!H", self.port_no)
+        packed += struct.pack("!BBHLH", self.version, self.type, self.length, self.xid, self.port_no)
         packed += struct.pack("!BBBBBB", self.hw_addr[0], self.hw_addr[1], self.hw_addr[2], self.hw_addr[3], self.hw_addr[4], self.hw_addr[5])
         packed += struct.pack("!LLL", self.config, self.mask, self.advertise)
         packed += struct.pack("!BBBB", self.pad[0], self.pad[1], self.pad[2], self.pad[3])
@@ -1207,36 +1269,40 @@
         Do not unpack empty array used as placeholder
         since they can contain heterogeneous type
         """
-        if (len(binaryString) < 24):
+        if (len(binaryString) < 32):
             return binaryString
-        fmt = '!H'
+        fmt = '!BBHLH'
         start = 0
         end = start + struct.calcsize(fmt)
-        (self.port_no,) = struct.unpack(fmt, binaryString[start:end])
+        (self.version, self.type, self.length, self.xid, self.port_no) = struct.unpack(fmt,  binaryString[start:end])
         fmt = '!BBBBBB'
-        start = 2
+        start = 10
         end = start + struct.calcsize(fmt)
         (self.hw_addr[0], self.hw_addr[1], self.hw_addr[2], self.hw_addr[3], self.hw_addr[4], self.hw_addr[5]) = struct.unpack(fmt, binaryString[start:end])
         fmt = '!LLL'
-        start = 8
+        start = 16
         end = start + struct.calcsize(fmt)
         (self.config, self.mask, self.advertise) = struct.unpack(fmt,  binaryString[start:end])
         fmt = '!BBBB'
-        start = 20
+        start = 28
         end = start + struct.calcsize(fmt)
         (self.pad[0], self.pad[1], self.pad[2], self.pad[3]) = struct.unpack(fmt, binaryString[start:end])
-        return binaryString[24:]
+        return binaryString[32:]
 
     def __len__(self):
         """Return length of message
         """
-        l = 24
+        l = 32
         return l
 
     def __eq__(self, other):
         """Return True if self and other have same values
         """
         if type(self) != type(other): return False
+        if self.version !=  other.version: return False
+        if self.type !=  other.type: return False
+        if self.length !=  other.length: return False
+        if self.xid !=  other.xid: return False
         if self.port_no !=  other.port_no: return False
         if self.hw_addr !=  other.hw_addr: return False
         if self.config !=  other.config: return False
@@ -1251,6 +1317,10 @@
         """Generate string showing basic members of structure
         """
         outstr = ''
+        outstr += prefix + 'version: ' + str(self.version) + '\n'
+        outstr += prefix + 'type: ' + str(self.type) + '\n'
+        outstr += prefix + 'length: ' + str(self.length) + '\n'
+        outstr += prefix + 'xid: ' + str(self.xid) + '\n'
         outstr += prefix + 'port_no: ' + str(self.port_no) + '\n'
         outstr += prefix + 'hw_addr: ' + str(self.hw_addr) + '\n'
         outstr += prefix + 'config: ' + str(self.config) + '\n'
@@ -1429,6 +1499,10 @@
         """Initialize
         Declare members and default values
         """
+        self.version = 0
+        self.type = 0
+        self.length = 0
+        self.xid = 0
         self.flags = 0
         self.miss_send_len = 128
 
@@ -1445,7 +1519,7 @@
             if(not self.__assert()[0]):
                 return None
         packed = ""
-        packed += struct.pack("!HH", self.flags, self.miss_send_len)
+        packed += struct.pack("!BBHLHH", self.version, self.type, self.length, self.xid, self.flags, self.miss_send_len)
         return packed
 
     def unpack(self, binaryString):
@@ -1453,24 +1527,28 @@
         Do not unpack empty array used as placeholder
         since they can contain heterogeneous type
         """
-        if (len(binaryString) < 4):
+        if (len(binaryString) < 12):
             return binaryString
-        fmt = '!HH'
+        fmt = '!BBHLHH'
         start = 0
         end = start + struct.calcsize(fmt)
-        (self.flags, self.miss_send_len) = struct.unpack(fmt,  binaryString[start:end])
-        return binaryString[4:]
+        (self.version, self.type, self.length, self.xid, self.flags, self.miss_send_len) = struct.unpack(fmt,  binaryString[start:end])
+        return binaryString[12:]
 
     def __len__(self):
         """Return length of message
         """
-        l = 4
+        l = 12
         return l
 
     def __eq__(self, other):
         """Return True if self and other have same values
         """
         if type(self) != type(other): return False
+        if self.version !=  other.version: return False
+        if self.type !=  other.type: return False
+        if self.length !=  other.length: return False
+        if self.xid !=  other.xid: return False
         if self.flags !=  other.flags: return False
         if self.miss_send_len !=  other.miss_send_len: return False
         return True
@@ -1481,6 +1559,10 @@
         """Generate string showing basic members of structure
         """
         outstr = ''
+        outstr += prefix + 'version: ' + str(self.version) + '\n'
+        outstr += prefix + 'type: ' + str(self.type) + '\n'
+        outstr += prefix + 'length: ' + str(self.length) + '\n'
+        outstr += prefix + 'xid: ' + str(self.xid) + '\n'
         outstr += prefix + 'flags: ' + str(self.flags) + '\n'
         outstr += prefix + 'miss_send_len: ' + str(self.miss_send_len) + '\n'
         return outstr
@@ -1581,6 +1663,10 @@
         """Initialize
         Declare members and default values
         """
+        self.version = 0
+        self.type = 0
+        self.length = 0
+        self.xid = 0
         self.port = 0
         self.pad= [0,0,0,0,0,0]
 
@@ -1601,7 +1687,7 @@
             if(not self.__assert()[0]):
                 return None
         packed = ""
-        packed += struct.pack("!H", self.port)
+        packed += struct.pack("!BBHLH", self.version, self.type, self.length, self.xid, self.port)
         packed += struct.pack("!BBBBBB", self.pad[0], self.pad[1], self.pad[2], self.pad[3], self.pad[4], self.pad[5])
         return packed
 
@@ -1610,28 +1696,32 @@
         Do not unpack empty array used as placeholder
         since they can contain heterogeneous type
         """
-        if (len(binaryString) < 8):
+        if (len(binaryString) < 16):
             return binaryString
-        fmt = '!H'
+        fmt = '!BBHLH'
         start = 0
         end = start + struct.calcsize(fmt)
-        (self.port,) = struct.unpack(fmt, binaryString[start:end])
+        (self.version, self.type, self.length, self.xid, self.port) = struct.unpack(fmt,  binaryString[start:end])
         fmt = '!BBBBBB'
-        start = 2
+        start = 10
         end = start + struct.calcsize(fmt)
         (self.pad[0], self.pad[1], self.pad[2], self.pad[3], self.pad[4], self.pad[5]) = struct.unpack(fmt, binaryString[start:end])
-        return binaryString[8:]
+        return binaryString[16:]
 
     def __len__(self):
         """Return length of message
         """
-        l = 8
+        l = 16
         return l
 
     def __eq__(self, other):
         """Return True if self and other have same values
         """
         if type(self) != type(other): return False
+        if self.version !=  other.version: return False
+        if self.type !=  other.type: return False
+        if self.length !=  other.length: return False
+        if self.xid !=  other.xid: return False
         if self.port !=  other.port: return False
         if self.pad !=  other.pad: return False
         return True
@@ -1642,6 +1732,10 @@
         """Generate string showing basic members of structure
         """
         outstr = ''
+        outstr += prefix + 'version: ' + str(self.version) + '\n'
+        outstr += prefix + 'type: ' + str(self.type) + '\n'
+        outstr += prefix + 'length: ' + str(self.length) + '\n'
+        outstr += prefix + 'xid: ' + str(self.xid) + '\n'
         outstr += prefix + 'port: ' + str(self.port) + '\n'
         return outstr
 
@@ -1658,6 +1752,10 @@
         """Initialize
         Declare members and default values
         """
+        self.version = 0
+        self.type = 0
+        self.length = 0
+        self.xid = 0
         self.buffer_id = 0
         self.total_len = 0
         self.in_port = 0
@@ -1677,7 +1775,7 @@
             if(not self.__assert()[0]):
                 return None
         packed = ""
-        packed += struct.pack("!LHHBB", self.buffer_id, self.total_len, self.in_port, self.reason, self.pad)
+        packed += struct.pack("!BBHLLHHBB", self.version, self.type, self.length, self.xid, self.buffer_id, self.total_len, self.in_port, self.reason, self.pad)
         return packed
 
     def unpack(self, binaryString):
@@ -1685,24 +1783,28 @@
         Do not unpack empty array used as placeholder
         since they can contain heterogeneous type
         """
-        if (len(binaryString) < 10):
+        if (len(binaryString) < 18):
             return binaryString
-        fmt = '!LHHBB'
+        fmt = '!BBHLLHHBB'
         start = 0
         end = start + struct.calcsize(fmt)
-        (self.buffer_id, self.total_len, self.in_port, self.reason, self.pad) = struct.unpack(fmt,  binaryString[start:end])
-        return binaryString[10:]
+        (self.version, self.type, self.length, self.xid, self.buffer_id, self.total_len, self.in_port, self.reason, self.pad) = struct.unpack(fmt,  binaryString[start:end])
+        return binaryString[18:]
 
     def __len__(self):
         """Return length of message
         """
-        l = 10
+        l = 18
         return l
 
     def __eq__(self, other):
         """Return True if self and other have same values
         """
         if type(self) != type(other): return False
+        if self.version !=  other.version: return False
+        if self.type !=  other.type: return False
+        if self.length !=  other.length: return False
+        if self.xid !=  other.xid: return False
         if self.buffer_id !=  other.buffer_id: return False
         if self.total_len !=  other.total_len: return False
         if self.in_port !=  other.in_port: return False
@@ -1716,6 +1818,10 @@
         """Generate string showing basic members of structure
         """
         outstr = ''
+        outstr += prefix + 'version: ' + str(self.version) + '\n'
+        outstr += prefix + 'type: ' + str(self.type) + '\n'
+        outstr += prefix + 'length: ' + str(self.length) + '\n'
+        outstr += prefix + 'xid: ' + str(self.xid) + '\n'
         outstr += prefix + 'buffer_id: ' + str(self.buffer_id) + '\n'
         outstr += prefix + 'total_len: ' + str(self.total_len) + '\n'
         outstr += prefix + 'in_port: ' + str(self.in_port) + '\n'
@@ -2010,6 +2116,10 @@
         """Initialize
         Declare members and default values
         """
+        self.version = 0
+        self.type = 0
+        self.length = 0
+        self.xid = 0
         self.stats_type = 0
         self.flags = 0
 
@@ -2026,7 +2136,7 @@
             if(not self.__assert()[0]):
                 return None
         packed = ""
-        packed += struct.pack("!HH", self.stats_type, self.flags)
+        packed += struct.pack("!BBHLHH", self.version, self.type, self.length, self.xid, self.stats_type, self.flags)
         return packed
 
     def unpack(self, binaryString):
@@ -2034,24 +2144,28 @@
         Do not unpack empty array used as placeholder
         since they can contain heterogeneous type
         """
-        if (len(binaryString) < 4):
+        if (len(binaryString) < 12):
             return binaryString
-        fmt = '!HH'
+        fmt = '!BBHLHH'
         start = 0
         end = start + struct.calcsize(fmt)
-        (self.stats_type, self.flags) = struct.unpack(fmt,  binaryString[start:end])
-        return binaryString[4:]
+        (self.version, self.type, self.length, self.xid, self.stats_type, self.flags) = struct.unpack(fmt,  binaryString[start:end])
+        return binaryString[12:]
 
     def __len__(self):
         """Return length of message
         """
-        l = 4
+        l = 12
         return l
 
     def __eq__(self, other):
         """Return True if self and other have same values
         """
         if type(self) != type(other): return False
+        if self.version !=  other.version: return False
+        if self.type !=  other.type: return False
+        if self.length !=  other.length: return False
+        if self.xid !=  other.xid: return False
         if self.stats_type !=  other.stats_type: return False
         if self.flags !=  other.flags: return False
         return True
@@ -2062,6 +2176,10 @@
         """Generate string showing basic members of structure
         """
         outstr = ''
+        outstr += prefix + 'version: ' + str(self.version) + '\n'
+        outstr += prefix + 'type: ' + str(self.type) + '\n'
+        outstr += prefix + 'length: ' + str(self.length) + '\n'
+        outstr += prefix + 'xid: ' + str(self.xid) + '\n'
         outstr += prefix + 'stats_type: ' + str(self.stats_type) + '\n'
         outstr += prefix + 'flags: ' + str(self.flags) + '\n'
         return outstr
@@ -2267,6 +2385,10 @@
         """Initialize
         Declare members and default values
         """
+        self.version = 0
+        self.type = 0
+        self.length = 0
+        self.xid = 0
         self.port = 0
         self.pad= [0,0]
 
@@ -2287,7 +2409,7 @@
             if(not self.__assert()[0]):
                 return None
         packed = ""
-        packed += struct.pack("!H", self.port)
+        packed += struct.pack("!BBHLH", self.version, self.type, self.length, self.xid, self.port)
         packed += struct.pack("!BB", self.pad[0], self.pad[1])
         return packed
 
@@ -2296,28 +2418,32 @@
         Do not unpack empty array used as placeholder
         since they can contain heterogeneous type
         """
-        if (len(binaryString) < 4):
+        if (len(binaryString) < 12):
             return binaryString
-        fmt = '!H'
+        fmt = '!BBHLH'
         start = 0
         end = start + struct.calcsize(fmt)
-        (self.port,) = struct.unpack(fmt, binaryString[start:end])
+        (self.version, self.type, self.length, self.xid, self.port) = struct.unpack(fmt,  binaryString[start:end])
         fmt = '!BB'
-        start = 2
+        start = 10
         end = start + struct.calcsize(fmt)
         (self.pad[0], self.pad[1]) = struct.unpack(fmt, binaryString[start:end])
-        return binaryString[4:]
+        return binaryString[12:]
 
     def __len__(self):
         """Return length of message
         """
-        l = 4
+        l = 12
         return l
 
     def __eq__(self, other):
         """Return True if self and other have same values
         """
         if type(self) != type(other): return False
+        if self.version !=  other.version: return False
+        if self.type !=  other.type: return False
+        if self.length !=  other.length: return False
+        if self.xid !=  other.xid: return False
         if self.port !=  other.port: return False
         if self.pad !=  other.pad: return False
         return True
@@ -2328,6 +2454,10 @@
         """Generate string showing basic members of structure
         """
         outstr = ''
+        outstr += prefix + 'version: ' + str(self.version) + '\n'
+        outstr += prefix + 'type: ' + str(self.type) + '\n'
+        outstr += prefix + 'length: ' + str(self.length) + '\n'
+        outstr += prefix + 'xid: ' + str(self.xid) + '\n'
         outstr += prefix + 'port: ' + str(self.port) + '\n'
         return outstr
 
@@ -2772,6 +2902,10 @@
         """Initialize
         Declare members and default values
         """
+        self.version = 0
+        self.type = 0
+        self.length = 0
+        self.xid = 0
         self.datapath_id = 0
         self.n_buffers = 0
         self.n_tables = 0
@@ -2796,7 +2930,7 @@
             if(not self.__assert()[0]):
                 return None
         packed = ""
-        packed += struct.pack("!QLB", self.datapath_id, self.n_buffers, self.n_tables)
+        packed += struct.pack("!BBHLQLB", self.version, self.type, self.length, self.xid, self.datapath_id, self.n_buffers, self.n_tables)
         packed += struct.pack("!BBB", self.pad[0], self.pad[1], self.pad[2])
         packed += struct.pack("!LL", self.capabilities, self.actions)
         return packed
@@ -2806,32 +2940,36 @@
         Do not unpack empty array used as placeholder
         since they can contain heterogeneous type
         """
-        if (len(binaryString) < 24):
+        if (len(binaryString) < 32):
             return binaryString
-        fmt = '!QLB'
+        fmt = '!BBHLQLB'
         start = 0
         end = start + struct.calcsize(fmt)
-        (self.datapath_id, self.n_buffers, self.n_tables) = struct.unpack(fmt,  binaryString[start:end])
+        (self.version, self.type, self.length, self.xid, self.datapath_id, self.n_buffers, self.n_tables) = struct.unpack(fmt,  binaryString[start:end])
         fmt = '!BBB'
-        start = 13
+        start = 21
         end = start + struct.calcsize(fmt)
         (self.pad[0], self.pad[1], self.pad[2]) = struct.unpack(fmt, binaryString[start:end])
         fmt = '!LL'
-        start = 16
+        start = 24
         end = start + struct.calcsize(fmt)
         (self.capabilities, self.actions) = struct.unpack(fmt,  binaryString[start:end])
-        return binaryString[24:]
+        return binaryString[32:]
 
     def __len__(self):
         """Return length of message
         """
-        l = 24
+        l = 32
         return l
 
     def __eq__(self, other):
         """Return True if self and other have same values
         """
         if type(self) != type(other): return False
+        if self.version !=  other.version: return False
+        if self.type !=  other.type: return False
+        if self.length !=  other.length: return False
+        if self.xid !=  other.xid: return False
         if self.datapath_id !=  other.datapath_id: return False
         if self.n_buffers !=  other.n_buffers: return False
         if self.n_tables !=  other.n_tables: return False
@@ -2846,6 +2984,10 @@
         """Generate string showing basic members of structure
         """
         outstr = ''
+        outstr += prefix + 'version: ' + str(self.version) + '\n'
+        outstr += prefix + 'type: ' + str(self.type) + '\n'
+        outstr += prefix + 'length: ' + str(self.length) + '\n'
+        outstr += prefix + 'xid: ' + str(self.xid) + '\n'
         outstr += prefix + 'datapath_id: ' + str(self.datapath_id) + '\n'
         outstr += prefix + 'n_buffers: ' + str(self.n_buffers) + '\n'
         outstr += prefix + 'n_tables: ' + str(self.n_tables) + '\n'
@@ -3086,6 +3228,10 @@
         """Initialize
         Declare members and default values
         """
+        self.version = 0
+        self.type = 0
+        self.length = 0
+        self.xid = 0
         self.vendor = 0
 
     def __assert(self):
@@ -3101,7 +3247,7 @@
             if(not self.__assert()[0]):
                 return None
         packed = ""
-        packed += struct.pack("!L", self.vendor)
+        packed += struct.pack("!BBHLL", self.version, self.type, self.length, self.xid, self.vendor)
         return packed
 
     def unpack(self, binaryString):
@@ -3109,24 +3255,28 @@
         Do not unpack empty array used as placeholder
         since they can contain heterogeneous type
         """
-        if (len(binaryString) < 4):
+        if (len(binaryString) < 12):
             return binaryString
-        fmt = '!L'
+        fmt = '!BBHLL'
         start = 0
         end = start + struct.calcsize(fmt)
-        (self.vendor,) = struct.unpack(fmt, binaryString[start:end])
-        return binaryString[4:]
+        (self.version, self.type, self.length, self.xid, self.vendor) = struct.unpack(fmt,  binaryString[start:end])
+        return binaryString[12:]
 
     def __len__(self):
         """Return length of message
         """
-        l = 4
+        l = 12
         return l
 
     def __eq__(self, other):
         """Return True if self and other have same values
         """
         if type(self) != type(other): return False
+        if self.version !=  other.version: return False
+        if self.type !=  other.type: return False
+        if self.length !=  other.length: return False
+        if self.xid !=  other.xid: return False
         if self.vendor !=  other.vendor: return False
         return True
 
@@ -3136,6 +3286,10 @@
         """Generate string showing basic members of structure
         """
         outstr = ''
+        outstr += prefix + 'version: ' + str(self.version) + '\n'
+        outstr += prefix + 'type: ' + str(self.type) + '\n'
+        outstr += prefix + 'length: ' + str(self.length) + '\n'
+        outstr += prefix + 'xid: ' + str(self.xid) + '\n'
         outstr += prefix + 'vendor: ' + str(self.vendor) + '\n'
         return outstr
 
@@ -3152,6 +3306,10 @@
         """Initialize
         Declare members and default values
         """
+        self.version = 0
+        self.type = 0
+        self.length = 0
+        self.xid = 0
         self.buffer_id = 4294967295
         self.in_port = 0
         self.actions_len = 0
@@ -3169,7 +3327,7 @@
             if(not self.__assert()[0]):
                 return None
         packed = ""
-        packed += struct.pack("!LHH", self.buffer_id, self.in_port, self.actions_len)
+        packed += struct.pack("!BBHLLHH", self.version, self.type, self.length, self.xid, self.buffer_id, self.in_port, self.actions_len)
         return packed
 
     def unpack(self, binaryString):
@@ -3177,24 +3335,28 @@
         Do not unpack empty array used as placeholder
         since they can contain heterogeneous type
         """
-        if (len(binaryString) < 8):
+        if (len(binaryString) < 16):
             return binaryString
-        fmt = '!LHH'
+        fmt = '!BBHLLHH'
         start = 0
         end = start + struct.calcsize(fmt)
-        (self.buffer_id, self.in_port, self.actions_len) = struct.unpack(fmt,  binaryString[start:end])
-        return binaryString[8:]
+        (self.version, self.type, self.length, self.xid, self.buffer_id, self.in_port, self.actions_len) = struct.unpack(fmt,  binaryString[start:end])
+        return binaryString[16:]
 
     def __len__(self):
         """Return length of message
         """
-        l = 8
+        l = 16
         return l
 
     def __eq__(self, other):
         """Return True if self and other have same values
         """
         if type(self) != type(other): return False
+        if self.version !=  other.version: return False
+        if self.type !=  other.type: return False
+        if self.length !=  other.length: return False
+        if self.xid !=  other.xid: return False
         if self.buffer_id !=  other.buffer_id: return False
         if self.in_port !=  other.in_port: return False
         if self.actions_len !=  other.actions_len: return False
@@ -3206,6 +3368,10 @@
         """Generate string showing basic members of structure
         """
         outstr = ''
+        outstr += prefix + 'version: ' + str(self.version) + '\n'
+        outstr += prefix + 'type: ' + str(self.type) + '\n'
+        outstr += prefix + 'length: ' + str(self.length) + '\n'
+        outstr += prefix + 'xid: ' + str(self.xid) + '\n'
         outstr += prefix + 'buffer_id: ' + str(self.buffer_id) + '\n'
         outstr += prefix + 'in_port: ' + str(self.in_port) + '\n'
         outstr += prefix + 'actions_len: ' + str(self.actions_len) + '\n'
@@ -3379,6 +3545,10 @@
         """Initialize
         Declare members and default values
         """
+        self.version = 0
+        self.type = 0
+        self.length = 0
+        self.xid = 0
         self.match = ofp_match()
         self.cookie = 0
         self.command = 0
@@ -3404,6 +3574,7 @@
             if(not self.__assert()[0]):
                 return None
         packed = ""
+        packed += struct.pack("!BBHL", self.version, self.type, self.length, self.xid)
         packed += self.match.pack()
         packed += struct.pack("!QHHHHLHH", self.cookie, self.command, self.idle_timeout, self.hard_timeout, self.priority, self.buffer_id, self.out_port, self.flags)
         return packed
@@ -3413,25 +3584,33 @@
         Do not unpack empty array used as placeholder
         since they can contain heterogeneous type
         """
-        if (len(binaryString) < 64):
+        if (len(binaryString) < 72):
             return binaryString
-        self.match.unpack(binaryString[0:])
+        fmt = '!BBHL'
+        start = 0
+        end = start + struct.calcsize(fmt)
+        (self.version, self.type, self.length, self.xid) = struct.unpack(fmt,  binaryString[start:end])
+        self.match.unpack(binaryString[8:])
         fmt = '!QHHHHLHH'
-        start = 40
+        start = 48
         end = start + struct.calcsize(fmt)
         (self.cookie, self.command, self.idle_timeout, self.hard_timeout, self.priority, self.buffer_id, self.out_port, self.flags) = struct.unpack(fmt,  binaryString[start:end])
-        return binaryString[64:]
+        return binaryString[72:]
 
     def __len__(self):
         """Return length of message
         """
-        l = 64
+        l = 72
         return l
 
     def __eq__(self, other):
         """Return True if self and other have same values
         """
         if type(self) != type(other): return False
+        if self.version !=  other.version: return False
+        if self.type !=  other.type: return False
+        if self.length !=  other.length: return False
+        if self.xid !=  other.xid: return False
         if self.match !=  other.match: return False
         if self.cookie !=  other.cookie: return False
         if self.command !=  other.command: return False
@@ -3449,6 +3628,10 @@
         """Generate string showing basic members of structure
         """
         outstr = ''
+        outstr += prefix + 'version: ' + str(self.version) + '\n'
+        outstr += prefix + 'type: ' + str(self.type) + '\n'
+        outstr += prefix + 'length: ' + str(self.length) + '\n'
+        outstr += prefix + 'xid: ' + str(self.xid) + '\n'
         outstr += prefix + 'match: \n' 
         outstr += self.match.show(prefix + '  ')
         outstr += prefix + 'cookie: ' + str(self.cookie) + '\n'
@@ -3474,6 +3657,10 @@
         """Initialize
         Declare members and default values
         """
+        self.version = 0
+        self.type = 0
+        self.length = 0
+        self.xid = 0
         self.err_type = 0
         self.code = 0
 
@@ -3490,7 +3677,7 @@
             if(not self.__assert()[0]):
                 return None
         packed = ""
-        packed += struct.pack("!HH", self.err_type, self.code)
+        packed += struct.pack("!BBHLHH", self.version, self.type, self.length, self.xid, self.err_type, self.code)
         return packed
 
     def unpack(self, binaryString):
@@ -3498,24 +3685,28 @@
         Do not unpack empty array used as placeholder
         since they can contain heterogeneous type
         """
-        if (len(binaryString) < 4):
+        if (len(binaryString) < 12):
             return binaryString
-        fmt = '!HH'
+        fmt = '!BBHLHH'
         start = 0
         end = start + struct.calcsize(fmt)
-        (self.err_type, self.code) = struct.unpack(fmt,  binaryString[start:end])
-        return binaryString[4:]
+        (self.version, self.type, self.length, self.xid, self.err_type, self.code) = struct.unpack(fmt,  binaryString[start:end])
+        return binaryString[12:]
 
     def __len__(self):
         """Return length of message
         """
-        l = 4
+        l = 12
         return l
 
     def __eq__(self, other):
         """Return True if self and other have same values
         """
         if type(self) != type(other): return False
+        if self.version !=  other.version: return False
+        if self.type !=  other.type: return False
+        if self.length !=  other.length: return False
+        if self.xid !=  other.xid: return False
         if self.err_type !=  other.err_type: return False
         if self.code !=  other.code: return False
         return True
@@ -3526,6 +3717,10 @@
         """Generate string showing basic members of structure
         """
         outstr = ''
+        outstr += prefix + 'version: ' + str(self.version) + '\n'
+        outstr += prefix + 'type: ' + str(self.type) + '\n'
+        outstr += prefix + 'length: ' + str(self.length) + '\n'
+        outstr += prefix + 'xid: ' + str(self.xid) + '\n'
         outstr += prefix + 'err_type: ' + str(self.err_type) + '\n'
         outstr += prefix + 'code: ' + str(self.code) + '\n'
         return outstr
@@ -3990,32 +4185,32 @@
 OFP_AGGREGATE_STATS_REPLY_BYTES = 24
 OFP_AGGREGATE_STATS_REQUEST_BYTES = 44
 OFP_DESC_STATS_BYTES = 1056
-OFP_ERROR_MSG_BYTES = 4
-OFP_FLOW_MOD_BYTES = 64
-OFP_FLOW_REMOVED_BYTES = 80
+OFP_ERROR_MSG_BYTES = 12
+OFP_FLOW_MOD_BYTES = 72
+OFP_FLOW_REMOVED_BYTES = 88
 OFP_FLOW_STATS_BYTES = 88
 OFP_FLOW_STATS_REQUEST_BYTES = 44
 OFP_HEADER_BYTES = 8
-OFP_HELLO_BYTES = 0
+OFP_HELLO_BYTES = 8
 OFP_MATCH_BYTES = 40
-OFP_PACKET_IN_BYTES = 10
-OFP_PACKET_OUT_BYTES = 8
+OFP_PACKET_IN_BYTES = 18
+OFP_PACKET_OUT_BYTES = 16
 OFP_PACKET_QUEUE_BYTES = 8
 OFP_PHY_PORT_BYTES = 48
-OFP_PORT_MOD_BYTES = 24
+OFP_PORT_MOD_BYTES = 32
 OFP_PORT_STATS_BYTES = 104
 OFP_PORT_STATS_REQUEST_BYTES = 8
-OFP_PORT_STATUS_BYTES = 56
-OFP_QUEUE_GET_CONFIG_REPLY_BYTES = 8
-OFP_QUEUE_GET_CONFIG_REQUEST_BYTES = 4
+OFP_PORT_STATUS_BYTES = 64
+OFP_QUEUE_GET_CONFIG_REPLY_BYTES = 16
+OFP_QUEUE_GET_CONFIG_REQUEST_BYTES = 12
 OFP_QUEUE_PROP_HEADER_BYTES = 8
 OFP_QUEUE_PROP_MIN_RATE_BYTES = 16
 OFP_QUEUE_STATS_BYTES = 32
 OFP_QUEUE_STATS_REQUEST_BYTES = 8
-OFP_STATS_REPLY_BYTES = 4
-OFP_STATS_REQUEST_BYTES = 4
-OFP_SWITCH_CONFIG_BYTES = 4
-OFP_SWITCH_FEATURES_BYTES = 24
+OFP_STATS_REPLY_BYTES = 12
+OFP_STATS_REQUEST_BYTES = 12
+OFP_SWITCH_CONFIG_BYTES = 12
+OFP_SWITCH_FEATURES_BYTES = 32
 OFP_TABLE_STATS_BYTES = 64
-OFP_VENDOR_HEADER_BYTES = 4
+OFP_VENDOR_HEADER_BYTES = 12
 
diff --git a/src/python/of10/error.py b/src/python/of10/error.py
index c69b70d..700338b 100644
--- a/src/python/of10/error.py
+++ b/src/python/of10/error.py
@@ -17,30 +17,28 @@
     """
     def __init__(self):
         ofp_error_msg.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_ERROR
-        self.type = OFPET_HELLO_FAILED
+        self.version = OFP_VERSION
+        self.type = OFPT_ERROR
+        self.err_type = OFPET_HELLO_FAILED
         self.data = ""
 
     def pack(self, assertstruct=True):
         self.header.length = self.__len__()
-        packed = self.header.pack()
+        packed = ""
         packed += ofp_error_msg.pack(self)
         packed += self.data
         return packed
 
     def unpack(self, binary_string):
-        binary_string = self.header.unpack(binary_string)
         binary_string = ofp_error_msg.unpack(self, binary_string)
         self.data = binary_string
         return ""
 
     def __len__(self):
-        return OFP_HEADER_BYTES + OFP_ERROR_MSG_BYTES + len(self.data)
+        return OFP_ERROR_MSG_BYTES + len(self.data)
 
     def show(self, prefix=''):
         outstr = prefix + "hello_failed_error_msg\m"
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_error_msg.show(self, prefix + '  ')
         outstr += prefix + "data is of length " + str(len(self.data)) + '\n'
         ##@todo Consider trying to parse the string
@@ -48,8 +46,7 @@
 
     def __eq__(self, other):
         if type(self) != type(other): return False
-        return (self.header == other.header and
-                ofp_error_msg.__eq__(self, other) and
+        return (ofp_error_msg.__eq__(self, other) and
                 self.data == other.data)
 
     def __ne__(self, other): return not self.__eq__(other)
@@ -67,30 +64,28 @@
     """
     def __init__(self):
         ofp_error_msg.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_ERROR
-        self.type = OFPET_BAD_REQUEST
+        self.version = OFP_VERSION
+        self.type = OFPT_ERROR
+        self.err_type = OFPET_BAD_REQUEST
         self.data = ""
 
     def pack(self, assertstruct=True):
         self.header.length = self.__len__()
-        packed = self.header.pack()
+        packed = ""
         packed += ofp_error_msg.pack(self)
         packed += self.data
         return packed
 
     def unpack(self, binary_string):
-        binary_string = self.header.unpack(binary_string)
         binary_string = ofp_error_msg.unpack(self, binary_string)
         self.data = binary_string
         return ""
 
     def __len__(self):
-        return OFP_HEADER_BYTES + OFP_ERROR_MSG_BYTES + len(self.data)
+        return OFP_ERROR_MSG_BYTES + len(self.data)
 
     def show(self, prefix=''):
         outstr = prefix + "bad_request_error_msg\m"
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_error_msg.show(self, prefix + '  ')
         outstr += prefix + "data is of length " + str(len(self.data)) + '\n'
         ##@todo Consider trying to parse the string
@@ -98,8 +93,7 @@
 
     def __eq__(self, other):
         if type(self) != type(other): return False
-        return (self.header == other.header and
-                ofp_error_msg.__eq__(self, other) and
+        return (ofp_error_msg.__eq__(self, other) and
                 self.data == other.data)
 
     def __ne__(self, other): return not self.__eq__(other)
@@ -117,30 +111,28 @@
     """
     def __init__(self):
         ofp_error_msg.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_ERROR
-        self.type = OFPET_BAD_ACTION
+        self.version = OFP_VERSION
+        self.type = OFPT_ERROR
+        self.err_type = OFPET_BAD_ACTION
         self.data = ""
 
     def pack(self, assertstruct=True):
         self.header.length = self.__len__()
-        packed = self.header.pack()
+        packed = ""
         packed += ofp_error_msg.pack(self)
         packed += self.data
         return packed
 
     def unpack(self, binary_string):
-        binary_string = self.header.unpack(binary_string)
         binary_string = ofp_error_msg.unpack(self, binary_string)
         self.data = binary_string
         return ""
 
     def __len__(self):
-        return OFP_HEADER_BYTES + OFP_ERROR_MSG_BYTES + len(self.data)
+        return OFP_ERROR_MSG_BYTES + len(self.data)
 
     def show(self, prefix=''):
         outstr = prefix + "bad_action_error_msg\m"
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_error_msg.show(self, prefix + '  ')
         outstr += prefix + "data is of length " + str(len(self.data)) + '\n'
         ##@todo Consider trying to parse the string
@@ -148,8 +140,7 @@
 
     def __eq__(self, other):
         if type(self) != type(other): return False
-        return (self.header == other.header and
-                ofp_error_msg.__eq__(self, other) and
+        return (ofp_error_msg.__eq__(self, other) and
                 self.data == other.data)
 
     def __ne__(self, other): return not self.__eq__(other)
@@ -167,30 +158,28 @@
     """
     def __init__(self):
         ofp_error_msg.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_ERROR
-        self.type = OFPET_FLOW_MOD_FAILED
+        self.version = OFP_VERSION
+        self.type = OFPT_ERROR
+        self.err_type = OFPET_FLOW_MOD_FAILED
         self.data = ""
 
     def pack(self, assertstruct=True):
         self.header.length = self.__len__()
-        packed = self.header.pack()
+        packed = ""
         packed += ofp_error_msg.pack(self)
         packed += self.data
         return packed
 
     def unpack(self, binary_string):
-        binary_string = self.header.unpack(binary_string)
         binary_string = ofp_error_msg.unpack(self, binary_string)
         self.data = binary_string
         return ""
 
     def __len__(self):
-        return OFP_HEADER_BYTES + OFP_ERROR_MSG_BYTES + len(self.data)
+        return OFP_ERROR_MSG_BYTES + len(self.data)
 
     def show(self, prefix=''):
         outstr = prefix + "flow_mod_failed_error_msg\m"
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_error_msg.show(self, prefix + '  ')
         outstr += prefix + "data is of length " + str(len(self.data)) + '\n'
         ##@todo Consider trying to parse the string
@@ -198,8 +187,7 @@
 
     def __eq__(self, other):
         if type(self) != type(other): return False
-        return (self.header == other.header and
-                ofp_error_msg.__eq__(self, other) and
+        return (ofp_error_msg.__eq__(self, other) and
                 self.data == other.data)
 
     def __ne__(self, other): return not self.__eq__(other)
@@ -217,30 +205,28 @@
     """
     def __init__(self):
         ofp_error_msg.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_ERROR
-        self.type = OFPET_PORT_MOD_FAILED
+        self.version = OFP_VERSION
+        self.type = OFPT_ERROR
+        self.err_type = OFPET_PORT_MOD_FAILED
         self.data = ""
 
     def pack(self, assertstruct=True):
         self.header.length = self.__len__()
-        packed = self.header.pack()
+        packed = ""
         packed += ofp_error_msg.pack(self)
         packed += self.data
         return packed
 
     def unpack(self, binary_string):
-        binary_string = self.header.unpack(binary_string)
         binary_string = ofp_error_msg.unpack(self, binary_string)
         self.data = binary_string
         return ""
 
     def __len__(self):
-        return OFP_HEADER_BYTES + OFP_ERROR_MSG_BYTES + len(self.data)
+        return OFP_ERROR_MSG_BYTES + len(self.data)
 
     def show(self, prefix=''):
         outstr = prefix + "port_mod_failed_error_msg\m"
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_error_msg.show(self, prefix + '  ')
         outstr += prefix + "data is of length " + str(len(self.data)) + '\n'
         ##@todo Consider trying to parse the string
@@ -248,8 +234,7 @@
 
     def __eq__(self, other):
         if type(self) != type(other): return False
-        return (self.header == other.header and
-                ofp_error_msg.__eq__(self, other) and
+        return (ofp_error_msg.__eq__(self, other) and
                 self.data == other.data)
 
     def __ne__(self, other): return not self.__eq__(other)
@@ -267,30 +252,28 @@
     """
     def __init__(self):
         ofp_error_msg.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_ERROR
-        self.type = OFPET_QUEUE_OP_FAILED
+        self.version = OFP_VERSION
+        self.type = OFPT_ERROR
+        self.err_type = OFPET_QUEUE_OP_FAILED
         self.data = ""
 
     def pack(self, assertstruct=True):
         self.header.length = self.__len__()
-        packed = self.header.pack()
+        packed = ""
         packed += ofp_error_msg.pack(self)
         packed += self.data
         return packed
 
     def unpack(self, binary_string):
-        binary_string = self.header.unpack(binary_string)
         binary_string = ofp_error_msg.unpack(self, binary_string)
         self.data = binary_string
         return ""
 
     def __len__(self):
-        return OFP_HEADER_BYTES + OFP_ERROR_MSG_BYTES + len(self.data)
+        return OFP_ERROR_MSG_BYTES + len(self.data)
 
     def show(self, prefix=''):
         outstr = prefix + "queue_op_failed_error_msg\m"
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_error_msg.show(self, prefix + '  ')
         outstr += prefix + "data is of length " + str(len(self.data)) + '\n'
         ##@todo Consider trying to parse the string
@@ -298,8 +281,7 @@
 
     def __eq__(self, other):
         if type(self) != type(other): return False
-        return (self.header == other.header and
-                ofp_error_msg.__eq__(self, other) and
+        return (ofp_error_msg.__eq__(self, other) and
                 self.data == other.data)
 
     def __ne__(self, other): return not self.__eq__(other)
diff --git a/src/python/of10/message.py b/src/python/of10/message.py
index d614110..5b4ce02 100644
--- a/src/python/of10/message.py
+++ b/src/python/of10/message.py
@@ -19,7 +19,6 @@
         Constructor for base class
 
         """
-        self.header = ofp_header()
         # Additional base data members declared here
 
     # Normally will define pack, unpack, __len__ functions
@@ -42,9 +41,8 @@
         ##@var header
         # OpenFlow message header: length, version, xid, type
         ofp_template_msg.__init__(self)
-        self.header = ofp_header()
         # For a real message, will be set to an integer
-        self.header.type = "TEMPLATE_MSG_VALUE"
+        self.type = "TEMPLATE_MSG_VALUE"
     def pack(self):
         """
         Pack object into string
@@ -107,7 +105,7 @@
 #
 ################################################################
 
-class barrier_reply:
+class barrier_reply(ofp_header):
     """
     Wrapper class for barrier_reply
 
@@ -117,12 +115,18 @@
     @arg xid: The transaction ID
     @arg type: The message type (OFPT_BARRIER_REPLY=19)
 
+    Data members inherited from ofp_header:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
 
     """
 
     def __init__(self, **kwargs):
-        self.header = ofp_header()
-        self.header.type = OFPT_BARRIER_REPLY
+        ofp_header.__init__(self)
+        self.version = OFP_VERSION
+        self.type = OFPT_BARRIER_REPLY
         for (k, v) in kwargs.items():
             if hasattr(self, k):
                 setattr(self, k, v)
@@ -137,9 +141,10 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
+        packed += ofp_header.pack(self)
         return packed
 
     def unpack(self, binary_string):
@@ -151,8 +156,8 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
+        binary_string = ofp_header.unpack(self, binary_string)
         # Fixme: If no self.data, add check for data remaining
         return binary_string
 
@@ -164,8 +169,9 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
+        length += ofp_header.__len__(self)
         return length
 
     def show(self, prefix=''):
@@ -180,7 +186,7 @@
         outstr = prefix + 'barrier_reply (OFPT_BARRIER_REPLY)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
+        outstr += ofp_header.show(self, prefix)
         return outstr
 
     def __eq__(self, other):
@@ -191,8 +197,8 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
+        if not ofp_header.__eq__(self, other): return False
         return True
 
     def __ne__(self, other):
@@ -205,7 +211,7 @@
         return not self.__eq__(other)
     
 
-class barrier_request:
+class barrier_request(ofp_header):
     """
     Wrapper class for barrier_request
 
@@ -215,12 +221,18 @@
     @arg xid: The transaction ID
     @arg type: The message type (OFPT_BARRIER_REQUEST=18)
 
+    Data members inherited from ofp_header:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
 
     """
 
     def __init__(self, **kwargs):
-        self.header = ofp_header()
-        self.header.type = OFPT_BARRIER_REQUEST
+        ofp_header.__init__(self)
+        self.version = OFP_VERSION
+        self.type = OFPT_BARRIER_REQUEST
         for (k, v) in kwargs.items():
             if hasattr(self, k):
                 setattr(self, k, v)
@@ -235,9 +247,10 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
+        packed += ofp_header.pack(self)
         return packed
 
     def unpack(self, binary_string):
@@ -249,8 +262,8 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
+        binary_string = ofp_header.unpack(self, binary_string)
         # Fixme: If no self.data, add check for data remaining
         return binary_string
 
@@ -262,8 +275,9 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
+        length += ofp_header.__len__(self)
         return length
 
     def show(self, prefix=''):
@@ -278,7 +292,7 @@
         outstr = prefix + 'barrier_request (OFPT_BARRIER_REQUEST)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
+        outstr += ofp_header.show(self, prefix)
         return outstr
 
     def __eq__(self, other):
@@ -289,8 +303,8 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
+        if not ofp_header.__eq__(self, other): return False
         return True
 
     def __ne__(self, other):
@@ -303,7 +317,7 @@
         return not self.__eq__(other)
     
 
-class echo_reply:
+class echo_reply(ofp_header):
     """
     Wrapper class for echo_reply
 
@@ -313,13 +327,19 @@
     @arg xid: The transaction ID
     @arg type: The message type (OFPT_ECHO_REPLY=3)
 
+    Data members inherited from ofp_header:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
     @arg data: Binary string following message members
 
     """
 
     def __init__(self, **kwargs):
-        self.header = ofp_header()
-        self.header.type = OFPT_ECHO_REPLY
+        ofp_header.__init__(self)
+        self.version = OFP_VERSION
+        self.type = OFPT_ECHO_REPLY
         self.data = ""
         for (k, v) in kwargs.items():
             if hasattr(self, k):
@@ -335,9 +355,10 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
+        packed += ofp_header.pack(self)
         packed += self.data
         return packed
 
@@ -350,8 +371,8 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
+        binary_string = ofp_header.unpack(self, binary_string)
         self.data = binary_string
         binary_string = ''
         return binary_string
@@ -364,8 +385,9 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
+        length += ofp_header.__len__(self)
         length += len(self.data)
         return length
 
@@ -381,7 +403,7 @@
         outstr = prefix + 'echo_reply (OFPT_ECHO_REPLY)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
+        outstr += ofp_header.show(self, prefix)
         outstr += prefix + 'data is of length ' + str(len(self.data)) + '\n'
         ##@todo Fix this circular reference
         # if len(self.data) > 0:
@@ -400,8 +422,8 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
+        if not ofp_header.__eq__(self, other): return False
         if self.data != other.data: return False
         return True
 
@@ -415,7 +437,7 @@
         return not self.__eq__(other)
     
 
-class echo_request:
+class echo_request(ofp_header):
     """
     Wrapper class for echo_request
 
@@ -425,13 +447,19 @@
     @arg xid: The transaction ID
     @arg type: The message type (OFPT_ECHO_REQUEST=2)
 
+    Data members inherited from ofp_header:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
     @arg data: Binary string following message members
 
     """
 
     def __init__(self, **kwargs):
-        self.header = ofp_header()
-        self.header.type = OFPT_ECHO_REQUEST
+        ofp_header.__init__(self)
+        self.version = OFP_VERSION
+        self.type = OFPT_ECHO_REQUEST
         self.data = ""
         for (k, v) in kwargs.items():
             if hasattr(self, k):
@@ -447,9 +475,10 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
+        packed += ofp_header.pack(self)
         packed += self.data
         return packed
 
@@ -462,8 +491,8 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
+        binary_string = ofp_header.unpack(self, binary_string)
         self.data = binary_string
         binary_string = ''
         return binary_string
@@ -476,8 +505,9 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
+        length += ofp_header.__len__(self)
         length += len(self.data)
         return length
 
@@ -493,7 +523,7 @@
         outstr = prefix + 'echo_request (OFPT_ECHO_REQUEST)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
+        outstr += ofp_header.show(self, prefix)
         outstr += prefix + 'data is of length ' + str(len(self.data)) + '\n'
         ##@todo Fix this circular reference
         # if len(self.data) > 0:
@@ -512,8 +542,8 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
+        if not ofp_header.__eq__(self, other): return False
         if self.data != other.data: return False
         return True
 
@@ -538,6 +568,10 @@
     @arg type: The message type (OFPT_ERROR=1)
 
     Data members inherited from ofp_error_msg:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
     @arg err_type
     @arg code
     @arg data: Binary string following message members
@@ -546,8 +580,8 @@
 
     def __init__(self, **kwargs):
         ofp_error_msg.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_ERROR
+        self.version = OFP_VERSION
+        self.type = OFPT_ERROR
         self.data = ""
         for (k, v) in kwargs.items():
             if hasattr(self, k):
@@ -563,8 +597,8 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
         packed += ofp_error_msg.pack(self)
         packed += self.data
@@ -579,7 +613,6 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
         binary_string = ofp_error_msg.unpack(self, binary_string)
         self.data = binary_string
@@ -594,7 +627,7 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
         length += ofp_error_msg.__len__(self)
         length += len(self.data)
@@ -612,7 +645,6 @@
         outstr = prefix + 'error (OFPT_ERROR)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_error_msg.show(self, prefix)
         outstr += prefix + 'data is of length ' + str(len(self.data)) + '\n'
         ##@todo Fix this circular reference
@@ -632,7 +664,6 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
         if not ofp_error_msg.__eq__(self, other): return False
         if self.data != other.data: return False
@@ -659,6 +690,10 @@
     @arg type: The message type (OFPT_FEATURES_REPLY=6)
 
     Data members inherited from ofp_switch_features:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
     @arg datapath_id
     @arg n_buffers
     @arg n_tables
@@ -670,8 +705,8 @@
 
     def __init__(self, **kwargs):
         ofp_switch_features.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_FEATURES_REPLY
+        self.version = OFP_VERSION
+        self.type = OFPT_FEATURES_REPLY
         self.ports = []
         for (k, v) in kwargs.items():
             if hasattr(self, k):
@@ -687,8 +722,8 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
         packed += ofp_switch_features.pack(self)
         for obj in self.ports:
@@ -704,7 +739,6 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
         binary_string = ofp_switch_features.unpack(self, binary_string)
         while len(binary_string) >= OFP_PHY_PORT_BYTES:
@@ -722,7 +756,7 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
         length += ofp_switch_features.__len__(self)
         for obj in self.ports:
@@ -741,7 +775,6 @@
         outstr = prefix + 'features_reply (OFPT_FEATURES_REPLY)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_switch_features.show(self, prefix)
         outstr += prefix + "Array ports\n"
         for obj in self.ports:
@@ -756,7 +789,6 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
         if not ofp_switch_features.__eq__(self, other): return False
         if self.ports != other.ports: return False
@@ -772,7 +804,7 @@
         return not self.__eq__(other)
     
 
-class features_request:
+class features_request(ofp_header):
     """
     Wrapper class for features_request
 
@@ -782,12 +814,18 @@
     @arg xid: The transaction ID
     @arg type: The message type (OFPT_FEATURES_REQUEST=5)
 
+    Data members inherited from ofp_header:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
 
     """
 
     def __init__(self, **kwargs):
-        self.header = ofp_header()
-        self.header.type = OFPT_FEATURES_REQUEST
+        ofp_header.__init__(self)
+        self.version = OFP_VERSION
+        self.type = OFPT_FEATURES_REQUEST
         for (k, v) in kwargs.items():
             if hasattr(self, k):
                 setattr(self, k, v)
@@ -802,9 +840,10 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
+        packed += ofp_header.pack(self)
         return packed
 
     def unpack(self, binary_string):
@@ -816,8 +855,8 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
+        binary_string = ofp_header.unpack(self, binary_string)
         # Fixme: If no self.data, add check for data remaining
         return binary_string
 
@@ -829,8 +868,9 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
+        length += ofp_header.__len__(self)
         return length
 
     def show(self, prefix=''):
@@ -845,7 +885,7 @@
         outstr = prefix + 'features_request (OFPT_FEATURES_REQUEST)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
+        outstr += ofp_header.show(self, prefix)
         return outstr
 
     def __eq__(self, other):
@@ -856,8 +896,8 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
+        if not ofp_header.__eq__(self, other): return False
         return True
 
     def __ne__(self, other):
@@ -881,6 +921,10 @@
     @arg type: The message type (OFPT_FLOW_MOD=14)
 
     Data members inherited from ofp_flow_mod:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
     @arg match
     @arg cookie
     @arg command
@@ -896,8 +940,8 @@
 
     def __init__(self, **kwargs):
         ofp_flow_mod.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_FLOW_MOD
+        self.version = OFP_VERSION
+        self.type = OFPT_FLOW_MOD
         self.actions = []
         for (k, v) in kwargs.items():
             if hasattr(self, k):
@@ -913,8 +957,8 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
         packed += ofp_flow_mod.pack(self)
         packed += action_list(self.actions).pack()
@@ -929,10 +973,9 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
         binary_string = ofp_flow_mod.unpack(self, binary_string)
-        ai_len = self.header.length - (OFP_FLOW_MOD_BYTES + OFP_HEADER_BYTES)
+        ai_len = self.length - (OFP_FLOW_MOD_BYTES + OFP_HEADER_BYTES)
         obj = action_list()
         binary_string = obj.unpack(binary_string, bytes=ai_len)
         self.actions = list(obj)
@@ -947,7 +990,7 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
         length += ofp_flow_mod.__len__(self)
         for obj in self.actions:
@@ -966,7 +1009,6 @@
         outstr = prefix + 'flow_mod (OFPT_FLOW_MOD)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_flow_mod.show(self, prefix)
         outstr += prefix + "List actions\n"
         for obj in self.actions:
@@ -981,7 +1023,6 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
         if not ofp_flow_mod.__eq__(self, other): return False
         if self.actions != other.actions: return False
@@ -1008,6 +1049,10 @@
     @arg type: The message type (OFPT_FLOW_REMOVED=11)
 
     Data members inherited from ofp_flow_removed:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
     @arg match
     @arg cookie
     @arg priority
@@ -1022,8 +1067,8 @@
 
     def __init__(self, **kwargs):
         ofp_flow_removed.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_FLOW_REMOVED
+        self.version = OFP_VERSION
+        self.type = OFPT_FLOW_REMOVED
         for (k, v) in kwargs.items():
             if hasattr(self, k):
                 setattr(self, k, v)
@@ -1038,8 +1083,8 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
         packed += ofp_flow_removed.pack(self)
         return packed
@@ -1053,7 +1098,6 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
         binary_string = ofp_flow_removed.unpack(self, binary_string)
         # Fixme: If no self.data, add check for data remaining
@@ -1067,7 +1111,7 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
         length += ofp_flow_removed.__len__(self)
         return length
@@ -1084,7 +1128,6 @@
         outstr = prefix + 'flow_removed (OFPT_FLOW_REMOVED)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_flow_removed.show(self, prefix)
         return outstr
 
@@ -1096,7 +1139,6 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
         if not ofp_flow_removed.__eq__(self, other): return False
         return True
@@ -1122,6 +1164,10 @@
     @arg type: The message type (OFPT_GET_CONFIG_REPLY=8)
 
     Data members inherited from ofp_switch_config:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
     @arg flags
     @arg miss_send_len
 
@@ -1129,8 +1175,8 @@
 
     def __init__(self, **kwargs):
         ofp_switch_config.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_GET_CONFIG_REPLY
+        self.version = OFP_VERSION
+        self.type = OFPT_GET_CONFIG_REPLY
         for (k, v) in kwargs.items():
             if hasattr(self, k):
                 setattr(self, k, v)
@@ -1145,8 +1191,8 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
         packed += ofp_switch_config.pack(self)
         return packed
@@ -1160,7 +1206,6 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
         binary_string = ofp_switch_config.unpack(self, binary_string)
         # Fixme: If no self.data, add check for data remaining
@@ -1174,7 +1219,7 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
         length += ofp_switch_config.__len__(self)
         return length
@@ -1191,7 +1236,6 @@
         outstr = prefix + 'get_config_reply (OFPT_GET_CONFIG_REPLY)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_switch_config.show(self, prefix)
         return outstr
 
@@ -1203,7 +1247,6 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
         if not ofp_switch_config.__eq__(self, other): return False
         return True
@@ -1218,7 +1261,7 @@
         return not self.__eq__(other)
     
 
-class get_config_request:
+class get_config_request(ofp_header):
     """
     Wrapper class for get_config_request
 
@@ -1228,12 +1271,18 @@
     @arg xid: The transaction ID
     @arg type: The message type (OFPT_GET_CONFIG_REQUEST=7)
 
+    Data members inherited from ofp_header:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
 
     """
 
     def __init__(self, **kwargs):
-        self.header = ofp_header()
-        self.header.type = OFPT_GET_CONFIG_REQUEST
+        ofp_header.__init__(self)
+        self.version = OFP_VERSION
+        self.type = OFPT_GET_CONFIG_REQUEST
         for (k, v) in kwargs.items():
             if hasattr(self, k):
                 setattr(self, k, v)
@@ -1248,9 +1297,10 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
+        packed += ofp_header.pack(self)
         return packed
 
     def unpack(self, binary_string):
@@ -1262,8 +1312,8 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
+        binary_string = ofp_header.unpack(self, binary_string)
         # Fixme: If no self.data, add check for data remaining
         return binary_string
 
@@ -1275,8 +1325,9 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
+        length += ofp_header.__len__(self)
         return length
 
     def show(self, prefix=''):
@@ -1291,7 +1342,7 @@
         outstr = prefix + 'get_config_request (OFPT_GET_CONFIG_REQUEST)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
+        outstr += ofp_header.show(self, prefix)
         return outstr
 
     def __eq__(self, other):
@@ -1302,8 +1353,8 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
+        if not ofp_header.__eq__(self, other): return False
         return True
 
     def __ne__(self, other):
@@ -1316,7 +1367,7 @@
         return not self.__eq__(other)
     
 
-class hello:
+class hello(ofp_header):
     """
     Wrapper class for hello
 
@@ -1326,13 +1377,19 @@
     @arg xid: The transaction ID
     @arg type: The message type (OFPT_HELLO=0)
 
+    Data members inherited from ofp_header:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
     @arg data: Binary string following message members
 
     """
 
     def __init__(self, **kwargs):
-        self.header = ofp_header()
-        self.header.type = OFPT_HELLO
+        ofp_header.__init__(self)
+        self.version = OFP_VERSION
+        self.type = OFPT_HELLO
         self.data = ""
         for (k, v) in kwargs.items():
             if hasattr(self, k):
@@ -1348,9 +1405,10 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
+        packed += ofp_header.pack(self)
         packed += self.data
         return packed
 
@@ -1363,8 +1421,8 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
+        binary_string = ofp_header.unpack(self, binary_string)
         self.data = binary_string
         binary_string = ''
         return binary_string
@@ -1377,8 +1435,9 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
+        length += ofp_header.__len__(self)
         length += len(self.data)
         return length
 
@@ -1394,7 +1453,7 @@
         outstr = prefix + 'hello (OFPT_HELLO)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
+        outstr += ofp_header.show(self, prefix)
         outstr += prefix + 'data is of length ' + str(len(self.data)) + '\n'
         ##@todo Fix this circular reference
         # if len(self.data) > 0:
@@ -1413,8 +1472,8 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
+        if not ofp_header.__eq__(self, other): return False
         if self.data != other.data: return False
         return True
 
@@ -1439,6 +1498,10 @@
     @arg type: The message type (OFPT_PACKET_IN=10)
 
     Data members inherited from ofp_packet_in:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
     @arg buffer_id
     @arg total_len
     @arg in_port
@@ -1449,8 +1512,8 @@
 
     def __init__(self, **kwargs):
         ofp_packet_in.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_PACKET_IN
+        self.version = OFP_VERSION
+        self.type = OFPT_PACKET_IN
         self.data = ""
         for (k, v) in kwargs.items():
             if hasattr(self, k):
@@ -1466,8 +1529,8 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
         packed += ofp_packet_in.pack(self)
         packed += self.data
@@ -1482,7 +1545,6 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
         binary_string = ofp_packet_in.unpack(self, binary_string)
         self.data = binary_string
@@ -1497,7 +1559,7 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
         length += ofp_packet_in.__len__(self)
         length += len(self.data)
@@ -1515,7 +1577,6 @@
         outstr = prefix + 'packet_in (OFPT_PACKET_IN)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_packet_in.show(self, prefix)
         outstr += prefix + 'data is of length ' + str(len(self.data)) + '\n'
         ##@todo Fix this circular reference
@@ -1535,7 +1596,6 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
         if not ofp_packet_in.__eq__(self, other): return False
         if self.data != other.data: return False
@@ -1562,6 +1622,10 @@
     @arg type: The message type (OFPT_PACKET_OUT=13)
 
     Data members inherited from ofp_packet_out:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
     @arg buffer_id
     @arg in_port
     @arg actions_len
@@ -1572,8 +1636,8 @@
 
     def __init__(self, **kwargs):
         ofp_packet_out.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_PACKET_OUT
+        self.version = OFP_VERSION
+        self.type = OFPT_PACKET_OUT
         self.actions = []
         self.data = ""
         for (k, v) in kwargs.items():
@@ -1590,8 +1654,8 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
         self.actions_len = 0
         for obj in self.actions:
@@ -1610,7 +1674,6 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
         binary_string = ofp_packet_out.unpack(self, binary_string)
         obj = action_list()
@@ -1628,7 +1691,7 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
         length += ofp_packet_out.__len__(self)
         for obj in self.actions:
@@ -1648,7 +1711,6 @@
         outstr = prefix + 'packet_out (OFPT_PACKET_OUT)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_packet_out.show(self, prefix)
         outstr += prefix + "List actions\n"
         for obj in self.actions:
@@ -1671,7 +1733,6 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
         if not ofp_packet_out.__eq__(self, other): return False
         if self.data != other.data: return False
@@ -1699,6 +1760,10 @@
     @arg type: The message type (OFPT_PORT_MOD=15)
 
     Data members inherited from ofp_port_mod:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
     @arg port_no
     @arg hw_addr
     @arg config
@@ -1709,8 +1774,8 @@
 
     def __init__(self, **kwargs):
         ofp_port_mod.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_PORT_MOD
+        self.version = OFP_VERSION
+        self.type = OFPT_PORT_MOD
         for (k, v) in kwargs.items():
             if hasattr(self, k):
                 setattr(self, k, v)
@@ -1725,8 +1790,8 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
         packed += ofp_port_mod.pack(self)
         return packed
@@ -1740,7 +1805,6 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
         binary_string = ofp_port_mod.unpack(self, binary_string)
         # Fixme: If no self.data, add check for data remaining
@@ -1754,7 +1818,7 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
         length += ofp_port_mod.__len__(self)
         return length
@@ -1771,7 +1835,6 @@
         outstr = prefix + 'port_mod (OFPT_PORT_MOD)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_port_mod.show(self, prefix)
         return outstr
 
@@ -1783,7 +1846,6 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
         if not ofp_port_mod.__eq__(self, other): return False
         return True
@@ -1809,6 +1871,10 @@
     @arg type: The message type (OFPT_PORT_STATUS=12)
 
     Data members inherited from ofp_port_status:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
     @arg reason
     @arg desc
 
@@ -1816,8 +1882,8 @@
 
     def __init__(self, **kwargs):
         ofp_port_status.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_PORT_STATUS
+        self.version = OFP_VERSION
+        self.type = OFPT_PORT_STATUS
         for (k, v) in kwargs.items():
             if hasattr(self, k):
                 setattr(self, k, v)
@@ -1832,8 +1898,8 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
         packed += ofp_port_status.pack(self)
         return packed
@@ -1847,7 +1913,6 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
         binary_string = ofp_port_status.unpack(self, binary_string)
         # Fixme: If no self.data, add check for data remaining
@@ -1861,7 +1926,7 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
         length += ofp_port_status.__len__(self)
         return length
@@ -1878,7 +1943,6 @@
         outstr = prefix + 'port_status (OFPT_PORT_STATUS)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_port_status.show(self, prefix)
         return outstr
 
@@ -1890,7 +1954,6 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
         if not ofp_port_status.__eq__(self, other): return False
         return True
@@ -1916,6 +1979,10 @@
     @arg type: The message type (OFPT_QUEUE_GET_CONFIG_REPLY=21)
 
     Data members inherited from ofp_queue_get_config_reply:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
     @arg port
     @arg queues: Variable length array of TBD
 
@@ -1923,8 +1990,8 @@
 
     def __init__(self, **kwargs):
         ofp_queue_get_config_reply.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_QUEUE_GET_CONFIG_REPLY
+        self.version = OFP_VERSION
+        self.type = OFPT_QUEUE_GET_CONFIG_REPLY
         self.queues = []
         for (k, v) in kwargs.items():
             if hasattr(self, k):
@@ -1940,8 +2007,8 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
         packed += ofp_queue_get_config_reply.pack(self)
         for obj in self.queues:
@@ -1957,7 +2024,6 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
         binary_string = ofp_queue_get_config_reply.unpack(self, binary_string)
         for obj in self.queues:
@@ -1973,7 +2039,7 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
         length += ofp_queue_get_config_reply.__len__(self)
         for obj in self.queues:
@@ -1992,7 +2058,6 @@
         outstr = prefix + 'queue_get_config_reply (OFPT_QUEUE_GET_CONFIG_REPLY)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_queue_get_config_reply.show(self, prefix)
         outstr += prefix + "Array queues\n"
         for obj in self.queues:
@@ -2007,7 +2072,6 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
         if not ofp_queue_get_config_reply.__eq__(self, other): return False
         if self.queues != other.queues: return False
@@ -2034,14 +2098,18 @@
     @arg type: The message type (OFPT_QUEUE_GET_CONFIG_REQUEST=20)
 
     Data members inherited from ofp_queue_get_config_request:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
     @arg port
 
     """
 
     def __init__(self, **kwargs):
         ofp_queue_get_config_request.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_QUEUE_GET_CONFIG_REQUEST
+        self.version = OFP_VERSION
+        self.type = OFPT_QUEUE_GET_CONFIG_REQUEST
         for (k, v) in kwargs.items():
             if hasattr(self, k):
                 setattr(self, k, v)
@@ -2056,8 +2124,8 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
         packed += ofp_queue_get_config_request.pack(self)
         return packed
@@ -2071,7 +2139,6 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
         binary_string = ofp_queue_get_config_request.unpack(self, binary_string)
         # Fixme: If no self.data, add check for data remaining
@@ -2085,7 +2152,7 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
         length += ofp_queue_get_config_request.__len__(self)
         return length
@@ -2102,7 +2169,6 @@
         outstr = prefix + 'queue_get_config_request (OFPT_QUEUE_GET_CONFIG_REQUEST)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_queue_get_config_request.show(self, prefix)
         return outstr
 
@@ -2114,7 +2180,6 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
         if not ofp_queue_get_config_request.__eq__(self, other): return False
         return True
@@ -2140,6 +2205,10 @@
     @arg type: The message type (OFPT_SET_CONFIG=9)
 
     Data members inherited from ofp_switch_config:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
     @arg flags
     @arg miss_send_len
 
@@ -2147,8 +2216,8 @@
 
     def __init__(self, **kwargs):
         ofp_switch_config.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_SET_CONFIG
+        self.version = OFP_VERSION
+        self.type = OFPT_SET_CONFIG
         for (k, v) in kwargs.items():
             if hasattr(self, k):
                 setattr(self, k, v)
@@ -2163,8 +2232,8 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
         packed += ofp_switch_config.pack(self)
         return packed
@@ -2178,7 +2247,6 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
         binary_string = ofp_switch_config.unpack(self, binary_string)
         # Fixme: If no self.data, add check for data remaining
@@ -2192,7 +2260,7 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
         length += ofp_switch_config.__len__(self)
         return length
@@ -2209,7 +2277,6 @@
         outstr = prefix + 'set_config (OFPT_SET_CONFIG)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_switch_config.show(self, prefix)
         return outstr
 
@@ -2221,7 +2288,6 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
         if not ofp_switch_config.__eq__(self, other): return False
         return True
@@ -2247,6 +2313,10 @@
     @arg type: The message type (OFPT_STATS_REPLY=17)
 
     Data members inherited from ofp_stats_reply:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
     @arg stats_type
     @arg flags
 
@@ -2254,8 +2324,8 @@
 
     def __init__(self, **kwargs):
         ofp_stats_reply.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_STATS_REPLY
+        self.version = OFP_VERSION
+        self.type = OFPT_STATS_REPLY
         for (k, v) in kwargs.items():
             if hasattr(self, k):
                 setattr(self, k, v)
@@ -2270,8 +2340,8 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
         packed += ofp_stats_reply.pack(self)
         return packed
@@ -2285,7 +2355,6 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
         binary_string = ofp_stats_reply.unpack(self, binary_string)
         # Fixme: If no self.data, add check for data remaining
@@ -2299,7 +2368,7 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
         length += ofp_stats_reply.__len__(self)
         return length
@@ -2316,7 +2385,6 @@
         outstr = prefix + 'stats_reply (OFPT_STATS_REPLY)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_stats_reply.show(self, prefix)
         return outstr
 
@@ -2328,7 +2396,6 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
         if not ofp_stats_reply.__eq__(self, other): return False
         return True
@@ -2354,6 +2421,10 @@
     @arg type: The message type (OFPT_STATS_REQUEST=16)
 
     Data members inherited from ofp_stats_request:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
     @arg stats_type
     @arg flags
 
@@ -2361,8 +2432,8 @@
 
     def __init__(self, **kwargs):
         ofp_stats_request.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_STATS_REQUEST
+        self.version = OFP_VERSION
+        self.type = OFPT_STATS_REQUEST
         for (k, v) in kwargs.items():
             if hasattr(self, k):
                 setattr(self, k, v)
@@ -2377,8 +2448,8 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
         packed += ofp_stats_request.pack(self)
         return packed
@@ -2392,7 +2463,6 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
         binary_string = ofp_stats_request.unpack(self, binary_string)
         # Fixme: If no self.data, add check for data remaining
@@ -2406,7 +2476,7 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
         length += ofp_stats_request.__len__(self)
         return length
@@ -2423,7 +2493,6 @@
         outstr = prefix + 'stats_request (OFPT_STATS_REQUEST)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_stats_request.show(self, prefix)
         return outstr
 
@@ -2435,7 +2504,6 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
         if not ofp_stats_request.__eq__(self, other): return False
         return True
@@ -2461,6 +2529,10 @@
     @arg type: The message type (OFPT_VENDOR=4)
 
     Data members inherited from ofp_vendor_header:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
     @arg vendor
     @arg data: Binary string following message members
 
@@ -2468,8 +2540,8 @@
 
     def __init__(self, **kwargs):
         ofp_vendor_header.__init__(self)
-        self.header = ofp_header()
-        self.header.type = OFPT_VENDOR
+        self.version = OFP_VERSION
+        self.type = OFPT_VENDOR
         self.data = ""
         for (k, v) in kwargs.items():
             if hasattr(self, k):
@@ -2485,8 +2557,8 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
 
         packed += ofp_vendor_header.pack(self)
         packed += self.data
@@ -2501,7 +2573,6 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
         binary_string = ofp_vendor_header.unpack(self, binary_string)
         self.data = binary_string
@@ -2516,7 +2587,7 @@
         string.
 
         """
-        length = OFP_HEADER_BYTES
+        length = 0
 
         length += ofp_vendor_header.__len__(self)
         length += len(self.data)
@@ -2534,7 +2605,6 @@
         outstr = prefix + 'vendor (OFPT_VENDOR)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_vendor_header.show(self, prefix)
         outstr += prefix + 'data is of length ' + str(len(self.data)) + '\n'
         ##@todo Fix this circular reference
@@ -2554,7 +2624,6 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
         if not ofp_vendor_header.__eq__(self, other): return False
         if self.data != other.data: return False
@@ -2692,10 +2761,10 @@
     Wrapper class for aggregate stats request message
     """
     def __init__(self, **kwargs):
-        self.header = ofp_header()
         ofp_stats_request.__init__(self)
         ofp_aggregate_stats_request.__init__(self)
-        self.header.type = OFPT_STATS_REQUEST
+        self.version = OFP_VERSION
+        self.type = OFPT_STATS_REQUEST
         self.stats_type = OFPST_AGGREGATE
         for (k, v) in kwargs.items():
             if hasattr(self, k):
@@ -2704,14 +2773,13 @@
                 raise NameError("field %s does not exist in %s" % (k, self.__class__))
 
     def pack(self, assertstruct=True):
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
         packed += ofp_stats_request.pack(self)
         packed += ofp_aggregate_stats_request.pack(self)
         return packed
 
     def unpack(self, binary_string):
-        binary_string = self.header.unpack(binary_string)
         binary_string = ofp_stats_request.unpack(self, binary_string)
         binary_string = ofp_aggregate_stats_request.unpack(self, binary_string)
         if len(binary_string) != 0:
@@ -2719,21 +2787,19 @@
         return binary_string
 
     def __len__(self):
-        return len(self.header) + OFP_STATS_REQUEST_BYTES + \
+        return OFP_STATS_REQUEST_BYTES + \
                OFP_AGGREGATE_STATS_REQUEST_BYTES
 
     def show(self, prefix=''):
         outstr = prefix + "aggregate_stats_request\n"
         outstr += prefix + "ofp header:\n"
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_stats_request.show(self)
         outstr += ofp_aggregate_stats_request.show(self)
         return outstr
 
     def __eq__(self, other):
         if type(self) != type(other): return False
-        return (self.header == other.header and
-                ofp_stats_request.__eq__(self, other) and
+        return (ofp_stats_request.__eq__(self, other) and
                 ofp_aggregate_stats_request.__eq__(self, other))
 
     def __ne__(self, other): return not self.__eq__(other)
@@ -2744,23 +2810,22 @@
     Wrapper class for aggregate stats reply
     """
     def __init__(self):
-        self.header = ofp_header()
         ofp_stats_reply.__init__(self)
-        self.header.type = OFPT_STATS_REPLY
-        self.type = OFPST_AGGREGATE
+        self.version = OFP_VERSION
+        self.type = OFPT_STATS_REPLY
+        self.stats_type = OFPST_AGGREGATE
         # stats: Array of type aggregate_stats_entry
         self.entries = []
 
     def pack(self, assertstruct=True):
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
         packed += ofp_stats_reply.pack(self)
         for obj in self.entries:
             packed += obj.pack()
         return packed
 
     def unpack(self, binary_string):
-        binary_string = self.header.unpack(binary_string)
         binary_string = ofp_stats_reply.unpack(self, binary_string)
         dummy = aggregate_stats_entry()
         while len(binary_string) >= len(dummy):
@@ -2772,7 +2837,7 @@
         return binary_string
 
     def __len__(self):
-        length = len(self.header) + OFP_STATS_REPLY_BYTES
+        length = OFP_STATS_REPLY_BYTES
         for obj in self.entries:
             length += len(obj)
         return length
@@ -2780,7 +2845,6 @@
     def show(self, prefix=''):
         outstr = prefix + "aggregate_stats_reply\n"
         outstr += prefix + "ofp header:\n"
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_stats_reply.show(self)
         outstr += prefix + "Stats array of length " + str(len(self.entries)) + '\n'
         for obj in self.entries:
@@ -2789,8 +2853,7 @@
 
     def __eq__(self, other):
         if type(self) != type(other): return False
-        return (self.header == other.header and
-                ofp_stats_reply.__eq__(self, other) and
+        return (ofp_stats_reply.__eq__(self, other) and
                 self.entries == other.entries)
 
     def __ne__(self, other): return not self.__eq__(other)
@@ -2801,10 +2864,10 @@
     Wrapper class for desc stats request message
     """
     def __init__(self, **kwargs):
-        self.header = ofp_header()
         ofp_stats_request.__init__(self)
         ofp_desc_stats_request.__init__(self)
-        self.header.type = OFPT_STATS_REQUEST
+        self.version = OFP_VERSION
+        self.type = OFPT_STATS_REQUEST
         self.stats_type = OFPST_DESC
         for (k, v) in kwargs.items():
             if hasattr(self, k):
@@ -2813,14 +2876,13 @@
                 raise NameError("field %s does not exist in %s" % (k, self.__class__))
 
     def pack(self, assertstruct=True):
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
         packed += ofp_stats_request.pack(self)
         packed += ofp_desc_stats_request.pack(self)
         return packed
 
     def unpack(self, binary_string):
-        binary_string = self.header.unpack(binary_string)
         binary_string = ofp_stats_request.unpack(self, binary_string)
         binary_string = ofp_desc_stats_request.unpack(self, binary_string)
         if len(binary_string) != 0:
@@ -2828,21 +2890,19 @@
         return binary_string
 
     def __len__(self):
-        return len(self.header) + OFP_STATS_REQUEST_BYTES + \
+        return OFP_STATS_REQUEST_BYTES + \
                OFP_DESC_STATS_REQUEST_BYTES
 
     def show(self, prefix=''):
         outstr = prefix + "desc_stats_request\n"
         outstr += prefix + "ofp header:\n"
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_stats_request.show(self)
         outstr += ofp_desc_stats_request.show(self)
         return outstr
 
     def __eq__(self, other):
         if type(self) != type(other): return False
-        return (self.header == other.header and
-                ofp_stats_request.__eq__(self, other) and
+        return (ofp_stats_request.__eq__(self, other) and
                 ofp_desc_stats_request.__eq__(self, other))
 
     def __ne__(self, other): return not self.__eq__(other)
@@ -2853,23 +2913,22 @@
     Wrapper class for desc stats reply
     """
     def __init__(self):
-        self.header = ofp_header()
         ofp_stats_reply.__init__(self)
-        self.header.type = OFPT_STATS_REPLY
-        self.type = OFPST_DESC
+        self.version = OFP_VERSION
+        self.type = OFPT_STATS_REPLY
+        self.stats_type = OFPST_DESC
         # stats: Array of type desc_stats_entry
         self.entries = []
 
     def pack(self, assertstruct=True):
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
         packed += ofp_stats_reply.pack(self)
         for obj in self.entries:
             packed += obj.pack()
         return packed
 
     def unpack(self, binary_string):
-        binary_string = self.header.unpack(binary_string)
         binary_string = ofp_stats_reply.unpack(self, binary_string)
         dummy = desc_stats_entry()
         while len(binary_string) >= len(dummy):
@@ -2881,7 +2940,7 @@
         return binary_string
 
     def __len__(self):
-        length = len(self.header) + OFP_STATS_REPLY_BYTES
+        length = OFP_STATS_REPLY_BYTES
         for obj in self.entries:
             length += len(obj)
         return length
@@ -2889,7 +2948,6 @@
     def show(self, prefix=''):
         outstr = prefix + "desc_stats_reply\n"
         outstr += prefix + "ofp header:\n"
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_stats_reply.show(self)
         outstr += prefix + "Stats array of length " + str(len(self.entries)) + '\n'
         for obj in self.entries:
@@ -2898,8 +2956,7 @@
 
     def __eq__(self, other):
         if type(self) != type(other): return False
-        return (self.header == other.header and
-                ofp_stats_reply.__eq__(self, other) and
+        return (ofp_stats_reply.__eq__(self, other) and
                 self.entries == other.entries)
 
     def __ne__(self, other): return not self.__eq__(other)
@@ -2910,10 +2967,10 @@
     Wrapper class for flow stats request message
     """
     def __init__(self, **kwargs):
-        self.header = ofp_header()
         ofp_stats_request.__init__(self)
         ofp_flow_stats_request.__init__(self)
-        self.header.type = OFPT_STATS_REQUEST
+        self.version = OFP_VERSION
+        self.type = OFPT_STATS_REQUEST
         self.stats_type = OFPST_FLOW
         for (k, v) in kwargs.items():
             if hasattr(self, k):
@@ -2922,14 +2979,13 @@
                 raise NameError("field %s does not exist in %s" % (k, self.__class__))
 
     def pack(self, assertstruct=True):
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
         packed += ofp_stats_request.pack(self)
         packed += ofp_flow_stats_request.pack(self)
         return packed
 
     def unpack(self, binary_string):
-        binary_string = self.header.unpack(binary_string)
         binary_string = ofp_stats_request.unpack(self, binary_string)
         binary_string = ofp_flow_stats_request.unpack(self, binary_string)
         if len(binary_string) != 0:
@@ -2937,21 +2993,19 @@
         return binary_string
 
     def __len__(self):
-        return len(self.header) + OFP_STATS_REQUEST_BYTES + \
+        return OFP_STATS_REQUEST_BYTES + \
                OFP_FLOW_STATS_REQUEST_BYTES
 
     def show(self, prefix=''):
         outstr = prefix + "flow_stats_request\n"
         outstr += prefix + "ofp header:\n"
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_stats_request.show(self)
         outstr += ofp_flow_stats_request.show(self)
         return outstr
 
     def __eq__(self, other):
         if type(self) != type(other): return False
-        return (self.header == other.header and
-                ofp_stats_request.__eq__(self, other) and
+        return (ofp_stats_request.__eq__(self, other) and
                 ofp_flow_stats_request.__eq__(self, other))
 
     def __ne__(self, other): return not self.__eq__(other)
@@ -2962,23 +3016,22 @@
     Wrapper class for flow stats reply
     """
     def __init__(self):
-        self.header = ofp_header()
         ofp_stats_reply.__init__(self)
-        self.header.type = OFPT_STATS_REPLY
-        self.type = OFPST_FLOW
+        self.version = OFP_VERSION
+        self.type = OFPT_STATS_REPLY
+        self.stats_type = OFPST_FLOW
         # stats: Array of type flow_stats_entry
         self.entries = []
 
     def pack(self, assertstruct=True):
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
         packed += ofp_stats_reply.pack(self)
         for obj in self.entries:
             packed += obj.pack()
         return packed
 
     def unpack(self, binary_string):
-        binary_string = self.header.unpack(binary_string)
         binary_string = ofp_stats_reply.unpack(self, binary_string)
         dummy = flow_stats_entry()
         while len(binary_string) >= len(dummy):
@@ -2990,7 +3043,7 @@
         return binary_string
 
     def __len__(self):
-        length = len(self.header) + OFP_STATS_REPLY_BYTES
+        length = OFP_STATS_REPLY_BYTES
         for obj in self.entries:
             length += len(obj)
         return length
@@ -2998,7 +3051,6 @@
     def show(self, prefix=''):
         outstr = prefix + "flow_stats_reply\n"
         outstr += prefix + "ofp header:\n"
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_stats_reply.show(self)
         outstr += prefix + "Stats array of length " + str(len(self.entries)) + '\n'
         for obj in self.entries:
@@ -3007,8 +3059,7 @@
 
     def __eq__(self, other):
         if type(self) != type(other): return False
-        return (self.header == other.header and
-                ofp_stats_reply.__eq__(self, other) and
+        return (ofp_stats_reply.__eq__(self, other) and
                 self.entries == other.entries)
 
     def __ne__(self, other): return not self.__eq__(other)
@@ -3019,10 +3070,10 @@
     Wrapper class for port stats request message
     """
     def __init__(self, **kwargs):
-        self.header = ofp_header()
         ofp_stats_request.__init__(self)
         ofp_port_stats_request.__init__(self)
-        self.header.type = OFPT_STATS_REQUEST
+        self.version = OFP_VERSION
+        self.type = OFPT_STATS_REQUEST
         self.stats_type = OFPST_PORT
         for (k, v) in kwargs.items():
             if hasattr(self, k):
@@ -3031,14 +3082,13 @@
                 raise NameError("field %s does not exist in %s" % (k, self.__class__))
 
     def pack(self, assertstruct=True):
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
         packed += ofp_stats_request.pack(self)
         packed += ofp_port_stats_request.pack(self)
         return packed
 
     def unpack(self, binary_string):
-        binary_string = self.header.unpack(binary_string)
         binary_string = ofp_stats_request.unpack(self, binary_string)
         binary_string = ofp_port_stats_request.unpack(self, binary_string)
         if len(binary_string) != 0:
@@ -3046,21 +3096,19 @@
         return binary_string
 
     def __len__(self):
-        return len(self.header) + OFP_STATS_REQUEST_BYTES + \
+        return OFP_STATS_REQUEST_BYTES + \
                OFP_PORT_STATS_REQUEST_BYTES
 
     def show(self, prefix=''):
         outstr = prefix + "port_stats_request\n"
         outstr += prefix + "ofp header:\n"
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_stats_request.show(self)
         outstr += ofp_port_stats_request.show(self)
         return outstr
 
     def __eq__(self, other):
         if type(self) != type(other): return False
-        return (self.header == other.header and
-                ofp_stats_request.__eq__(self, other) and
+        return (ofp_stats_request.__eq__(self, other) and
                 ofp_port_stats_request.__eq__(self, other))
 
     def __ne__(self, other): return not self.__eq__(other)
@@ -3071,23 +3119,22 @@
     Wrapper class for port stats reply
     """
     def __init__(self):
-        self.header = ofp_header()
         ofp_stats_reply.__init__(self)
-        self.header.type = OFPT_STATS_REPLY
-        self.type = OFPST_PORT
+        self.version = OFP_VERSION
+        self.type = OFPT_STATS_REPLY
+        self.stats_type = OFPST_PORT
         # stats: Array of type port_stats_entry
         self.entries = []
 
     def pack(self, assertstruct=True):
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
         packed += ofp_stats_reply.pack(self)
         for obj in self.entries:
             packed += obj.pack()
         return packed
 
     def unpack(self, binary_string):
-        binary_string = self.header.unpack(binary_string)
         binary_string = ofp_stats_reply.unpack(self, binary_string)
         dummy = port_stats_entry()
         while len(binary_string) >= len(dummy):
@@ -3099,7 +3146,7 @@
         return binary_string
 
     def __len__(self):
-        length = len(self.header) + OFP_STATS_REPLY_BYTES
+        length = OFP_STATS_REPLY_BYTES
         for obj in self.entries:
             length += len(obj)
         return length
@@ -3107,7 +3154,6 @@
     def show(self, prefix=''):
         outstr = prefix + "port_stats_reply\n"
         outstr += prefix + "ofp header:\n"
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_stats_reply.show(self)
         outstr += prefix + "Stats array of length " + str(len(self.entries)) + '\n'
         for obj in self.entries:
@@ -3116,8 +3162,7 @@
 
     def __eq__(self, other):
         if type(self) != type(other): return False
-        return (self.header == other.header and
-                ofp_stats_reply.__eq__(self, other) and
+        return (ofp_stats_reply.__eq__(self, other) and
                 self.entries == other.entries)
 
     def __ne__(self, other): return not self.__eq__(other)
@@ -3128,10 +3173,10 @@
     Wrapper class for queue stats request message
     """
     def __init__(self, **kwargs):
-        self.header = ofp_header()
         ofp_stats_request.__init__(self)
         ofp_queue_stats_request.__init__(self)
-        self.header.type = OFPT_STATS_REQUEST
+        self.version = OFP_VERSION
+        self.type = OFPT_STATS_REQUEST
         self.stats_type = OFPST_QUEUE
         for (k, v) in kwargs.items():
             if hasattr(self, k):
@@ -3140,14 +3185,13 @@
                 raise NameError("field %s does not exist in %s" % (k, self.__class__))
 
     def pack(self, assertstruct=True):
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
         packed += ofp_stats_request.pack(self)
         packed += ofp_queue_stats_request.pack(self)
         return packed
 
     def unpack(self, binary_string):
-        binary_string = self.header.unpack(binary_string)
         binary_string = ofp_stats_request.unpack(self, binary_string)
         binary_string = ofp_queue_stats_request.unpack(self, binary_string)
         if len(binary_string) != 0:
@@ -3155,21 +3199,19 @@
         return binary_string
 
     def __len__(self):
-        return len(self.header) + OFP_STATS_REQUEST_BYTES + \
+        return OFP_STATS_REQUEST_BYTES + \
                OFP_QUEUE_STATS_REQUEST_BYTES
 
     def show(self, prefix=''):
         outstr = prefix + "queue_stats_request\n"
         outstr += prefix + "ofp header:\n"
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_stats_request.show(self)
         outstr += ofp_queue_stats_request.show(self)
         return outstr
 
     def __eq__(self, other):
         if type(self) != type(other): return False
-        return (self.header == other.header and
-                ofp_stats_request.__eq__(self, other) and
+        return (ofp_stats_request.__eq__(self, other) and
                 ofp_queue_stats_request.__eq__(self, other))
 
     def __ne__(self, other): return not self.__eq__(other)
@@ -3180,23 +3222,22 @@
     Wrapper class for queue stats reply
     """
     def __init__(self):
-        self.header = ofp_header()
         ofp_stats_reply.__init__(self)
-        self.header.type = OFPT_STATS_REPLY
-        self.type = OFPST_QUEUE
+        self.version = OFP_VERSION
+        self.type = OFPT_STATS_REPLY
+        self.stats_type = OFPST_QUEUE
         # stats: Array of type queue_stats_entry
         self.entries = []
 
     def pack(self, assertstruct=True):
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
         packed += ofp_stats_reply.pack(self)
         for obj in self.entries:
             packed += obj.pack()
         return packed
 
     def unpack(self, binary_string):
-        binary_string = self.header.unpack(binary_string)
         binary_string = ofp_stats_reply.unpack(self, binary_string)
         dummy = queue_stats_entry()
         while len(binary_string) >= len(dummy):
@@ -3208,7 +3249,7 @@
         return binary_string
 
     def __len__(self):
-        length = len(self.header) + OFP_STATS_REPLY_BYTES
+        length = OFP_STATS_REPLY_BYTES
         for obj in self.entries:
             length += len(obj)
         return length
@@ -3216,7 +3257,6 @@
     def show(self, prefix=''):
         outstr = prefix + "queue_stats_reply\n"
         outstr += prefix + "ofp header:\n"
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_stats_reply.show(self)
         outstr += prefix + "Stats array of length " + str(len(self.entries)) + '\n'
         for obj in self.entries:
@@ -3225,8 +3265,7 @@
 
     def __eq__(self, other):
         if type(self) != type(other): return False
-        return (self.header == other.header and
-                ofp_stats_reply.__eq__(self, other) and
+        return (ofp_stats_reply.__eq__(self, other) and
                 self.entries == other.entries)
 
     def __ne__(self, other): return not self.__eq__(other)
@@ -3237,10 +3276,10 @@
     Wrapper class for table stats request message
     """
     def __init__(self, **kwargs):
-        self.header = ofp_header()
         ofp_stats_request.__init__(self)
         ofp_table_stats_request.__init__(self)
-        self.header.type = OFPT_STATS_REQUEST
+        self.version = OFP_VERSION
+        self.type = OFPT_STATS_REQUEST
         self.stats_type = OFPST_TABLE
         for (k, v) in kwargs.items():
             if hasattr(self, k):
@@ -3249,14 +3288,13 @@
                 raise NameError("field %s does not exist in %s" % (k, self.__class__))
 
     def pack(self, assertstruct=True):
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
         packed += ofp_stats_request.pack(self)
         packed += ofp_table_stats_request.pack(self)
         return packed
 
     def unpack(self, binary_string):
-        binary_string = self.header.unpack(binary_string)
         binary_string = ofp_stats_request.unpack(self, binary_string)
         binary_string = ofp_table_stats_request.unpack(self, binary_string)
         if len(binary_string) != 0:
@@ -3264,21 +3302,19 @@
         return binary_string
 
     def __len__(self):
-        return len(self.header) + OFP_STATS_REQUEST_BYTES + \
+        return OFP_STATS_REQUEST_BYTES + \
                OFP_TABLE_STATS_REQUEST_BYTES
 
     def show(self, prefix=''):
         outstr = prefix + "table_stats_request\n"
         outstr += prefix + "ofp header:\n"
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_stats_request.show(self)
         outstr += ofp_table_stats_request.show(self)
         return outstr
 
     def __eq__(self, other):
         if type(self) != type(other): return False
-        return (self.header == other.header and
-                ofp_stats_request.__eq__(self, other) and
+        return (ofp_stats_request.__eq__(self, other) and
                 ofp_table_stats_request.__eq__(self, other))
 
     def __ne__(self, other): return not self.__eq__(other)
@@ -3289,23 +3325,22 @@
     Wrapper class for table stats reply
     """
     def __init__(self):
-        self.header = ofp_header()
         ofp_stats_reply.__init__(self)
-        self.header.type = OFPT_STATS_REPLY
-        self.type = OFPST_TABLE
+        self.version = OFP_VERSION
+        self.type = OFPT_STATS_REPLY
+        self.stats_type = OFPST_TABLE
         # stats: Array of type table_stats_entry
         self.entries = []
 
     def pack(self, assertstruct=True):
-        self.header.length = len(self)
-        packed = self.header.pack()
+        self.length = len(self)
+        packed = ""
         packed += ofp_stats_reply.pack(self)
         for obj in self.entries:
             packed += obj.pack()
         return packed
 
     def unpack(self, binary_string):
-        binary_string = self.header.unpack(binary_string)
         binary_string = ofp_stats_reply.unpack(self, binary_string)
         dummy = table_stats_entry()
         while len(binary_string) >= len(dummy):
@@ -3317,7 +3352,7 @@
         return binary_string
 
     def __len__(self):
-        length = len(self.header) + OFP_STATS_REPLY_BYTES
+        length = OFP_STATS_REPLY_BYTES
         for obj in self.entries:
             length += len(obj)
         return length
@@ -3325,7 +3360,6 @@
     def show(self, prefix=''):
         outstr = prefix + "table_stats_reply\n"
         outstr += prefix + "ofp header:\n"
-        outstr += self.header.show(prefix + '  ')
         outstr += ofp_stats_reply.show(self)
         outstr += prefix + "Stats array of length " + str(len(self.entries)) + '\n'
         for obj in self.entries:
@@ -3334,8 +3368,7 @@
 
     def __eq__(self, other):
         if type(self) != type(other): return False
-        return (self.header == other.header and
-                ofp_stats_reply.__eq__(self, other) and
+        return (ofp_stats_reply.__eq__(self, other) and
                 self.entries == other.entries)
 
     def __ne__(self, other): return not self.__eq__(other)
diff --git a/src/python/of10/parse.py b/src/python/of10/parse.py
index 63d17c9..ac76a16 100644
--- a/src/python/of10/parse.py
+++ b/src/python/of10/parse.py
@@ -96,12 +96,13 @@
     """
     hdr = message.ofp_header()
     hdr.unpack(binary_string)
+    logging.info(hdr.show())
     # FIXME: Add error detection
     if not hdr.type in msg_type_subclassed:
         return msg_type_to_class_map[hdr.type]()
     if hdr.type == cstruct.OFPT_STATS_REQUEST:
         sub_hdr = message.ofp_stats_request()
-        sub_hdr.unpack(binary_string[cstruct.OFP_HEADER_BYTES:])
+        sub_hdr.unpack(binary_string)
         try:
             obj = stats_request_to_class_map[sub_hdr.stats_type]()
         except KeyError:
@@ -109,7 +110,7 @@
         return obj
     elif hdr.type == cstruct.OFPT_STATS_REPLY:
         sub_hdr = message.ofp_stats_reply()
-        sub_hdr.unpack(binary_string[cstruct.OFP_HEADER_BYTES:])
+        sub_hdr.unpack(binary_string)
         try:
             obj = stats_reply_to_class_map[sub_hdr.stats_type]()
         except KeyError:
@@ -117,7 +118,7 @@
         return obj
     elif hdr.type == cstruct.OFPT_ERROR:
         sub_hdr = message.ofp_error_msg()
-        sub_hdr.unpack(binary_string[cstruct.OFP_HEADER_BYTES:])
+        sub_hdr.unpack(binary_string)
         return error_to_class_map[sub_hdr.err_type]()
     else:
         parse_logger.error("Cannot parse pkt to message")
diff --git a/src/python/oftest/base_tests.py b/src/python/oftest/base_tests.py
index 5c6c9cf..9d905f9 100644
--- a/src/python/oftest/base_tests.py
+++ b/src/python/oftest/base_tests.py
@@ -44,7 +44,7 @@
             reply, pkt = self.controller.transact(request)
             self.assertTrue(reply is not None,
                             "Did not complete features_request for handshake")
-            if reply.header.version == 1:
+            if reply.version == 1:
                 self.supported_actions = reply.actions
                 logging.info("Supported actions: " + hex(self.supported_actions))
         except:
diff --git a/src/python/oftest/controller.py b/src/python/oftest/controller.py
index 6fd88f5..cd7bbcf 100644
--- a/src/python/oftest/controller.py
+++ b/src/python/oftest/controller.py
@@ -254,26 +254,26 @@
                     if hdr.type == ofp.OFPT_ECHO_REQUEST:
                         self.logger.debug("Responding to echo request")
                         rep = ofp.message.echo_reply()
-                        rep.header.xid = hdr.xid
+                        rep.xid = hdr.xid
                         # Ignoring additional data
                         self.message_send(rep.pack(), zero_xid=True)
                         continue
 
                 # Log error messages
                 if hdr.type == ofp.OFPT_ERROR:
-                    if msg.type in ofp.ofp_error_type_map:
-                        type_str = ofp.ofp_error_type_map[msg.type]
-                        if msg.type == ofp.OFPET_HELLO_FAILED:
+                    if msg.err_type in ofp.ofp_error_type_map:
+                        type_str = ofp.ofp_error_type_map[msg.err_type]
+                        if msg.err_type == ofp.OFPET_HELLO_FAILED:
                             code_map = ofp.ofp_hello_failed_code_map
-                        elif msg.type == ofp.OFPET_BAD_REQUEST:
+                        elif msg.err_type == ofp.OFPET_BAD_REQUEST:
                             code_map = ofp.ofp_bad_request_code_map
-                        elif msg.type == ofp.OFPET_BAD_ACTION:
+                        elif msg.err_type == ofp.OFPET_BAD_ACTION:
                             code_map = ofp.ofp_bad_action_code_map
-                        elif msg.type == ofp.OFPET_FLOW_MOD_FAILED:
+                        elif msg.err_type == ofp.OFPET_FLOW_MOD_FAILED:
                             code_map = ofp.ofp_flow_mod_failed_code_map
-                        elif msg.type == ofp.OFPET_PORT_MOD_FAILED:
+                        elif msg.err_type == ofp.OFPET_PORT_MOD_FAILED:
                             code_map = ofp.ofp_port_mod_failed_code_map
-                        elif msg.type == ofp.OFPET_QUEUE_OP_FAILED:
+                        elif msg.err_type == ofp.OFPET_QUEUE_OP_FAILED:
                             code_map = ofp.ofp_queue_op_failed_code_map
                         else:
                             code_map = None
@@ -285,7 +285,7 @@
                     else:
                         type_str = "unknown"
                     self.logger.warn("Received error message: xid=%d type=%s (%d) code=%s (%d)",
-                                     hdr.xid, type_str, msg.type, code_str, msg.code)
+                                     hdr.xid, type_str, msg.err_type, code_str, msg.code)
 
                 # Now check for message handlers; preference is given to
                 # handlers for a specific packet
@@ -592,8 +592,8 @@
                     self.logger.debug("Looking for %s" % ofp.ofp_type_map[exp_msg])
                     for i in range(len(self.packets)):
                         msg = self.packets[i][0]
-                        self.logger.debug("Checking packets[%d] (%s)" % (i, ofp.ofp_type_map[msg.header.type]))
-                        if msg.header.type == exp_msg:
+                        self.logger.debug("Checking packets[%d] (%s)" % (i, ofp.ofp_type_map[msg.type]))
+                        if msg.type == exp_msg:
                             (msg, pkt) = self.packets.pop(i)
                             return (msg, pkt)
             # Not found
@@ -626,21 +626,21 @@
 
         """
 
-        if not zero_xid and msg.header.xid == 0:
-            msg.header.xid = ofutils.gen_xid()
+        if not zero_xid and msg.xid == 0:
+            msg.xid = ofutils.gen_xid()
 
-        self.logger.debug("Running transaction %d" % msg.header.xid)
+        self.logger.debug("Running transaction %d" % msg.xid)
 
         with self.xid_cv:
             if self.xid:
                 self.logger.error("Can only run one transaction at a time")
                 return (None, None)
 
-            self.xid = msg.header.xid
+            self.xid = msg.xid
             self.xid_response = None
             self.message_send(msg.pack())
 
-            self.logger.debug("Waiting for transaction %d" % msg.header.xid)
+            self.logger.debug("Waiting for transaction %d" % msg.xid)
             ofutils.timed_wait(self.xid_cv, lambda: self.xid_response, timeout=timeout)
 
             if self.xid_response:
@@ -670,8 +670,8 @@
             raise Exception("no socket")
         #@todo If not string, try to pack
         if type(msg) != type(""):
-            if msg.header.xid == 0 and not zero_xid:
-                msg.header.xid = ofutils.gen_xid()
+            if msg.xid == 0 and not zero_xid:
+                msg.xid = ofutils.gen_xid()
             outpkt = msg.pack()
         else:
             outpkt = msg
diff --git a/src/python/oftest/illegal_message.py b/src/python/oftest/illegal_message.py
index eeb5022..2d0ce7b 100644
--- a/src/python/oftest/illegal_message.py
+++ b/src/python/oftest/illegal_message.py
@@ -6,26 +6,36 @@
 
 ILLEGAL_MESSAGE_TYPE=217
 
-class illegal_message_type:
+class illegal_message_type(of10.ofp_header):
     """
-    Wrapper class for illegal message
+    Wrapper class for illegal_message_type
 
     OpenFlow message header: length, version, xid, type
     @arg length: The total length of the message
     @arg version: The OpenFlow version (1)
     @arg xid: The transaction ID
-    @arg type: The message type (OFPT_ECHO_REQUEST=2)
+    @arg type: The message type (ILLEGAL_MESSAGE_TYPE=217)
 
+    Data members inherited from ofp_header:
+    @arg version
+    @arg type
+    @arg length
+    @arg xid
     @arg data: Binary string following message members
 
-    The message type is set to "illegal" and the pack assert
-    check for the OF header is disabled
     """
 
-    def __init__(self):
-        self.header = of10.ofp_header()
-        self.header.type = ILLEGAL_MESSAGE_TYPE
+    def __init__(self, **kwargs):
+        of10.ofp_header.__init__(self)
+        self.version = of10.OFP_VERSION
+        self.type = ILLEGAL_MESSAGE_TYPE
         self.data = ""
+        for (k, v) in kwargs.items():
+            if hasattr(self, k):
+                setattr(self, k, v)
+            else:
+                raise NameError("field %s does not exist in %s" % (k, self.__class__))
+
 
     def pack(self):
         """
@@ -34,9 +44,10 @@
         @return The packed string which can go on the wire
 
         """
-        self.header.length = len(self)
-        packed = self.header.pack(assertstruct=False)
+        self.length = len(self)
+        packed = ""
 
+        packed += of10.ofp_header.pack(self, assertstruct=False)
         packed += self.data
         return packed
 
@@ -49,8 +60,8 @@
         @return The remainder of binary_string that was not parsed.
 
         """
-        binary_string = self.header.unpack(binary_string)
 
+        binary_string = of10.ofp_header.unpack(self, binary_string)
         self.data = binary_string
         binary_string = ''
         return binary_string
@@ -63,8 +74,9 @@
         string.
 
         """
-        length = of10.OFP_HEADER_BYTES
+        length = 0
 
+        length += of10.ofp_header.__len__(self)
         length += len(self.data)
         return length
 
@@ -77,12 +89,18 @@
 
         """
 
-        outstr = prefix + 'illegal_message (' + \
-            str(ILLEGAL_MESSAGE_TYPE) + ')\n'
+        outstr = prefix + 'illegal_message (217)\n'
         prefix += '  '
         outstr += prefix + 'ofp header\n'
-        outstr += self.header.show(prefix + '  ')
+        outstr += of10.ofp_header.show(self, prefix)
         outstr += prefix + 'data is of length ' + str(len(self.data)) + '\n'
+        ##@todo Fix this circular reference
+        # if len(self.data) > 0:
+            # obj = of_message_parse(self.data)
+            # if obj != None:
+                # outstr += obj.show(prefix)
+            # else:
+                # outstr += prefix + "Unable to parse data\n"
         return outstr
 
     def __eq__(self, other):
@@ -93,8 +111,8 @@
 
         """
         if type(self) != type(other): return False
-        if not self.header.__eq__(other.header): return False
 
+        if not of10.ofp_header.__eq__(self, other): return False
         if self.data != other.data: return False
         return True
 
