Project

General

Profile

Download (5.89 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	services_proxyarp.php
5
	part of pfSense
6
	Copyright (C) 2004 Scott Ullrich
7

    
8
	originally part of m0n0wall (http://m0n0.ch/wall)
9
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
10
	All rights reserved.
11

    
12
	Redistribution and use in source and binary forms, with or without
13
	modification, are permitted provided that the following conditions are met:
14

    
15
	1. Redistributions of source code must retain the above copyright notice,
16
	   this list of conditions and the following disclaimer.
17

    
18
	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

    
22
	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
##|+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
require("guiconfig.inc");
43

    
44
if (!is_array($config['proxyarp']['proxyarpnet'])) {
45
	$config['proxyarp']['proxyarpnet'] = array();
46
}
47
$a_proxyarp = &$config['proxyarp']['proxyarpnet'];
48

    
49
if ($_POST) {
50
	$pconfig = $_POST;
51

    
52
	$retval = 0;
53
	$retval = services_proxyarp_configure();
54
	$savemsg = get_std_save_message($retval);
55

    
56
	if ($retval == 0)
57
		clear_subsystem_dirty('proxyarp');
58
}
59

    
60
if ($_GET['act'] == "del") {
61
	if ($a_proxyarp[$_GET['id']]) {
62
		unset($a_proxyarp[$_GET['id']]);
63
		write_config();
64
		mark_subsystem_dirty('proxyarp');
65
		header("Location: services_proxyarp.php");
66
		exit;
67
	}
68
}
69

    
70
$pgtitle = array("Services","Proxy ARP");
71
include("head.inc");
72

    
73
?>
74

    
75
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
76
<?php include("fbegin.inc"); ?>
77
<form action="services_proxyarp.php" method="post">
78
<?php if ($savemsg) print_info_box($savemsg); ?>
79
<?php if (is_subsystem_dirty('proxyarp')): ?><p>
80
<?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>
81
<?php endif; ?>
82
              <table width="100%" border="0" cellpadding="0" cellspacing="0">
83
                <tr>
84
                  <td width="20%" class="listhdrr">Interface</td>
85
                  <td width="30%" class="listhdrr">Network</td>
86
                  <td width="40%" class="listhdr">Description</td>
87
                  <td width="10%" class="list"></td>
88
				</tr>
89
			  <?php $i = 0; foreach ($a_proxyarp as $arpent): ?>
90
                <tr>
91
		 <td class="listlr" ondblclick="document.location='services_proxyarp_edit.php?id=<?=$i;?>';">
92
                  <?php
93
				  	if ($arpent['interface']) {
94
					  $iflabels = get_configured_interface_with_descr();
95

    
96
					  echo htmlspecialchars($iflabels[$arpent['interface']]);
97
					} else {
98
						echo "WAN";
99
					}
100
	    		  ?>
101
                  </td>
102
                  <td class="listr" ondblclick="document.location='services_proxyarp_edit.php?id=<?=$i;?>';">
103
				  <?php if (isset($arpent['network'])) {
104
				  			list($sa,$sn) = explode("/", $arpent['network']);
105
							if ($sn == 32)
106
								echo $sa;
107
							else
108
					  			echo $arpent['network'];
109
						} else if (isset($arpent['range']))
110
							echo $arpent['range']['from'] . "-" . $arpent['range']['to'];
111
                    ?>&nbsp;
112
                  </td>
113
                  <td class="listbg" ondblclick="document.location='services_proxyarp_edit.php?id=<?=$i;?>';">
114
                    <?=htmlspecialchars($arpent['descr']);?>&nbsp;
115
                  </td>
116
                  <td valign="middle" nowrap class="list">
117
                    <table border="0" cellspacing="0" cellpadding="1">
118
                      <tr>
119
                        <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>
120
                        <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>
121
                      </tr>
122
                    </table>
123
                  </td>
124
                </tr>
125
                <?php $i++; endforeach; ?>
126
                <tr>
127
                  <td class="list" colspan="3"></td>
128
                  <td class="list">
129
                    <table border="0" cellspacing="0" cellpadding="1">
130
                      <tr>
131
                        <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>
132
                      </tr>
133
                    </table>
134
                  </td>
135
                </tr>
136
              </table>
137
            </form>
138
            <p class="vexpl"><span class="red"><strong>Notes:<br>
139
                      </strong></span>
140
			*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>
141
			<br>
142
			*CARP can be a great replacement for proxyarp.
143
            <?php include("fend.inc"); ?>
144
</body>
145
</html>
(139-139/217)