def decode(self, aBuffer):
     d = dhcp.BootpPacket(aBuffer)
     self.set_decoded_protocol( d )
     off = len(d.getData())
     if dhcp.DhcpPacket(aBuffer[off:])['cookie'] == dhcp.DhcpPacket.MAGIC_NUMBER:
         self.data_decoder = DHCPDecoder()
         packet = self.data_decoder.decode(aBuffer[off:])
         d.contains(packet)
     return d
 def decode(self, aBuffer):
     d = dhcp.DhcpPacket(aBuffer)
     self.set_decoded_protocol( d )
     return d