net-service port not service?
Posted: Fri Apr 02, 2010 11:23 pm
I like net-service:
But, I would like to be able to specify a port, not a service name, and get the name back. Right now, I have code that parses the "services" file and does this.
Thoughts?
Code: Select all
net-service
syntax: (net-service str-service str-protocol)
Makes a lookup in the services database and returns the standard port number for this service.
Returns nil on failure.
(net-service "ftp" "tcp") --> 21
Code: Select all
(net-service "" "tcp" 21) --> ftp
syntax: (net-service str-service str-protocol port-number)
Returns nil on failure or the name of the service.