Ignore:
Timestamp:
Dec 29, 2011, 10:07:45 PM (13 years ago)
Author:
chronos
Message:
  • Opraveno: Při generování značkování paketů pro řízení rychlosti se negenrovaly jednotlivé počítače uvnitř podsítě přiřazené některému členovi.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/system/generators/firewall_mangle.php

    r317 r334  
    2020
    2121// Generate address tree
    22 $AddressTree = array('Address' => new NetworkAddressIPv4(), 'Name' => 'main', 'Items' => array());
     22$AddressTree = array('Address' => new NetworkAddressIPv4(), 'Name' => 'main', 'Items' => array(), 'ForceMark' => false);
    2323
    2424// Divide rules by subnet number
     
    8080  foreach($Node['Items'] as $Index => $Item)
    8181  {
    82     if((count($Item['Items']) == 0) or ($Item['ForceMark'] == true))
     82    if(count($Item['Items']) == 0)
    8383    {
    8484      // Hosts
     
    107107    }   
    108108  }
     109  if($Node['ForceMark'] == true)
     110  {
     111    // Mark member subnets
     112    $ParentSubnetId = GetSubgroupByRange($Node['Address']->AddressToString().'/'.$Node['Address']->Prefix);
     113
     114    $PacketMark = GetMarkByComment($Node['Name'].'-out');
     115    $ItemsFirewall[] = array('chain' => 'inet-'.$ParentSubnetId.'-out', 'src-address' => $Address, 'out-interface' =>  $InetInterface, 'action' => 'mark-packet', 'new-packet-mark' => $PacketMark, 'passthrough' => 'no', 'comment' => $Node['Name'].'-all-out');
     116    $PacketMark = GetMarkByComment($Node['Name'].'-in');
     117    $ItemsFirewall[] = array('chain' => 'inet-'.$ParentSubnetId.'-in', 'dst-address' => $Address, 'in-interface' => $InetInterface, 'action' => 'mark-packet', 'new-packet-mark' => $PacketMark, 'passthrough' => 'no', 'comment' => $Node['Name'].'-all-in');
     118  }
    109119}
    110120
Note: See TracChangeset for help on using the changeset viewer.