Search in sources :

Example 6 with TrexIpV4Packet

use of com.exalttech.trex.packets.TrexIpV4Packet in project trex-stateless-gui by cisco-system-traffic-generator.

the class UDPTest method getIPV4PacketBuilder.

@Override
protected IpV4Packet.Builder getIPV4PacketBuilder(int totalLength, int packetLength, Payload payload, PacketData packetData) throws UnknownHostException {
    LOG.info("Create IPV4 Packet");
    TrexIpV4Packet ipV4Packet = prepareIPV4Packet(totalLength, packetLength, payload, packetData);
    int ipv4PacketLength = PacketBuilderHelper.getIPV4PacketLength(packetData.isTaggedVlan(), packetLength, totalLength);
    ipV4Packet.setPacketLength(ipv4PacketLength);
    int udpPacketLength = PacketBuilderHelper.getTcpUdpPacketLength(packetData.isTaggedVlan(), packetLength, totalLength);
    // build  packet
    ipV4Packet.buildPacket(getUdpPacket(payload, udpPacketLength, packetData).getBuilder(), IpNumber.UDP);
    return ipV4Packet.getBuilder();
}
Also used : TrexIpV4Packet(com.exalttech.trex.packets.TrexIpV4Packet)

Aggregations

TrexIpV4Packet (com.exalttech.trex.packets.TrexIpV4Packet)6 TrexEthernetPacket (com.exalttech.trex.packets.TrexEthernetPacket)1 TrexTcpPacket (com.exalttech.trex.packets.TrexTcpPacket)1 TrexUdpPacket (com.exalttech.trex.packets.TrexUdpPacket)1