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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: shiva at aachalon dot de
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 05 01:01:35 2025 UTC