Changeset 288 for trunk/system
- Timestamp:
- Sep 9, 2010, 7:29:41 PM (14 years ago)
- Location:
- trunk/system/generators
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/generators/common.php
r267 r288 35 35 } 36 36 37 function InsertToAddressTree(&$Tree, $Address, $Name, $InterSubnets = false )37 function InsertToAddressTree(&$Tree, $Address, $Name, $InterSubnets = false, $ForceMark = false) 38 38 { 39 39 global $Config; … … 57 57 $NewAddress->ChangePrefix($Tree['Address']->Prefix + 1); 58 58 //echo('InsertToTree('.$NewAddress->AddressToString().'/'.$NewAddress->Prefix.')'."\n"); 59 $Tree['Items'][] = array('Address' => $NewAddress, 'Name' => $Name, 'Items' => array() );59 $Tree['Items'][] = array('Address' => $NewAddress, 'Name' => $Name, 'Items' => array(), 'ForceMark' => false); 60 60 InsertToAddressTree($Tree['Items'][count($Tree['Items']) - 1], $Address, $Name, true); 61 61 } else 62 62 { 63 63 64 $NewNode = array('Address' => $Address, 'Name' => $Name, 'Items' => array() );64 $NewNode = array('Address' => $Address, 'Name' => $Name, 'Items' => array(), 'ForceMark' => $ForceMark); 65 65 66 66 // Should be existed items placed under new node? -
trunk/system/generators/dns.php
r273 r288 114 114 'Host' => array(), 115 115 'Alias' => array(), 116 'Network' => array('10.145.64', '10.145.65', '10.145.66', '10.145.67', ' 77.92.221'),116 'Network' => array('10.145.64', '10.145.65', '10.145.66', '10.145.67', '10.145.68', '10.145.69', '10.145.70', '10.145.71', '77.92.221', '172.16.0', '172.16.1'), 117 117 ); 118 118 -
trunk/system/generators/firewall_mangle.php
r280 r288 64 64 $NewAddress->AddressFromString($Subnet['AddressRange']); 65 65 $NewAddress->Prefix = $Subnet['Mask']; 66 InsertToAddressTree($AddressTree, $NewAddress, $Subnet['Name']); 66 if($Subnet['Member'] != 0) $ForceMark = true; 67 else $ForceMark = false; 68 echo($ForceMark.', '); 69 InsertToAddressTree($AddressTree, $NewAddress, $Subnet['Name'], false, $ForceMark); 67 70 } 68 71 echo("\n"); … … 77 80 foreach($Node['Items'] as $Index => $Item) 78 81 { 79 if( count($Item['Items']) == 0)82 if((count($Item['Items']) == 0) or ($Item['ForceMark'] == true)) 80 83 { 81 84 // Hosts -
trunk/system/generators/firewall_nat.php
r280 r288 15 15 16 16 $Items = array(); 17 // NTP redirect 18 $Items[] = array('chain' => 'srcnat', 'src-address' => '10.145.66.1', 'protocol' => 'udp', 'src-port' => 123, 'action' => 'src-nat', 'to-addresses' => '10.145.64.1', 'comment' => 'NTP_redirect_4'); 19 $Items[] = array('chain' => 'srcnat', 'src-address' => '10.145.66.161', 'protocol' => 'udp', 'src-port' => 123, 'action' => 'src-nat', 'to-addresses' => '10.145.64.1', 'comment' => 'NTP_redirect_5'); 20 $Items[] = array('chain' => 'srcnat', 'src-address' => '10.145.66.193', 'protocol' => 'udp', 'src-port' => 123, 'action' => 'src-nat', 'to-addresses' => '10.145.64.1', 'comment' => 'NTP_redirect_1'); 21 $Items[] = array('chain' => 'srcnat', 'src-address' => '10.145.66.225', 'protocol' => 'udp', 'src-port' => 123, 'action' => 'src-nat', 'to-addresses' => '10.145.64.1', 'comment' => 'NTP_redirect_2'); 22 $Items[] = array('chain' => 'srcnat', 'src-address' => '10.145.66.250', 'protocol' => 'udp', 'src-port' => 123, 'action' => 'src-nat', 'to-addresses' => '10.145.64.1', 'comment' => 'NTP_redirect_3'); 23 $Items[] = array('chain' => 'srcnat', 'src-address' => '10.145.66.253', 'protocol' => 'udp', 'src-port' => 123, 'action' => 'src-nat', 'to-addresses' => '10.145.64.1', 'comment' => 'NTP_redirect_6'); 24 17 25 // Chain for inet interface 18 26 $Items[] = array('chain' => 'srcnat', 'out-interface' => $InetInterface, 'action' => 'jump', 'jump-target' => 'inet-out', 'comment' => 'inet-out'); … … 75 83 76 84 //print_r($Items); 77 $Routerboard->ListUpdate($Path, array('chain', 'dst-address', 'in-interface', 'src-address', 'out-interface', 'to-ports', 'dst-port', 'protocol', 'action', 'to-addresses', 'comment', 'jump-target' ), $Items);85 $Routerboard->ListUpdate($Path, array('chain', 'dst-address', 'in-interface', 'src-address', 'out-interface', 'to-ports', 'dst-port', 'protocol', 'action', 'to-addresses', 'comment', 'jump-target', 'src-port'), $Items); 78 86 79 87 ?>
Note:
See TracChangeset
for help on using the changeset viewer.