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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

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: Sun May 19 14:01:32 2024 UTC