Login   Register  
PHP Classes
elePHPant
Icontem

Class: IP Address Subnet Sniffer

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Jeffrey Silverman  >  IP Address Subnet Sniffer  >  Download .tar.gz .zip  >  Support forum Support forum (1)  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: IP Address Subnet Sniffer
Base name: ipaddresssubnetsniff
Description: Determine if an IP address belongs to a subnetwork
Related classes: , , , , , ,
Version: -
PHP version: -
License: GNU General Public License (GPL)
All time users: 1419 users
All time rank: 2281
Week users: 0 users
Week rank: 2420
Picture of Jeffrey Silverman
Author: Jeffrey Silverman <e-mail contact>
Packages: 2 Browse this author's classes Browse this author's classes
Country: United States United States - PHP jobs in United States
Age: ???
All time rank: 870114 in United States United States
Week rank: 2255 Down288 in United States United States Down


  Detailed description  
This class can be used to determine wether a given IP address belongs to a given list of subnetworks.

The class takes an array of subnetwork masks to be checked in the form of strings with decimal numbers seperated dots .

Then the class can check whether a given IP address belongs to any of the specified subnetworks by applying the respective masks.

This class was created to emulate the "Deny from x.x.x.x" directive for Apache (nd other servers -- for example, Samba uses a similar format for allowing/denying access to a range of IP addresses). I needed a way to deny/allow access to a range of IP addresses but, for technical reasons, I could not use a .htaccess file, and had to do the IP address processing within the PHP script itself.

For example, you can emulate the line "Deny from 192.168.0.0/24" by supplying the string "192.168.0.0/24" to the class. To see exactly how to do this, see the documentation within the class file itself.

 

  Groups  
Group folder image Networking Networking protocols, clients and servers View top rated classes

  Rate classes User ratings   Applications   Files Files  

  User ratings  
Ratings
Utility
Consistency
Documentation
Examples
Tests
Videos
Overall
Rank
All time:
Good (87.5%)
Good (81.2%)
-
-
-
-
Not sure (51.9%)
1366
Month:
Not yet rated by the users

  Applications that use this class  
No application links were specified for this class.
Add link image If you know an application of this package, send a message to the author to add a link here.
  Files folder image Files  
File Role Description
Plain text file IPAddressSubnetSniffer.php Class This class determines whether a given IP address is in a given list of subnets. The idea is to use this determination to allow/deny access to a PHP script based on IP address. Because of the way a particular web environment that I was using was set up, I was unable to use a .htaccess file for this task. I could not find a built-in PHP function or functions to do this task, so this class was built.
Plain text file README Data Shorty documentation

Download all files: ipaddresssubnetsniff.tar.gz ipaddresssubnetsniff.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.