1
|
<?php
|
2
|
/* $Id$ */
|
3
|
/*
|
4
|
firewall_shaper_wizards.php
|
5
|
Copyright (C) 2004, 2005 Scott Ullrich
|
6
|
Copyright (C) 2008 Ermal Luçi
|
7
|
Copyright (C) 2013-2015 Electric Sheep Fencing, LP
|
8
|
All rights reserved.
|
9
|
|
10
|
Redistribution and use in source and binary forms, with or without
|
11
|
modification, are permitted provided that the following conditions are met:
|
12
|
|
13
|
1. Redistributions of source code must retain the above copyright notice,
|
14
|
this list of conditions and the following disclaimer.
|
15
|
|
16
|
2. Redistributions in binary form must reproduce the above copyright
|
17
|
notice, this list of conditions and the following disclaimer in the
|
18
|
documentation and/or other materials provided with the distribution.
|
19
|
|
20
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
21
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
22
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
23
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
24
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
25
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
26
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
27
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
28
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
29
|
POSSIBILITY OF SUCH DAMAGE.
|
30
|
*/
|
31
|
/*
|
32
|
pfSense_BUILDER_BINARIES: /usr/bin/killall
|
33
|
pfSense_MODULE: shaper
|
34
|
*/
|
35
|
|
36
|
##|+PRIV
|
37
|
##|*IDENT=page-firewall-trafficshaper-wizard
|
38
|
##|*NAME=Firewall: Traffic Shaper: Wizard page
|
39
|
##|*DESCR=Allow access to the 'Firewall: Traffic Shaper: Wizard' page.
|
40
|
##|*MATCH=firewall_shaper_wizards.php*
|
41
|
##|-PRIV
|
42
|
|
43
|
require("guiconfig.inc");
|
44
|
require_once("functions.inc");
|
45
|
require_once("filter.inc");
|
46
|
require_once("shaper.inc");
|
47
|
require_once("util.inc");
|
48
|
|
49
|
if($_GET['reset'] != "") {
|
50
|
sigkillbyname('pfctl', SIGKILL);
|
51
|
exit;
|
52
|
}
|
53
|
|
54
|
if ($_POST['apply']) {
|
55
|
write_config();
|
56
|
|
57
|
$retval = 0;
|
58
|
/* Setup pf rules since the user may have changed the optimization value */
|
59
|
$retval = filter_configure();
|
60
|
$savemsg = get_std_save_message($retval);
|
61
|
if (stristr($retval, "error") != true)
|
62
|
$savemsg = get_std_save_message($retval);
|
63
|
else
|
64
|
$savemsg = $retval;
|
65
|
|
66
|
/* reset rrd queues */
|
67
|
unlink_if_exists("/var/db/rrd/*queuedrops.rrd");
|
68
|
unlink_if_exists("/var/db/rrd/*queues.rrd");
|
69
|
enable_rrd_graphing();
|
70
|
|
71
|
clear_subsystem_dirty('shaper');
|
72
|
}
|
73
|
|
74
|
$pgtitle = array(gettext("Firewall"),gettext("Traffic Shaper"),gettext("Wizards"));
|
75
|
$shortcut_section = "trafficshaper";
|
76
|
|
77
|
$wizards = array(
|
78
|
gettext("Multiple Lan/Wan") => "traffic_shaper_wizard_multi_all.xml",
|
79
|
gettext("Dedicated Links") => "traffic_shaper_wizard_dedicated.xml",
|
80
|
);
|
81
|
|
82
|
$closehead = false;
|
83
|
include("head.inc");
|
84
|
|
85
|
if ($input_errors)
|
86
|
print_input_errors($input_errors);
|
87
|
|
88
|
$tab_array = array();
|
89
|
$tab_array[] = array(gettext("By Interface"), false, "firewall_shaper.php");
|
90
|
$tab_array[] = array(gettext("By Queue"), false, "firewall_shaper_queues.php");
|
91
|
$tab_array[] = array(gettext("Limiter"), false, "firewall_shaper_vinterface.php");
|
92
|
$tab_array[] = array(gettext("Layer7"), false, "firewall_shaper_layer7.php");
|
93
|
$tab_array[] = array(gettext("Wizards"), true, "firewall_shaper_wizards.php");
|
94
|
display_top_tabs($tab_array);
|
95
|
|
96
|
if ($savemsg)
|
97
|
print_info_box($savemsg, 'success');
|
98
|
|
99
|
if (is_subsystem_dirty('shaper'))
|
100
|
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."));
|
101
|
|
102
|
?>
|
103
|
<div class="panel panel-default">
|
104
|
<div class="panel-heading"><h2 class="panel-title"><?=gettext('Traffic Shaper Wizards')?></h2></div>
|
105
|
<div class="panel-body">
|
106
|
<dl class="dl-horizontal responsive">
|
107
|
<?php
|
108
|
foreach ($wizards as $key => $wizard):
|
109
|
?>
|
110
|
<dt>
|
111
|
<?=$key?>
|
112
|
</dt>
|
113
|
<dd>
|
114
|
<?='<a href="wizard.php?xml=' . $wizard . '">' . $wizard . '</a>'?>
|
115
|
</dd>
|
116
|
<?php
|
117
|
endforeach;
|
118
|
?>
|
119
|
</dl>
|
120
|
</div>
|
121
|
</div>
|
122
|
<?php
|
123
|
include("foot.inc");
|