Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
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)