def nftest_send_phy(ifaceName, pkt): if connections[ifaceName] == ifaceName: print "Error: cannot send on phy of a port in loopback" sys.exit(1) sent_phy[ifaceName].append(pkt) if sim: simPkt.pktSendPHY(int(ifaceName[4:5])+1, pkt) else: hwPktLib.send(iface_map[connections[ifaceName]], pkt)
def nftest_send_phy(ifaceName, pkt, exp = True): if connections[ifaceName] == ifaceName: print "Error: cannot send on phy of a port in loopback" sys.exit(1) sent_phy[ifaceName].append(pkt) if sim: for pkt_s in pkt: pkt_s.tuser_sport = 1 << (int(ifaceName[2:3])*2) # physical ports are even-numbered for i in range(len(pkt)): simPkt.pktSendPHY(int(ifaceName[2:3])+1, pkt) f = simLib.fPort(int(ifaceName[2]) + 1) axitools.axis_dump( pkt, f, 256, 1e-9 ) else: hwPktLib.send(iface_map[connections[ifaceName]], pkt, exp)
def nftest_send_phy(ifaceName, pkt, exp=True): if connections[ifaceName] == ifaceName: print "Error: cannot send on phy of a port in loopback" sys.exit(1) sent_phy[ifaceName].append(pkt) if sim: for pkt_s in pkt: pkt_s.tuser_sport = 1 << (int(ifaceName[2:3]) * 2 ) # physical ports are even-numbered for i in range(len(pkt)): simPkt.pktSendPHY(int(ifaceName[2:3]) + 1, pkt) f = simLib.fPort(int(ifaceName[2]) + 1) axitools.axis_dump(pkt, f, 256, 1e-9) else: hwPktLib.send(iface_map[connections[ifaceName]], pkt, exp)