Changeset 275 for trunk/system
- Timestamp:
- Jan 24, 2010, 8:05:10 AM (15 years ago)
- Location:
- trunk/system/generators
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/generators/firewall_nat.php
r272 r275 33 33 $DbResult2 = $Database->select('NetworkSubnet', '*', 'Member='.$Member['Id']); 34 34 while($Subnet = $DbResult2->fetch_assoc()) 35 { 35 { 36 36 $Subnet['Name'] = RouterOSIdent('subnet-'.$Subnet['Name']); 37 37 echo($Subnet['Name'].'('.$Subnet['AddressRange'].'/'.$Subnet['Mask'].'), '); 38 $Range = CIDRToAddressRange($Subnet['ExtAddressRange'], $Subnet['ExtMask']); 38 $NewAddress = new NetworkAddressIPv4(); 39 $NewAddress->AddressFromString($Subnet['ExtAddressRange']); 40 $NewAddress->Prefix = $Subnet['ExtMask']; 41 $Range = $NewAddress->GetRange(); 39 42 if($Subnet['ExtMask'] != 32) $Range = $Range['From'].'-'.$Range['To']; 40 43 else $Range = $Range['From']; … … 43 46 $Items[] = array('chain' => 'srcnat', 'src-address' => $Src, 'out-interface' => $InetInterface, 'action' => 'src-nat', 'to-addresses' => $Range, 'comment' => $Subnet['Name'].'-out'); 44 47 45 $Range = CIDRToAddressRange($Subnet['AddressRange'], $Subnet['Mask']); 48 $NewAddress = new NetworkAddressIPv4(); 49 $NewAddress->AddressFromString($Subnet['AddressRange']); 50 $NewAddress->Prefix = $Subnet['Mask']; 51 $Range = $NewAddress->GetRange(); 46 52 if($Subnet['Mask'] != 32) $Range = $Range['From'].'-'.$Range['To']; 47 53 else $Range = $Range['From']; -
trunk/system/generators/netwatch_import.php
r273 r275 17 17 foreach($List as $Properties) 18 18 { 19 if(IsAddressInSubnet($Properties['host'], $Subnet['AddressRange'], $Subnet['Mask'])) 19 $NewAddress = new NetworkAddressIPv4(); 20 $NewAddress->AddressFromString($Subnet['AddressRange']); 21 $NewAddress->Prefix = $Subnet['Mask']; 22 if($NewAddress->Contain($Properties['host'])) 20 23 { 21 24 //echo($Properties['host'].', ');
Note:
See TracChangeset
for help on using the changeset viewer.