Changeset 334


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.
Location:
trunk/system/generators
Files:
2 edited

Legend:

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

    r301 r334  
    2020  $DbResult2 = $Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM `NetworkInterface` LEFT JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE '.
    2121  ' CompareNetworkPrefix(INET_ATON(LocalIP), INET_ATON("'.$Subnet['AddressRange'].'"), '.$Subnet['Mask'].') AND (`MAC` != "00:00:00:00:00:00") ORDER BY `LocalIP`');
    22   echo($Database->error);
     22  //echo($Database->error);
    2323  while($Interface = $DbResult2->fetch_assoc())
    2424  {
  • 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.