From 7a9c39891ce6e8b50e484c88b8c565771adea517 Mon Sep 17 00:00:00 2001 From: mkasper Date: Sat, 7 Jan 2006 22:52:54 +0000 Subject: [PATCH] Import m0n0wall 1.2b3 files. git-svn-id: https://svn.m0n0.ch/wall/trunk@10 e36fee2c-cc09-0410-a7cc-ebac5c6737de --- captiveportal/index.php | 2 +- phpconf/inc/captiveportal.inc | 3 +- phpconf/inc/filter.inc | 4 + phpconf/inc/interfaces.inc | 90 +++++++++++--- phpconf/inc/services.inc | 115 +++++++++++++++-- phpconf/inc/system.inc | 6 +- phpconf/rc.bootup | 7 ++ phpconf/rc.newwanip | 3 + webgui/block.gif | Bin 194 -> 308 bytes webgui/block_d.gif | Bin 193 -> 204 bytes webgui/diag_backup.php | 23 ++-- webgui/diag_logs.php | 4 +- webgui/diag_logs_dhcp.php | 4 +- webgui/diag_logs_filter.php | 4 +- webgui/diag_logs_settings.php | 4 +- webgui/diag_logs_vpn.php | 6 +- webgui/fbegin.inc | 6 +- webgui/firewall_rules.php | 196 +++++++++++++++++++---------- webgui/firewall_rules_edit.php | 9 +- webgui/gui.css | 23 +++- webgui/interfaces_opt.php | 13 +- webgui/interfaces_wan.php | 38 ++++-- webgui/interfaces_wlan.inc | 2 +- webgui/left.gif | Bin 0 -> 597 bytes webgui/left_d.gif | Bin 0 -> 597 bytes webgui/license.php | 2 +- webgui/reject.gif | Bin 186 -> 309 bytes webgui/reject_d.gif | Bin 185 -> 204 bytes webgui/services_captiveportal.php | 58 ++++----- webgui/services_dhcp.php | 26 ++-- webgui/services_dyndns.php | 144 ++++++++++++++++++---- webgui/services_proxyarp.php | 29 +++-- webgui/services_proxyarp_edit.php | 21 ++++ webgui/services_snmp.php | 14 +-- webgui/status.php | 60 +++++---- webgui/status_interfaces.php | 198 ++++++++++++++++++++---------- webgui/system.php | 5 + webgui/x_d.gif | Bin 0 -> 401 bytes 38 files changed, 784 insertions(+), 335 deletions(-) create mode 100644 webgui/left.gif create mode 100644 webgui/left_d.gif create mode 100644 webgui/x_d.gif diff --git a/captiveportal/index.php b/captiveportal/index.php index c264625..497e506 100644 --- a/captiveportal/index.php +++ b/captiveportal/index.php @@ -119,7 +119,7 @@ EOD; if (isset($config['captiveportal']['httpslogin'])) $htmltext = str_replace("\$PORTAL_ACTION\$", "https://{$config['captiveportal']['httpsname']}:8001/", $htmltext); else - $htmltext = str_replace("\$PORTAL_ACTION\$", "", $htmltext); + $htmltext = str_replace("\$PORTAL_ACTION\$", "http://{$config['interfaces'][$config['captiveportal']['interface']]['ipaddr']}:8000/", $htmltext); if (preg_match("/redirurl=(.*)/", $orig_request, $matches)) $redirurl = urldecode($matches[1]); diff --git a/phpconf/inc/captiveportal.inc b/phpconf/inc/captiveportal.inc index d5d78b1..f12f1da 100644 --- a/phpconf/inc/captiveportal.inc +++ b/phpconf/inc/captiveportal.inc @@ -78,8 +78,9 @@ function captiveportal_configure() {

m0n0wall captive portal

This is the default captive portal page. Please upload your own custom HTML file on the Services: Captive portal screen in the m0n0wall webGUI.

-
+ +
diff --git a/phpconf/inc/filter.inc b/phpconf/inc/filter.inc index f1eb24c..9b41729 100644 --- a/phpconf/inc/filter.inc +++ b/phpconf/inc/filter.inc @@ -55,6 +55,7 @@ function filter_configure() { $tcpidletimeout = $config['filter']['tcpidletimeout']; mwexec("/sbin/sysctl net.inet.ipf.fr_tcpidletimeout={$tcpidletimeout}"); mwexec("/sbin/sysctl net.inet.ipf.fr_tcphalfclosed=480"); + mwexec("/sbin/sysctl net.inet.ipf.fr_udpacktimeout=240"); /* SIP... */ /* generate ipnat rules */ $ipnatrules = filter_nat_rules_generate(); @@ -379,12 +380,14 @@ EOD; unset($sa); if ($route['interface'] == "lan") { + $ip = $lanip; $sa = $lansa; $sn = $lansn; $if = $lanif; } else if (strstr($route['interface'], "opt")) { $oc = $optcfg[$route['interface']]; if ($oc['ip']) { + $ip = $oc['ip']; $sa = $oc['sa']; $sn = $oc['sn']; $if = $oc['if']; @@ -393,6 +396,7 @@ EOD; if ($sa) { $ipfrules .= << $paents) { + if ($paif == "wan" && !(is_ipaddr($config['interfaces']['wan']['ipaddr']) || + ($config['interfaces']['wan']['ipaddr'] == "dhcp") || + ($config['interfaces']['wan']['ipaddr'] == "bigpond"))) + continue; + + $args = $config['interfaces'][$paif]['if'] . " auto"; + + foreach ($paents as $paent) { + if (isset($paent['network'])) + $args .= " " . escapeshellarg($paent['network']); + else if (isset($paent['range'])) + $args .= " " . escapeshellarg($paent['range']['from'] . "-" . + $paent['range']['to']); + } + + mwexec_bg("/usr/local/sbin/choparp " . $args); } + } +} + +function services_dnsupdate_process() { + global $config, $g; + + /* Dynamic DNS updating active? */ + if (isset($config['dnsupdate']['enable'])) { - mwexec_bg("/usr/local/sbin/choparp " . $args); + $wanip = get_current_wan_address(); + if ($wanip) { + + $keyname = $config['dnsupdate']['keyname']; + /* trailing dot */ + if (substr($keyname, -1) != ".") + $keyname .= "."; + + $hostname = $config['dnsupdate']['host']; + /* trailing dot */ + if (substr($hostname, -1) != ".") + $hostname .= "."; + + /* write private key file + this is dumb - public and private keys are the same for HMAC-MD5, + but nsupdate insists on having both */ + $fd = fopen("{$g['varetc_path']}/K{$keyname}+157+00000.private", "w"); + $privkey .= << diff --git a/phpconf/inc/system.inc b/phpconf/inc/system.inc index d2c0b33..2333f23 100644 --- a/phpconf/inc/system.inc +++ b/phpconf/inc/system.inc @@ -226,7 +226,7 @@ EOD; if (isset($syslogcfg['system'])) { $syslogconf .= << attempt DNS update */ + if (is_ipaddr($config['interfaces']['wan']['ipaddr'])) + services_dnsupdate_process(); + /* start DHCP service */ services_dhcpd_configure(); diff --git a/phpconf/rc.newwanip b/phpconf/rc.newwanip index a9bf510..d61069e 100644 --- a/phpconf/rc.newwanip +++ b/phpconf/rc.newwanip @@ -73,6 +73,9 @@ if ($config['interfaces']['wan']['ipaddr'] == "bigpond") interfaces_wan_bigpond_configure($curwanip); + /* perform RFC 2136 DNS update */ + services_dnsupdate_process(); + /* write current WAN IP to file */ $fd = @fopen("{$g['vardb_path']}/wanip", "w"); if ($fd) { diff --git a/webgui/block.gif b/webgui/block.gif index df952404dd569c5e01a4851b653da3e9dfcae518..fafb63c29feb9ad371f0aec966dd6e1b3b0726f2 100644 GIT binary patch literal 308 zcmZ?wbhEHb5P_AJEi?W%<@s5c+M zFA-+G3F$!+4YQ`7ojRE_bp4dv>o<0|Im9gfxOhjI&e5$8xL%d;9X&6@QcQR-fsIE_wAHO$jzv+ZFH2&QBZD;nwYOu| literal 194 zcmZ?wbhEHb`Sa%GzaQVf?%wPx!9~wylNd{D) z_>+Z^fkBEv2P6!#lY!M diff --git a/webgui/block_d.gif b/webgui/block_d.gif index 2d3d98006aa0840b829865dc84553d63037a1b57..03d9ab0cd886f3b01bbf3c31e551229430650ec0 100644 GIT binary patch literal 204 zcmV;-05ktbNk%w1VG95Y0K^{v?7q0{!@ckB?&`L#?7X(=sh{k)vG3&K?%UYz)6ehi z?d-t1@88|;;NI@q*Y4ll=%SeFs-f(`y6dv4>7|?LtfTMY-|y$;>7<(P=;!I9nCq~p z>8hdb?(XTMneOiHA^8LW0018VEC2ui01E&M000F^;5QiEXA0XQavo8l9w#w{*D9Nh zUEfoC6dljhut7XKlc^K2X(pv5z~<3t0;SH>Q%SHq*qo-4`B=UN2ZyXYa}FOwS!src G0029|Tyu{A literal 193 zcmZ?wbhEHbs2%-%1XSN*zs^Z)<+Z^fkBc%2P6ZslY!Ol0c%KLn%89&Hi?;@JZ*w~cjPAfM9xf9wwkw6G5M{}@)jN= ijk!hM9o$Q!Z+KXq_*kf$(5I&7HX)E>B7YGFgEattR9nFS diff --git a/webgui/diag_backup.php b/webgui/diag_backup.php index 888651c..bc4d9d4 100644 --- a/webgui/diag_backup.php +++ b/webgui/diag_backup.php @@ -85,28 +85,28 @@ if ($_POST) {
- +
- - + + + + + - - + +
Backup configuration
  +  

Click this button to download the system configuration in XML format.

- -
-  
-  

Restore configuration
  -

Open a m0n0wall configuration XML file and click the button +

  + Open a m0n0wall configuration XML file and click the button below to restore the configuration.

Note:
@@ -116,8 +116,7 @@ if ($_POST) {

-

-
diff --git a/webgui/diag_logs.php b/webgui/diag_logs.php index fe4d41a..e28c36d 100644 --- a/webgui/diag_logs.php +++ b/webgui/diag_logs.php @@ -64,14 +64,14 @@ function dump_clog($logfile, $tail, $withorig = true) { -<?=gentitle("Diagnostics: System logs");?> +<?=gentitle("Diagnostics: Logs");?> -

Diagnostics: System logs

+

Diagnostics: Logs