Please read Nameservicefacility,introduction first.
The application described by this document, nns, is a simple command line client for the nano name
service facility provided by the Tcllib packages nameserv, and nameserv::server. Beyond that the
application's sources also serve as an example of how to use the client package nameserv. All abilities
of a client are covered, from configuration to registration of names to searching.
This name service facility has nothing to do with the Internet's DomainNameSystem, otherwise known as
DNS. If the reader is looking for a package dealing with that please see either of the packages dns and
resolv, both found in Tcllib too.
USECASESnns was written with the following two main use cases in mind.
[1] Registration of a name/data pair in the name service.
[2] Searching the name service for entries matching a glob pattern.
Beyond the above we also want to be able to identify the client, and get information about the name
service.
COMMANDLINEnnsbind ?-hosthost? ?-portport? namedata
This form registers the name/data pair in the specified name service. In this form the command
will not exit to keep the registration alive. The user has to kill it explicitly, either by
sending a signal, or through the job-control facilities of the shell in use. It will especially
survive the loss of the connection to the name service and reestablish the name/data pair when the
connection is restored.
The options to specify the name service will be explained later, in section OPTIONS.
nnssearch ?-hosthost? ?-portport? ?-continuous? ?pattern?
This form searches the specified name service for entries matching the glob-pattern and prints
them to stdout, with each entry on its own line. If no pattern is specified it defaults to *,
matching everything.
The options to specify the name service will be explained later, in section OPTIONS.
If the option -continuous is specified the client will not exit after performing the search, but
start to continuously monitor the service for changes to the set of matching entries,
appropriately updating the display as changes arrive. In that form it will especially also survive
the loss of the connection to the name service and reestablish the search when the connection is
restored.
nnsident ?-hosthost? ?-portport?
This form asks the specified name service for the version and features of the name service
protocol it supports and prints the results to stdout.
The options to specify the name service will be explained later, in section OPTIONS.
nnswho
This form prints name, version, and protocol version of the application to stdout.
OPTIONS
This section describes all the options available to the user of the application
-host name|ipaddress
If this option is not specified it defaults to localhost. It specifies the name or ip-address of
the host the name service to talk to is running on.
-port number
If this option is not specified it defaults to 38573. It specifies the TCP port the name service
to talk to is listening on for requests.