php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #2506 getservicebyport() and getservicebyname()
Submitted: 1999-10-13 11:05 UTC Modified: 1999-11-01 19:59 UTC
From: shiva at aachalon dot de Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 3.0.12 OS: any
Private report: No CVE-ID: None
 [1999-10-13 11:05 UTC] shiva at aachalon dot de
There already are gethostbyaddr() and gethostbyname() ... But where are the functions mentioned in the subject. Do I have to parse /etc/services to do that..?
How about:

SYNOPSIS
  mixed getservicebyname(string name)
  string getservicebyport(int port)

DESCRIPTION
  getservicebyname("ftp") would return "21"
  getservicebyport(80) would return "www"

Of course, when local /etc/services file has a mapping for it, otherwise it should return values like e.g. gethostbyaddr(..)
  getservicebyport(123456) would return "123456", when not defined in /etc/services

just my two cents
  Christian

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-11-01 19:59 UTC] evan at cvs dot php dot net
Implemented in latest PHP4 CVS.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 29 03:01:29 2024 UTC