UDPPROBE(1)

NAME
udpprobe - send a UDP datagram and look for response

SYNOPSIS
udpprobe [ -w seconds ] host port [ text ]

DESCRIPTION
udpprobe creates an Internet domain UDP socket, sends one datagram over it and looks for response. The host argument can be an Internet number in dot-notation (like ``129.13.10.91'') or a domain name. In this case it must be possible to resolve the name to a valid Internet address with gethostbyname(3). The port argument can be a port number or a service name which can be mapped to a port number by getservbyname(3). The optional text argument specifies text to send. If this argument is missing, the text is taken from the standard input. If it is a null string, a single null charachter is sent.

OPTIONS

-w seconds
    Specifies the timeout for response. After sending one datagram, udpprobe waits at most this amount of time until the host returns a datagram in response. If a datagram is received, its content is printed on standard output. If the timeout is zero, udpprobe returns immediately, discarding any response. Default is one second.

EXAMPLES
The command

    udpprobe localhost echo "Hello world"

sends the string "Hello world" to the local host's UDP echo port. This should return the same string and print it on standard output, provided the UDP echo service is available.
The command

    udpprobe -w0 mailgate 1001 ""

sends a dummy datagram to UDP port 1001 to host "mailgate" in the local domain and returns immediately. This could be used for signaling purposes - mailgate's inetd could be set up such that a datagram sent to this port causes a mail delivery program to be executed, etc.

DIAGNOSTICS
If any system call fails, the reason is printed to standard error and an exit code of 2 is returned. The exit code is 0 if a response datagram is received, 1 if none is received after the timeout period.

SEE ALSO
socket(2), connect(2), gethostbyname(3), getservbyname(3), ping(8), inetd(8)

BUGS
Only one datagram is sent and received. The size of a datagram (for both directions) is limited to 1024 bytes. Whether this arbitrary size actually fits into a datagram or gets truncated, and what exactly happens when it is truncated, is system-dependent.
Depending on the network and software environment, it may be impossible to distinguish between a failure to deliver a datagram and a delivered datagram with no answer.

VERSION
1.1 as of 31 Jan 1994.

AUTHOR
Olaf Titz <olaf@bigred.ka.sub.org>
This software is in the public domain.