Ignore:
Timestamp:
Apr 14, 2015, 10:20:16 PM (10 years ago)
Author:
chronos
Message:
  • Removed: Spaces on end of line.
  • Modified: Tabs converted to spaces.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/NetworkConfigRouterOS/Generators/FirewallMangle.php

    r735 r738  
    3030  $NewAddress->AddressFromString($Subnet['AddressRange']);
    3131  $NewAddress->Prefix = $Subnet['Mask'];
    32   InsertToAddressTree($AddressTree, $NewAddress, 'subnet-'.RouterOSIdent($Subnet['Name'])); 
     32  InsertToAddressTree($AddressTree, $NewAddress, 'subnet-'.RouterOSIdent($Subnet['Name']));
    3333}
    3434
     
    5858    }
    5959  }
    60  
     60
    6161  $DbResult2 = $System->Database->select('NetworkSubnet', '*', '`Member`='.$Member['Id']);
    6262  while($Subnet = $DbResult2->fetch_assoc())
     
    8080{
    8181  global $InetInterface, $ItemsFirewall;
    82  
     82
    8383  foreach($Node['Items'] as $Index => $Item)
    8484  {
     
    8989      $Address = $Item['Address']->AddressToString();
    9090      if($Item['Address']->Prefix != 32) $Address .= '/'.$Item['Address']->Prefix;
    91      
     91
    9292      $PacketMark = GetMarkByComment($Item['Name'].'-out');
    9393      $ItemsFirewall[] = array('chain' => 'inet-'.$ParentSubnetId.'-out', 'src-address' => $Address, 'out-interface' =>  $InetInterface, 'action' => 'mark-packet', 'new-packet-mark' => $PacketMark, 'passthrough' => 'no', 'comment' => $Item['Name'].'-out');
     
    100100      $SubnetId = GetSubgroupByRange($Item['Address']->AddressToString().'/'.$Item['Address']->Prefix);
    101101      $PacketMark = GetMarkByComment($Item['Name'].'-out');
    102      
     102
    103103      $Address = $Item['Address']->AddressToString();
    104104      if($Item['Address']->Prefix != 32) $Address .= '/'.$Item['Address']->Prefix;
    105      
    106       $ItemsFirewall[] = array('chain' => 'inet-'.$ParentSubnetId.'-out', 'src-address' => $Address, 'out-interface' => $InetInterface, 'action' => 'jump', 'jump-target' => 'inet-'.$SubnetId.'-out', 'comment' => $Item['Name'].'-out');   
    107       $ItemsFirewall[] = array('chain' => 'inet-'.$ParentSubnetId.'-in', 'dst-address' => $Address, 'in-interface' => $InetInterface, 'action' => 'jump', 'jump-target' => 'inet-'.$SubnetId.'-in', 'comment' => $Item['Name'].'-in');   
    108      
    109       ProcessNode($Item);     
    110     }   
     105
     106      $ItemsFirewall[] = array('chain' => 'inet-'.$ParentSubnetId.'-out', 'src-address' => $Address, 'out-interface' => $InetInterface, 'action' => 'jump', 'jump-target' => 'inet-'.$SubnetId.'-out', 'comment' => $Item['Name'].'-out');
     107      $ItemsFirewall[] = array('chain' => 'inet-'.$ParentSubnetId.'-in', 'dst-address' => $Address, 'in-interface' => $InetInterface, 'action' => 'jump', 'jump-target' => 'inet-'.$SubnetId.'-in', 'comment' => $Item['Name'].'-in');
     108
     109      ProcessNode($Item);
     110    }
    111111  }
    112112  if($Node['ForceMark'] == true)
     
    133133// Slow free internet
    134134$PacketMark = GetMarkByComment('free-out');
    135 $ItemsFirewall[] = array('chain' => 'inet-1-out', 'out-interface' => $InetInterface, 
     135$ItemsFirewall[] = array('chain' => 'inet-1-out', 'out-interface' => $InetInterface,
    136136  'action' => 'mark-packet', 'new-packet-mark' => $PacketMark, 'comment' => 'free-out', 'passthrough' => 'yes');
    137137$PacketMark = GetMarkByComment('free-in');
    138 $ItemsFirewall[] = array('chain' => 'inet-1-in', 'in-interface' => $InetInterface, 
    139         'action' => 'mark-packet', 'new-packet-mark' => $PacketMark, 'comment' => 'free-in', 'passthrough' => 'no');
     138$ItemsFirewall[] = array('chain' => 'inet-1-in', 'in-interface' => $InetInterface,
     139  'action' => 'mark-packet', 'new-packet-mark' => $PacketMark, 'comment' => 'free-in', 'passthrough' => 'no');
    140140// Unregistred clients add to address list
    141 $ItemsFirewall[] = array('chain' => 'inet-1-out', 'out-interface' => $InetInterface, 'src-address' => '10.145.0.0/16', 
    142         'action' => 'add-src-to-address-list', 'address-list' => 'unregistred', 'timeout' => '1d',
    143         'comment' => 'unregistred-clients');
     141$ItemsFirewall[] = array('chain' => 'inet-1-out', 'out-interface' => $InetInterface, 'src-address' => '10.145.0.0/16',
     142  'action' => 'add-src-to-address-list', 'address-list' => 'unregistred', 'timeout' => '1d',
     143  'comment' => 'unregistred-clients');
    144144
    145145//print_r($ItemsFirewall);
Note: See TracChangeset for help on using the changeset viewer.