<?php
require_once "config.php";

global $DB;
$data_t = $DB->selectPage($totalCount,"SELECT * FROM packets ORDER BY id");
foreach($data_t as $data_k=>$data_v)
{
echo "/sbin/ipfw -q pipe ".($data_v[id]+2050)." config bw ".$data_v[speed_down]."Kbit/s mask dst-ip 0xffffffff \n";
echo "/sbin/ipfw -q pipe ".($data_v[id]+2250)." config bw ".$data_v[speed_up]."Kbit/s mask src-ip 0xffffffff \n";
echo "/sbin/ipfw -q add ".($data_v[id]+3000)." pipe ".($data_v[id]+2050)." all from any to 'table(".($data_v[id]+26).")' out \n";
echo "/sbin/ipfw -q add ".($data_v[id]+3000)." pipe ".($data_v[id]+2250)." all from 'table(".($data_v[id]+26).")' to any in \n";
}
?>
