Whisper Library
 All Classes Functions Variables Typedefs Enumerations Friends
whisper_library::UdpPacketGenerator Class Reference

generates valid udp packets More...

Static Public Member Functions

static UdpPacket generateNextPacket (unsigned short port)
 generates a udp packet More...
 
static UdpPacket generatePacketWithLength (unsigned short port, unsigned int length)
 generates a udp packet with specific length More...
 

Detailed Description

generates valid udp packets

This class provides a function to create valid udp packets with random content and length.

Member Function Documentation

UdpPacket whisper_library::UdpPacketGenerator::generateNextPacket ( unsigned short  port)
static

generates a udp packet

'nextPacket' returns a valid udp packet with random content and length. Call the function with the port, the packet is sent to. The length of the packet is random and uniformly distributed between 50 and 150 bytes. It contains uniformly distributed random characters.

UdpPacket whisper_library::UdpPacketGenerator::generatePacketWithLength ( unsigned short  port,
unsigned int  length 
)
static

generates a udp packet with specific length

Generates a UdpPacket with the given length by filling the packet with random characters. If the given length is less than eight, a udp packet without data is returned.

Parameters
portthe source and destination port
lengththe desired length of the packet
Returns
a valid udp packet with the desired length