Net_Portscan
[ class tree: Net_Portscan ] [ index: Net_Portscan ] [ all elements ]

Class: Net_Portscan

Source Location: /Net_Portscan-1.0.3/Portscan.php

Class Overview


Portscan class


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 41]
Portscan class

This class provides methods to scan ports on machines, that are connected to the internet. See README for more information on how to use it.



[ Top ]


Method Detail

checkPort   [line 61]

string checkPort( string $host, integer $port, [integer $timeout = 30])

Check if there is a service available at a certain port.

This function tries to open a connection to the port $port on the machine $host. If the connection can be established, there is a service listening on the port. If the connection fails, there is no service.

  • Access: public

Parameters:

string   $host     Hostname
integer   $port     Portnumber
integer   $timeout     Timeout for socket connection in seconds (default is 30).

[ Top ]

checkPortRange   [line 92]

array checkPortRange( string $host, integer $minPort, integer $maxPort, [integer $timeout = 30])

Check a range of ports at a machine

This function can scan a range of ports (from $minPort to $maxPort) on the machine $host for running services.

  • Return: Associative array containing the result
  • Access: public

Parameters:

string   $host     Hostname
integer   $minPort     Lowest port
integer   $maxPort     Highest port
integer   $timeout     Timeout for socket connection in seconds (default is 30).

[ Top ]

getPort   [line 132]

integer getPort( string $service, [string $protocol = "tcp"])

Get port that a certain service uses.
  • Return: Internet port which corresponds to $service
  • Access: public

Parameters:

string   $service     Name of the service
string   $protocol     Protocol (Is either tcp or udp. Default is tcp.)

[ Top ]

getService   [line 114]

string getService( integer $port, [string $protocol = "tcp"])

Get name of the service that is listening on a certain port.
  • Return: Name of the Internet service associated with $service
  • Access: public

Parameters:

integer   $port     Portnumber
string   $protocol     Protocol (Is either tcp or udp. Default is tcp.)

[ Top ]


Documentation generated on Mon, 21 Dec 2009 21:30:02 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.