public class UdpTool
extends java.lang.Object
Constructor and Description |
---|
UdpTool(int local_port,
java.io.Writer output)
Creates a new UdpTool.
|
Modifier and Type | Method and Description |
---|---|
void |
halt()
Stops running.
|
static void |
main(java.lang.String[] args)
Main method.
|
void |
send(byte[] data,
SocketAddress dest_soaddr)
Sends a packet to the given destination.
|
void |
sendTrace(java.io.BufferedReader input,
SocketAddress dest_soaddr)
Sends a sequence of packets to the given destination.
|
void |
sendTrace(long num,
SocketAddress dest_soaddr)
Sends a sequence of UDP packets with incremental sequence number as payload.
|
void |
setAsciiMode(boolean ascii_mode)
Sets ASCII mode.
|
void |
setInterTime(long inter_time)
Sets the time between packet departures.
|
public UdpTool(int local_port, java.io.Writer output)
local_port
- UDP local portoutput
- output for writing incoming datapublic void setInterTime(long inter_time)
inter_time
- inter-time value (in milliseconds)public void setAsciiMode(boolean ascii_mode)
ascii_mode
- whether using ASCII inputs/outputs (true=ascii, false=hex)public void send(byte[] data, SocketAddress dest_soaddr)
data
- UDP packet payloaddest_soaddr
- destination socket addresspublic void sendTrace(java.io.BufferedReader input, SocketAddress dest_soaddr)
input
- trace input where packets are read fromdest_soaddr
- destination socket addresspublic void sendTrace(long num, SocketAddress dest_soaddr)
num
- the number of packets to be sentdest_soaddr
- destination socket addresspublic void halt()
public static void main(java.lang.String[] args)