Project

General

Profile

Download (5.95 KB) Statistics
| Branch: | Tag: | Revision:
1 5b237745 Scott Ullrich
<?php
2 b46bfcf5 Bill Marquette
/* $Id$ */
3 5b237745 Scott Ullrich
/*
4
	services_proxyarp.php
5 b46bfcf5 Bill Marquette
	part of pfSense
6
	Copyright (C) 2004 Scott Ullrich
7 841dd38a Scott Ullrich
8 7a1b90bc Scott Ullrich
	originally part of m0n0wall (http://m0n0.ch/wall)
9 5b237745 Scott Ullrich
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
10
	All rights reserved.
11 841dd38a Scott Ullrich
12 5b237745 Scott Ullrich
	Redistribution and use in source and binary forms, with or without
13
	modification, are permitted provided that the following conditions are met:
14 841dd38a Scott Ullrich
15 5b237745 Scott Ullrich
	1. Redistributions of source code must retain the above copyright notice,
16
	   this list of conditions and the following disclaimer.
17 841dd38a Scott Ullrich
18 5b237745 Scott Ullrich
	2. Redistributions in binary form must reproduce the above copyright
19
	   notice, this list of conditions and the following disclaimer in the
20
	   documentation and/or other materials provided with the distribution.
21 841dd38a Scott Ullrich
22 5b237745 Scott Ullrich
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
23
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
	POSSIBILITY OF SUCH DAMAGE.
32
*/
33
34 6b07c15a Matthew Grooms
##|+PRIV
35
##|*IDENT=page-services-proxyarp
36
##|*NAME=Services: Proxy ARP page
37
##|*DESCR=Allow access to the 'Services: Proxy ARP' page.
38
##|*MATCH=services_proxyarp.php*
39
##|-PRIV
40
41
42 5b237745 Scott Ullrich
require("guiconfig.inc");
43
44
if (!is_array($config['proxyarp']['proxyarpnet'])) {
45
	$config['proxyarp']['proxyarpnet'] = array();
46
}
47
proxyarp_sort();
48
$a_proxyarp = &$config['proxyarp']['proxyarpnet'];
49
50
if ($_POST) {
51
	$pconfig = $_POST;
52 841dd38a Scott Ullrich
53 5b237745 Scott Ullrich
	$retval = 0;
54 3851094f Scott Ullrich
	$retval = services_proxyarp_configure();
55 5b237745 Scott Ullrich
	$savemsg = get_std_save_message($retval);
56
57
	if ($retval == 0) {
58
		if (file_exists($d_proxyarpdirty_path))
59
			unlink($d_proxyarpdirty_path);
60
	}
61
}
62
63
if ($_GET['act'] == "del") {
64
	if ($a_proxyarp[$_GET['id']]) {
65
		unset($a_proxyarp[$_GET['id']]);
66
		write_config();
67
		touch($d_proxyarpdirty_path);
68
		header("Location: services_proxyarp.php");
69
		exit;
70
	}
71
}
72 4df96eff Scott Ullrich
73 d88c6a9f Scott Ullrich
$pgtitle = array("Services","Proxy ARP");
74 4df96eff Scott Ullrich
include("head.inc");
75
76 5b237745 Scott Ullrich
?>
77
78
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
79
<?php include("fbegin.inc"); ?>
80
<form action="services_proxyarp.php" method="post">
81
<?php if ($savemsg) print_info_box($savemsg); ?>
82
<?php if (file_exists($d_proxyarpdirty_path)): ?><p>
83
<?php print_info_box_np("The proxy ARP configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
84
<?php endif; ?>
85
              <table width="100%" border="0" cellpadding="0" cellspacing="0">
86
                <tr>
87 26ef3f74 Scott Ullrich
                  <td width="20%" class="listhdrr">Interface</td>
88
                  <td width="30%" class="listhdrr">Network</td>
89
                  <td width="40%" class="listhdr">Description</td>
90 5b237745 Scott Ullrich
                  <td width="10%" class="list"></td>
91
				</tr>
92
			  <?php $i = 0; foreach ($a_proxyarp as $arpent): ?>
93
                <tr>
94 2d165eff Bill Marquette
		 <td class="listlr" ondblclick="document.location='services_proxyarp_edit.php?id=<?=$i;?>';">
95 26ef3f74 Scott Ullrich
                  <?php
96
				  	if ($arpent['interface']) {
97 3e321df2 Ermal Luçi
					  $iflabels = get_configured_interface_with_descr();
98
99 26ef3f74 Scott Ullrich
					  echo htmlspecialchars($iflabels[$arpent['interface']]);
100
					} else {
101
						echo "WAN";
102
					}
103
	    		  ?>
104
                  </td>
105 2d165eff Bill Marquette
                  <td class="listr" ondblclick="document.location='services_proxyarp_edit.php?id=<?=$i;?>';">
106 5b237745 Scott Ullrich
				  <?php if (isset($arpent['network'])) {
107
				  			list($sa,$sn) = explode("/", $arpent['network']);
108
							if ($sn == 32)
109
								echo $sa;
110
							else
111
					  			echo $arpent['network'];
112
						} else if (isset($arpent['range']))
113
							echo $arpent['range']['from'] . "-" . $arpent['range']['to'];
114
                    ?>&nbsp;
115
                  </td>
116 d4da6249 Scott Ullrich
                  <td class="listbg" ondblclick="document.location='services_proxyarp_edit.php?id=<?=$i;?>';">
117 26ef3f74 Scott Ullrich
                    <?=htmlspecialchars($arpent['descr']);?>&nbsp;
118 5b237745 Scott Ullrich
                  </td>
119 75a70796 Bill Marquette
                  <td valign="middle" nowrap class="list">
120
                    <table border="0" cellspacing="0" cellpadding="1">
121
                      <tr>
122 677c0869 Erik Kristensen
                        <td valign="middle"><a href="services_proxyarp_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
123
                        <td valign="middle"><a href="services_proxyarp.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this network?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
124 75a70796 Bill Marquette
                      </tr>
125
                    </table>
126
                  </td>
127
                </tr>
128
                <?php $i++; endforeach; ?>
129 841dd38a Scott Ullrich
                <tr>
130 26ef3f74 Scott Ullrich
                  <td class="list" colspan="3"></td>
131 75a70796 Bill Marquette
                  <td class="list">
132
                    <table border="0" cellspacing="0" cellpadding="1">
133
                      <tr>
134 677c0869 Erik Kristensen
                        <td valign="middle"><a href="services_proxyarp_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
135 75a70796 Bill Marquette
                      </tr>
136
                    </table>
137
                  </td>
138
                </tr>
139 5b237745 Scott Ullrich
              </table>
140
            </form>
141 055cf54b Scott Ullrich
            <p class="vexpl"><span class="red"><strong>Notes:<br>
142 b1caca4b Scott Ullrich
                      </strong></span>
143 36d0358b Scott Ullrich
			*Proxy ARP can be used if you need {$g['product_name']} to send ARP replies on an interface for other IP addresses than its own (e.g. for 1:1, advanced outbound or server NAT). It is not necessary on the WAN interface if you have a subnet routed to you or if you use PPPoE/PPTP, and it only works on the WAN interface if it's configured with a static IP address or DHCP.</p>
144 b1caca4b Scott Ullrich
			<br>
145
			*CARP can be a great replacement for proxyarp.
146 26ef3f74 Scott Ullrich
            <?php include("fend.inc"); ?>
147 5b237745 Scott Ullrich
</body>
148
</html>