def read_tracebox_pkt(self, data):
    fields = dict()
    ip = dpkt.ip.IP(data)
    fields['hop'] = socket.inet_ntoa(ip.src)
    if ip.p == dpkt.ip.IP_PROTO_ICMP:
      # This is a reply from a hop
      fields['hop'] = socket.inet_ntoa(ip.src)
      icmp = ip.data
      #print "ICMP quote:", icmp.type, icmp.code, "LEN:", len(icmp.data.data)
      # icmp.data is type dpkt.icmp.TimeExceed
      # so, icmp.data.data is a dpkt.ip.IP
      ip = icmp.data.data
    fields['IP::Version'] = ip.v
    fields['IP::IHL'] = ip.hl
    dscp = (ip.tos & 0xFC) >> 2
    ecn = (ip.tos & 0x03)
    fields['IP::DiffServicesCP'] = hex(dscp)
    fields['IP::ECN'] = hex(ecn)
    fields['IP:Length'] = hex(ip.len)
    fields['IP:ID'] = ip.id
    flags = (ip.df >> 1) + ip.mf
    fields['IP:Flags'] = hex(flags)
    fields['IP:FragmentOffset'] = ip.offset
    fields['IP:TTL'] = ip.ttl
    fields['IP::Protocol'] = ip.p
    fields['IP::Checksum'] = hex(ip.sum)
    fields['IP::SourceAddr'] = socket.inet_ntoa(ip.src)
    fields['IP::DestAddr'] = socket.inet_ntoa(ip.dst)
    if ip.p == dpkt.ip.IP_PROTO_TCP:
      tcp = ip.data
      if not isinstance(tcp, dpkt.tcp.TCP):
        #print "Partial quote!"
        z = struct.pack('12sB',ip.data,0x50) + struct.pack('7B',*([0]*7))
        tcp = dpkt.tcp.TCP(z)
        #print type(tcp)
      if len(ip.data) >= 4:
        fields['TCP::SPort'] = hex(tcp.sport)
        fields['TCP::DPort'] = hex(tcp.dport)
      if len(ip.data) >= 8:
        fields['TCP::SeqNumber'] = hex(tcp.seq)
      if len(ip.data) >= 12:
        fields['TCP::AckNumber'] = hex(tcp.ack)
      if len(ip.data) >= 16:
        fields['TCP::Offset'] = hex(tcp.off)
        fields['TCP::Flags'] = hex(tcp.flags)
        fields['TCP::Window'] = hex(tcp.win)
      if len(ip.data) == 20:
        fields['TCP::Checksum'] = hex(tcp.sum)
        fields['TCP::UrgentPtr'] = hex(tcp.urp)
      if len(ip.data) >= 20:
        if len(tcp.opts) > 0:
          opts = dpkt.tcp.parse_opts(tcp.opts)
          for o,d in opts:
            if o == dpkt.tcp.TCP_OPT_EOL:
              fields['TCP::OPT_EOL'] = d
            elif o == dpkt.tcp.TCP_OPT_NOP:
              fields['TCP::OPT_NOP'] = d
            elif o == dpkt.tcp.TCP_OPT_MSS:
              fields['TCP::OPT_MSS'] = d
            elif o == dpkt.tcp.TCP_OPT_WSCALE:
              fields['TCP::OPT_WSCALE'] = d
            elif o == dpkt.tcp.TCP_OPT_SACKOK:
              fields['TCP::OPT_SACKOK'] = d
            elif o == dpkt.tcp.TCP_OPT_SACK:
              fields['TCP::OPT_SACK'] = d
            elif o == dpkt.tcp.TCP_OPT_TIMESTAMP:
              fields['TCP::OPT_TIMESTAMP'] = d
    return fields