code: def bfd_parse(data):
          
          pkt = packet.Packet(data)
          i = iter(pkt)
          eth_pkt = next(i)
  
          assert isinstance(eth_pkt, ethernet.ethernet)
  
          ipv4_pkt = next(i)
          assert isinstance(ipv4_pkt, ipv4.ipv4)
  
          udp_pkt = next(i)
          assert isinstance(udp_pkt, udp.udp)
  
          udp_payload = next(i)
  
          return bfd.bfd.parser(udp_payload)[0]
docs: Parse raw packet and return BFD class from packet library.