aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/per-user-bandwidth-distribution.xml55
-rw-r--r--pkg_config.xml12
2 files changed, 67 insertions, 0 deletions
diff --git a/packages/per-user-bandwidth-distribution.xml b/packages/per-user-bandwidth-distribution.xml
new file mode 100644
index 00000000..c58c8b00
--- /dev/null
+++ b/packages/per-user-bandwidth-distribution.xml
@@ -0,0 +1,55 @@
+<packagegui>
+ <name>per-user-bandwidth-distribution</name>
+ <version>1.0.1</version>
+ <title>Services: Per User Bandwidth</title>
+ <aftersaveredirect>pkg_edit.php?xml=per-user-bandwidth-distribution.xml&amp;id=0</aftersaveredirect>
+ <menu>
+ <name>Per User Bandwidth</name>
+ <tooltiptext>Enforce a fair use bandwidth policy</tooltiptext>
+ <section>Services</section>
+ <configfile>per-user-bandwidth-distribution.xml</configfile>
+ </menu>
+ <service>
+ <name>PerUserBandwidth</name>
+ <rcfile>per_user_bandwidth_distribution.sh</rcfile>
+ </service>
+ <configpath>installedpackages->package->$packagename->configuration->settings</configpath>
+ <fields>
+ <field>
+ <fielddescr>Bandwidth</fielddescr>
+ <fieldname>bandwidth</fieldname>
+ <description>Enter the bandwidth you would like to distribute:</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>Bandwidth Type</fielddescr>
+ <fieldname>bandwidthtype</fieldname>
+ <type>select</type>
+ <options>
+ <option>
+ <value>Byte/s</value>
+ <name>Byte/s</name>
+ </option>
+ <option>
+ <value>KByte/s</value>
+ <name>KByte/s</name>
+ </option>
+ <option>
+ <value>MByte/s</value>
+ <name>MByte/s</name>
+ </option>
+ </options>
+ </field>
+ </fields>
+ <custom_add_php_command>
+ $fd = fopen("/usr/local/etc/rc.d/per_user_bandwidth_distribution.sh","w");
+ fwrite($fd, "/sbin/kldload dummynet");
+ fwrite($fd, "/sbin/ipfw add 10 pipe 1 ip from any to any out via {$wanif}");
+ fwrite($fd, "/sbin/ipfw add 10 pipe 2 ip from any to any in via {$wanif}");
+ fwrite($fd, "/sbin/ipfw add allow all from any to any");
+ fwrite($fd, "/sbin/ipfw pipe 1 config mask src-ip 0x000000ff bw {$_POST['bandwidth']}{$_POST['bandwidthtype']}");
+ fwrite($fd, "/sbin/ipfw pipe 2 config mask dst-ip 0x000000ff bw {$_POST['bandwidth']}{$_POST['bandwidthtype']}");
+ fclose($fd);
+ mwexec("chmod a+rx /usr/local/etc/rc.d/per_user_bandwidth_distribution.sh");
+ </custom_add_php_command>
+</packagegui>
diff --git a/pkg_config.xml b/pkg_config.xml
index 01133993..231d13e4 100644
--- a/pkg_config.xml
+++ b/pkg_config.xml
@@ -15,6 +15,18 @@
<configurationfile>pfstat.xml</configurationfile>
</package>
<package>
+ <name>BWDistribute</name>
+ <descr>Adds a per user bandwidth distribution option. Requires 0.76 or better.</descr>
+ <category>FTP</category>
+ <config_file>http://www.pfsense.com/packages/config/per-user-bandwidth-distribution.xml</config_file>
+ <version>0.1</version>
+ <status>ALPHA</status>
+ <configurationfile>per-user-bandwidth-distribution.xml</configurationfile>
+ <logging>
+ <facilityname>services</facilityname>
+ </logging>
+ </package>
+ <package>
<name>pure-ftpd</name>
<website>http://www.pureftpd.org/</website>
<descr>Pure FTPd Server is a fast, production quality, standards-conformant FTP server based on Troll-FTPd. It has no known vulnerabilities, is trivial to set up, and is especially designed for modern kernels. Features include PAM support, IPv6, chroot()ed home directories, virtual domains, built-in 'ls', FXP protocol, anti-warez system, bandwidth throttling, restricted ports for passive downloads, an LDAP backend, XML output, and more.</descr>