## send transperent arp packets pkts = [] expected_pkts = [] for i in range(size / (1500 - 64) + 1): DA = "ff:ff:ff:ff:ff:ff" pkt = Ether(src = SA, dst = DA) / ARP(op = 'who-has', psrc = SIP, pdst = DIP, hwsrc = SA, hwdst = HWDST) #pkt = Ether(src = SA, dst = DA) if not isHW(): pkt.tuser_sport = 32 pkts.append(pkt) expected_pkts.append(pkt) for i in range(size / (1500 - 64) + 1): for pkt in pkts: pkt.time = i*(1e-8) + (1e-6) if isHW(): for i in xrange(len(pkts)): nftest_send_phy('nf0', pkts[i], False) nftest_expect_phy('nf0', expected_pkts[i], '\x00' * 42) nftest_expect_dma('nf0', expected_pkts[i], '\x00' * 42) if not isHW(): #pass nftest_send_phy('nf0', pkts) nftest_expect_phy('nf1', expected_pkts) nftest_expect_phy('nf2', expected_pkts) nftest_expect_phy('nf3', expected_pkts) nftest_barrier()
nftest_barrier() pkts = [] expected_pkts = [] pkta = [] for i in range(num_broadcast): pkt = Ether(src = SA, dst = DA) / ARP(op = 'who-has', psrc = SIP, pdst = DIP, hwsrc = SA, hwdst = HWDST) pkt.tuser_sport = 1 pkts.append(pkt) expected_pkts.append(pkt / Raw(load = magic + key)) for i in range(num_broadcast): for pkt in pkts: pkt.time = i*(1e-8) + (1e-6) if isHW(): nftest_expect_phy('nf1', pkt / Raw(load = magic + key)) nftest_send_phy('nf0', pkt) if not isHW(): nftest_send_phy('nf0', pkts) nftest_expect_phy('nf1', expected_pkts) nftest_expect_phy('nf2', expected_pkts) nftest_expect_phy('nf3', expected_pkts) nftest_barrier() #change the data with register writes for i in xrange(4):
nftest_barrier() pkts = [] expected_pkts = [] pkta = [] for i in range(num_broadcast): pkt = Ether(src=SA, dst=DA) / ARP( op='who-has', psrc=SIP, pdst=DIP, hwsrc=SA, hwdst=HWDST) pkt.tuser_sport = 1 pkts.append(pkt) expected_pkts.append(pkt / Raw(load=magic + key)) for i in range(num_broadcast): for pkt in pkts: pkt.time = i * (1e-8) + (1e-6) if isHW(): nftest_expect_phy('nf1', pkt / Raw(load=magic + key)) nftest_send_phy('nf0', pkt) if not isHW(): nftest_send_phy('nf0', pkts) nftest_expect_phy('nf1', expected_pkts) nftest_expect_phy('nf2', expected_pkts) nftest_expect_phy('nf3', expected_pkts) nftest_barrier() #change the data with register writes for i in xrange(4):