TnmInet3tnm
A tcl package to use and probe tcp/ip services.
Overview
The TnmInet package provides a set of Tcl command procedures to probe various TCP/IP services. Most of the commands work synchronously which means that they might block the process for a while if there are communication problems. The result of some of the commands is returned in a human readable format which in some cases depends on the software that services requests. The main purpose of these functions is therefore to retrieve information that is displayed in a user-interface and not further processed by software.
Using the package
The TnmInet package is loaded into a Tcl interpreter by using the following sequence of Tcl commands:
package require Tnm package require TnmInet $tnm(version)
All the TnmInet commands live in the TnmInet namespace. You can import these commands into the current namespace by using the following Tcl command:
namespace import TnmInet::*
It is however suggested to import commands explicitely or to use the full name in scripts to avoid name clashes.
Commands
- TnmInet::GetIpAddress host
-
The
TnmInet::GetIpAddresscommmand takes a host name or a host address and returns the host address or an error if the host is not known in the local network database or in the global Domain Name System (DNS).
- TnmInet::GetIpName host
-
The
TnmInet::GetIpNamecommand takes a host name or a host address and returns the host name or an error if the host is not known in the local network database or in the global Domain Name System (DNS).
- TnmInet::DayTime host
-
The
TnmInet::DayTimecommand connects to the daytime service on host and retrieves the local time of day. The command returns the remote system time.
- TnmInet::Finger host ?user?
-
The
TnmInet::Fingercommand connects to a host using the finger user information protocol (RFC 1288).
- TnmInet::TraceRoute host ?maxlength? ?retries?
-
The
TnmInet::TraceRoutecommand uses the van Jacobsen algorithm to trace a route through the Internet to host. It returns the routing trace in formatted, human readable format. The optional maxlength and retries parameters set the maximum length of a route and the number of retries for each hop.
- TnmInet::TcpServices ?host?
-
The
TnmInet::TcpServicescommand first reads obtains a list of locally known service names and port numbers. Afterwards, it tries to establish a TCP connection to each port number on host. The command returns a formatted, human readable list of TCP services where the attempt to establish a connection was successful.
- TnmInet::RpcServices ?host?
-
The
TnmInet::RpcServicescommand first obtains the list of ONC RPC services registered at the portmapper on host. Afterwards, it probes every listed RPC service by calling RPC procedure 0. The command returns a formatted, human readable list of RPC service together with an indication if the call to procedure 0 was successful. The output also contains the time needed to call procedure 0 for those calls that were successful.
- TnmInet::SendMail recipients message ?subject?
-
The
TnmInet::SendMailcommand send a mail message to a list of recipients. The option parameters defines the subject of the outgoing message. The message is delivered by talking SMTP (RFC 821) to the local mail transfer agent.The
TnmInet::SendMailuses the contents of the global tnm(email) variable in the SMTP From: header line. The global variable tnm(email) is set to "$tnm(user)@$tnm(domain)" if is does not exist.
Releases
Unchanged in 3 releases since Debian 2.1 (Slink).