Changeset 555 for trunk/Modules/NetworkConfigRouterOS/Generators/Queue.php
- Timestamp:
- Jul 8, 2013, 12:55:56 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigRouterOS/Generators/Queue.php
r554 r555 15 15 $Routerboard->HostName = $Config['MainRouter']['HostName']; 16 16 $Routerboard->Debug = true; 17 18 $UsedNames = array(); 19 20 function CheckName($Name) 21 { 22 global $UsedNames; 23 24 if(in_array($Name, $UsedNames)) die("\n".'Duplicate name: '.$Name); 25 else $UsedNames[] = $Name; 26 } 17 27 18 28 $Finance = &$System->Modules['Finance']; … … 72 82 $UserMaxSpeedIn = round($Service['InternetSpeedMax'] / $InDivider) * 1000; 73 83 $UserMaxSpeedOut = round($Service['InternetSpeedMax'] / $OutDivider) * 1000; 74 if($ServiceIndex == 1) 75 { 76 $ItemsQueue[] = array('name' => $MemberName.'-out', 'limit-at' => $SpeedIn, 'max-limit' => $UserMaxSpeedIn, 'parent' => 'main-out'); 77 $ItemsQueue[] = array('name' => $MemberName.'-in', 'limit-at' => $SpeedOut, 'max-limit' => $UserMaxSpeedOut, 'parent' => 'main-in'); 78 } 84 $ItemsQueue[] = array('name' => $MemberName.'-out', 'limit-at' => $SpeedIn, 'max-limit' => $UserMaxSpeedIn, 'parent' => 'main-out'); 85 $ItemsQueue[] = array('name' => $MemberName.'-in', 'limit-at' => $SpeedOut, 'max-limit' => $UserMaxSpeedOut, 'parent' => 'main-in'); 86 CheckName($MemberName.'-out'); 87 CheckName($MemberName.'-in'); 79 88 80 89 $Filter = '(`Used` = 1) AND (`Service` = '.$Service['RelId'].')'; … … 108 117 $PacketMark = GetMarkByComment($Name.'-in'); 109 118 $ItemsQueue[] = array('name' => $Name.'-in', 'limit-at' => $HostSpeedOut, 'max-limit' => $UserMaxSpeedOut, 'parent' => $MemberName.'-in', 'packet-mark' => $PacketMark); 119 CheckName($Name.'-out'); 120 CheckName($Name.'-in'); 110 121 } 111 122 } … … 122 133 $PacketMark = GetMarkByComment($Subnet['Name'].'-in'); 123 134 $ItemsQueue[] = array('name' => $Subnet['Name'].'-in', 'limit-at' => $HostSpeedOut, 'max-limit' => $UserMaxSpeedOut, 'parent' => $MemberName.'-in', 'packet-mark' => $PacketMark); 135 CheckName($Subnet['Name'].'-out'); 136 CheckName($Subnet['Name'].'-in'); 124 137 } 125 138 echo("\n"); 139 $ServiceIndex++; 126 140 } 127 141 }
Note:
See TracChangeset
for help on using the changeset viewer.