Esempio 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)
Esempio n. 2
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[2]) + 1, pkt)
    else:
        hwPktLib.send(iface_map[connections[ifaceName]], pkt)
Esempio n. 3
0
def nftest_send_dma(ifaceName, pkt, exp = True):
    sent_dma[ifaceName].append(pkt)
    if sim:
        for pkt_s in pkt:
	    pkt_s.tuser_sport = 1 << (int(ifaceName[2:3])%4*2 + 1) # PCI ports are odd-numbered

        for i in range(len(pkt)):
            simPkt.pktSendDMA(int(ifaceName[2:3])+1, pkt)
        f = simLib.fDMA()
	axitools.axis_dump( pkt, f, 256, 1e-9 )
    else:
        hwPktLib.send(iface_map[ifaceName], pkt, exp)
Esempio n. 4
0
def nftest_send_dma(ifaceName, pkt):
    sent_dma[ifaceName].append(pkt)
    if sim:
        for pkt_s in pkt:
	    pkt_s.tuser_sport = 1 << (int(ifaceName[2:3])%4*2 + 1) # PCI ports are odd-numbered

        for i in range(len(pkt)):
            simPkt.pktSendDMA(int(ifaceName[2:3])+1, pkt)
        f = simLib.fDMA()
	axitools.axis_dump( pkt, f, 256, 1e-9 )
    else:
        hwPktLib.send(iface_map[ifaceName], pkt)
Esempio n. 5
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)
Esempio n. 6
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:
        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)
Esempio n. 7
0
def nftest_send_dma(ifaceName, pkt):
    sent_dma[ifaceName].append(pkt)
    if sim:
        simPkt.pktSendDMA(int(ifaceName[2]) + 1, pkt)
    else:
        hwPktLib.send(iface_map[ifaceName], pkt)
Esempio n. 8
0
def nftest_send_dma(ifaceName, pkt):
    sent_dma[ifaceName].append(pkt)
    if sim:
        simPkt.pktSendDMA(int(ifaceName[4:5])+1, pkt)
    else:
        hwPktLib.send(iface_map[ifaceName], pkt)