1 |
ce9abebd
|
Ermal Luci
|
<?php
|
2 |
|
|
/* $Id$ */
|
3 |
|
|
/*
|
4 |
|
|
services_igmpproxy.php
|
5 |
8ec0b9d0
|
Ermal Luci
|
|
6 |
|
|
Copyright (C) 2009 Ermal Lu?i
|
7 |
ce9abebd
|
Ermal Luci
|
Copyright (C) 2004 Scott Ullrich
|
8 |
|
|
All rights reserved.
|
9 |
|
|
|
10 |
|
|
originially part of m0n0wall (http://m0n0.ch/wall)
|
11 |
|
|
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
12 |
|
|
All rights reserved.
|
13 |
|
|
|
14 |
|
|
Redistribution and use in source and binary forms, with or without
|
15 |
|
|
modification, are permitted provided that the following conditions are met:
|
16 |
|
|
|
17 |
|
|
1. Redistributions of source code must retain the above copyright notice,
|
18 |
|
|
this list of conditions and the following disclaimer.
|
19 |
|
|
|
20 |
|
|
2. Redistributions in binary form must reproduce the above copyright
|
21 |
|
|
notice, this list of conditions and the following disclaimer in the
|
22 |
|
|
documentation and/or other materials provided with the distribution.
|
23 |
|
|
|
24 |
|
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
25 |
|
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
26 |
|
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
27 |
|
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
28 |
|
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
29 |
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
30 |
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
31 |
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
32 |
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
33 |
|
|
POSSIBILITY OF SUCH DAMAGE.
|
34 |
|
|
*/
|
35 |
1d333258
|
Scott Ullrich
|
/*
|
36 |
|
|
pfSense_MODULE: dyndns
|
37 |
|
|
*/
|
38 |
ce9abebd
|
Ermal Luci
|
|
39 |
|
|
##|+PRIV
|
40 |
|
|
##|*IDENT=page-services-igmpproxy
|
41 |
|
|
##|*NAME=Services: Igmpproxy page
|
42 |
|
|
##|*DESCR=Allow access to the 'Services: Igmpproxy' page.
|
43 |
|
|
##|*MATCH=services_igmpproxy.php*
|
44 |
|
|
##|-PRIV
|
45 |
|
|
|
46 |
|
|
require("guiconfig.inc");
|
47 |
|
|
|
48 |
|
|
if (!is_array($config['igmpproxy']['igmpentry']))
|
49 |
|
|
$config['igmpproxy']['igmpentry'] = array();
|
50 |
|
|
|
51 |
|
|
//igmpproxy_sort();
|
52 |
|
|
$a_igmpproxy = &$config['igmpproxy']['igmpentry'];
|
53 |
|
|
|
54 |
|
|
if ($_POST) {
|
55 |
|
|
|
56 |
|
|
$pconfig = $_POST;
|
57 |
|
|
|
58 |
|
|
$retval = 0;
|
59 |
|
|
/* reload all components that use igmpproxy */
|
60 |
|
|
$retval = services_igmpproxy_configure();
|
61 |
|
|
|
62 |
|
|
if(stristr($retval, "error") <> true)
|
63 |
|
|
$savemsg = get_std_save_message($retval);
|
64 |
|
|
else
|
65 |
|
|
$savemsg = $retval;
|
66 |
6833c9cd
|
Ermal Lu?i
|
|
67 |
|
|
clear_subsystem_dirty('igmpproxy');
|
68 |
ce9abebd
|
Ermal Luci
|
}
|
69 |
|
|
|
70 |
|
|
if ($_GET['act'] == "del") {
|
71 |
|
|
if ($a_igmpproxy[$_GET['id']]) {
|
72 |
|
|
unset($a_igmpproxy[$_GET['id']]);
|
73 |
|
|
write_config();
|
74 |
4bbfe029
|
Ermal Lu?i
|
mark_subsystem_dirty('igmpproxy');
|
75 |
ce9abebd
|
Ermal Luci
|
header("Location: services_igmpproxy.php");
|
76 |
|
|
exit;
|
77 |
|
|
}
|
78 |
|
|
}
|
79 |
|
|
|
80 |
fcf384b1
|
Chris Buechler
|
$pgtitle = array("Services","IGMP Proxy");
|
81 |
ce9abebd
|
Ermal Luci
|
include("head.inc");
|
82 |
|
|
|
83 |
|
|
?>
|
84 |
|
|
|
85 |
|
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
86 |
|
|
<?php include("fbegin.inc"); ?>
|
87 |
|
|
<form action="services_igmpproxy.php" method="post">
|
88 |
|
|
<?php if ($savemsg) print_info_box($savemsg); ?>
|
89 |
4bbfe029
|
Ermal Lu?i
|
<?php if (is_subsystem_dirty('igmpproxy')): ?><p>
|
90 |
fcf384b1
|
Chris Buechler
|
<?php print_info_box_np("The IGMP entry list has been changed.<br>You must apply the changes in order for them to take effect.");?>
|
91 |
ce9abebd
|
Ermal Luci
|
<?php endif; ?>
|
92 |
|
|
|
93 |
0a8574d9
|
Scott Ullrich
|
<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
|
94 |
ce9abebd
|
Ermal Luci
|
<tr>
|
95 |
|
|
<td width="15%" class="listhdrr">Name</td>
|
96 |
|
|
<td width="10%" class="listhdrr">Type</td>
|
97 |
|
|
<td width="25%" class="listhdrr">Values</td>
|
98 |
|
|
<td width="25%" class="listhdr">Description</td>
|
99 |
|
|
<td width="5%" class="list">
|
100 |
|
|
<table border="0" cellspacing="0" cellpadding="1">
|
101 |
|
|
<tr>
|
102 |
|
|
<td valign="middle" width="17"> </td>
|
103 |
|
|
<td valign="middle"><a href="services_igmpproxy_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="add a new igmpentry"></a></td>
|
104 |
|
|
</tr>
|
105 |
|
|
</table>
|
106 |
|
|
</td>
|
107 |
|
|
</tr>
|
108 |
|
|
<?php $i = 0; foreach ($a_igmpproxy as $igmpentry): ?>
|
109 |
|
|
<tr>
|
110 |
|
|
<td class="listlr" ondblclick="document.location='services_igmpproxy_edit.php?id=<?=$i;?>';">
|
111 |
5bd4c718
|
Chris Buechler
|
<?=htmlspecialchars(strtoupper($igmpentry['ifname']));?>
|
112 |
ce9abebd
|
Ermal Luci
|
</td>
|
113 |
|
|
<td class="listlr" ondblclick="document.location='services_igmpproxy_edit.php?id=<?=$i;?>';">
|
114 |
|
|
<?=htmlspecialchars($igmpentry['type']);?>
|
115 |
|
|
</td>
|
116 |
|
|
<td class="listr" ondblclick="document.location='services_igmpproxy_edit.php?id=<?=$i;?>';">
|
117 |
|
|
<?php
|
118 |
|
|
$addresses = implode(", ", array_slice(explode(" ", $igmpentry['address']), 0, 10));
|
119 |
|
|
echo $addresses;
|
120 |
|
|
if(count($addresses) < 10) {
|
121 |
|
|
echo " ";
|
122 |
|
|
} else {
|
123 |
|
|
echo "...";
|
124 |
|
|
}
|
125 |
|
|
?>
|
126 |
|
|
</td>
|
127 |
|
|
<td class="listbg" ondblclick="document.location='services_igmpproxy_edit.php?id=<?=$i;?>';">
|
128 |
|
|
<?=htmlspecialchars($igmpentry['descr']);?>
|
129 |
|
|
</td>
|
130 |
|
|
<td valign="middle" nowrap class="list">
|
131 |
|
|
<table border="0" cellspacing="0" cellpadding="1">
|
132 |
|
|
<tr>
|
133 |
|
|
<td valign="middle"><a href="services_igmpproxy_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="edit igmpentry"></a></td>
|
134 |
|
|
<td><a href="services_igmpproxy.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this igmpentry? All elements that still use it will become invalid (e.g. filter rules)!')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="delete igmpentry"></a></td>
|
135 |
|
|
</tr>
|
136 |
|
|
</table>
|
137 |
|
|
</td>
|
138 |
|
|
</tr>
|
139 |
|
|
<?php $i++; endforeach; ?>
|
140 |
|
|
<tr>
|
141 |
|
|
<td class="list" colspan="4"></td>
|
142 |
|
|
<td class="list">
|
143 |
|
|
<table border="0" cellspacing="0" cellpadding="1">
|
144 |
|
|
<tr>
|
145 |
|
|
<td valign="middle" width="17"> </td>
|
146 |
|
|
<td valign="middle"><a href="services_igmpproxy_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="add a new igmpentry"></a></td>
|
147 |
|
|
</td>
|
148 |
|
|
<td valign="middle">
|
149 |
|
|
<a href="services_igmpproxy_import.php">
|
150 |
|
|
<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_import_igmpentry.gif" width="17" height="17" border="0" title="<?=gettext("import igmpproxy from list");?>" alt="" />
|
151 |
|
|
</a>
|
152 |
|
|
</td>
|
153 |
|
|
</tr>
|
154 |
|
|
</table>
|
155 |
|
|
</td>
|
156 |
|
|
</tr>
|
157 |
|
|
<tr>
|
158 |
|
|
<td colspan="2" width="78%">
|
159 |
|
|
<br />
|
160 |
|
|
<input id="submit" name="submit" type="submit" class="formbtn" value="Save" />
|
161 |
|
|
<br />
|
162 |
|
|
</td>
|
163 |
|
|
</tr>
|
164 |
|
|
<tr>
|
165 |
|
|
<td class="tabcont" colspan="4">
|
166 |
fcf384b1
|
Chris Buechler
|
<p><span class="vexpl"><span class="red"><strong>Note:<br></strong></span>Please add the interface for upstream, the allowed subnets, and the downstream interfaces you would like the proxy to allow. Only one 'upstream' interface can be configured.</span></p>
|
167 |
ce9abebd
|
Ermal Luci
|
</td>
|
168 |
|
|
</tr>
|
169 |
|
|
</table>
|
170 |
|
|
</form>
|
171 |
|
|
<?php include("fend.inc"); ?>
|
172 |
|
|
</body>
|
173 |
|
|
</html>
|