diff options
author | Ermal <eri@pfsense.org> | 2010-04-20 18:32:59 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-04-20 18:32:59 +0000 |
commit | 1dbe445acc2b74c4a610e397c0c15031d99666e5 (patch) | |
tree | dc3b2f6fd668a6180fb8a009c9200e92cf6423c2 /usr/local/www/services_captiveportal_ip_edit.php | |
parent | 0d388969180882e133f0ec062b8da7cb9d969896 (diff) | |
download | pfsense-1dbe445acc2b74c4a610e397c0c15031d99666e5.zip pfsense-1dbe445acc2b74c4a610e397c0c15031d99666e5.tar.gz |
Use tables of ipfw for passthrough mac entries. This makes it scale way better than previously. Fix multiple entries on adding mac through entries automatically after login for the same user. The changes allow even pass through mac to be controlled from the Status->Captiveportal. Use serialize/unserialize on some files that keep temporary information to speed up calculations. Really allow mac passthrough to follow radius rules or time out rules when present.
Diffstat (limited to 'usr/local/www/services_captiveportal_ip_edit.php')
-rwxr-xr-x | usr/local/www/services_captiveportal_ip_edit.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/usr/local/www/services_captiveportal_ip_edit.php b/usr/local/www/services_captiveportal_ip_edit.php index 4e1b661..977ba9f 100755 --- a/usr/local/www/services_captiveportal_ip_edit.php +++ b/usr/local/www/services_captiveportal_ip_edit.php @@ -118,7 +118,21 @@ if ($_POST) { write_config(); if (isset($config['captiveportal']['enable'])) { - mwexec("/sbin/ipfw table 1 add " . $ip['ip']); + $bwup = ""; + $bwdown = ""; + $ruleno = captiveportal_get_next_ipfw_ruleno(); + if (!empty($ip['bw_up'])) { + $pipeno = $ruleno + 20000; + mwexec("/sbin/ipfw pipe {$pipeno} config bw {$ip['bw_up']}Kbit/s queue 100") + $bwup = "pipe {$pipeno}"; + } + if (!empty($ip['bw_down'])) { + $pipeno = $ruleno + 20001; + mwexec("/sbin/ipfw pipe {$pipeno} config bw {$ip['bw_down']}Kbit/s queue 100") + $bwdown = "pipe {$pipeno}"; + } + mwexec("/sbin/ipfw table 1 add {$ip['ip']} {$bwup}"); + mwexec("/sbin/ipfw table 2 add {$ip['ip']} {$bwdown}"); } header("Location: services_captiveportal_ip.php"); |