hping wiki

hping recv ?-hexdata? interface ?timeout? ?count?

Receive packets as a Tcl list in the APD format. interface is the interface from wich to read packets, timeout is an optional argument to set a timeout value in milliseconds, with the exception that a zero timeout means to return as soon as possible the packets that was already in queue when the hping recv subcommand
was called, while a -1 timeout value means to expect forever for packets (no timeout). If timeout is specified, an additional (optional) count parameter can be specified, modifing the recv subcommand behaviour to return as soon as count packets were already received. A special count value of zero means to collect an infinite number of packets (at least until the timeout is not reached).
The optional -hexdata switch specify to return packets payload as hex digits instead of quoted strings. To use -hexdata is encouraged for all the applications, but the ones that needs to display packets in a human readable format.
For default the timeout is set to -1, and count to 1 (in other words hping will wait forever if no packets are available, but will return when the first packet is received).

# Capture a packet from eth0
hping3.0.0-alpha> hping recv eth0

# Caputure a packet using the hex format for data payload
hping3.0.0-alpha> hping recv -hexdata eth0

# Wait for all the packets received in 5 seconds, and print how many they are
hping3.0.0-alpha> puts [llength [hping recv eth0 5000 0]]

Edit this page Upload file Page history - Page last update: Sat Mar 18 11:03:33 GMT 2006 by | Your address: | Admin