logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

asp - find an host IP address by its name

Acknowledgments

       Steven N. Hirsch <shirsch@ibm.net> for v1.3 bug fix and for the verbose option.
       Colin Phipps <cphipps@doomworld.com> for the tmpnam security issue.

Author

       Stenio Brunetta <stenio@brunettaeperin.it>

       Comments and suggestions are welcome.

Bugs

       UDP  is  an  unreliable protocol, therefore there is a chance you will not find the host even if it is on
       line. Anyway, if you are sure that the peer is on line and  asp  aware,  you  could  adjust  the  various
       parameters  until  you get a reply. At last you will find the correct settings for your particular needs.
       This until the RDM communication style will be implemented under Linux.

       Obviously the hostname has to be unique among the possible IP addresses:  asp  will  hook  to  the  first
       correct reply.

Description

Asp finds the IP address of an Internet connected host. In order to find it, the peer hostname  (not  the
       FQDN),  and  the  range  of  its  possible IP addresses need to be specified. Those IP addresses could be
       simple IP addresses as 127.0.0.1 or "metaip" addresses as 127.0.0.1-20 or  127.0.0.*:  the  former  is  a
       simple way to avoid to type a lot of consecutive addresses, the latter is short for 127.0.0.1-254.

       In  order to simplify the management of the associations between hostnames and addresses, asp searches in
       a specified directory a text file containing the possible IP addresses of the looked for host.  The  name
       of the text file has to be formed by the hostname followed by an optional extension of your choice.

       For example to find the author's dynamic IP address, obviously if I am on line, you can provide my metaip
       address on standard input with the command:

              echo "195.31.186.1-62
              194.166.58.2-18" | asp -f atomic

       or you can put my metaip address in a file called atomic in your ~/.asp directory, like this:

              echo "195.31.186.1-62
              194.166.58.2-18" > ~/.asp/atomic

       and then you can simply do:

              asp atomic

Environment

ASPCMD This variable could be used to store your preferred settings. An option set  in  this  environment
              variable could be overridden or toggled from command line.

Name

       asp - find an host IP address by its name

Options

-u     Update the file /etc/hosts with the IP address of hostname or delete the possible old entry if the
              address is not found. Obviously the file have to by writable by the user.

       -v     Include  more verbiage to make output readable by humans.  Default consists only of dotted quad IP
              address, which is intended for output substitution in scripts.

       -f     Force the reading of addresses from standard input instead that from the hostname's file.

       -ddir
              Set the directory containing the addresses file referred by hostname to dir.  Default is ~/.asp.

       -eext
              Set addresses files extension to ext.  Default is no extension.

       -aaddresses
              Set the number of queries to send before make  a  pause  of  send_delay  seconds.  Default  is  12
              queries.

       -rrepetitions
              Set the number of times to try the same address. Default is 3 times.

       -ssend_delay
              Delay the sending of the next group of addressessend_delay seconds. Default is 2 seconds.

       -wwait_time
              Wait the peer reply for wait_time seconds. Default is 5 seconds.

       -pport
              Specify  an  alternative  port  number.  For default the port number is obtained searching the asp
              entry in /etc/services.

       -V     Show version information.

See Also

aspd(8).

Linux                                             February 1997                                           ASP(1)

Synopsis

asp  [-uv]  [-f  |  [-ddir] [-eext]] [-aaddresses] [-rrepetitions] [-ssend_delay] [-wwait_time] [-pport] hostnameasp-V

See Also