1
|
<?php
|
2
|
/* $Id$ */
|
3
|
/*
|
4
|
services_igmpproxy.php
|
5
|
|
6
|
Copyright (C) 2013-2015 Electric Sheep Fencing, LP
|
7
|
Copyright (C) 2009 Ermal Luçi
|
8
|
Copyright (C) 2004 Scott Ullrich
|
9
|
All rights reserved.
|
10
|
|
11
|
originally part of m0n0wall (http://m0n0.ch/wall)
|
12
|
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
13
|
All rights reserved.
|
14
|
|
15
|
Redistribution and use in source and binary forms, with or without
|
16
|
modification, are permitted provided that the following conditions are met:
|
17
|
|
18
|
1. Redistributions of source code must retain the above copyright notice,
|
19
|
this list of conditions and the following disclaimer.
|
20
|
|
21
|
2. Redistributions in binary form must reproduce the above copyright
|
22
|
notice, this list of conditions and the following disclaimer in the
|
23
|
documentation and/or other materials provided with the distribution.
|
24
|
|
25
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
26
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
27
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
28
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
29
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
30
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
31
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
32
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
33
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
34
|
POSSIBILITY OF SUCH DAMAGE.
|
35
|
*/
|
36
|
/*
|
37
|
pfSense_MODULE: igmpproxy
|
38
|
*/
|
39
|
|
40
|
##|+PRIV
|
41
|
##|*IDENT=page-services-igmpproxy
|
42
|
##|*NAME=Services: Igmpproxy page
|
43
|
##|*DESCR=Allow access to the 'Services: Igmpproxy' page.
|
44
|
##|*MATCH=services_igmpproxy.php*
|
45
|
##|-PRIV
|
46
|
|
47
|
require("guiconfig.inc");
|
48
|
|
49
|
if (!is_array($config['igmpproxy']['igmpentry'])) {
|
50
|
$config['igmpproxy']['igmpentry'] = array();
|
51
|
}
|
52
|
|
53
|
//igmpproxy_sort();
|
54
|
$a_igmpproxy = &$config['igmpproxy']['igmpentry'];
|
55
|
|
56
|
if ($_POST) {
|
57
|
$pconfig = $_POST;
|
58
|
|
59
|
$retval = 0;
|
60
|
/* reload all components that use igmpproxy */
|
61
|
$retval = services_igmpproxy_configure();
|
62
|
|
63
|
if (stristr($retval, "error") <> true) {
|
64
|
$savemsg = get_std_save_message($retval);
|
65
|
} else {
|
66
|
$savemsg = $retval;
|
67
|
}
|
68
|
|
69
|
clear_subsystem_dirty('igmpproxy');
|
70
|
}
|
71
|
|
72
|
if ($_GET['act'] == "del") {
|
73
|
if ($a_igmpproxy[$_GET['id']]) {
|
74
|
unset($a_igmpproxy[$_GET['id']]);
|
75
|
write_config();
|
76
|
mark_subsystem_dirty('igmpproxy');
|
77
|
header("Location: services_igmpproxy.php");
|
78
|
exit;
|
79
|
}
|
80
|
}
|
81
|
|
82
|
$pgtitle = array(gettext("Services"), gettext("IGMP Proxy"));
|
83
|
include("head.inc");
|
84
|
|
85
|
if ($savemsg)
|
86
|
print_info_box($savemsg, 'success');
|
87
|
|
88
|
if (is_subsystem_dirty('igmpproxy'))
|
89
|
print_info_box_np(gettext('The IGMP entry list has been changed.' . '<br />' . 'You must apply the changes in order for them to take effect.'));
|
90
|
?>
|
91
|
|
92
|
<form action="services_igmpproxy.php" method="post">
|
93
|
<div class="table-responsive">
|
94
|
<table class="table table-striped table-hover table-condensed">
|
95
|
<thead>
|
96
|
<tr>
|
97
|
<th><?=gettext("Name")?></th>
|
98
|
<th><?=gettext("Type")?></th>
|
99
|
<th><?=gettext("Values")?></th>
|
100
|
<th><?=gettext("Description")?></th>
|
101
|
<th</th>
|
102
|
</tr>
|
103
|
</thead>
|
104
|
<tbody>
|
105
|
<?php
|
106
|
$i = 0;
|
107
|
foreach ($a_igmpproxy as $igmpentry):
|
108
|
?>
|
109
|
<tr>
|
110
|
<td>
|
111
|
<?=htmlspecialchars(convert_friendly_interface_to_friendly_descr($igmpentry['ifname']))?>
|
112
|
</td>
|
113
|
<td>
|
114
|
<?=htmlspecialchars($igmpentry['type'])?>
|
115
|
</td>
|
116
|
<td>
|
117
|
<?php
|
118
|
$addresses = implode(", ", array_slice(explode(" ", $igmpentry['address']), 0, 10));
|
119
|
print($addresses);
|
120
|
|
121
|
if(count($addresses) < 10) {
|
122
|
print(' ');
|
123
|
} else {
|
124
|
print('...');
|
125
|
}
|
126
|
?>
|
127
|
</td>
|
128
|
<td>
|
129
|
<?=htmlspecialchars($igmpentry['descr'])?>
|
130
|
</td>
|
131
|
<td>
|
132
|
<a href="services_igmpproxy_edit.php?id=<?=$i?>" class="btn btn-info btn-xs"><?=gettext('Edit')?></a>
|
133
|
<a href="services_igmpproxy.php?act=del&id=<?=$i?>" class="btn btn-danger btn-xs"><?=gettext('Delete')?></a>
|
134
|
</td>
|
135
|
</tr>
|
136
|
<?php
|
137
|
$i++;
|
138
|
endforeach;
|
139
|
?>
|
140
|
</tbody>
|
141
|
</table>
|
142
|
</div>
|
143
|
|
144
|
<nav class="action-buttons">
|
145
|
<input id="submit" name="submit" type="submit" class="btn btn-primary" value="<?=gettext("Save")?>" />
|
146
|
<a href="services_igmpproxy_edit.php" class="btn btn-success"><?=gettext('Add')?></a>
|
147
|
</nav>
|
148
|
|
149
|
</form>
|
150
|
|
151
|
<?php
|
152
|
|
153
|
print_info_box(gettext('Please add the interface for upstream, the allowed subnets, and the downstream interfaces you would like the proxy to allow. ' .
|
154
|
'Only one "upstream" interface can be configured.'));
|
155
|
|
156
|
include("foot.inc");
|