[vscweb-commit] SF.net SVN: vscweb: [459] branches/vsc-2.0/Main/Domain/include/libnet.inc.php
Brought to you by:
cirrusrex
|
From: <hc...@us...> - 2006-08-04 19:42:08
|
Revision: 459 Author: hctv19 Date: 2006-08-04 12:42:03 -0700 (Fri, 04 Aug 2006) ViewCVS: http://svn.sourceforge.net/vscweb/?rev=459&view=rev Log Message: ----------- Ip ranges now do not get the first and last IP cropped off of the scanning list as a network and broadcast address Modified Paths: -------------- branches/vsc-2.0/Main/Domain/include/libnet.inc.php Modified: branches/vsc-2.0/Main/Domain/include/libnet.inc.php =================================================================== --- branches/vsc-2.0/Main/Domain/include/libnet.inc.php 2006-08-03 21:11:16 UTC (rev 458) +++ branches/vsc-2.0/Main/Domain/include/libnet.inc.php 2006-08-04 19:42:03 UTC (rev 459) @@ -121,6 +121,9 @@ $_error = $error->getMessage(); return false; } + //Set type + $net['type'] = "single"; + $net['start_addr'] = $ipv4->ip; $net['end_addr'] = $ipv4->ip; return $net; @@ -142,6 +145,9 @@ $_error = $error->getMessage(); return false; } + //Set type + $net['type'] = "subnet"; + $net['start_addr'] = $ipv4->network; $net['end_addr'] = $ipv4->broadcast; return $net; @@ -160,6 +166,9 @@ $_error = $error->getMessage(); return false; } + //Set type + $net['type'] = "subnet"; + $net['start_addr'] = $ipv4->network; $net['end_addr'] = $ipv4->broadcast; return $net; @@ -177,6 +186,9 @@ $_error = $match[2]." is less than ".$match[1]; return false; } + //Set type + $net['type'] = "ip_range"; + $net['start_addr'] = $match[1]; $net['end_addr'] = $match[2]; //print "(F) start: ".$net['start_addr']; @@ -377,7 +389,21 @@ $this->network = Net_IPv4::ip2double($ipv4['start_addr']); $this->broadcast = Net_IPv4::ip2double($ipv4['end_addr']); + $this->offset = 1; + if ($ipv4['type'] == "subnet") + { + $this->offset = 1; + } + else if ($ipv4['type'] == "single") + { + $this->offset = 1; + } + else + { + $this->offset =0; + } + if ($this->network == $this->broadcast) { /* we have a /32 */ $this->network--; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |