diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-05-24 22:29:36 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-05-24 22:29:36 +0000 |
commit | d5d00b834f97c9f8f38bcfc3589fcc4849e5718a (patch) | |
tree | 6d7d3633d9e8ed090c6f6f8b1b3140d2deb3e60e /usr/local/www | |
parent | 4a6032d0e2d00b3981fd536eb2abcd404460f264 (diff) | |
download | pfsense-d5d00b834f97c9f8f38bcfc3589fcc4849e5718a.zip pfsense-d5d00b834f97c9f8f38bcfc3589fcc4849e5718a.tar.gz |
Add CarpDEV-DHCP support.
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/firewall_virtual_ip_edit.php | 53 | ||||
-rwxr-xr-x | usr/local/www/interfaces.php | 37 | ||||
-rwxr-xr-x | usr/local/www/interfaces_wan.php | 37 |
3 files changed, 96 insertions, 31 deletions
diff --git a/usr/local/www/firewall_virtual_ip_edit.php b/usr/local/www/firewall_virtual_ip_edit.php index 3e1df0c..96b52cb 100755 --- a/usr/local/www/firewall_virtual_ip_edit.php +++ b/usr/local/www/firewall_virtual_ip_edit.php @@ -219,56 +219,65 @@ function get_radio_value(obj) return null; } function enable_change(enable_over) { - var note = document.getElementById("typenote"); - var carpnote = document.createTextNode("This must be the network's subnet mask. It does not specify a CIDR range."); - var proxyarpnote = document.createTextNode("This is a CIDR block of proxy ARP addresses."); - var ipaliasnote = document.createTextNode("This must be the network's subnet mask. It does not specify a CIDR range."); + var note = document.getElementById("typenote"); + var carpnote = document.createTextNode("This must be the network's subnet mask. It does not specify a CIDR range."); + var proxyarpnote = document.createTextNode("This is a CIDR block of proxy ARP addresses."); + var ipaliasnote = document.createTextNode("This must be the network's subnet mask. It does not specify a CIDR range."); if ((get_radio_value(document.iform.mode) == "carp") || enable_over) { document.iform.vhid.disabled = 0; document.iform.password.disabled = 0; document.iform.advskew.disabled = 0; document.iform.type.disabled = 1; document.iform.subnet_bits.disabled = 0; - if (note.firstChild == null) { - note.appendChild(carpnote); - } else { - note.removeChild(note.firstChild); - note.appendChild(carpnote); - } + document.iform.subnet.disabled = 0; + if (note.firstChild == null) { + note.appendChild(carpnote); + } else { + note.removeChild(note.firstChild); + note.appendChild(carpnote); + } } else { document.iform.vhid.disabled = 1; document.iform.password.disabled = 1; document.iform.advskew.disabled = 1; document.iform.type.disabled = 0; document.iform.subnet_bits.disabled = 1; - if (note.firstChild == null) { - note.appendChild(proxyarpnote); - } else { - note.removeChild(note.firstChild); - note.appendChild(proxyarpnote); - } + document.iform.subnet.disabled = 0; + if (note.firstChild == null) { + note.appendChild(proxyarpnote); + } else { + note.removeChild(note.firstChild); + note.appendChild(proxyarpnote); + } } if (get_radio_value(document.iform.mode) == "other") { - document.iform.type.disabled = 1; + document.iform.type.disabled = 1; if (note.firstChild != null) { note.removeChild(note.firstChild); } + document.iform.subnet.disabled = 0; } if (get_radio_value(document.iform.mode) == "ipalias") { - document.iform.type.disabled = 1; + document.iform.type.disabled = 1; note.removeChild(note.firstChild); note.appendChild(ipaliasnote); document.iform.subnet_bits.disabled = 0; + document.iform.subnet.disabled = 0; + } + if (get_radio_value(document.iform.mode) == "carpdev-dhcp") { + document.iform.type.disabled = 1; + note.removeChild(note.firstChild); + note.appendChild(ipaliasnote); + document.iform.subnet_bits.disabled = 1; + document.iform.subnet.disabled = 1; + document.iform.subnet.value = ''; } - } function typesel_change() { switch (document.iform.type.selectedIndex) { case 0: // single document.iform.subnet.disabled = 0; if((get_radio_value(document.iform.mode) == "proxyarp")) document.iform.subnet_bits.disabled = 1; - //document.iform.range_from.disabled = 1; - //document.iform.range_to.disabled = 1; break; case 1: // network document.iform.subnet.disabled = 0; @@ -307,6 +316,8 @@ function typesel_change() { <?php if ($pconfig['mode'] == "other") echo "checked";?>> Other <input name="mode" type="radio" onclick="enable_change(false)" value="ipalias" <?php if ($pconfig['mode'] == "ipalias") echo "checked";?>> IP Alias + <input name="mode" type="radio" onclick="enable_change(false)" value="carpdev-dhcp" + <?php if ($pconfig['mode'] == "carpdev-dhcp") echo "checked";?>> CarpDEV-DHCP </td> </tr> <tr> diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 0d069a3..b7db860 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -350,6 +350,11 @@ if ($_POST) { $wancfg['dhcphostname'] = $_POST['dhcphostname']; $wancfg['alias-address'] = $_POST['alias-address']; $wancfg['alias-subnet'] = $_POST['alias-subnet']; + } else if ($_POST['type'] == "CarpDEV-DHCP") { + $wancfg['ipaddr'] = "carpdev-dhcp"; + $wancfg['dhcphostname'] = $_POST['dhcphostname']; + $wancfg['alias-address'] = $_POST['alias-address']; + $wancfg['alias-subnet'] = $_POST['alias-subnet']; } else if ($_POST['type'] == "PPPoE") { $wancfg['ipaddr'] = "pppoe"; $config['pppoe']['username'] = $_POST['username']; @@ -643,6 +648,28 @@ function type_change(enable_change,enable_change_pptp) { document.iform.pptp_idletimeout.disabled = 1; document.iform.dhcphostname.disabled = 1; break; + case 5: + document.iform.username.disabled = 1; + document.iform.password.disabled = 1; + document.iform.provider.disabled = 1; + document.iform.pppoe_dialondemand.disabled = 1; + document.iform.pppoe_idletimeout.disabled = 1; + document.iform.pppoe_preset.disabled = 1; + document.iform.pppoe_preset.checked = 0; + Effect.Fade('presetwrap', { duration: 1.0 }); + document.iform.ipaddr.disabled = 1; + document.iform.subnet.disabled = 1; + document.iform.gateway.disabled = 1; + document.iform.pptp_username.disabled = 1; + document.iform.pptp_password.disabled = 1; + document.iform.pptp_local.disabled = 1; + document.iform.pptp_subnet.disabled = 1; + document.iform.pptp_remote.disabled = 1; + document.iform.pptp_dialondemand.disabled = 1; + document.iform.pptp_idletimeout.disabled = 1; + document.iform.dhcphostname.disabled = 1; + break; + } } @@ -667,11 +694,11 @@ function show_mon_config() { <tr> <td valign="middle" class="vncell"><strong>Type</strong></td> <td class="vtable"> <select name="type" class="formselect" id="type" onchange="type_change()"> - <?php $opts = split(" ", "Static DHCP PPPoE PPTP"); - foreach ($opts as $opt): ?> - <option <?php if ($opt == $pconfig['type']) echo "selected";?>> - <?=htmlspecialchars($opt);?> - </option> + <?php $opts = split(" ", "Static DHCP PPPoE PPTP CarpDEV-DHCP"); + foreach ($opts as $opt): ?> + <option <?php if ($opt == $pconfig['type']) echo "selected";?>> + <?=htmlspecialchars($opt);?> + </option> <?php endforeach; ?> </select></td> </tr> diff --git a/usr/local/www/interfaces_wan.php b/usr/local/www/interfaces_wan.php index 0d069a3..b7db860 100755 --- a/usr/local/www/interfaces_wan.php +++ b/usr/local/www/interfaces_wan.php @@ -350,6 +350,11 @@ if ($_POST) { $wancfg['dhcphostname'] = $_POST['dhcphostname']; $wancfg['alias-address'] = $_POST['alias-address']; $wancfg['alias-subnet'] = $_POST['alias-subnet']; + } else if ($_POST['type'] == "CarpDEV-DHCP") { + $wancfg['ipaddr'] = "carpdev-dhcp"; + $wancfg['dhcphostname'] = $_POST['dhcphostname']; + $wancfg['alias-address'] = $_POST['alias-address']; + $wancfg['alias-subnet'] = $_POST['alias-subnet']; } else if ($_POST['type'] == "PPPoE") { $wancfg['ipaddr'] = "pppoe"; $config['pppoe']['username'] = $_POST['username']; @@ -643,6 +648,28 @@ function type_change(enable_change,enable_change_pptp) { document.iform.pptp_idletimeout.disabled = 1; document.iform.dhcphostname.disabled = 1; break; + case 5: + document.iform.username.disabled = 1; + document.iform.password.disabled = 1; + document.iform.provider.disabled = 1; + document.iform.pppoe_dialondemand.disabled = 1; + document.iform.pppoe_idletimeout.disabled = 1; + document.iform.pppoe_preset.disabled = 1; + document.iform.pppoe_preset.checked = 0; + Effect.Fade('presetwrap', { duration: 1.0 }); + document.iform.ipaddr.disabled = 1; + document.iform.subnet.disabled = 1; + document.iform.gateway.disabled = 1; + document.iform.pptp_username.disabled = 1; + document.iform.pptp_password.disabled = 1; + document.iform.pptp_local.disabled = 1; + document.iform.pptp_subnet.disabled = 1; + document.iform.pptp_remote.disabled = 1; + document.iform.pptp_dialondemand.disabled = 1; + document.iform.pptp_idletimeout.disabled = 1; + document.iform.dhcphostname.disabled = 1; + break; + } } @@ -667,11 +694,11 @@ function show_mon_config() { <tr> <td valign="middle" class="vncell"><strong>Type</strong></td> <td class="vtable"> <select name="type" class="formselect" id="type" onchange="type_change()"> - <?php $opts = split(" ", "Static DHCP PPPoE PPTP"); - foreach ($opts as $opt): ?> - <option <?php if ($opt == $pconfig['type']) echo "selected";?>> - <?=htmlspecialchars($opt);?> - </option> + <?php $opts = split(" ", "Static DHCP PPPoE PPTP CarpDEV-DHCP"); + foreach ($opts as $opt): ?> + <option <?php if ($opt == $pconfig['type']) echo "selected";?>> + <?=htmlspecialchars($opt);?> + </option> <?php endforeach; ?> </select></td> </tr> |