1 |
c9f0b1c2
|
Ermal Luçi
|
<?php
|
2 |
|
|
/* $Id$ */
|
3 |
|
|
/*
|
4 |
a368a026
|
Ermal Lu?i
|
firewall_shaper_wizards.php
|
5 |
c9f0b1c2
|
Ermal Luçi
|
*/
|
6 |
fd9ebcd5
|
Stephen Beaver
|
/* ====================================================================
|
7 |
|
|
* Copyright (c) 2004-2015 Electric Sheep Fencing, LLC. All rights reserved.
|
8 |
|
|
* Copyright (c) 2004, 2005 Scott Ullrich
|
9 |
|
|
* Copyright (c) 2008 Ermal Luçi
|
10 |
|
|
*
|
11 |
|
|
* Redistribution and use in source and binary forms, with or without modification,
|
12 |
|
|
* are permitted provided that the following conditions are met:
|
13 |
|
|
*
|
14 |
|
|
* 1. Redistributions of source code must retain the above copyright notice,
|
15 |
|
|
* this list of conditions and the following disclaimer.
|
16 |
|
|
*
|
17 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
18 |
|
|
* notice, this list of conditions and the following disclaimer in
|
19 |
|
|
* the documentation and/or other materials provided with the
|
20 |
|
|
* distribution.
|
21 |
|
|
*
|
22 |
|
|
* 3. All advertising materials mentioning features or use of this software
|
23 |
|
|
* must display the following acknowledgment:
|
24 |
|
|
* "This product includes software developed by the pfSense Project
|
25 |
|
|
* for use in the pfSense software distribution. (http://www.pfsense.org/).
|
26 |
|
|
*
|
27 |
|
|
* 4. The names "pfSense" and "pfSense Project" must not be used to
|
28 |
|
|
* endorse or promote products derived from this software without
|
29 |
|
|
* prior written permission. For written permission, please contact
|
30 |
|
|
* coreteam@pfsense.org.
|
31 |
|
|
*
|
32 |
|
|
* 5. Products derived from this software may not be called "pfSense"
|
33 |
|
|
* nor may "pfSense" appear in their names without prior written
|
34 |
|
|
* permission of the Electric Sheep Fencing, LLC.
|
35 |
|
|
*
|
36 |
|
|
* 6. Redistributions of any form whatsoever must retain the following
|
37 |
|
|
* acknowledgment:
|
38 |
|
|
*
|
39 |
|
|
* "This product includes software developed by the pfSense Project
|
40 |
|
|
* for use in the pfSense software distribution (http://www.pfsense.org/).
|
41 |
|
|
*
|
42 |
|
|
* THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
|
43 |
|
|
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
44 |
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
45 |
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
|
46 |
|
|
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
47 |
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
48 |
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
49 |
|
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
50 |
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
51 |
|
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
52 |
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
53 |
|
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
54 |
|
|
*
|
55 |
|
|
* ====================================================================
|
56 |
|
|
*
|
57 |
|
|
*/
|
58 |
7ac5a4cb
|
Scott Ullrich
|
/*
|
59 |
|
|
pfSense_BUILDER_BINARIES: /usr/bin/killall
|
60 |
d7770192
|
sbeaver
|
pfSense_MODULE: shaper
|
61 |
7ac5a4cb
|
Scott Ullrich
|
*/
|
62 |
c9f0b1c2
|
Ermal Luçi
|
|
63 |
6b07c15a
|
Matthew Grooms
|
##|+PRIV
|
64 |
|
|
##|*IDENT=page-firewall-trafficshaper-wizard
|
65 |
|
|
##|*NAME=Firewall: Traffic Shaper: Wizard page
|
66 |
|
|
##|*DESCR=Allow access to the 'Firewall: Traffic Shaper: Wizard' page.
|
67 |
|
|
##|*MATCH=firewall_shaper_wizards.php*
|
68 |
|
|
##|-PRIV
|
69 |
|
|
|
70 |
c9f0b1c2
|
Ermal Luçi
|
require("guiconfig.inc");
|
71 |
7a927e67
|
Scott Ullrich
|
require_once("functions.inc");
|
72 |
|
|
require_once("filter.inc");
|
73 |
|
|
require_once("shaper.inc");
|
74 |
71802285
|
Renato Botelho
|
require_once("util.inc");
|
75 |
c9f0b1c2
|
Ermal Luçi
|
|
76 |
d7770192
|
sbeaver
|
if($_GET['reset'] != "") {
|
77 |
71802285
|
Renato Botelho
|
sigkillbyname('pfctl', SIGKILL);
|
78 |
c9f0b1c2
|
Ermal Luçi
|
exit;
|
79 |
|
|
}
|
80 |
|
|
|
81 |
96b777d6
|
Ermal Luçi
|
if ($_POST['apply']) {
|
82 |
ba782be2
|
Renato Botelho
|
write_config();
|
83 |
|
|
|
84 |
|
|
$retval = 0;
|
85 |
|
|
/* Setup pf rules since the user may have changed the optimization value */
|
86 |
|
|
$retval = filter_configure();
|
87 |
|
|
$savemsg = get_std_save_message($retval);
|
88 |
6aaec445
|
Phil Davis
|
if (stristr($retval, "error") <> true) {
|
89 |
ba782be2
|
Renato Botelho
|
$savemsg = get_std_save_message($retval);
|
90 |
6aaec445
|
Phil Davis
|
} else {
|
91 |
ba782be2
|
Renato Botelho
|
$savemsg = $retval;
|
92 |
6aaec445
|
Phil Davis
|
}
|
93 |
ba782be2
|
Renato Botelho
|
|
94 |
|
|
/* reset rrd queues */
|
95 |
71802285
|
Renato Botelho
|
unlink_if_exists("/var/db/rrd/*queuedrops.rrd");
|
96 |
|
|
unlink_if_exists("/var/db/rrd/*queues.rrd");
|
97 |
ba782be2
|
Renato Botelho
|
enable_rrd_graphing();
|
98 |
|
|
|
99 |
|
|
clear_subsystem_dirty('shaper');
|
100 |
96b777d6
|
Ermal Luçi
|
}
|
101 |
|
|
|
102 |
6c07db48
|
Phil Davis
|
$pgtitle = array(gettext("Firewall"), gettext("Traffic Shaper"), gettext("Wizards"));
|
103 |
b32dd0a6
|
jim-p
|
$shortcut_section = "trafficshaper";
|
104 |
c9f0b1c2
|
Ermal Luçi
|
|
105 |
ba782be2
|
Renato Botelho
|
$wizards = array(
|
106 |
|
|
gettext("Multiple Lan/Wan") => "traffic_shaper_wizard_multi_all.xml",
|
107 |
|
|
gettext("Dedicated Links") => "traffic_shaper_wizard_dedicated.xml",
|
108 |
|
|
);
|
109 |
c9f0b1c2
|
Ermal Luçi
|
|
110 |
4271dfb8
|
Colin Fleming
|
$closehead = false;
|
111 |
c9f0b1c2
|
Ermal Luçi
|
include("head.inc");
|
112 |
|
|
|
113 |
d7770192
|
sbeaver
|
if ($input_errors)
|
114 |
|
|
print_input_errors($input_errors);
|
115 |
4271dfb8
|
Colin Fleming
|
|
116 |
d7770192
|
sbeaver
|
$tab_array = array();
|
117 |
|
|
$tab_array[] = array(gettext("By Interface"), false, "firewall_shaper.php");
|
118 |
|
|
$tab_array[] = array(gettext("By Queue"), false, "firewall_shaper_queues.php");
|
119 |
|
|
$tab_array[] = array(gettext("Limiter"), false, "firewall_shaper_vinterface.php");
|
120 |
|
|
$tab_array[] = array(gettext("Layer7"), false, "firewall_shaper_layer7.php");
|
121 |
|
|
$tab_array[] = array(gettext("Wizards"), true, "firewall_shaper_wizards.php");
|
122 |
|
|
display_top_tabs($tab_array);
|
123 |
c9f0b1c2
|
Ermal Luçi
|
|
124 |
d7770192
|
sbeaver
|
if ($savemsg)
|
125 |
|
|
print_info_box($savemsg, 'success');
|
126 |
|
|
|
127 |
|
|
if (is_subsystem_dirty('shaper'))
|
128 |
|
|
print_info_box_np(gettext("The traffic shaper configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
|
129 |
c9f0b1c2
|
Ermal Luçi
|
|
130 |
ba782be2
|
Renato Botelho
|
?>
|
131 |
d7770192
|
sbeaver
|
<div class="panel panel-default">
|
132 |
f17594c7
|
Sjon Hortensius
|
<div class="panel-heading"><h2 class="panel-title"><?=gettext('Traffic Shaper Wizards')?></h2></div>
|
133 |
d7770192
|
sbeaver
|
<div class="panel-body">
|
134 |
|
|
<dl class="dl-horizontal responsive">
|
135 |
ba782be2
|
Renato Botelho
|
<?php
|
136 |
d7770192
|
sbeaver
|
foreach ($wizards as $key => $wizard):
|
137 |
ba782be2
|
Renato Botelho
|
?>
|
138 |
d7770192
|
sbeaver
|
<dt>
|
139 |
|
|
<?=$key?>
|
140 |
|
|
</dt>
|
141 |
|
|
<dd>
|
142 |
|
|
<?='<a href="wizard.php?xml=' . $wizard . '">' . $wizard . '</a>'?>
|
143 |
|
|
</dd>
|
144 |
ba782be2
|
Renato Botelho
|
<?php
|
145 |
d7770192
|
sbeaver
|
endforeach;
|
146 |
ba782be2
|
Renato Botelho
|
?>
|
147 |
d7770192
|
sbeaver
|
</dl>
|
148 |
|
|
</div>
|
149 |
|
|
</div>
|
150 |
ba782be2
|
Renato Botelho
|
<?php
|
151 |
d7770192
|
sbeaver
|
include("foot.inc");
|