[Fwd: Net Services]
| From: | Evan Klinger | Date: | Mon, 18 Oct 1999 23:09:50 +0000 |
| Subject: | [Fwd: Net Services] | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-5559@lists.php.net to get a copy of this message | ||
-------- Original Message --------
Subject: Net Services
Date: Fri, 15 Oct 1999 16:14:16 -0700
From: Evan Klinger <evan715@sirius.com>
To: php-dev@lists.php.net
CC: php4beta@lists.php.net
References: <19991015225454.27197.qmail@php.net>
I've uploaded a net services package to
http://www.sirius.com/~evan715/netservices.tar.gz
(20K) which implement
the getservby{name,port} functions. These are identical to the ones in C
-- they open /etc/services for reading and fetch the service name given
as port or fetch the port given the service name.
Installation/Requirements
You must be using PHP4. Latest CVS is recommended.
Unpack the archive and gunzip it into the php4/ext/standard directory.
Rerun buildconf; configure; make.
cd php4/ext/standard
tar zxf netservices.tar.gz
cd ../..
./buildconf
./configure your-options
make
Usage
string getservbyport(int port, string protocol);
Where port is the port for which are you trying to obtain the service
name and protocol is either "udp" or "tcp". Returns service name or
false if there is no name or an error occured.
int getservbyname(string name, string protocol);
Where name is the service name for which you are trying to obtain the
port and protocol is either "udp" or "tcp". Returns port or false if
there is no port or an error occured.
Help
This is my first attempt at contributing to PHP development so if
something doesn't work quite right, please remain calm. I will do my
best to help get it working on everyone's system as long as PHP itself
works. Patches and requests are welcomed.
Contact
email: evan715@sirius.com
AIM: evan715