I have the following code. But, I don't know function or code about libpcap version and link-layer. So, So I have not been able to proceed. I am a beginner of Python. Help me!!

Code:
import dpkt
import socket
import sys

f = open('filename')
pcap = dpkt.pcap.Reader(f)

for ts, buf in pcap:
  print ts, len(buf)
  for c in buf:
    print hex(ord(c)),
  print