From f1f60c926a4167268e68e4ad000d412c50a63635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=C3=A7i?= Date: Mon, 14 Jul 2008 21:01:53 +0000 Subject: * Merge multiple PPPoE/PPTP interfaces from RELENG_1_MULTI_ANYTHING * Much improved rule generation speed * Many bug fixing in general of the interface handling NOTE: this is the other half of changes --- usr/local/www/fbegin.inc | 4 +- usr/local/www/firewall_nat_out.php | 5 +- usr/local/www/firewall_rules.php | 5 +- usr/local/www/firewall_rules_edit.php | 3 +- usr/local/www/interfaces.php | 165 ++++++++++------ usr/local/www/interfaces_assign.php | 3 +- usr/local/www/interfaces_ppp.php | 2 +- usr/local/www/interfaces_ppp_edit.php | 2 +- usr/local/www/interfaces_wan.php | 165 ++++++++++------ usr/local/www/services_dyndns.php | 326 +++++++------------------------- usr/local/www/services_dyndns_edit.php | 221 ++++++++++++++++++++++ usr/local/www/services_rfc2136.php | 114 +++++++++++ usr/local/www/services_rfc2136_edit.php | 114 +++++++++++ usr/local/www/status_interfaces.php | 12 +- 14 files changed, 758 insertions(+), 383 deletions(-) create mode 100644 usr/local/www/services_dyndns_edit.php create mode 100644 usr/local/www/services_rfc2136.php create mode 100644 usr/local/www/services_rfc2136_edit.php (limited to 'usr/local') diff --git a/usr/local/www/fbegin.inc b/usr/local/www/fbegin.inc index 9db1963..23efdb1 100755 --- a/usr/local/www/fbegin.inc +++ b/usr/local/www/fbegin.inc @@ -139,7 +139,7 @@ if ($_REQUEST['noticeaction'] == 'acknowledge') { - + $odescr): if (!isset($config['interfaces'][$oif]['ovpn'])): ?> - + diff --git a/usr/local/www/firewall_nat_out.php b/usr/local/www/firewall_nat_out.php index 99fc3f7..5ee1c11 100755 --- a/usr/local/www/firewall_nat_out.php +++ b/usr/local/www/firewall_nat_out.php @@ -73,7 +73,8 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") { case "advancedoutboundnat": $was_enabled = isset($config['nat']['advancedoutbound']['enable']); $config['nat']['advancedoutbound']['enable'] = true; - unset($config['nat']['ipsecpassthru']['enable']); + if (isset($config['nat']['ipsecpassthru']['enable'])) + unset($config['nat']['ipsecpassthru']['enable']); if($was_enabled == false) { /* * user has enabled advanced outbound nat -- lets automatically create entries @@ -252,6 +253,8 @@ include("head.inc"); echo "WAN"; else if (!$natent['interface'] || ($natent['interface'] == "lan")) echo "LAN"; + else if ($natent['interface'] == "openvpn") + echo "OpenVPN"; else echo htmlspecialchars($config['interfaces'][$natent['interface']]['descr']); ?> diff --git a/usr/local/www/firewall_rules.php b/usr/local/www/firewall_rules.php index df4300f..a12449a 100755 --- a/usr/local/www/firewall_rules.php +++ b/usr/local/www/firewall_rules.php @@ -261,7 +261,7 @@ echo " - +
- - - - - - - - - - - - - - - - - - - - - +
- - - -
Dynamic DNS client onClick="enable_change(false)"> Enable
Service type -
Hostname/Interface - -
- - Note:
-
- Enter the complete host/domain name. example: myhost.dyndns.org -
-
MX - -
- Note: With DynDNS service you can only use a hostname, not an IP address. -
- Set this option only if you need a special MX record. Not - all services support this.
Wildcards - > - Enable Wildcard
+ + + + +
+ +
+
+ + + + + + + - - - + + - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - + - - - - - - - - - - - + + + - - - - - - - -
ServiceHostnameDescription
Username - + +
+ $ifdesc): + if ($dyndns['interface'] == $if): ?> + + + +
Password - + +
  - -
 
- - - -
RFC 2136 Dynamic DNS updates onClick="enable_change(false)"> Enable
Hostname - + + +   + +  
TTL - - seconds
Key name - -
- This must match the setting on the DNS server.
Key type - > Zone   - > Host   - > User +
Key - -
- Paste an HMAC-MD5 key here.
Server - -
Protocol - > - Use TCP instead of UDP

+ Note:
+
+ Add something meaningful here. +

 
  - -
 Note:
-
You must configure a DNS server in System: - General setup or allow the DNS server list to be overridden - by DHCP/PPP on WAN for dynamic DNS updates to work.
+
+
- diff --git a/usr/local/www/services_dyndns_edit.php b/usr/local/www/services_dyndns_edit.php new file mode 100644 index 0000000..9cc73cd --- /dev/null +++ b/usr/local/www/services_dyndns_edit.php @@ -0,0 +1,221 @@ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
Dynamic DNS client
+
Disable + > +
Service type +
Interface to monitor + +
Hostname/Interface + +
+ + Note:
+
+ Enter the complete host/domain name. example: myhost.dyndns.org +
+
MX + +
+ Note: With DynDNS service you can only use a hostname, not an IP address. +
+ Set this option only if you need a special MX record. Not + all services support this.
Wildcards + > + Enable Wildcard
Username + +
Password + +
Description + +
  + + + + + +
 Note:
+
You must configure a DNS server in System: + General setup or allow the DNS server list to be overridden + by DHCP/PPP on WAN for dynamic DNS updates to work.
+
+ + diff --git a/usr/local/www/services_rfc2136.php b/usr/local/www/services_rfc2136.php new file mode 100644 index 0000000..d5d37a7 --- /dev/null +++ b/usr/local/www/services_rfc2136.php @@ -0,0 +1,114 @@ + + + + +
+ + + + + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
HostnameDescription
+ $ifdesc): + if ($rfc2136['interface'] == $if): ?> + + + + + + +   + + +  
 

+ Note:
+
+ Add something meaningful here. +

 
+
+
+
+ + + diff --git a/usr/local/www/services_rfc2136_edit.php b/usr/local/www/services_rfc2136_edit.php new file mode 100644 index 0000000..d5d37a7 --- /dev/null +++ b/usr/local/www/services_rfc2136_edit.php @@ -0,0 +1,114 @@ + + + + +
+ + + + + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
HostnameDescription
+ $ifdesc): + if ($rfc2136['interface'] == $if): ?> + + + + + + +   + + +  
 

+ Note:
+
+ Add something meaningful here. +

 
+
+
+
+ + + diff --git a/usr/local/www/status_interfaces.php b/usr/local/www/status_interfaces.php index c813347..fde298e 100755 --- a/usr/local/www/status_interfaces.php +++ b/usr/local/www/status_interfaces.php @@ -43,16 +43,16 @@ if ($_POST) { if ($ifcfg['ipaddr'] == "dhcp") interfaces_dhcp_down($interface); else if ($ifcfg['ipaddr'] == "pppoe") - interfaces_wan_pppoe_down(); // FIXME: when we support multi-pppoe + interfaces_wan_pppoe_down($interface); else if ($ifcfg['ipaddr'] == "pptp") - interfaces_wan_pptp_down(); // FIXME: when we support multi-pptp + interfaces_wan_pptp_down($interface); } else if ($_POST['submit'] == "Connect" || $_POST['submit'] == "Renew") { if ($ifcfg['ipaddr'] == "dhcp") interfaces_dhcp_up($interface); else if ($ifcfg['ipaddr'] == "pppoe") - interfaces_wan_pppoe_up(); // FIXME: when we support multi-pppoe + interfaces_wan_pppoe_up($interface); else if ($ifcfg['ipaddr'] == "pptp") - interfaces_wan_pptp_up(); // FIXME: when we support multi-pptp + interfaces_wan_pptp_up($interface); } else { header("Location: index.php"); exit; @@ -82,7 +82,7 @@ include("head.inc"); interface - () + () @@ -217,7 +217,7 @@ include("head.inc"); $real_interface = ""; $interrupt_total = ""; $interrupt_sec = ""; - $real_interface = convert_friendly_interface_to_real_interface_name($ifname); + $real_interface = $ifinfo['hwif']; $interrupt_total = `vmstat -i | grep $real_interface | awk '{ print $3 }'`; $interrupt_sec = `vmstat -i | grep $real_interface | awk '{ print $4 }'`; if(strstr($interrupt_total, "hci")) { -- cgit v1.1