Changeset 276
- Timestamp:
- Jan 24, 2010, 9:21:28 AM (15 years ago)
- Location:
- trunk/system/generators
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/generators/firewall_nat.php
r275 r276 4 4 include('../../global.php'); 5 5 include('../routerboard.php'); 6 include('common.php'); 6 7 $Path = array('ip', 'firewall', 'nat'); 7 8 … … 40 41 $NewAddress->Prefix = $Subnet['ExtMask']; 41 42 $Range = $NewAddress->GetRange(); 42 if($Subnet['ExtMask'] != 32) $Range = $Range['From'] .'-'.$Range['To'];43 else $Range = $Range['From'] ;43 if($Subnet['ExtMask'] != 32) $Range = $Range['From']->AddressToStrin().'-'.$Range['To']->AddressToString(); 44 else $Range = $Range['From']->AddressToString(); 44 45 if($Subnet['Mask'] == 32) $Src = $Subnet['AddressRange']; 45 46 else $Src = $Subnet['AddressRange'].'/'.$Subnet['Mask']; … … 50 51 $NewAddress->Prefix = $Subnet['Mask']; 51 52 $Range = $NewAddress->GetRange(); 52 if($Subnet['Mask'] != 32) $Range = $Range['From'] .'-'.$Range['To'];53 else $Range = $Range['From'] ;53 if($Subnet['Mask'] != 32) $Range = $Range['From']->AddressToString().'-'.$Range['To']->AddressToString(); 54 else $Range = $Range['From']->AddressToString(); 54 55 if($Subnet['ExtMask'] == 32) $Dest = $Subnet['ExtAddressRange']; 55 56 else $Dest = $Subnet['ExtAddressRange'].'/'.$Subnet['ExtMask']; … … 65 66 $Items[] = array('chain' => 'dstnat', 'dst-address' => '212.111.4.174', 'protocol' => 'udp', 'dst-port' => 53, 'in-interface' => $InetInterface, 'action' => 'dst-nat', 'to-addresses' => '10.145.64.8', 'to-ports' => 53, 'comment' => 'DNS_redirection_UDP'); 66 67 68 //print_r($Items); 67 69 $Routerboard->ListUpdate($Path, array('chain', 'dst-address', 'in-interface', 'src-address', 'out-interface', 'to-ports', 'dst-port', 'protocol', 'action', 'to-addresses', 'comment'), $Items); 68 70 -
trunk/system/generators/netwatch_import.php
r275 r276 4 4 include('../../global.php'); 5 5 include('../routerboard.php'); 6 include('common.php'); 6 7 $Path = array('tool', 'netwatch'); 7 8 … … 17 18 foreach($List as $Properties) 18 19 { 19 $NewAddress = new NetworkAddressIPv4(); 20 $NewAddress->AddressFromString($Subnet['AddressRange']); 21 $NewAddress->Prefix = $Subnet['Mask']; 22 if($NewAddress->Contain($Properties['host'])) 20 $SubnetAddress = new NetworkAddressIPv4(); 21 $SubnetAddress->AddressFromString($Subnet['AddressRange']); 22 $SubnetAddress->Prefix = $Subnet['Mask']; 23 $Address = new NetworkAddressIPv4(); 24 $Address->AddressFromString($Properties['host']); 25 $Address->Prefix = 32; 26 if($SubnetAddress->Contain($Address)) 23 27 { 24 28 //echo($Properties['host'].', ');
Note:
See TracChangeset
for help on using the changeset viewer.