Professional Documents
Culture Documents
-----------------------
randpkt is a small utility creates a libpcap trace file full of random packets.
You can control the number of packets, the maximum size of each packet,
and the type of each packet. It is not build by default, but you
can create it in the top-level Wireshark directory by typing:
make randpkt
The usage statement produced by randpkt will list the legal types.
If you choose a maxbytes value that is less than the size of the
sample packet, then your packets would contain only the sample
packet... not much variance there! Randpkt exits on that condition.
pkt_example examples[] = {
{ "arp",
"Address Resolution Protocol",
PKT_ARP,
pkt_arp,
WTAP_ENCAP_ETHERNET,
array_length(pkt_arp) },
{ "eth",
"Ethernet",
PKT_ETHERNET,
NULL,
WTAP_ENCAP_ETHERNET,
0 },
};
Note that packets that designate only their datalink type have no sample
arrays, since the only thing that needs to be set is the datalink type,
which is a field in the libpcap frame record; it's not a part of the
packet itself.
Enjoy!