getservbyport() in Python?

jeffg at provenance.com.au jeffg at provenance.com.au
Mon Jan 10 02:54:56 EST 2000


Does anyone know of any Python implementation of the Linux standard call
getservbyport()? This function is given a network socket port number and
returns the service name. eg if passed 80, will return 'http'. This
information is taken from the /etc/services file.

If nothing exists (& I've looked around pretty thoroughly), then I plan
to scan the services file directly, using re to search for the port
number I want. If I do this, I'll post the function here.

Regards,
Jeff Gray


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list