An integer or a string.
A string or nil
.
A list of keywords specifying which information is required.
The function get-service-entry
looks up service in the system database. If service is an integer, it is the port number to look up. If service is a string, it is a name to look up (it may be one of the aliases).
If protocol is a string, then get-service-entry
looks for a system database entry with protocol protocol, otherwise it finds the first entry with any protocol.
fields specifies which information is returned. When get-service-entry
finds an entry, it returns information about it as multiple values corresponding to the keywords in fields. These keywords can be:
Return the name of the entry.
Return the port number of the entry.
Return a list of aliases of the service.
Return the protocol of the entry, as lowercase strings like "tcp" or "udp".
If service is an integer then the default value of fields is (:name)
. Otherwise the default value of fields is (:port)
.
get-service-entry
tells you what the host computer knows. The results can be quite different between computers. nil
is not the correct protocol to use.
(get-service-entry "smtp" nil) => 25
(get-service-entry 25 nil :fields '(:name :aliases)) => "smtp", ("mail")
(get-service-entry "mail" nil) => 25
LispWorks User Guide and Reference Manual - 13 Feb 2015