Changeset 892
- Timestamp:
- Dec 31, 2020, 11:47:45 AM (4 years ago)
- Location:
- trunk/Modules/NetworkConfigRouterOS/Generators
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigRouterOS/Generators/Common.php
r874 r892 1 1 <?php 2 2 3 function GetMarkByComment( $Comment)3 function GetMarkByComment(string $Comment): int 4 4 { 5 5 global $Database; … … 17 17 } 18 18 19 function GetSubgroupByRange( $AddressRange)19 function GetSubgroupByRange(string $AddressRange): int 20 20 { 21 21 global $Database; … … 33 33 } 34 34 35 function InsertToAddressTreeIPv4( &$Tree, $Address, $Name, $InterSubnets = false,$ForceMark = false)35 function InsertToAddressTreeIPv4(array &$Tree, NetworkAddressIPv4 $Address, string $Name, bool $InterSubnets = false, bool $ForceMark = false) 36 36 { 37 37 global $Config; … … 78 78 } 79 79 80 function InsertToAddressTreeIPv6( &$Tree, $Address, $Name, $InterSubnets = false,$ForceMark = false)80 function InsertToAddressTreeIPv6(array &$Tree, NetworkAddressIPv6 $Address, string $Name, bool $InterSubnets = false, bool $ForceMark = false) 81 81 { 82 82 global $Config; … … 123 123 } 124 124 125 function ShowSubnetNode( $Node, $Indent = 0)125 function ShowSubnetNode(array $Node, int $Indent = 0): void 126 126 { 127 127 echo(str_repeat(' ', $Indent).$Node['Address']->AddressToString().'/'.$Node['Address']->Prefix.' '.$Node['Name']."\n"); -
trunk/Modules/NetworkConfigRouterOS/Generators/FirewallMangle.php
r887 r892 82 82 // Process users 83 83 $DbResult = $this->System->Database->query('SELECT `Member`.*, `Subject`.`Name` FROM `Member` '. 84 85 84 'LEFT JOIN `Subject` ON `Subject`.`Id` = `Member`.`Subject` '. 85 'WHERE `Member`.`Blocked` = 0'); 86 86 while ($Member = $DbResult->fetch_assoc()) 87 87 { … … 133 133 $this->ProcessNode($AddressTree); 134 134 135 // Limit direct input/output traffic to gateway 136 $PacketMark = GetMarkByComment('rt-gateway-3-out'); 137 $ItemsFirewall[] = array('chain' => 'output', 'out-interface' => $InetInterface, 'action' => 'mark-packet', 'new-packet-mark' => $PacketMark, 'comment' => 'local-out',); 138 $PacketMark = GetMarkByComment('rt-gateway-3-in'); 139 $ItemsFirewall[] = array('chain' => 'input', 'in-interface' => $InetInterface, 'action' => 'mark-packet', 'new-packet-mark' => $PacketMark, 'comment' => 'local-in',); 140 135 141 // Limited free internet 136 142 $PacketMark = GetMarkByComment('free-out');
Note:
See TracChangeset
for help on using the changeset viewer.