python-pcap模块解析mac地址
import pcap
import binascii
a = pcap.pcap()
a.setfilter('arp')
for i,j in a:
if binascii.hexlify(j[21])=="02":
print 'Mac Reply!'
for index in range(len(j)):
if index>=22 and index<=27:
print binascii.hexlify(j[index])+":"
print "Over"
break
运行结果: