[ Home | What's New | Contents | Overview | Contributors | Distribution | Examples | Documentation | Manual | Publications | Mailing List Archive | Problems ] This page was last updated by Axel Belinfante on 2004-10-25
TorX Test Tool Information
Prev   Next

udp(1) - udp connection program

Table of Contents

Name

udp - udp connection program

Synopsis

udp [ -debug [ nr ] ] [ -port portnr ] [ -[no]printdata ] [ -[no]printdatahex ] [ -[no]delay ]

Description

udp opens a socket at port portnr, if given, or the first free one. If this succeeds, it prints on standard output a line of the form
HOSTPORT localportnr
where localportnr is the number of the opened port, after which it waits for commands on standard input and messages that arrive on the socket, until it detects end of file on its standard input, after which it closes the socket and exits. The recognized commands are discussed below. When a message arrives on the socket, it outputs on standard output a line of the form
RECV peerhost peeraddr peerport data
if printing of data is enabled, and/or, if printing of data in hexadecimal form is enabled, a line of the form
RECVHEX peerhost peeraddr peerport datahex
In these lines peerhost, peeraddr and peerport are the hostname, the IP number and the port number of the peer, and data and datahex are the contents of the message, as received resp. in hexadecimal form. By default, output in hexadecimal format is enabled, and output in ``normal'' format is disabled. This can be changed using the command line options -[no]printdatahex and -[no]printdata and with corresponding commands, as discussed below.

The -delay option enables randomly chosen 1-second delays (sleeps) between receipt of a message on standard input and forwarding of the message over the socket. If messages arrive at the socket (from over the network) during the delay (sleep), also they suffer from the delay. However, the FIFO behaviour of the program is untouched. This option is meant to (crudely) simulate the behaviour of buffering channels, such that if there are multiple channels we may see random interleavings of the messages on the different channels.

The -debug [nr] option opens a hardcoded pseudo terminal (pty) on which debugging information is printed. The amount of information printed depends on the numeric debug mode given (see the source).

Commands

The following commands can be given on the standard input of udp. The command keyword (printed in capitals in this section) is recognized regardless of case (uppercase, lowercase, mixed).
SENDHEX peerhost peerport datahex
send the data (given as hexadecimal string) to peer at port peerport of host peerhost.
LOCALADDR
print a HOSTPORT localportnr line to standard output (as done after startup)
PRINTDATA
enable printing of data ``as received'', in the form of RECV lines
NOPRINTDATA
disable printing of data ``as received'', in the form of RECV lines
PRINTDATAHEX
enable printing of data in hexadecimal form, in the form of RECVHEX lines
NOPRINTDATAHEX
disable printing of data in hexadecimal form, in the form of RECVHEX lines
DEBUG [nr]
set debugging mode. Debugging mode 0 disables debugging, for the other modes, see the source.
NODEBUG
disable debugging

Bugs

For the -[no]delay command line option there is no corresponding command that can be given on standard input.

There is no option to set the seed of the random number generator used for the -[no]delay command line option.

See Also

torx-intro(1), tcp(1), hexcontext(1), unhexify(1)

Contact

By Email: <torx_support@cs.utwente.nl>

Version

This manual page documents version 3.9.0 of torx.


Table of Contents


Prev Table of Contents Next
Appendix D: TorX Manual Pages: torx_open(1) - run open/caesar tool on torx explorer program Valid HTML 4.01! Appendix D: TorX Manual Pages: unhexify(1) - translate from hexadecimal to ascii