1 |
c9f0b1c2
|
Ermal Luçi
|
<?php
|
2 |
|
|
/* $Id$ */
|
3 |
|
|
/*
|
4 |
a368a026
|
Ermal Lu?i
|
firewall_shaper_wizards.php
|
5 |
c9f0b1c2
|
Ermal Luçi
|
Copyright (C) 2004, 2005 Scott Ullrich
|
6 |
1d7ba683
|
ayvis
|
Copyright (C) 2008 Ermal Luçi
|
7 |
dd447bde
|
Jim Thompson
|
Copyright (C) 2013-2014 Electric Sheep Fencing, LP
|
8 |
c9f0b1c2
|
Ermal Luçi
|
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 |
7ac5a4cb
|
Scott Ullrich
|
/*
|
32 |
|
|
pfSense_BUILDER_BINARIES: /usr/bin/killall
|
33 |
|
|
pfSense_MODULE: shaper
|
34 |
|
|
*/
|
35 |
c9f0b1c2
|
Ermal Luçi
|
|
36 |
6b07c15a
|
Matthew Grooms
|
##|+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 |
c9f0b1c2
|
Ermal Luçi
|
require("guiconfig.inc");
|
44 |
7a927e67
|
Scott Ullrich
|
require_once("functions.inc");
|
45 |
|
|
require_once("filter.inc");
|
46 |
|
|
require_once("shaper.inc");
|
47 |
71802285
|
Renato Botelho
|
require_once("util.inc");
|
48 |
c9f0b1c2
|
Ermal Luçi
|
|
49 |
|
|
if($_GET['reset'] <> "") {
|
50 |
71802285
|
Renato Botelho
|
sigkillbyname('pfctl', SIGKILL);
|
51 |
c9f0b1c2
|
Ermal Luçi
|
exit;
|
52 |
|
|
}
|
53 |
|
|
|
54 |
96b777d6
|
Ermal Luçi
|
if ($_POST['apply']) {
|
55 |
ba782be2
|
Renato Botelho
|
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 |
71802285
|
Renato Botelho
|
unlink_if_exists("/var/db/rrd/*queuedrops.rrd");
|
68 |
|
|
unlink_if_exists("/var/db/rrd/*queues.rrd");
|
69 |
ba782be2
|
Renato Botelho
|
enable_rrd_graphing();
|
70 |
|
|
|
71 |
|
|
clear_subsystem_dirty('shaper');
|
72 |
96b777d6
|
Ermal Luçi
|
}
|
73 |
|
|
|
74 |
9eae6681
|
Renato Botelho
|
$pgtitle = array(gettext("Firewall"),gettext("Traffic Shaper"),gettext("Wizards"));
|
75 |
b32dd0a6
|
jim-p
|
$shortcut_section = "trafficshaper";
|
76 |
c9f0b1c2
|
Ermal Luçi
|
|
77 |
ba782be2
|
Renato Botelho
|
$wizards = array(
|
78 |
|
|
gettext("Multiple Lan/Wan") => "traffic_shaper_wizard_multi_all.xml",
|
79 |
|
|
gettext("Dedicated Links") => "traffic_shaper_wizard_dedicated.xml",
|
80 |
|
|
);
|
81 |
c9f0b1c2
|
Ermal Luçi
|
|
82 |
4271dfb8
|
Colin Fleming
|
$closehead = false;
|
83 |
c9f0b1c2
|
Ermal Luçi
|
include("head.inc");
|
84 |
|
|
?>
|
85 |
4271dfb8
|
Colin Fleming
|
<link rel="stylesheet" type="text/css" media="all" href="./tree/tree.css" />
|
86 |
|
|
</head>
|
87 |
c9f0b1c2
|
Ermal Luçi
|
|
88 |
|
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC" >
|
89 |
4271dfb8
|
Colin Fleming
|
|
90 |
|
|
<?php include("fbegin.inc"); ?>
|
91 |
c9f0b1c2
|
Ermal Luçi
|
<?php if ($input_errors) print_input_errors($input_errors); ?>
|
92 |
|
|
|
93 |
|
|
<form action="firewall_shaper_wizards.php" method="post" id="iform" name="iform">
|
94 |
|
|
|
95 |
|
|
<?php if ($savemsg) print_info_box($savemsg); ?>
|
96 |
a368a026
|
Ermal Lu?i
|
<?php if (is_subsystem_dirty('shaper')): ?><p>
|
97 |
1d7ba683
|
ayvis
|
<?php 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."));?><br /></p>
|
98 |
c9f0b1c2
|
Ermal Luçi
|
<?php endif; ?>
|
99 |
4271dfb8
|
Colin Fleming
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="traffic shaper wizard">
|
100 |
ba782be2
|
Renato Botelho
|
<tr><td>
|
101 |
c9f0b1c2
|
Ermal Luçi
|
<?php
|
102 |
|
|
$tab_array = array();
|
103 |
c056f625
|
Vinicius Coque
|
$tab_array[0] = array(gettext("By Interface"), false, "firewall_shaper.php");
|
104 |
|
|
$tab_array[1] = array(gettext("By Queue"), false, "firewall_shaper_queues.php");
|
105 |
|
|
$tab_array[2] = array(gettext("Limiter"), false, "firewall_shaper_vinterface.php");
|
106 |
|
|
$tab_array[3] = array(gettext("Layer7"), false, "firewall_shaper_layer7.php");
|
107 |
|
|
$tab_array[4] = array(gettext("Wizards"), true, "firewall_shaper_wizards.php");
|
108 |
c9f0b1c2
|
Ermal Luçi
|
display_top_tabs($tab_array);
|
109 |
|
|
?>
|
110 |
ba782be2
|
Renato Botelho
|
</td></tr>
|
111 |
|
|
<tr>
|
112 |
|
|
<td>
|
113 |
|
|
<div id="mainarea">
|
114 |
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area">
|
115 |
|
|
<tr>
|
116 |
|
|
<td class="listhdrr" width="25%" align="center" ><?=gettext("Wizard function");?></td>
|
117 |
|
|
<td class="listhdrr" width="75%" align="center"><?=gettext("Wizard Link");?></td>
|
118 |
|
|
</tr>
|
119 |
|
|
<?php
|
120 |
|
|
foreach ($wizards as $key => $wizard):
|
121 |
|
|
?>
|
122 |
|
|
<tr class="tabcont">
|
123 |
|
|
<td class="listlr" style="background-color: #e0e0e0" width="25%" align="center">
|
124 |
|
|
<?php
|
125 |
|
|
echo $key;
|
126 |
|
|
?>
|
127 |
|
|
</td>
|
128 |
|
|
<td class="listr" style="background-color: #e0e0e0" width="75%" align="center">
|
129 |
|
|
<?php
|
130 |
|
|
echo "<a href=\"wizard.php?xml=" . $wizard ."\" >" .$wizard . "</a>";
|
131 |
|
|
?>
|
132 |
|
|
</td>
|
133 |
|
|
</tr>
|
134 |
|
|
<?php
|
135 |
|
|
endforeach;
|
136 |
|
|
?>
|
137 |
|
|
</table>
|
138 |
|
|
</div>
|
139 |
|
|
</td>
|
140 |
c9f0b1c2
|
Ermal Luçi
|
</tr>
|
141 |
|
|
</table>
|
142 |
|
|
</form>
|
143 |
4271dfb8
|
Colin Fleming
|
<?php include("fend.inc"); ?>
|
144 |
c9f0b1c2
|
Ermal Luçi
|
</body>
|
145 |
|
|
</html>
|