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();
}
Aggregations