[vscweb-commit] SF.net SVN: vscweb: [460] branches/vsc-2.0/Main/Domain/include/libnet.inc.php
Brought to you by:
cirrusrex
|
From: <hc...@us...> - 2006-08-04 20:22:08
|
Revision: 460 Author: hctv19 Date: 2006-08-04 13:22:05 -0700 (Fri, 04 Aug 2006) ViewCVS: http://svn.sourceforge.net/vscweb/?rev=460&view=rev Log Message: ----------- Ip ranges will still being cut off at the last entry. Fixed this. 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-04 19:42:03 UTC (rev 459) +++ branches/vsc-2.0/Main/Domain/include/libnet.inc.php 2006-08-04 20:22:05 UTC (rev 460) @@ -384,13 +384,14 @@ var $network; var $broadcast; var $offset; + var $type; function Net_Range($ipv4) { $this->network = Net_IPv4::ip2double($ipv4['start_addr']); $this->broadcast = Net_IPv4::ip2double($ipv4['end_addr']); - - $this->offset = 1; + $this->type = $ipv4['type']; + $this->offset = 1 ; if ($ipv4['type'] == "subnet") { $this->offset = 1; @@ -412,9 +413,15 @@ } function get_next() { - if (($this->network + $this->offset) >= $this->broadcast) { + + if ($this->type == "ip_range" && ($this->network + $this->offset) > $this->broadcast) + { return NULL; } + else if (($this->type == "subnet" || $this->type == "single") && ($this->network + $this->offset) >= $this->broadcast) + { + return NULL; + } $ret_addr = $this->network + $this->offset; $this->offset++; return long2ip($ret_addr); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |