diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index ee9317e215..0bbcf5864b 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -140,8 +140,9 @@ function filter_configure() { touch($g['tmp_path'] . "/filter_dirty"); } -function delete_states_for_down_gateways() { +function filter_delete_states_for_down_gateways() { global $config; + $a_gateways = return_gateways_status(); foreach ($a_gateways as $gateway) { if ($gateway['status'] == "down") { @@ -369,7 +370,7 @@ function filter_configure_sync() { echo "."; update_filter_reload_status("Processing down interface states"); - delete_states_for_down_gateways(); + filter_delete_states_for_down_gateways(); update_filter_reload_status("Running plugins"); @@ -2084,7 +2085,7 @@ EOD; /* if antilockout is enabled, LAN exists and has * an IP and subnet mask assigned */ - $lanif = $FilterIflist["lan"]['if']; + $lanif = $FilterIflist['lan']['if']; $ipfrules .= << false, "disablehelpicon" => false, "debug" => false, - "latest_config" => "6.3", + "latest_config" => "6.4", "nopkg_platforms" => array("cdrom"), "minimum_ram_warning" => "105", "minimum_ram_warning_text" => "128 MB", diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 846d33d42b..cbb9055575 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -243,9 +243,7 @@ EOD; /* return the status of the apinger targets as a array */ function return_gateways_status() { - global $config; - global $g; - $gateways_arr = return_gateways_array(); + global $config, $g; $apingerstatus = array(); if (file_exists("{$g['tmp_path']}/apinger.status")) { @@ -253,28 +251,13 @@ function return_gateways_status() { } $status = array(); - $i = 2; - /* assign a dummy IP address for dynamic interfaces in case we need it */ - $monitor = array(); - foreach($gateways_arr as $name => $gateway) { - if($gateway['monitor'] == "dynamic") { - $gateway['monitor'] = "127.0.0.{$i}"; - $i++; - } - $status[$gateway['monitor']]['monitor'] = $gateway['monitor']; - $status[$gateway['monitor']]['interface'] = $gateway['interface']; - $status[$gateway['monitor']]['gateway'] = $gateway['gateway']; - $status[$gateway['monitor']]['name'] = $gateway['name']; - $status[$gateway['monitor']]['status'] = "down"; - - } foreach($apingerstatus as $line) { $info = explode("|", $line); $target = $info[0]; $status[$target]['name'] = $info[1]; $status[$target]['lastcheck'] = $info[4] ? date('r', $info[4]) : date('r'); - $status[$target]['delay'] = $info[5]; - $status[$target]['loss'] = $info[6]; + $status[$target]['delay'] = empty($info[5]) ? 0 : $info[5]; + $status[$target]['loss'] = empty($info[6]) ? "0.0%" : $info[6] . "%"; $status[$target]['status'] = trim($info[7]); } return($status); @@ -475,19 +458,15 @@ function dhclient_update_gateway_groups_defaultroute($interface = "wan") { } function lookup_gateway_ip_by_name($name) { - global $config; - if(is_array($config['gateways']['gateway_item'])) { - foreach($config['gateways']['gateway_item'] as $gateway) { - if($gateway['name'] == $name) - return ($gateway['gateway']); - } - } else - return (false); + $gateways_arr = return_gateways_array(); + if (!empty($gateways_arr[$name])) + return $gateways_arr[$name]['gateway']; + + return false; } function lookup_gateway_monitor_ip_by_name($name) { - global $config; $gateways_arr = return_gateways_array(); if (!empty($gateways_arr[$name])) { @@ -506,7 +485,6 @@ function lookup_gateway_monitor_ip_by_name($name) { } function lookup_gateway_interface_by_name($name) { - global $config; $gateways_arr = return_gateways_array(); if (!empty($gateways_arr[$name])) { @@ -526,8 +504,14 @@ function get_interface_gateway($interface, &$dynamic = false) { $gwcfg = $config['interfaces'][$interface]; if (is_ipaddr($gwcfg['gateway'])) $gw = $gwcfg['gateway']; - else if (!empty($gwcfg['gateway'])) - $gw = lookup_gateway_ip_by_name($gwcfg['gateway']); + else if (!empty($gwcfg['gateway']) && is_array($config['gateways']['gateway_item'])) { + foreach($config['gateways']['gateway_item'] as $gateway) { + if ($gateway['name'] == $gwcfg['gateway']) { + $gw = $gateway['gateway']; + break; + } + } + } // for dynamic interfaces we handle them through the $interface_router file. if (!is_ipaddr($gw) && !is_ipaddr($gwcfg['ipaddr'])) { diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 7bcd95dcb9..08b57c28dc 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -62,7 +62,7 @@ function get_interface_arr($flush = false) { /* If the cache doesn't exist, build it */ if (!isset($interface_arr_cache) or $flush) - $interface_arr_cache = `/sbin/ifconfig -l`; + $interface_arr_cache = explode(" ", trim(`/sbin/ifconfig -l`)); return $interface_arr_cache; } @@ -72,16 +72,16 @@ function get_interface_arr($flush = false) { * detected. */ function does_interface_exist($interface) { - global $config; + global $config; + + if(!$interface) + return false; - if(!$interface) - return false; - - $ints = get_interface_arr(); - if(stristr($ints, $interface) !== false) - return true; - else - return false; + $ints = get_interface_arr(); + if (in_array($interface, $ints)) + return true; + else + return false; } function interfaces_loopback_configure() { @@ -806,13 +806,11 @@ function interface_bring_down($interface = "wan", $destroy = false) { $realif = get_real_interface($interface); switch ($ifcfg['ipaddr']) { + case "ppp": case "pppoe": - killbypid("{$g['varrun_path']}/pppoe_{$interface}.pid"); - sleep(2); - unlink_if_exists("{$g['varetc_path']}/mpd_{$interface}.conf"); - break; case "pptp": - killbypid("{$g['varrun_path']}/pptp_{$interface}.pid"); + case "l2tp": + killbypid("{$g['varrun_path']}/{$ifcfg['ipaddr']}_{$interface}.pid"); sleep(2); unlink_if_exists("{$g['varetc_path']}/mpd_{$interface}.conf"); break; @@ -833,11 +831,6 @@ function interface_bring_down($interface = "wan", $destroy = false) { mwexec("/usr/sbin/arp -d -i {$realif} -a"); } break; - case "ppp": - killbypid("{$g['varrun_path']}/ppp_{$interface}.pid"); - sleep(2); - unlink_if_exists("{$g['varetc_path']}/mpd_{$interface}.conf"); - break; default: if(does_interface_exist("$realif")) { mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " delete", true); @@ -867,122 +860,430 @@ function interface_bring_down($interface = "wan", $destroy = false) { return; } -function interface_ppp_configure($interface) { - global $config, $g; - - $wancfg =& $config['interfaces'][$interface]; - if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) { - foreach ($config['ppps']['ppp'] as $ppp) { - if ($wancfg['if'] == basename($ppp['port'])) - break; +function interfaces_ptpid_used($ptpid) { + global $config; + + if (is_array($config['ppps']['ppp'])) + foreach ($config['ppps']['ppp'] as & $settings) + if ($ptpid == $settings['ptpid']) + return true; + + return false; +} + +function interfaces_ptpid_next() { + + $ptpid = 0; + while(interfaces_ptpid_used($ptpid)) + $ptpid++; + + return $ptpid; +} + +function getMPDCRONSettings($pppif_) { + global $config; + $cron_cmd_file = "{$g['varetc_path']}/pppoe_restart_"; + if (is_array($config['cron']['item'])) { + for ($i = 0; $i < count($config['cron']['item']); $i++) { + $item = $config['cron']['item'][$i]; + if (strpos($item['command'], $cron_cmd_file.$pppif_) !== false) { + return array("ID" => $i, "ITEM" => $item); + } } } - if (!$ppp || empty($ppp['port'])) - return; + return NULL; +} - if ($interface == "wan") - $pppid = "0"; - else - $pppid = substr($interface, 3); +function handle_pppoe_reset($post_array) { + global $config, $g; - $pppif = "ppp{$pppid}"; + $cron_cmd_file = "{$g['varetc_path']}/pppoe_restart_"; - // mpd5 requires a /var/spool/lock directory + $pppif = $post_array['type'].$post_array['ptpid']; + if (!is_array($config['cron']['item'])) + $config['cron']['item'] = array(); + $itemhash = getMPDCRONSettings($pppif); + $item = $itemhash['ITEM']; + + // reset cron items if necessary and return + if (empty($post_array['pppoe-reset-type'])) { + if (isset($item)) + unset($config['cron']['item'][$itemhash['ID']]); + sigkillbypid("{$g['varrun_path']}/cron.pid", "HUP"); + return; + } + + if (empty($item)) + $item = array(); + if (isset($post_array['pppoe-reset-type']) && $post_array['pppoe-reset-type'] == "custom") { + $item['minute'] = $post_array['pppoe_resetminute']; + $item['hour'] = $post_array['pppoe_resethour']; + if (isset($post_array['pppoe_resetdate']) && $post_array['pppoe_resetdate'] <> "") { + $date = explode("/", $post_array['pppoe_resetdate']); + $item['mday'] = $date[1]; + $item['month'] = $date[0]; + } else { + $item['mday'] = "*"; + $item['month'] = "*"; + } + $item['wday'] = "*"; + $item['who'] = "root"; + $item['command'] = $cron_cmd_file.$pppif; + } else if (isset($post_array['pppoe-reset-type']) && $post_array['pppoe-reset-type'] == "preset") { + switch ($post_array['pppoe_pr_preset_val']) { + case "monthly": + $item['minute'] = "0"; + $item['hour'] = "0"; + $item['mday'] = "1"; + $item['month'] = "*"; + $item['wday'] = "*"; + $item['who'] = "root"; + $item['command'] = $cron_cmd_file.$pppif; + break; + case "weekly": + $item['minute'] = "0"; + $item['hour'] = "0"; + $item['mday'] = "*"; + $item['month'] = "*"; + $item['wday'] = "0"; + $item['who'] = "root"; + $item['command'] = $cron_cmd_file.$pppif; + break; + case "daily": + $item['minute'] = "0"; + $item['hour'] = "0"; + $item['mday'] = "*"; + $item['month'] = "*"; + $item['wday'] = "*"; + $item['who'] = "root"; + $item['command'] = $cron_cmd_file.$pppif; + break; + case "hourly": + $item['minute'] = "0"; + $item['hour'] = "*"; + $item['mday'] = "*"; + $item['month'] = "*"; + $item['wday'] = "*"; + $item['who'] = "root"; + $item['command'] = $cron_cmd_file.$pppif; + break; + } // end switch + } else { + /* test whether a cron item exists and unset() it if necessary */ + $itemhash = getMPDCRONSettings($pppif); + $item = $itemhash['ITEM']; + if (isset($item)) + unset($config['cron']['item'][$itemhash['ID']]); + }// end if + if (isset($itemhash['ID'])) + $config['cron']['item'][$itemhash['ID']] = $item; + else + $config['cron']['item'][] = $item; +} + +/* This function can configure PPPoE, MLPPP (PPPoE), PPtP. +* It writes the mpd config file to /var/etc every time the link is opened. +*/ + +function interface_ppps_configure($interface) { + global $config, $g; + + // mpd5 requires a /var/spool/lock directory for PPP modem links. if(!is_dir("/var/spool/lock")) { exec("/bin/mkdir -p /var/spool/lock"); exec("/bin/chmod a+rw /var/spool/lock/."); } + // mpd5 modem chat script expected in the same directory as the mpd_xxx.conf files if (!file_exists("{$g['varetc_path']}/mpd.script")) mwexec("/bin/ln -s /usr/local/sbin/mpd.script {$g['varetc_path']}/."); - if($g['booting']) - echo " configuring PPP on {$pppif} interface...\n"; + $ifcfg = &$config['interfaces'][$interface]; + if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) { + foreach ($config['ppps']['ppp'] as $pppid => $ppp) { + if ($ifcfg['if'] == $ppp['if']) + break; + } + } + if (!$ppp || $ifcfg['if'] != $ppp['if']){ + log_error("Can't find PPP config for {$ifcfg['if']} in interface_ppps_configure()."); + return 0; + } + if (!isset($ifcfg['enable'])) { + log_error("{$interface} is not enabled."); + return 0; + } + $pppif = $ifcfg['if']; + if ($ppp['type'] == "ppp") + $type = "modem"; + else + $type = $ppp['type']; + $upper_type = strtoupper($ppp['type']); + + if($g['booting']) { + echo " configuring {$upper_type} on {$pppif} interface...\n"; + // Do not re-configure the interface if we are booting and it's already been started + if(file_exists("{$g['varrun_path']}/{$ppp['type']}_{$interface}.pid")) + return 0; + } + + $ports = explode(',',$ppp['ports']); + $localips = explode(',',$ppp['localip']); + $gateways = explode(',',$ppp['gateway']); + $subnets = explode(',',$ppp['subnet']); + + /* We bring up the parent interface first because if DHCP is configured on the parent we need + to obtain an address first so we can write it in the mpd .conf file for PPtP and L2tP configs + */ + foreach($ports as $pid => $port){ + switch ($ppp['type']) { + case "pppoe": + /* Bring the parent interface up */ + interfaces_bring_up($port); + break; + case "pptp": + case "l2tp": + /* configure interface */ + if ($localips[$pid] == "dhcp") { + // configure DHCP on the $port interface + interface_dhcp_configure($port); + // Wait for the IP address before proceeding. + for ($count = 0; $count < 30; $count++) { + $localips[$pid] = find_interface_ip($port); + if(is_ipaddr($localips[$pid])) + break; + sleep(1); + } + log_error("Could not get PPtP/L2tP Local IP address for {$port} using DHCP in interfaces_ppps_configure"); + return 0; + } else { + // Manually configure interface IP/subnet + mwexec("/sbin/ifconfig " . escapeshellarg($port) . " " . + escapeshellarg($localips[$pid] . "/" . $subnets[$pid]) . " up"); + } + /* configure the gateway (remote IP ) */ + if (!is_ipaddr($gateways[$pid]) && is_hostname($gateways[$pid])) { + // do a DNS lookup for the gateway IP and store it in $gateways[$pid] + for ($count = 0; $count < 30; $count++) { + $gateways[$pid] = gethostbyname($gateways[$pid]); + if(is_ipaddr($gateways[$pid])) + break; + sleep(1); + } + log_error("Could not get a PPtP/L2tP Remote IP address for {$port} using DNS in interfaces_ppps_configure"); + return 0; + } + if (0) // Logic for this? + log_error("Could not bring up interface {$port} for {$interface} {$ppp['type']} link in interface_ppps_configure()."); + break; + case "ppp": + if (!file_exists("{$port}")) { + log_error("Device {$port} does not exist. PPP link cannot start without the modem device."); + return 1; + } + break; + default: + break; + } + } /* generate mpd.conf */ $fd = fopen("{$g['varetc_path']}/mpd_{$interface}.conf", "w"); if (!$fd) { - log_error("Error: cannot open mpd_{$interface}.conf in interface_ppp_configure().\n"); + log_error("Error: cannot open mpd_{$interface}.conf in interface_ppps_configure().\n"); return 1; } + + if (is_array($ports) && count($ports) > 1) + $multilink = "enable"; + else + $multilink = "disable"; + + if ($type == "modem"){ + if (is_ipaddr($ppp['localip'])) + $localip = $ppp['localip']; + else + $localip = '0.0.0.0'; + + if (is_ipaddr($ppp['gateway'])) + $gateway = $ppp['gateway']; + else + $gateway = "10.6.6.{$pppid}"; + $ranges = "{$localip}/0 {$gateway}/0"; + + if (empty($ppp['apnum'])) + $ppp['apnum'] = 1; + } + else + $ranges = "0.0.0.0/0 0.0.0.0/0"; + + if (isset($ppp['ondemand'])) + $ondemand = "enable"; + else + $ondemand = "disable"; + if (!isset($ppp['idletimeout'])) + $ppp['idletimeout'] = 0; + + if (empty($ppp['username']) && $type == "modem"){ + $ppp['username'] = "user"; + $ppp['password'] = "none"; + } + if (empty($ppp['password']) && $type == "modem") + $passwd = "none"; + else + $passwd = base64_decode($ppp['password']); + + $bandwidths = explode(',',$ppp['bandwidth']); + $mtus = explode(',',$ppp['mtu']); + $mrus = explode(',',$ppp['mru']); + + if (isset($ppp['mrru'])) + $mrrus = explode(',',$ppp['mrru']); // Construct the mpd.conf file $mpdconf = << $port){ + $mpdconf .= << /conf/{$pppif}.log"); + conf_mount_ro(); + } + } else { + if (file_exists("/conf/{$pppif}.log")) { + conf_mount_rw(); + mwexec("rm -f /conf/{$pppif}.log"); + conf_mount_ro(); + } + } + + /* fire up mpd */ + mwexec("/usr/local/sbin/mpd5 -b -k -d {$g['varetc_path']} -f mpd_{$interface}.conf -p {$g['varrun_path']}/{$ppp['type']}_{$interface}.pid -s ppp {$ppp['type']}client"); + + // Check for PPPoE periodic reset request + if ($type == "pppoe") + if (isset($ppp['pppoe-reset-type'])) + setup_pppoe_reset_file($ppp['if'], $interface); + else + setup_pppoe_reset_file($ppp['if']); + + /* sleep until wan is up - or 30 seconds, whichever comes first */ + for ($count = 0; $count < 12; $count++) { + if(file_exists("{$g['tmp_path']}/{$pppif}up")) { + break; + } + sleep(1); + } + + return 0; } function interfaces_carp_setup() { @@ -1939,13 +2290,13 @@ function interface_configure($interface = "wan", $reloadall = false) { interface_dhcp_configure($interface); break; case 'pppoe': - interface_pppoe_configure($interface); + interface_ppps_configure($interface); break; case 'pptp': - interface_pptp_configure($interface); + interface_ppps_configure($interface); break; case 'ppp': - interface_ppp_configure($interface); + interface_ppps_configure($interface); break; default: if ($wancfg['ipaddr'] <> "" && $wancfg['subnet'] <> "") { @@ -2062,7 +2413,12 @@ function interface_dhcp_configure($interface = "wan") { } $wanif = get_real_interface($interface); - + if ($wancfg['ipaddr'] == "pppoe" || $wancfg['ipaddr'] == "pptp" || $wancfg['ipaddr'] == "l2tp") + $wanif = get_real_interface($interface, true); + if (stristr($wanif,',')) { + log_error("Invalid interface \"{$wanif}\" in interface_dhcp_configure()"); + return 0; + } $dhclientconf = ""; $dhclientconf .= << {$g['tmp_path']}/{$wanif}_output > {$g['tmp_path']}/{$wanif}_error_output"); @@ -2108,7 +2462,10 @@ EOD; function interface_pppoe_configure($interface = "wan") { global $config, $g; - $wancfg = $config['interfaces'][$interface]; + if (!is_array($config['interfaces'][$interface])) + return; + + $wancfg =& $config['interfaces'][$interface]; /* generate mpd.conf */ $fd = fopen("{$g['varetc_path']}/mpd_{$interface}.conf", "w"); @@ -2142,7 +2499,8 @@ EOD; $realif = "pppoe0"; else { // Here code assumes only that strings of form "opt#" will be passed. - $realif = "pppoe" . substr($interface, 3); + $pppoeidx = substr($interface, 3); + $realif = "pppoe{$pppoeidx}"; } $mpdconf .= << 0) + $index = intval(substr($interface, 5)); + if ($interface == "pppoe") + return "lan"; + if ($index > 0) return "opt{$index}"; else return "wan"; } else if (stristr($interface, "pptp")) { - $index = substr($interface, 4); - if (intval($index) > 0) + $index = intval(substr($interface, 4)); + if ($interface == "pptp") + return "lan"; + if ($index > 0) return "opt{$index}"; else return "wan"; - } else if (stristr($interface, "vip")) { - $index = substr($interface, 3); - $counter = 0; - foreach ($config['virtualip']['vip'] as $vip) { + } else if (stristr($interface, "ppp")) { + $index = intval(substr($interface, 3)); + if ($interface == "ppp") + return "lan"; + if ($index > 0) + return "opt{$index}"; + else + return "wan"; + } else if (stristr($interface, "l2tp")) { + $index = intval(substr($interface, 4)); + if ($interface == "l2tp") + return "lan"; + if ($index > 0) + return "opt{$index}"; + else + return "wan"; + } else if (stristr($interface, "vip")) { + $index = intval(substr($interface, 3)); + foreach ($config['virtualip']['vip'] as $counter => $vip) { if ($vip['mode'] == "carpdev-dhcp" || $vip['mode'] == "carp") { - if (intval($index) == $counter) + if ($index == $counter) return $vip['interface']; - $counter++; } } } else if (stristr($interface, "carp")) { - $index = substr($interface, 4); - $counter = 0; - foreach ($config['virtualip']['vip'] as $vip) { + $index = intval(substr($interface, 4)); + foreach ($config['virtualip']['vip'] as $counter => $vip) { if ($vip['mode'] == "carpdev-dhcp" || $vip['mode'] == "carp") { - if (intval($index) == $counter) + if ($index == $counter) return $vip['interface']; - $counter++; } } } - /* if list */ - $ifdescrs = get_configured_interface_list(false, true); + /* XXX: For speed reasons reference directly the interface array */ + $ifdescrs = $config['interfaces']; + //$ifdescrs = get_configured_interface_list(false, true); foreach ($ifdescrs as $if => $ifname) { - if($config['interfaces'][$if]['if'] == $interface) - return $ifname; + if ($config['interfaces'][$if]['if'] == $interface) + return $if; /* XXX: ermal - The 3 lines below are totally bogus code. */ $int = interface_translate_type_to_real($if); - if($ifname == $interface) - return $ifname; - - if($int == $interface) + if ($int == $interface) return $ifname; } return NULL; @@ -2575,7 +2951,7 @@ function interface_get_wireless_clone($wlif) { } } -function get_real_interface($interface = "wan") { +function get_real_interface($interface = "wan", $get_parent = false) { global $config; $wanif = NULL; @@ -2601,78 +2977,60 @@ function get_real_interface($interface = "wan") { $wanif = "ppp"; break; default: - $iflist = get_configured_interface_with_descr(false, true); + // If a real interface was alread passed simply + // pass the real interface back. This encourages + // the usage of this function in more cases so that + // we can combine logic for more flexibility. + if(does_interface_exist($interface)) { + $wanif = $interface; + break; + } + if (empty($config['interfaces'][$interface])) + break; - foreach ($iflist as $if => $ifdesc) { - // If a real interface was alread passed simply - // pass the real interface back. This encourages - // the usage of this function in more cases so that - // we can combine logic for more flexibility. - if($config['interfaces'][$if]['if'] == $interface) { - if(does_interface_exist($interface)) { - $wanif = $interface; - break; + $cfg =& $config['interfaces'][$interface]; + + // Wireless cloned NIC support (FreeBSD 8+) + // interface name format: $parentnic_wlanparentnic# + // example: ath0_wlan0 + if (is_interface_wireless($cfg['if'])) { + $wanif = interface_get_wireless_clone($cfg['if']); + break; + } + /* + if (empty($cfg['if'])) { + $wancfg = $cfg['if']; + break; + } + */ + + switch ($cfg['ipaddr']) { + case "carpdev-dhcp": + $viparr = &$config['virtualip']['vip']; + if(is_array($viparr)) + foreach ($viparr as $counter => $vip) { + if ($vip['mode'] == "carpdev-dhcp") { + if($vip['interface'] == $interface) { + $wanif = "carp{$counter}"; + break; + } + } } - } - - if ($interface == $if || $interface == $ifdesc) { - - $cfg = $config['interfaces'][$if]; - - // Wireless cloned NIC support (FreeBSD 8+) - // interface name format: $parentnic_wlanparentnic# - // example: ath0_wlan0 - if(is_interface_wireless($cfg['if'])) { - $wanif = interface_get_wireless_clone($cfg['if']); break; - } - - if (empty($cfg['ipaddr'])) { + case "pppoe": + case "pptp": + case "l2tp": + case "ppp": + $wanif = $cfg['if']; + if ($get_parent) + foreach ($config['ppps']['ppp'] as $ppp) { + if ($ppp['if'] == $cfg['if']) + $wanif = $ppp['ports']; + } + break; + default: $wanif = $cfg['if']; break; - } - - switch ($cfg['ipaddr']) { - case "carpdev-dhcp": - $viparr = &$config['virtualip']['vip']; - $counter = 0; - if(is_array($viparr)) - foreach ($viparr as $vip) { - if ($vip['mode'] == "carpdev-dhcp") { - if($vip['interface'] == $if) { - $wanif = "carp{$counter}"; - break; - } - $counter++; - } else if ($vip['mode'] = "carp") - $counter++; - } - break; - case "pppoe": - if ($if == "wan") - $wanif = "pppoe0"; - else - $wanif = "pppoe" . substr($if,3); - break; - case "pptp": - if ($if == "wan") - $wanif = "pptp0"; - else - $wanif = "pptp" . substr($if, 3); - break; - case "ppp": - if ($if == "wan") - $wanif = "ppp0"; - else - $wanif = "ppp" . substr($if, 3); - break; - default: - $wanif = $cfg['if']; - break; - } - - break; - } } break; } @@ -2880,7 +3238,7 @@ function find_interface_ip($interface, $flush = false) $interface = str_replace("\n", "", $interface); - if (does_interface_exist($interface) == false) + if (!does_interface_exist($interface)) return; /* Setup IP cache */ @@ -2920,15 +3278,11 @@ function get_interface_ip($interface = "wan") return null; } - /* Do we really come here for these interfaces ?! */ - if (in_array($realif, array("pptp", "pppoe", "l2tp", "openvpn", "enc0" /* , "ppp" */))) - return ""; - $curip = find_interface_ip($realif); if ($curip && is_ipaddr($curip) && ($curip != "0.0.0.0")) return $curip; - - return null; + else + return null; } function get_interface_subnet($interface = "wan") @@ -2943,10 +3297,6 @@ function get_interface_subnet($interface = "wan") return null; } - /* Do we really come here for these interfaces ?! */ - if (in_array($realif, array("pptp", "pppoe", "l2tp", "openvpn", "enc0" /* , "ppp" */))) - return ""; - $cursn = find_interface_subnet($realif); if (!empty($cursn)) return $cursn; @@ -2966,14 +3316,16 @@ function get_interfaces_with_gateway() { switch ($ifname['ipaddr']) { case "dhcp": case "carpdev-dhcp": + case "ppp"; case "pppoe": case "pptp": + case "l2tp": case "ppp"; - $ints[] = $ifdescr; + $ints[$ifdescr] = $ifdescr; break; default: if (!empty($ifname['gateway'])) - $ints[] = $ifdescr; + $ints[$ifdescr] = $ifdescr; break; } } @@ -2982,10 +3334,25 @@ function get_interfaces_with_gateway() { /* return true if interface has a gateway */ function interface_has_gateway($friendly) { + global $config; - $friendly = strtolower($friendly); - if (in_array($friendly, get_interfaces_with_gateway())) - return true; + if (!empty($config['interfaces'][$friendly])) { + $ifname =& $config['interfaces'][$friendly]; + switch ($ifname['ipaddr']) { + case "dhcp": + case "carpdev-dhcp": + case "pppoe": + case "pptp": + case "l2tp": + case "ppp"; + return true; + break; + default: + if (!empty($ifname['gateway'])) + return true; + break; + } + } return false; } @@ -3163,16 +3530,17 @@ function is_jumbo_capable($int) { return false; } -function setup_pppoe_reset_file($interface, $status) { - define("CRON_PPPOE_CMD_FILE", "/conf/pppoe{$interface}restart"); - define("CRON_PPPOE_CMD", "#!/bin/sh\necho '' | /usr/local/bin/php -q"); - if ($status == true) { - if (!file_exists(CRON_PPPOE_CMD_FILE)) { - file_put_contents(CRON_PPPOE_CMD_FILE, CRON_PPPOE_CMD); - chmod(CRON_PPPOE_CMD_FILE, 0700); - } +function setup_pppoe_reset_file($pppif, $iface="") { + global $g; + $cron_file = "{$g['varetc_path']}/pppoe_restart_{$pppif}"; + + if(!empty($iface) && !empty($pppif)){ + $cron_cmd = "#!/bin/sh\necho '' | /usr/local/bin/php -q"; + file_put_contents($cron_file, $cron_cmd); + chmod($cron_file, 0700); + sigkillbypid("{$g['varrun_path']}/cron.pid", "HUP"); } else - unlink_if_exists(CRON_PPPOE_CMD_FILE); + unlink_if_exists($cron_file); } ?> diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 21bbe0ce32..188a2814ae 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1147,7 +1147,6 @@ function convert_seconds_to_hms($sec){ } /* Compute the total uptime from the ppp uptime log file in the conf directory */ -/* Written by: gnoahb@gmail.com */ function get_ppp_uptime($port){ if (file_exists("/conf/{$port}.log")){ @@ -1171,7 +1170,7 @@ function get_interface_info($ifdescr) { $ifinfo = array(); if (empty($config['interfaces'][$ifdescr])) return; - $ifinfo['hwif'] = $config['interfaces'][$if]['if']; + $ifinfo['hwif'] = $config['interfaces'][$ifdescr]['if']; $ifinfo['if'] = get_real_interface($ifdescr); $chkif = $ifinfo['if']; @@ -1255,16 +1254,25 @@ function get_interface_info($ifdescr) { /* PPP interface? -> get uptime for this session and cumulative uptime from the persistant log file in conf */ case "ppp": if ($ifinfo['status'] == "up") - $ifinfo['ppplink'] = "up"; + $ifinfo['ppplink'] = "up"; else $ifinfo['ppplink'] = "down" ; - $dev = $config['interfaces'][$if]['if']; - if (empty($dev)) + if (empty($ifinfo['status'])) + $ifinfo['status'] = "down"; + + if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) { + foreach ($config['ppps']['ppp'] as $pppid => $ppp) { + if ($config['interfaces'][$ifdescr]['if'] == $ppp['if']) + break; + } + } + $dev = $ppp['ports']; + if ($config['interfaces'][$ifdescr]['if'] != $ppp['if'] || empty($dev)) break; - if (file_exists("/dev/{$dev}")) { - if (file_exists("{$g['varrun_path']}/ppp_{$if}.pid")) { - $ifinfo['pppinfo'] = "{$ifinfo['if']}"; + if (file_exists($dev)) { + if (file_exists("{$g['varrun_path']}/ppp_{$ifdescr}.pid")) { + $ifinfo['pppinfo'] = $ifinfo['ifdescr']; $sec = trim(`/usr/local/sbin/ppp-uptime.sh {$ifinfo['if']}`); $ifinfo['ppp_uptime'] = convert_seconds_to_hms($sec); } @@ -1332,8 +1340,8 @@ function get_interface_info($ifdescr) { } /* lookup the gateway */ - if (interface_has_gateway($if)) - $ifinfo['gateway'] = get_interface_gateway($if); + if (interface_has_gateway($ifdescr)) + $ifinfo['gateway'] = get_interface_gateway($ifdescr); } $bridge = ""; @@ -2003,4 +2011,164 @@ function get_include_contents($filename) { return false; } +/* This xml 2 array function is courtesy of the php.net comment section on xml_parse. + * it is roughly 4 times faster then our existing pfSense parser but due to the large + * size of the RRD xml dumps this is required. + * The reason we do not use it for pfSense is that it does not know about array fields + * which causes it to fail on array fields with single items. Possible Todo? + */ +function xml2array($contents, $get_attributes = 1, $priority = 'tag') +{ + if (!function_exists('xml_parser_create')) + { + return array (); + } + $parser = xml_parser_create(''); + xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8"); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); + xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); + xml_parse_into_struct($parser, trim($contents), $xml_values); + xml_parser_free($parser); + if (!$xml_values) + return; //Hmm... + $xml_array = array (); + $parents = array (); + $opened_tags = array (); + $arr = array (); + $current = & $xml_array; + $repeated_tag_index = array (); + foreach ($xml_values as $data) + { + unset ($attributes, $value); + extract($data); + $result = array (); + $attributes_data = array (); + if (isset ($value)) + { + if ($priority == 'tag') + $result = $value; + else + $result['value'] = $value; + } + if (isset ($attributes) and $get_attributes) + { + foreach ($attributes as $attr => $val) + { + if ($priority == 'tag') + $attributes_data[$attr] = $val; + else + $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr' + } + } + if ($type == "open") + { + $parent[$level -1] = & $current; + if (!is_array($current) or (!in_array($tag, array_keys($current)))) + { + $current[$tag] = $result; + if ($attributes_data) + $current[$tag . '_attr'] = $attributes_data; + $repeated_tag_index[$tag . '_' . $level] = 1; + $current = & $current[$tag]; + } + else + { + if (isset ($current[$tag][0])) + { + $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result; + $repeated_tag_index[$tag . '_' . $level]++; + } + else + { + $current[$tag] = array ( + $current[$tag], + $result + ); + $repeated_tag_index[$tag . '_' . $level] = 2; + if (isset ($current[$tag . '_attr'])) + { + $current[$tag]['0_attr'] = $current[$tag . '_attr']; + unset ($current[$tag . '_attr']); + } + } + $last_item_index = $repeated_tag_index[$tag . '_' . $level] - 1; + $current = & $current[$tag][$last_item_index]; + } + } + elseif ($type == "complete") + { + if (!isset ($current[$tag])) + { + $current[$tag] = $result; + $repeated_tag_index[$tag . '_' . $level] = 1; + if ($priority == 'tag' and $attributes_data) + $current[$tag . '_attr'] = $attributes_data; + } + else + { + if (isset ($current[$tag][0]) and is_array($current[$tag])) + { + $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result; + if ($priority == 'tag' and $get_attributes and $attributes_data) + { + $current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data; + } + $repeated_tag_index[$tag . '_' . $level]++; + } + else + { + $current[$tag] = array ( + $current[$tag], + $result + ); + $repeated_tag_index[$tag . '_' . $level] = 1; + if ($priority == 'tag' and $get_attributes) + { + if (isset ($current[$tag . '_attr'])) + { + $current[$tag]['0_attr'] = $current[$tag . '_attr']; + unset ($current[$tag . '_attr']); + } + if ($attributes_data) + { + $current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data; + } + } + $repeated_tag_index[$tag . '_' . $level]++; //0 and 1 index is already taken + } + } + } + elseif ($type == 'close') + { + $current = & $parent[$level -1]; + } + } + return ($xml_array); +} + +function get_country_name($country_code) { + if ($country_code != "ALL" && strlen($country_code) != 2) + return ""; + + $country_names_xml = "/usr/local/share/mobile-broadband-provider-info/iso_3166-1_list_en.xml"; + $country_names_contents = file_get_contents($country_names_xml); + $country_names = xml2array($country_names_contents); + + if($country_code == "ALL") { + $country_list = array(); + foreach($country_names['ISO_3166-1_List_en']['ISO_3166-1_Entry'] as $country) { + $country_list[] = array( "code" => $country['ISO_3166-1_Alpha-2_Code_element'], + "name" => ucwords(strtolower($country['ISO_3166-1_Country_name'])) ); + } + return $country_list; + } + + foreach ($country_names['ISO_3166-1_List_en']['ISO_3166-1_Entry'] as $country) { + if ($country['ISO_3166-1_Alpha-2_Code_element'] == strtoupper($country_code)) { + return ucwords(strtolower($country['ISO_3166-1_Country_name'])); + } + } + return ""; +} + ?> diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index f06b98c721..6c241c2050 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -882,24 +882,6 @@ function delete_package_xml($pkg) { eval_once($pkg_config['custom_php_global_functions']); if($pkg_config['custom_php_pre_deinstall_command'] <> "") eval_once($pkg_config['custom_php_pre_deinstall_command']); - /* remove all additional files */ - if(is_array($pkg_config['additional_files_needed'])) { - $static_output .= "\tAuxiliary files... "; - update_output_window($static_output); - foreach($pkg_config['additional_files_needed'] as $afn) { - $filename = get_filename_from_url($afn['item'][0]); - if($afn['prefix'] <> "") { - $prefix = $afn['prefix']; - } else { - $prefix = "/usr/local/pkg/"; - } - unlink_if_exists($prefix . $filename); - if(file_exists($prefix . $filename)) - mwexec("rm -rf {$prefix}{$filename}"); - } - $static_output .= "done.\n"; - update_output_window($static_output); - } /* system files */ if(is_array($pkg_config['modify_system']['item'])) { $static_output .= "\tSystem files... "; @@ -935,6 +917,24 @@ function delete_package_xml($pkg) { update_output_window($static_output); } + /* remove all additional files */ + if(is_array($pkg_config['additional_files_needed'])) { + $static_output .= "\tAuxiliary files... "; + update_output_window($static_output); + foreach($pkg_config['additional_files_needed'] as $afn) { + $filename = get_filename_from_url($afn['item'][0]); + if($afn['prefix'] <> "") { + $prefix = $afn['prefix']; + } else { + $prefix = "/usr/local/pkg/"; + } + unlink_if_exists($prefix . $filename); + if(file_exists($prefix . $filename)) + mwexec("rm -rf {$prefix}{$filename}"); + } + $static_output .= "done.\n"; + update_output_window($static_output); + } /* package XML file */ $static_output .= "\tPackage XML... "; update_output_window($static_output); diff --git a/etc/inc/priv.defs.inc b/etc/inc/priv.defs.inc index 2c4543de0b..7c900fef4f 100644 --- a/etc/inc/priv.defs.inc +++ b/etc/inc/priv.defs.inc @@ -318,6 +318,12 @@ $priv_list['page-getstats']['descr'] = "Allow access to the 'AJAX: Get Stats' pa $priv_list['page-getstats']['match'] = array(); $priv_list['page-getstats']['match'][] = "getstats.php*"; +$priv_list['page-status-systemlogs-ppp'] = array(); +$priv_list['page-status-systemlogs-ppp']['name'] = "WebCfg - Status: System logs: IPsec VPN page"; +$priv_list['page-status-systemlogs-ppp']['descr'] = "Allow access to the 'Status: System logs: IPsec VPN' page."; +$priv_list['page-status-systemlogs-ppp']['match'] = array(); +$priv_list['page-status-systemlogs-ppp']['match'][] = "diag_logs_ppp.php*"; + $priv_list['page-diagnostics-nanobsd'] = array(); $priv_list['page-diagnostics-nanobsd']['name'] = "WebCfg - Diagnostics: NanoBSD"; $priv_list['page-diagnostics-nanobsd']['descr'] = "Allow access to the 'Diagnostics: NanoBSD' page."; diff --git a/etc/inc/rrd.inc b/etc/inc/rrd.inc index fa2920e268..98766e3301 100644 --- a/etc/inc/rrd.inc +++ b/etc/inc/rrd.inc @@ -634,142 +634,7 @@ function enable_rrd_graphing() { } function kill_traffic_collector() { - mwexec("/bin/pkill -f updaterrd.sh"); -} - -/* This xml 2 array function is courtesy of the php.net comment section on xml_parse. - * it is roughly 4 times faster then our existing pfSense parser but due to the large - * size of the RRD xml dumps this is required. - * The reason we do not use it for pfSense is that it does not know about array fields - * which causes it to fail on array fields with single items. Possible Todo? - */ -function xml2array($contents, $get_attributes = 1, $priority = 'tag') -{ - if (!function_exists('xml_parser_create')) - { - return array (); - } - $parser = xml_parser_create(''); - xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8"); - xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); - xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); - xml_parse_into_struct($parser, trim($contents), $xml_values); - xml_parser_free($parser); - if (!$xml_values) - return; //Hmm... - $xml_array = array (); - $parents = array (); - $opened_tags = array (); - $arr = array (); - $current = & $xml_array; - $repeated_tag_index = array (); - foreach ($xml_values as $data) - { - unset ($attributes, $value); - extract($data); - $result = array (); - $attributes_data = array (); - if (isset ($value)) - { - if ($priority == 'tag') - $result = $value; - else - $result['value'] = $value; - } - if (isset ($attributes) and $get_attributes) - { - foreach ($attributes as $attr => $val) - { - if ($priority == 'tag') - $attributes_data[$attr] = $val; - else - $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr' - } - } - if ($type == "open") - { - $parent[$level -1] = & $current; - if (!is_array($current) or (!in_array($tag, array_keys($current)))) - { - $current[$tag] = $result; - if ($attributes_data) - $current[$tag . '_attr'] = $attributes_data; - $repeated_tag_index[$tag . '_' . $level] = 1; - $current = & $current[$tag]; - } - else - { - if (isset ($current[$tag][0])) - { - $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result; - $repeated_tag_index[$tag . '_' . $level]++; - } - else - { - $current[$tag] = array ( - $current[$tag], - $result - ); - $repeated_tag_index[$tag . '_' . $level] = 2; - if (isset ($current[$tag . '_attr'])) - { - $current[$tag]['0_attr'] = $current[$tag . '_attr']; - unset ($current[$tag . '_attr']); - } - } - $last_item_index = $repeated_tag_index[$tag . '_' . $level] - 1; - $current = & $current[$tag][$last_item_index]; - } - } - elseif ($type == "complete") - { - if (!isset ($current[$tag])) - { - $current[$tag] = $result; - $repeated_tag_index[$tag . '_' . $level] = 1; - if ($priority == 'tag' and $attributes_data) - $current[$tag . '_attr'] = $attributes_data; - } - else - { - if (isset ($current[$tag][0]) and is_array($current[$tag])) - { - $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result; - if ($priority == 'tag' and $get_attributes and $attributes_data) - { - $current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data; - } - $repeated_tag_index[$tag . '_' . $level]++; - } - else - { - $current[$tag] = array ( - $current[$tag], - $result - ); - $repeated_tag_index[$tag . '_' . $level] = 1; - if ($priority == 'tag' and $get_attributes) - { - if (isset ($current[$tag . '_attr'])) - { - $current[$tag]['0_attr'] = $current[$tag . '_attr']; - unset ($current[$tag . '_attr']); - } - if ($attributes_data) - { - $current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data; - } - } - $repeated_tag_index[$tag . '_' . $level]++; //0 and 1 index is already taken - } - } - } - elseif ($type == 'close') - { - $current = & $parent[$level -1]; - } - } - return ($xml_array); + mwexec("/bin/pkill -f updaterrd.sh", true); } ?> diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 013351bee8..94f69cd849 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -38,26 +38,6 @@ pfSense_MODULE: utils */ -function services_parse_dhcpd_hostnames() { - global $g, $config; - - // Launch if option enabled - if (isset($config['dnsmasq']['regdhcp'])) { - /* Make sure we do not error out */ - @touch("{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases"); - if (!file_exists("{$g['varetc_path']}/hosts")) - system_hosts_generate(); - if (file_exists("{$g['varrun_path']}/dhcpleases.pid")) - sigkillbypid("{$g['varrun_path']}/dhcpleases.pid", "HUP"); - else - mwexec("/usr/local/sbin/dhcpleases -l {$g['dhcpd_chroot_path']}/var/db/dhcpd.leases -d {$config['system']['domain']} -p {$g['varrun_path']}/dnsmasq.pid -h {$g['varetc_path']}/hosts"); - } else { - sigkillbypid("{$g['varrun_path']}/dhcpleases.pid", "TERM"); - @unlink("{$g['varrun_path']}/dhcpleases.pid"); - } - -} - function services_dhcpd_configure() { global $config, $g; @@ -648,9 +628,6 @@ function services_dnsmasq_configure() { $return = 1; } - // restart isc-dhcpd parser - services_parse_dhcpd_hostnames(); - return $return; } diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 75e3f6d9d2..a7c3423577 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -225,6 +225,19 @@ function system_hosts_generate() { fwrite($fd, $hosts); fclose($fd); + /* Start the monitoring process for dynamic dhcpclients. */ + if (isset($config['dnsmasq']['regdhcp'])) { + /* Make sure we do not error out */ + @touch("{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases"); + if (file_exists("{$g['varrun_path']}/dhcpleases.pid")) + sigkillbypid("{$g['varrun_path']}/dhcpleases.pid", "HUP"); + else + mwexec("/usr/local/sbin/dhcpleases -l {$g['dhcpd_chroot_path']}/var/db/dhcpd.leases -d {$syscfg['domain']} -p {$g['varrun_path']}/dnsmasq.pid -h {$g['varetc_path']}/hosts"); + } else { + sigkillbypid("{$g['varrun_path']}/dhcpleases.pid", "TERM"); + @unlink("{$g['varrun_path']}/dhcpleases.pid"); + } + return 0; } diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index 81ee8f6cd3..2bd25ed061 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -1970,4 +1970,96 @@ function upgrade_062_to_063() { } } + +function upgrade_063_to_064() { + global $config; + $j=0; + $ifcfg = &$config['interfaces']; + + if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) { + foreach ($config['ppps']['ppp'] as $pppid => $ppp) { + $config['ppps']['ppp'][$pppid]['if'] = "ppp".$j; + $config['ppps']['ppp'][$pppid]['ptpid'] = $j; + $j++; + if (isset($ppp['port'])){ + $config['ppps']['ppp'][$pppid]['ports'] = $ppp['port']; + unset($config['ppps']['ppp'][$pppid]['port']); + } + if (!isset($ppp['type'])){ + $config['ppps']['ppp'][$pppid]['type'] = "ppp"; + } + if (isset($ppp['defaultgw'])) + unset($config['ppps']['ppp'][$pppid]['defaultgw']); + } + } + + if (!is_array($config['ppps']['ppp'])) + $config['ppps']['ppp'] = array(); + $a_ppps = &$config['ppps']['ppp']; + + foreach ($ifcfg as $ifname => $ifinfo) { + $ppp = array(); + // For pppoe conversion + if ($ifinfo['ipaddr'] == "pppoe" || $ifinfo['ipaddr'] == "pptp"){ + if (isset($ifinfo['ptpid'])) + continue; + $ppp['ptpid'] = $j; + $ppp['type'] = $ifinfo['ipaddr']; + $ppp['if'] = $ifinfo['ipaddr'].$j; + $ppp['ports'] = $ifinfo['if']; + if ($ifinfo['ipaddr'] == "pppoe"){ + $ppp['username'] = $ifinfo['pppoe_username']; + $ppp['password'] = base64_encode($ifinfo['pppoe_password']); + } + if ($ifinfo['ipaddr'] == "pptp"){ + $ppp['username'] = $ifinfo['pptp_username']; + $ppp['password'] = base64_encode($ifinfo['pptp_password']); + } + + if (isset($ifinfo['provider'])) + $ppp['provider'] = $ifinfo['provider']; + if (isset($ifinfo['ondemand'])) + $ppp['ondemand'] = true; + if (isset($ifinfo['timeout'])) + $ppp['idletimeout'] = $ifinfo['timeout']; + if (isset($ifinfo['pppoe']['pppoe-reset-type'])){ + $ppp['pppoe-reset-type'] = $ifinfo['pppoe']['pppoe-reset-type']; + if (is_array($config['cron']['item'])) { + for ($i = 0; $i < count($config['cron']['item']); $i++) { + $item = $config['cron']['item'][$i]; + if (strpos($item['command'], "/conf/pppoe{$ifname}restart") !== false) + $config['cron']['item'][$i]['command'] = "/var/etc/pppoe_restart_" . $ppp['if']; + } + } + } + if (isset($ifinfo['local'])) + $ppp['localip'] = $ifinfo['local']; + if (isset($ifinfo['subnet'])) + $ppp['subnet'] = $ifinfo['subnet']; + if (isset($ifinfo['remote'])) + $ppp['gateway'] = $ifinfo['remote']; + + $ifcfg[$ifname]['if'] = $ifinfo['ipaddr'].$j; + $j++; + + unset($ifcfg[$ifname]['pppoe_username']); + unset($ifcfg[$ifname]['pppoe_password']); + unset($ifcfg[$ifname]['provider']); + unset($ifcfg[$ifname]['ondemand']); + unset($ifcfg[$ifname]['timeout']); + unset($ifcfg[$ifname]['pppoe_reset']); + unset($ifcfg[$ifname]['pppoe_preset']); + unset($ifcfg[$ifname]['pppoe']); + unset($ifcfg[$ifname]['pptp_username']); + unset($ifcfg[$ifname]['pptp_password']); + unset($ifcfg[$ifname]['local']); + unset($ifcfg[$ifname]['subnet']); + unset($ifcfg[$ifname]['remote']); + + $a_ppps[] = $ppp; + + } + } +} + ?> diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc index f38a0ff486..a98969d4aa 100644 --- a/etc/inc/vpn.inc +++ b/etc/inc/vpn.inc @@ -1065,18 +1065,20 @@ EOD; if (isset($pptpdcfg["wins"]) && $pptpdcfg['wins'] != "") $mpdconf .= " set ipcp nbns {$pptpdcfg['wins']}\n"; - if (is_array($pptpdcfg['dnsserver']) && ($pptpdcfg['dnsserver'][0])) { - $mpdconf .= " set ipcp dns " . join(" ", $pptpdcfg['dnsserver']) . "\n"; - } else - if (isset ($config['dnsmasq']['enable'])) { - $mpdconf .= " set ipcp dns " . get_interface_ip("lan"); - if ($syscfg['dnsserver'][0]) - $mpdconf .= " " . $syscfg['dnsserver'][0]; - $mpdconf .= "\n"; - } else - if (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) { - $mpdconf .= " set ipcp dns " . join(" ", $syscfg['dnsserver']) . "\n"; - } + + if (!empty($pptpdcfg['dns1'])) { + $mpdconf .= " set ipcp dns " . $pptpdcfg['dns1']; + if (!empty($pptpdcfg['dns2'])) + $mpdconf .= " " . $pptpdcfg['dns2']; + $mpdconf .= "\n"; + } elseif (isset ($config['dnsmasq']['enable'])) { + $mpdconf .= " set ipcp dns " . get_interface_ip("lan"); + if ($syscfg['dnsserver'][0]) + $mpdconf .= " " . $syscfg['dnsserver'][0]; + $mpdconf .= "\n"; + } elseif (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) { + $mpdconf .= " set ipcp dns " . join(" ", $syscfg['dnsserver']) . "\n"; + } if (isset ($pptpdcfg['radius']['server']['enable'])) { $authport = (isset($pptpdcfg['radius']['server']['port']) && strlen($pptpdcfg['radius']['server']['port']) > 1) ? $pptpdcfg['radius']['server']['port'] : 1812; @@ -1274,15 +1276,19 @@ pppoe_standart: EOD; - if (isset ($config['dnsmasq']['enable'])) { + if (!empty($pppoecfg['dns1'])) { + $mpdconf .= " set ipcp dns " . $pppoecfg['dns1']; + if (!empty($pppoecfg['dns2'])) + $mpdconf .= " " . $pppoecfg['dns2']; + $mpdconf .= "\n"; + } elseif (isset ($config['dnsmasq']['enable'])) { $mpdconf .= " set ipcp dns " . get_interface_ip("lan"); if ($syscfg['dnsserver'][0]) $mpdconf .= " " . $syscfg['dnsserver'][0]; $mpdconf .= "\n"; - } else - if (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) { + } elseif (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) { $mpdconf .= " set ipcp dns " . join(" ", $syscfg['dnsserver']) . "\n"; - } + } if (isset ($pppoecfg['radius']['enable'])) { $mpdconf .=<<. -EOF -} - -# Usage: convert os_device -# Convert an OS device to the corresponding GRUB drive. -# This part is OS-specific. -convert () { - # First, check if the device file exists. - if test -e "$1"; then - : - else - echo "$1: Not found or not a block device." 1>&2 - exit 1 - fi - - # Break the device name into the disk part and the partition part. - case "$host_os" in - linux*) - tmp_disk=`echo "$1" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' \ - -e 's%\(d[0-9]*\)p[0-9]*$%\1%' \ - -e 's%\(fd[0-9]*\)$%\1%' \ - -e 's%/part[0-9]*$%/disc%' \ - -e 's%\(c[0-7]d[0-9]*\).*$%\1%'` - tmp_part=`echo "$1" | sed -e 's%.*/[sh]d[a-z]\([0-9]*\)$%\1%' \ - -e 's%.*d[0-9]*p%%' \ - -e 's%.*/fd[0-9]*$%%' \ - -e 's%.*/floppy/[0-9]*$%%' \ - -e 's%.*/\(disc\|part\([0-9]*\)\)$%\2%' \ - -e 's%.*c[0-7]d[0-9]*p%%'` - ;; - gnu*) - tmp_disk=`echo "$1" | sed 's%\([sh]d[0-9]*\).*%\1%'` - tmp_part=`echo "$1" | sed "s%$tmp_disk%%"` ;; - freebsd[234]* | kfreebsd*-gnu) - tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%r\1%' \ - | sed 's%r\{0,1\}\(da[0-9]*\).*$%r\1%'` - tmp_part=`echo "$1" \ - | sed "s%.*/r\{0,1\}[saw]d[0-9]\(s[0-9]*[a-h]\)%\1%" \ - | sed "s%.*/r\{0,1\}da[0-9]\(s[0-9]*[a-h]\)%\1%"` - ;; - freebsd[567]*) - tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%\1%' \ - | sed 's%r\{0,1\}\(da[0-9]*\).*$%\1%'` - tmp_part=`echo "$1" \ - | sed "s%.*/r\{0,1\}[saw]d[0-9]\(s[0-9]*[a-h]\)%\1%" \ - | sed "s%.*/r\{0,1\}da[0-9]\(s[0-9]*[a-h]\)%\1%"` - ;; - netbsd* | knetbsd*-gnu) - tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([sw]d[0-9]*\).*$%r\1d%' \ - | sed 's%r\{0,1\}\(fd[0-9]*\).*$%r\1a%'` - tmp_part=`echo "$1" \ - | sed "s%.*/r\{0,1\}[sw]d[0-9]\([abe-p]\)%\1%"` - ;; - *) - echo "grub-install does not support your OS yet." 1>&2 - exit 1 ;; - esac - - # Get the drive name. - tmp_drive=`grep -v '^#' $device_map | grep "$tmp_disk *$" \ - | sed 's%.*\(([hf]d[0-9][a-g0-9,]*)\).*%\1%'` - - # If not found, print an error message and exit. - if test "x$tmp_drive" = x; then - echo "$1 does not have any corresponding BIOS drive." 1>&2 - exit 1 - fi - - if test "x$tmp_part" != x; then - # If a partition is specified, we need to translate it into the - # GRUB's syntax. - case "$host_os" in - linux*) - echo "$tmp_drive" | sed "s%)$%,`expr $tmp_part - 1`)%" ;; - gnu*) - if echo $tmp_part | grep "^s" >/dev/null; then - tmp_pc_slice=`echo $tmp_part \ - | sed "s%s\([0-9]*\)[a-g]*$%\1%"` - tmp_drive=`echo "$tmp_drive" \ - | sed "s%)%,\`expr "$tmp_pc_slice" - 1\`)%"` - fi - if echo $tmp_part | grep "[a-g]$" >/dev/null; then - tmp_bsd_partition=`echo "$tmp_part" \ - | sed "s%[^a-g]*\([a-g]\)$%\1%"` - tmp_drive=`echo "$tmp_drive" \ - | sed "s%)%,$tmp_bsd_partition)%"` - fi - echo "$tmp_drive" ;; - freebsd* | kfreebsd*-gnu) - if echo $tmp_part | grep "^s" >/dev/null; then - tmp_pc_slice=`echo $tmp_part \ - | sed "s%s\([0-9]*\)[a-h]*$%\1%"` - tmp_drive=`echo "$tmp_drive" \ - | sed "s%)%,\`expr "$tmp_pc_slice" - 1\`)%"` - fi - if echo $tmp_part | grep "[a-h]$" >/dev/null; then - tmp_bsd_partition=`echo "$tmp_part" \ - | sed "s%s\{0,1\}[0-9]*\([a-h]\)$%\1%"` - tmp_drive=`echo "$tmp_drive" \ - | sed "s%)%,$tmp_bsd_partition)%"` - fi - echo "$tmp_drive" ;; - netbsd* | knetbsd*-gnu) - if echo $tmp_part | grep "^[abe-p]$" >/dev/null; then - tmp_bsd_partition=`echo "$tmp_part" \ - | sed "s%\([a-p]\)$%\1%"` - tmp_drive=`echo "$tmp_drive" \ - | sed "s%)%,$tmp_bsd_partition)%"` - fi - echo "$tmp_drive" ;; - esac - else - # If no partition is specified, just print the drive name. - echo "$tmp_drive" - fi -} - -# Usage: resolve_symlink file -# Find the real file/device that file points at -resolve_symlink () { - tmp_fname=$1 - # Resolve symlinks - while test -L $tmp_fname; do - tmp_new_fname=`ls -al $tmp_fname | sed -n 's%.*-> \(.*\)%\1%p'` - if test -z "$tmp_new_fname"; then - echo "Unrecognized ls output" 2>&1 - exit 1 - fi - - # Convert relative symlinks - case $tmp_new_fname in - /*) tmp_fname="$tmp_new_fname" - ;; - *) tmp_fname="`echo $tmp_fname | sed 's%/[^/]*$%%'`/$tmp_new_fname" - ;; - esac - done - echo "$tmp_fname" -} - -# Usage: find_device file -# Find block device on which the file resides. -find_device () { - # For now, this uses the program `df' to get the device name, but is - # this really portable? - tmp_fname=`df $1/ | sed -n 's%.*\(/dev/[^ ]*\).*%\1%p'` - - if test -z "$tmp_fname"; then - echo "Could not find device for $1" 2>&1 - exit 1 - fi - - tmp_fname=`resolve_symlink $tmp_fname` - - echo "$tmp_fname" -} - -# Check the arguments. -for option in "$@"; do - case "$option" in - -h | --help) - usage - exit 0 ;; - -v | --version) - echo "grub-install (GNU GRUB ${VERSION})" - exit 0 ;; - --root-directory=*) - rootdir=`echo "$option" | sed 's/--root-directory=//'` ;; - --grub-shell=*) - grub_shell=`echo "$option" | sed 's/--grub-shell=//'` ;; - --no-floppy) - no_floppy="--no-floppy" ;; - --force-lba) - force_lba="--force-lba" ;; - --recheck) - recheck=yes ;; - # This is an undocumented feature... - --debug) - debug=yes ;; - -*) - echo "Unrecognized option \`$option'" 1>&2 - usage - exit 1 - ;; - *) - if test "x$install_device" != x; then - echo "More than one install_devices?" 1>&2 - usage - exit 1 - fi - install_device="${option}" ;; - esac -done - -if test "x$install_device" = x; then - echo "install_device not specified." 1>&2 - usage - exit 1 -fi - -# If the debugging feature is enabled, print commands. -if test $debug = yes; then - set -x -fi - -# Initialize these directories here, since ROOTDIR was initialized. -case "$host_os" in -netbsd* | openbsd*) - # Because /boot is used for the boot block in NetBSD and OpenBSD, use /grub - # instead of /boot/grub. - grub_prefix=/grub - bootdir=${rootdir} - ;; -*) - # Use /boot/grub by default. - bootdir=${rootdir}/boot - ;; -esac - -grubdir=${bootdir}/grub -device_map=${grubdir}/device.map - -# Check if GRUB is installed. -# This is necessary, because the user can specify "grub --read-only". -set $grub_shell dummy -if test -f "$1"; then - : -else - echo "$1: Not found." 1>&2 - exit 1 -fi - -if test -f "$pkglibdir/stage1"; then - : -else - echo "${pkglibdir}/stage1: Not found." 1>&2 - exit 1 -fi - -if test -f "$pkglibdir/stage2"; then - : -else - echo "${pkglibdir}/stage2: Not found." 1>&2 - exit 1 -fi - -# Don't check for *stage1_5, because it is not fatal even if any -# Stage 1.5 does not exist. - -# Create the GRUB directory if it is not present. -test -d "$bootdir" || mkdir "$bootdir" || exit 1 -test -d "$grubdir" || mkdir "$grubdir" || exit 1 - -# If --recheck is specified, remove the device map, if present. -if test $recheck = yes; then - rm -f $device_map -fi - -# Create the device map file if it is not present. -if test -f "$device_map"; then - : -else - # Create a safe temporary file. - test -n "$mklog" && log_file=`$mklog` - - $grub_shell --batch $no_floppy --device-map=$device_map <$log_file -quit -EOF - if grep "Error [0-9]*: " $log_file >/dev/null; then - cat $log_file 1>&2 - exit 1 - fi - - rm -f $log_file -fi - -# Make sure that there is no duplicated entry. -tmp=`sed -n '/^([fh]d[0-9]*)/s/\(^(.*)\).*/\1/p' $device_map \ - | sort | uniq -d | sed -n 1p` -if test -n "$tmp"; then - echo "The drive $tmp is defined multiple times in the device map $device_map" 1>&2 - exit 1 -fi - -# Check for INSTALL_DEVICE. -case "$install_device" in -/dev/*) - install_device=`resolve_symlink "$install_device"` - install_drive=`convert "$install_device"` - # I don't know why, but some shells wouldn't die if exit is - # called in a function. - if test "x$install_drive" = x; then - exit 1 - fi ;; -\([hf]d[0-9]*\)) - install_drive="$install_device" ;; -[hf]d[0-9]*) - # The GRUB format with no parenthesis. - install_drive="($install_device)" ;; -*) - echo "Format of install_device not recognized." 1>&2 - usage - exit 1 ;; -esac - -# Get the root drive. -root_device=`find_device ${rootdir}` -bootdir_device=`find_device ${bootdir}` - -# Check if the boot directory is in the same device as the root directory. -if test "x$root_device" != "x$bootdir_device"; then - # Perhaps the user has a separate boot partition. - root_device=$bootdir_device - grub_prefix="/grub" -fi - -# Convert the root device to a GRUB drive. -root_drive=`convert "$root_device"` -if test "x$root_drive" = x; then - exit 1 -fi - -# Check if the root directory exists in the same device as the grub -# directory. -grubdir_device=`find_device ${grubdir}` - -if test "x$grubdir_device" != "x$root_device"; then - # For now, cannot deal with this situation. - cat <&2 -You must set the root directory by the option --root-directory, because -$grubdir does not exist in the root device $root_device. -EOF - exit 1 -fi - -# Copy the GRUB images to the GRUB directory. -for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do - rm -f $file || exit 1 -done -for file in \ - ${pkglibdir}/stage1 ${pkglibdir}/stage2 ${pkglibdir}/*stage1_5; do - cp -f $file ${grubdir} || exit 1 -done - -# Make a default file. -${grub_set_default} --root-directory=${rootdir} default - -# Make sure that GRUB reads the same images as the host OS. -test -n "$mkimg" && img_file=`$mkimg` -test -n "$mklog" && log_file=`$mklog` - -for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do - count=5 - tmp=`echo $file | sed "s|^${grubdir}|${grub_prefix}|"` - while test $count -gt 0; do - $grub_shell --batch $no_floppy --device-map=$device_map <$log_file -dump ${root_drive}${tmp} ${img_file} -quit -EOF - if grep "Error [0-9]*: " $log_file >/dev/null; then - : - elif cmp $file $img_file >/dev/null; then - break - fi - sleep 1 - count=`expr $count - 1` - done - if test $count -eq 0; then - echo "The file $file not read correctly." 1>&2 - echo - fi -done - -rm -f $img_file -rm -f $log_file - -# Create a safe temporary file. -test -n "$mklog" && log_file=`$mklog` - -# Now perform the installation. -$grub_shell --batch $no_floppy --device-map=$device_map <$log_file -root $root_drive -setup $force_lba --stage2=$grubdir/stage2 --prefix=$grub_prefix $install_drive -quit -EOF - -if grep "Error [0-9]*: " $log_file >/dev/null || test $debug = yes; then - cat $log_file 1>&2 - exit 1 -fi - -rm -f $log_file - -# Prompt the user to check if the device map is correct. -echo "Installation finished. No error reported." -echo "This is the contents of the device map $device_map." -echo "Check if this is correct or not. If any of the lines is incorrect," -echo "fix it and re-run the script \`grub-install'." -echo - -cat $device_map - -# Bye. -exit 0 diff --git a/usr/local/sbin/kbdcheck b/usr/local/sbin/kbdcheck deleted file mode 100755 index 500fc1c964..0000000000 Binary files a/usr/local/sbin/kbdcheck and /dev/null differ diff --git a/usr/local/sbin/mdnsd b/usr/local/sbin/mdnsd deleted file mode 100755 index 0636247351..0000000000 Binary files a/usr/local/sbin/mdnsd and /dev/null differ diff --git a/usr/local/share/mobile-broadband-provider-info/iso_3166-1_list_en.xml b/usr/local/share/mobile-broadband-provider-info/iso_3166-1_list_en.xml new file mode 100755 index 0000000000..44c5a627b5 --- /dev/null +++ b/usr/local/share/mobile-broadband-provider-info/iso_3166-1_list_en.xml @@ -0,0 +1,987 @@ + + + + AFGHANISTAN + AF + + + ÅLAND ISLANDS + AX + + + ALBANIA + AL + + + ALGERIA + DZ + + + AMERICAN SAMOA + AS + + + ANDORRA + AD + + + ANGOLA + AO + + + ANGUILLA + AI + + + ANTARCTICA + AQ + + + ANTIGUA AND BARBUDA + AG + + + ARGENTINA + AR + + + ARMENIA + AM + + + ARUBA + AW + + + AUSTRALIA + AU + + + AUSTRIA + AT + + + AZERBAIJAN + AZ + + + BAHAMAS + BS + + + BAHRAIN + BH + + + BANGLADESH + BD + + + BARBADOS + BB + + + BELARUS + BY + + + BELGIUM + BE + + + BELIZE + BZ + + + BENIN + BJ + + + BERMUDA + BM + + + BHUTAN + BT + + + BOLIVIA, PLURINATIONAL STATE OF + BO + + + BOSNIA AND HERZEGOVINA + BA + + + BOTSWANA + BW + + + BOUVET ISLAND + BV + + + BRAZIL + BR + + + BRITISH INDIAN OCEAN TERRITORY + IO + + + BRUNEI DARUSSALAM + BN + + + BULGARIA + BG + + + BURKINA FASO + BF + + + BURUNDI + BI + + + CAMBODIA + KH + + + CAMEROON + CM + + + CANADA + CA + + + CAPE VERDE + CV + + + CAYMAN ISLANDS + KY + + + CENTRAL AFRICAN REPUBLIC + CF + + + CHAD + TD + + + CHILE + CL + + + CHINA + CN + + + CHRISTMAS ISLAND + CX + + + COCOS (KEELING) ISLANDS + CC + + + COLOMBIA + CO + + + COMOROS + KM + + + CONGO + CG + + + CONGO, THE DEMOCRATIC REPUBLIC OF THE + CD + + + COOK ISLANDS + CK + + + COSTA RICA + CR + + + CÔTE D'IVOIRE + CI + + + CROATIA + HR + + + CUBA + CU + + + CYPRUS + CY + + + CZECH REPUBLIC + CZ + + + DENMARK + DK + + + DJIBOUTI + DJ + + + DOMINICA + DM + + + DOMINICAN REPUBLIC + DO + + + ECUADOR + EC + + + EGYPT + EG + + + EL SALVADOR + SV + + + EQUATORIAL GUINEA + GQ + + + ERITREA + ER + + + ESTONIA + EE + + + ETHIOPIA + ET + + + FALKLAND ISLANDS (MALVINAS) + FK + + + FAROE ISLANDS + FO + + + FIJI + FJ + + + FINLAND + FI + + + FRANCE + FR + + + FRENCH GUIANA + GF + + + FRENCH POLYNESIA + PF + + + FRENCH SOUTHERN TERRITORIES + TF + + + GABON + GA + + + GAMBIA + GM + + + GEORGIA + GE + + + GERMANY + DE + + + GHANA + GH + + + GIBRALTAR + GI + + + GREECE + GR + + + GREENLAND + GL + + + GRENADA + GD + + + GUADELOUPE + GP + + + GUAM + GU + + + GUATEMALA + GT + + + GUERNSEY + GG + + + GUINEA + GN + + + GUINEA-BISSAU + GW + + + GUYANA + GY + + + HAITI + HT + + + HEARD ISLAND AND MCDONALD ISLANDS + HM + + + HOLY SEE (VATICAN CITY STATE) + VA + + + HONDURAS + HN + + + HONG KONG + HK + + + HUNGARY + HU + + + ICELAND + IS + + + INDIA + IN + + + INDONESIA + ID + + + IRAN, ISLAMIC REPUBLIC OF + IR + + + IRAQ + IQ + + + IRELAND + IE + + + ISLE OF MAN + IM + + + ISRAEL + IL + + + ITALY + IT + + + JAMAICA + JM + + + JAPAN + JP + + + JERSEY + JE + + + JORDAN + JO + + + KAZAKHSTAN + KZ + + + KENYA + KE + + + KIRIBATI + KI + + + KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF + KP + + + KOREA, REPUBLIC OF + KR + + + KUWAIT + KW + + + KYRGYZSTAN + KG + + + LAO PEOPLE'S DEMOCRATIC REPUBLIC + LA + + + LATVIA + LV + + + LEBANON + LB + + + LESOTHO + LS + + + LIBERIA + LR + + + LIBYAN ARAB JAMAHIRIYA + LY + + + LIECHTENSTEIN + LI + + + LITHUANIA + LT + + + LUXEMBOURG + LU + + + MACAO + MO + + + MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF + MK + + + MADAGASCAR + MG + + + MALAWI + MW + + + MALAYSIA + MY + + + MALDIVES + MV + + + MALI + ML + + + MALTA + MT + + + MARSHALL ISLANDS + MH + + + MARTINIQUE + MQ + + + MAURITANIA + MR + + + MAURITIUS + MU + + + MAYOTTE + YT + + + MEXICO + MX + + + MICRONESIA, FEDERATED STATES OF + FM + + + MOLDOVA, REPUBLIC OF + MD + + + MONACO + MC + + + MONGOLIA + MN + + + MONTENEGRO + ME + + + MONTSERRAT + MS + + + MOROCCO + MA + + + MOZAMBIQUE + MZ + + + MYANMAR + MM + + + NAMIBIA + NA + + + NAURU + NR + + + NEPAL + NP + + + NETHERLANDS + NL + + + NETHERLANDS ANTILLES + AN + + + NEW CALEDONIA + NC + + + NEW ZEALAND + NZ + + + NICARAGUA + NI + + + NIGER + NE + + + NIGERIA + NG + + + NIUE + NU + + + NORFOLK ISLAND + NF + + + NORTHERN MARIANA ISLANDS + MP + + + NORWAY + NO + + + OMAN + OM + + + PAKISTAN + PK + + + PALAU + PW + + + PALESTINIAN TERRITORY, OCCUPIED + PS + + + PANAMA + PA + + + PAPUA NEW GUINEA + PG + + + PARAGUAY + PY + + + PERU + PE + + + PHILIPPINES + PH + + + PITCAIRN + PN + + + POLAND + PL + + + PORTUGAL + PT + + + PUERTO RICO + PR + + + QATAR + QA + + + REUNION + RE + + + ROMANIA + RO + + + RUSSIAN FEDERATION + RU + + + RWANDA + RW + + + SAINT BARTHÉLEMY + BL + + + SAINT HELENA, ASCENSION AND TRISTAN DA CUNHA + SH + + + SAINT KITTS AND NEVIS + KN + + + SAINT LUCIA + LC + + + SAINT MARTIN + MF + + + SAINT PIERRE AND MIQUELON + PM + + + SAINT VINCENT AND THE GRENADINES + VC + + + SAMOA + WS + + + SAN MARINO + SM + + + SAO TOME AND PRINCIPE + ST + + + SAUDI ARABIA + SA + + + SENEGAL + SN + + + SERBIA + RS + + + SEYCHELLES + SC + + + SIERRA LEONE + SL + + + SINGAPORE + SG + + + SLOVAKIA + SK + + + SLOVENIA + SI + + + SOLOMON ISLANDS + SB + + + SOMALIA + SO + + + SOUTH AFRICA + ZA + + + SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS + GS + + + SPAIN + ES + + + SRI LANKA + LK + + + SUDAN + SD + + + SURINAME + SR + + + SVALBARD AND JAN MAYEN + SJ + + + SWAZILAND + SZ + + + SWEDEN + SE + + + SWITZERLAND + CH + + + SYRIAN ARAB REPUBLIC + SY + + + TAIWAN, PROVINCE OF CHINA + TW + + + TAJIKISTAN + TJ + + + TANZANIA, UNITED REPUBLIC OF + TZ + + + THAILAND + TH + + + TIMOR-LESTE + TL + + + TOGO + TG + + + TOKELAU + TK + + + TONGA + TO + + + TRINIDAD AND TOBAGO + TT + + + TUNISIA + TN + + + TURKEY + TR + + + TURKMENISTAN + TM + + + TURKS AND CAICOS ISLANDS + TC + + + TUVALU + TV + + + UGANDA + UG + + + UKRAINE + UA + + + UNITED ARAB EMIRATES + AE + + + UNITED KINGDOM + GB + + + UNITED STATES + US + + + UNITED STATES MINOR OUTLYING ISLANDS + UM + + + URUGUAY + UY + + + UZBEKISTAN + UZ + + + VANUATU + VU + + + VENEZUELA, BOLIVARIAN REPUBLIC OF + VE + + + VIET NAM + VN + + + VIRGIN ISLANDS, BRITISH + VG + + + VIRGIN ISLANDS, U.S. + VI + + + WALLIS AND FUTUNA + WF + + + WESTERN SAHARA + EH + + + YEMEN + YE + + + ZAMBIA + ZM + + + ZIMBABWE + ZW + + diff --git a/usr/local/share/mobile-broadband-provider-info/serviceproviders.xml b/usr/local/share/mobile-broadband-provider-info/serviceproviders.xml new file mode 100644 index 0000000000..5429421764 --- /dev/null +++ b/usr/local/share/mobile-broadband-provider-info/serviceproviders.xml @@ -0,0 +1,6742 @@ + + + + + + + + + + + + + + Etisalat + + + + Etisalat + mnet + mnet + 194.170.1.6 + 194.170.1.7 + + + Etisalat 3G + etisalat.ae + etisalat.ae + + + + + + + + + Vodafone + + + + + + + + + + + Beeline + + + + internet + internet + + + + + Orange + + + + Internet Hima (USB) + + + Mobile Broadband + + + + + VivaCell/MTS + + + + MTS connect + + + Mobile Broadband + + + + + + + + + + Movinet + + uname + + + + Unitel + + + + + + + + + + + Personal + + + + gprs + adgj + 172.25.7.6 + 172.25.7.7 + + + + + Claro + + + + + + clarogprs + clarogprs999 + 170.51.255.100 + 170.51.242.18 + + + + + Movistar + + + + + wap + wap + + + + + + + + + A1/Telekom Austria + + + + A1 Breitband + ppp@a1plus.at + ppp + 194.48.139.254 + 194.48.124.202 + + + aon (Flex, Breitband-Duo, BusinessFlex) + + ppp + + + + + Bob + + + + data@bob.at + ppp + + + + + T-Mobile + + + + WAP + t-mobile + tm + + + Internet + t-mobile + tm + + + Business Internet + t-mobile + tm + + + + + tele.ring + + + + web@telering.at + web + 212.95.31.11 + 212.95.31.35 + + + + + Orange + + + + Web + web + web + 194.24.128.100 + 194.24.128.102 + + + Web (no filtering) + web + web + + + + + Three + Drei + + + + + + + Yesss + + + + + + + + + + Exetel + + + + + + Optus + + + + Mobile Internet (handsets) + 211.29.132.12 + 198.142.0.51 + + + Wireless Broadband + 211.29.132.12 + 198.142.0.51 + + + Pre-Paid Mobile Broadband + 211.29.132.12 + 198.142.0.51 + + + + + Telstra + + + + 139.130.4.4 + 203.50.2.71 + + + Telstra (3G data pack) + Telstra + 139.130.4.4 + 203.50.2.71 + + + Telstra (Next G) + 139.130.4.4 + 203.50.2.71 + + + Telstra (3G PC pack - pay by time) + Telstra + 139.130.4.4 + 203.50.2.71 + + + + + Three + + + + a + a + 202.124.68.130 + 202.124.76.66 + + + Three Prepaid + a + a + 202.124.68.130 + 202.124.76.66 + + + + + Virgin Mobile + + + + Mobile Internet + guest + guest + 61.88.88.88 + + + Mobile Broadband + + + + + Vodafone + + + + Postpaid + 192.189.54.33 + 210.80.58.3 + + + Prepaid + + + + + + + + + Azercell + + + + + + + Bakcell + + + + + + + + + + + BH GSM + + + + + + + + + + + Digicel + + + + + + + + + + + Robi (AKTel) + + + + Internet + 192.168.23.7 + + + + + Banglalink + + + + Web + 10.10.55.34 + + + + + GrameenPhone + + + + 202.56.4.120 + 202.56.4.121 + + + + + Warid + + + + Internet + 10.6.0.2 + + + + + Citycell + + waps + waps + 117.18.224.146 + 117.18.224.147 + + + + + + + + + Mobistar + + + + Business + mobistar + mobistar + 212.65.63.10 + 212.65.63.145 + + + Personal + mobistar + mobistar + 212.65.63.10 + 212.65.63.145 + + + Internet Everywhere + mobistar + mobistar + 212.65.63.10 + 212.65.63.145 + + + + + Telenet Mobile + + + + Walk & Talk + + + Walk & Surf + + + + + Orange + + + + + + Proximus + + + + Inter + 195.238.2.21 + 195.238.2.22 + + + Intra + 195.238.2.21 + 195.238.2.22 + + + + + Base + + + + base + base + + + + + + + + + GloBul + + + + globul + 192.168.88.11 + + + + + M-Tel + + + + mtel + mtel + 213.226.7.34 + 213.226.7.35 + + + + + Vivacom + + + + + Vivacom Internet (Postpaid) + vivacom + vivacom + + + Vivatel (old) + vivatel + vivatel + 192.168.123.123 + + + + + + + + + Batelco + + + + oNet + wap + wap + + + + + Zain BH + + + + eGO + hsdpa + hsdpa + + + + + STC + + + + Viva + + + + + + + + + + Brasil Telecom + + + BrT + BrT + + + + + Claro + + + + claro + claro + + + 3G + claro + claro + + + + + CTBC + + + + + + + ctbc + 1212 + + + + + Oi + + + + + + + oioioi + + + WAP + oiwap + oioioi + + + + + TIM + + + + + + + + tim + tim + 10.223.246.102 + 10.223.246.103 + + + + + Velox + + + iesgprs + iesgprs2002 + 66.36.250.14 + + + + + Vivo + + + + + + + + vivo + vivo + + + + + + + + + Batelco + + + + + + + + + + + B-Mobile + + + + + + + DSTCOM + + + + wap + wap + + + + + + + + + + velcom + + + + GPRS WAP + wap + wap + + + GPRS WEB + web + web + + + GPRS WEB PLUS + plus + plus + + + GPRS PRIVET + privet + privet + + + WEB BASIC + web1 + web1 + + + WEB 25 + web2 + web2 + + + WEB 150 + web3 + web3 + + + WEB 500 + vmi + vmi + + + + + MTS + + + + mts + mts + + + + + + life:) + + + + + + + + + + + Mascom Wireless + + + + + + + + + + + Fido + + + + fido + fido + 204.92.15.211 + 207.181.101.4 + + + + + Rogers + + + + wapuser1 + wap + 207.181.101.4 + 207.181.101.5 + + + + + Bell Mobility + + + + + + + Internet + + + Mobile Web + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Telus Mobility + + + + + + Internet + + + Internet (with VPN) + + + Blackberry + + + Mobile Web/Smartphone + + + + + + + + + + + + + + Virgin Mobile + + + + SaskTel + + + + + + + Vidéotron + + + + + IHVM + + + + + WIND Mobile + + + + + + + + + + + Vodacom + + + + vodalive + 172.24.97.1 + + + + + + + + + + + + + Orange + + + + Business Everywhere + 213.55.128.1 + 213.55.128.2 + + + Prima Surf + + + Internet Everywhere + + + + + Sunrise + + + + internet + internet + 212.35.35.35 + 212.35.35.5 + + + + + Swisscom + + + + gprs + gprs + + + + + + + + + MTN + + + + 172.16.100.5 + + + + + + + + + Claro Chile + + + + clarochile + clarochile + + + Prepago + clarochile + clarochile + + + WAP + clarochile + clarochile + + + + + Entel PCS + + + + entelpcs + entelpcs + + + WAP + entelpcs + entelpcs + + + + + Movistar + + + + Web + web + web + + + WAP + wap + wap + + + + + + + + + Orange + + + + orange + orange + + + + + MTN + + + + guest + guest + + + + + + + + + China Mobile + + + + + WAP + guest + guest + + + Internet + guest + guest + 211.136.20.203 + + + + + China Unicom + + + + uninet + + + + + China Telecom + + ctnet@mycdma.cn + vnet.mobi + + + + + + + + + + IceCelular + + + + + guest + guest + 208.133.206.44 + + + + + + + + + Comcel + + + + COMCELWEB + COMCELWEB + + + + + Tigo + + + + + + + + Movistar + + + + + movistar + movistar + + + + + + + + + Cytamobile-Vodafone + + + + + + + MTN + + + + wap + wap + + + + + + + + + Cesky Mobil + + + + Postpaid + 212.67.64.2 + 217.77.161.131 + + + Prepaid + 212.67.64.2 + 217.77.161.131 + + + + + EuroTel / Telefónica + + + + Go + 160.218.10.200 + 160.218.43.200 + + + Contract + 160.218.10.200 + 160.218.43.200 + + + Contract (Open) + 160.218.10.200 + 160.218.43.200 + + + + + Oscar + + + + Postpaid + wap + wap + 217.77.161.130 + 217.77.161.131 + + + Prepaid + 217.77.161.130 + 217.77.161.131 + + + + + Paegas Internet + + + Internet + 62.141.0.1 + 62.141.0.2 + + + Profil + 62.141.0.1 + 62.141.0.2 + + + + + Radiomibil + + + + + + T-Mobil + + + + 62.141.0.1 + 213.162.65.1 + + + + + + + + + AldiTalk/MedionMobile + + + + + + Volume rate/30 Day Flatrate + eplus + gprs + 212.23.97.2 + 212.23.97.3 + + + 24 Hour Flatrate + Tages-Flatrate + eplus + gprs + + + + + blau.de + + + + + + blau + blau + + + 24 Hour Flatrate + Tages-Flatrate + blau + blau + + + + + E-Plus + + + + + + + eplus + gprs + 212.23.97.2 + 212.23.97.3 + + + + + O2 + + + + + + + Pay-by-MB + 195.182.110.132 + 62.134.11.4 + + + Pay-by-time + 195.182.110.132 + 62.134.11.4 + + + + + T-mobile (D1) + + + + + + t-d1 + 193.254.160.1 + 193.254.160.130 + + + + + Vodafone (D2) + + + + + + + vodafone + vodafone + 139.7.30.125 + 139.7.30.126 + + + WebSessions + vodafone + vodafone + 139.7.30.125 + 139.7.30.126 + + + + + FONIC + + + + + + + + + simyo Internet + + + + + + simyo + simyo + 212.23.97.2 + 212.23.97.3 + + + + + + vistream + + + web + vistream + + + + + solomo + + + web + vistream + + + + + Materna BR + + + web + vistream + + + + + sdt.net + + + web + vistream + + + + + igge & ko + + + web + vistream + + + + + PTT mobile + + + web + vistream + + + + + TouristMobile + + + web + vistream + + + + + SunSIM + + + web + vistream + + + + + SüdkurierTel + + + web + vistream + + + + + NetCologne + + + web + password + + + + + + + + + 3 + + + + BredbÃ¥nd + + + BredbÃ¥nd Premium Kontant + + + 3 (Mobil Abonnement) + + + + + + OiSTER + + + + + + + + + ice.net (Nordisk Mobiltelefon) + + cdma + cdma + + + + Telenor + + + + + 212.88.64.199 + 212.88.64.14 + + + + + TDC + + + + 194.239.134.83 + 193.162.153.164 + + + + + Fullrate + + + Fullrate + Fullrate + + + + + Telia + + + + + + + BiBoB + + + + + + + + + + Orange + + + + + + + + + + + Djezzy + + + + + + + Mobilis + + + + internet + internet + + + + + Nedjma + + + + WEB + nedjma + nedjma + + + + + + + + + Porta 3G + + + + + + + + + + + EMT + + + + 217.71.32.116 + 217.71.32.115 + + + + + Nordea + + + + + + + Elisa + + + 194.204.0.1 + + + + + Tele2 + + + + wap + wap + + + + + + + + + Vodafone + + + + internet + internet + + + + + Etisalat + + + + + + + MobiNil + + + + 80.75.166.250 + 163.121.163.201 + + + + + + + + + Euskaltel + + + + CLIENTE + EUSKALTEL + + + + + Másmovil + + + + + + móbil R (Mundo-R) + + + + + + + Ono + + + + 62.42.230.24 + 62.42.63.52 + + + + + Pepephone + + + + + + Orange (Amena) + + + + + CLIENTE + AMENA + 213.143.32.20 + 213.143.33.8 + + + + + Simyo + + + + + + + Telecable + + + + telecable + telecable + + + + + movistar (Telefonica) + + + + movistar + movistar + 194.179.1.100 + 194.179.1.101 + + + + + Vodafone (Airtel) + + + + + vodafone + vodafone + 212.73.32.3 + 212.73.32.67 + + + + + Yoigo + + + + + + + Jazztel + + + + + + + + + + Dna + + + + 217.78.192.22 + 217.78.192.78 + + + + + Elisa + + + + + + + Saunalahti + + + + Postpaid (contract) + 192.89.123.230 + 192.89.123.231 + + + Prepaid (no contract) + 192.89.123.230 + 192.89.123.231 + + + + + Sonera + + + + 192.89.123.230 + 192.89.123.231 + + + Prointernet (public IP) + 192.89.123.230 + 192.89.123.231 + + + + + Welho + + + Wekkula + + + + + + + + + Vodafone + + + + + + + + + + + A Mobile (Auchan Telecom) + + + + + + Bouygues Telecom + + + + + B2Bouygtel + 62.201.129.99 + + + 62.201.129.99 + + + + + France Telecom + + + + + gprs + + + + + Orange + + + + + Contract + orange + orange + 194.51.3.56 + 194.51.3.76 + + + Business Contract + orange + orange + 194.51.3.56 + 194.51.3.76 + + + No Contract / Mobicarte + orange + orange + 194.51.3.56 + 194.51.3.76 + + + Orange MIB + mportail + mib + 172.17.0.2 + 172.17.0.4 + + + Internet Everywhere 3G + + + + + SFR + + + + + + Web + 172.20.2.10 + 172.20.2.39 + + + WAP + + + Mobile Broadband + slsfr + slsfr + 172.20.2.10 + 172.20.2.39 + + + Full Internet + + + + + Transatel Telecom + + + + + + TEN + + + orange + orange + + + Pay-by-MB + orange + orange + + + + + + + + + airtel vodaphone + + + + + + BT Mobile + + + + bt + bt + + + + + O2 + + + + + + + Contract + o2web + password + 193.113.200.200 + 193.113.200.201 + + + Contract (faster) + faster + password + 193.113.200.200 + 193.113.200.201 + + + Pay and Go (Prepaid) + payandgo + payandgo + + + iPhone (Contract) + vertigo + password + + + Mobile Broadband + o2bb + password + + + WAP + o2wap + password + + + + + T-Mobile + + + + User + mms + 149.254.201.126 + 149.254.192.126 + + + + + Virgin Mobile + + + + + 196.7.0.138 + 196.7.142.132 + + + + + Vodafone + + + + Contract + web + web + 10.206.65.68 + 10.203.65.68 + + + Prepaid + wap + wap + 172.29.1.11 + 172.29.1.11 + + + TopUp and Go + + + + + 3 + + + + Internet + + + Handsets + + + + + Orange + + + + + + Contract + orange + orange + 193.35.133.10 + 193.35.134.10 + + + Contract (with VPN) + orange + orange + 193.35.133.10 + 193.35.134.10 + + + Orange WAP + orange + multimedia + 158.43.192.1 + 158.43.128.1 + + + + + + + + + Geocell + + + + 212.72.130.20 + 212.72.152.001 + + + + + + + + + Sure (Cable & Wireless) + + + + WAP + + + Internet + + + + + + + + + MTN + + + + + + + Vodafone (ONEtouch) + + + + + + + Tigo + + + + web + + + + + Zain + + + + + + Kasapa + + + + + + + + Cosmote + + + + 195.167.65.194 + + + + + Vodafone + + + + Contract + + + Mobile Broadband On Demand + 213.249.17.10 + 213.249.17.11 + + + + + Wind + + + + + web + web + + + + + + + + + Claro + + + + + + + Comcel / Tigo + + + + Wap + Wap + + + + + + + + + GT&T Cellink Plus + + + test + test + + + + + DigiCel + + + + web + web + + + + + + + + + CSL + + + + + 202.84.255.1 + 203.116.254.150 + + + + + New World + + + + + + + People + + + + + + + SmarTone + + + + 202.140.96.51 + 202.140.96.52 + + + + + Sunday + + + + + + Orange + + + + + + Three + + + + + + + + + + + + Tigo + + + + + + + + + + + T-Mobile + + + + 10.12.0.1 + + + + + VIPNET + + + + GPRS 5 + 38591 + 38591 + 195.29.159.15 + + + GPRS 0 + 38591 + 38591 + 195.29.159.15 + + + 3G + 38591 + 38591 + 212.91.97.3 + 212.91.97.4 + + + + + + + + + Pannon + + + + átalánydíjas + 193.225.155.254 + 194.149.0.157 + + + Normál + 193.225.153.17 + 195.56.172.113 + + + Tömörített + 193.225.153.17 + 194.149.0.157 + + + + + T-Mobile + + + + 212.51.115.1 + 194.176.224.6 + + + MMS + mms + 212.51.115.1 + 194.176.224.3 + + + + + Vodafone + + + + ElÅ‘f. Normál + vodawap + vodawap + 80.244.97.30 + 80.244.96.1 + + + ElÅ‘f. töm. + vodawap + vodawap + 80.244.97.30 + 80.244.96.1 + + + Felt. norm. + 80.244.97.30 + 80.244.96.1 + + + Vodafone (felt. töm.) + 80.244.97.30 + 80.244.96.1 + + + + + + + + + AXIS + + + + axis + 123456 + + + + + IM3 + + + + gprs + im3 + 202.155.46.66 + 202.155.46.77 + + + + + Indosat + + + + 202.152.162.250 + + + Matrix 3G + indosat + indosat + 202.155.46.66 + 202.155.46.77 + + + + + Telkomsel + + + + + wap + wap123 + 202.152.0.2 + 202.155.14.251 + + + + + Excelcomindo (XL) + + + + xlgprs + proxl + 202.152.254.245 + 202.152.254.246 + + + + + + + + + O2 + + + + Contract + gprs + gprs + 62.40.32.33 + 62.40.32.34 + + + Prepaid + faster + web + 62.40.32.33 + 62.40.32.34 + + + + + Vodafone + + + + vodafone + vodafone + + + Old + vodafone + vodafone + + + Prepaid + vodafone + vodafone + 10.24.59.100 + + + + + Meteor + + + + Meteor Data + my + meteor + + + Broadband To Go + + + + + Three Ireland + + + + 172.31.140.69 + 172.30.140.69 + + + + + + + + + CellCom + + + + + + + Orange + + + + 158.43.192.1 + 158.43.128.1 + + + + + Pelephone + + + + 3G + pcl@3g + pcl + + + + + + + + + Sure (Cable & Wireless) + + + + WAP + + + Internet + + + + + + + + + AIRCEL + + + + + + + + + + + + + + + + + + + + + + + + Web + + + GPRS (Postpaid) + + + GPRS (Prepaid) + + + + + Airtel + + + + + + + + + + + + + + + + + + + + + + + + + + + 202.56.230.5 + 202.56.240.5 + + + + + Vodafone + + + + + + + + + + + + + + + + + + + + + + + + Vodafone Connect + + + Vodafone Live + + + + + BSNL/CellOne + + + + + + + + + + + + + + + + + + + + + + + + + South Zone A (Karnatka, Andhra Pradesh, Chennai, Tamil Nadu, Kerala) + + + South Zone B (Karnatka, Andhra Pradesh, Chennai, Tamil Nadu, Kerala) + + + North Zone (Haryana, Punjab, UP(East), UP(West), Himachal Pradesh, Rajasthan, Jammu & Kashmir) + + + West Zone (Maharashtra, Gujrat, Madhya Pradesh, Chattishgarh) + + + East Zone Prepaid (Jharkhand, Bihar, Kolkata, West Bengal, Orissa, Assam, North East, Adman Nicobar) + 218.248.240.208 + 218.248.240.135 + + + East Zone Postpaid (Jharkhand, Bihar, Kolkata, West Bengal, Orissa, Assam, North East, Adman Nicobar) + 218.248.240.208 + 218.248.240.135 + + + + + Idea Cellular + + + + + + + + + + + + + + + + + + 10.4.42.15 + + + + + MTNL + + + + + Delhi + mtnl + mtnl123 + + + Mumbai (Prepaid) + mtnl + mtnl123 + + + Mumbai (Postpaid / Plan 2) + mtnl + mtnl123 + + + + + Reliance + + + + + + + + + + + Smart Net + + + Smart WAP + + + + Reliance Netconnect + + + + + + + + + + + + + + + + + + + + + + + + + Spice telecom + + + + + + spice + spice + + + kar + + + + + Tata Docomo + + + + + + + + + + + + + + + + + + + + + + + + Internet + + + + + Tata Indicom (Plug2Surf) + + internet + internet + + + + Tata Indicom (Photon+) + + internet + internet + + + + MTS MBlaze + + internet@internet.mtsindia.in + mts + + + + + + + + + Itisaluna + + itisaluna + itisaluna + + + + + Omnea Telecom + + omnea + omnea + + + + Kalimat Telecom + + + + + + Korek + + + + korek + korek + + + + + Asia Cell + + + + + + + + + + + + Vodafone + + + + + 213.176.128.51 + 213.176.128.50 + + + + + Nova + + + + 192.168.190.54 + 192.168.190.55 + + + + + Síminn + + + + 194.105.224.1 + 212.30.200.200 + + + + + + + + + Vodafone + + + + Mobile Internet + + + Internet Facile (old) + + + + + TIM + + + + Maxxi Alice/Internet + + + WAP + WAPTIM + 213.230.155.94 + 213.230.130.222 + + + + + Wind + + + + Non-business + Wind + Wind + 193.70.152.25 + 193.70.192.25 + + + Business + Wind + Wind + 193.70.152.25 + 193.70.192.25 + + + + + 3 + + + + Standard + + + Tre.Dati + + + + + Fastweb + + + Voce/dati + + + Solo dati + + + + + PosteMobile + + + + + + + + + + + Sure (Cable & Wireless) + + + + WAP + + + Internet + + + + + Jersey Telecom + + + + abc + abc + 212.9.0.135 + 212.9.0.136 + + + + + + + + + Cable & Wireless + + + + + + + Digicel + + + + wapuser + wap03jam + 208.131.176.126 + 200.10.152.232 + + + + + + + + + Softbank Mobile + + + + + + + + + + + + + + + + + + + + + + + ai@softbank + softbank + + + + + e-mobile + + + + em + em + + + + + NTTdocomo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + mopera + + + mopera U + + + + + au(KDDI) + + au@au-win.ne.jp + au + 210.196.3.183 + 210.141.112.163 + + + + + + + + Zain / Celtel + + + + + + + Safaricom + + + + web + web + + + + + Econet + + + + + + + + + + hello + + + + + + + Mobitel + + + + CellCard Corporate + mobitel + mobitel + + + CellCard Unlimited + mobitel + mobitel + + + + + qb + + + + QBmore + + + + + Star-Cell + + + + + + + Excell + + + + + + + + KTF + + + ktf + ktf + + + + LGTelecom + + + + + + + SKTelecom + + + sktelecom + + + + + + + + Zain + + + + Personal + pps + pps + + + Corporate + + + + + Wataniya + + + + + + + Viva + + + + + + + + + + + Beeline + + + + @internet.beeline + 212.19.149.53 + 194.226.128.1 + + + + + K'CELL + + + + + + + + Activ + + + + + + + Neo + + + + + + + Pathword + + Pathword + Pathword + + + + Dalacom + + Dalacom + Dalacom + + + + + + + + ETL + + + + 192.168.4.130 + + + + + + + + + MTC Touch + + + + + + + + + + + Cable & Wireless + + + + + + + + + + + Airtel + + + + + + + Dialog GSM + + + + Postpaid + + + Prepaid + + + Unlimited Broadband + + + + + Hutch + + + + + + + Mobitel + + + + + + + Tigo + + + + + + + + + + + Bite + + + + bite + 213.226.131.131 + 193.219.88.36 + + + + + TELE2 GPRS + + + + + + + Omnitel (contract) + + + + Contract + 194.176.32.129 + 195.22.175.1 + + + No contract + omni + omni + 194.176.32.129 + 195.22.175.1 + + + + + + + + + LUXGSM + + + + 194.154.192.101 + 194.154.192.102 + + + + + Tango + + + + tango + tango + + + + + VOXmobile + + + + + + + + + + + LMT + + + + 212.93.96.2 + 212.93.96.4 + + + O!Karte internet + + + O!Karte + + + + + Tele2 + + + + Regular + gprs + internet + + + Mobile Internet + wap + wap + + + Zelta Zivtina + wap + wap + + + + + Bite + + + + Bite plus + + + + + + + + + Ittissalat Al Maghrib + + + + wac + 1987 + + + + + Medi Telecom + + + + MEDIWAP + MEDIWAP + + + + + + + + + Moldcell + + + + Internet + gprs + gprs + + + + + Eventis + + + + Internet + + + + + Orange + + + + Internet + + + + + + + + + ProMonte GSM + + + + + + + T-Mobile + + + + + + + m:tel + + + + + + + + + + + Orange + + + + iew + iew + + + + + + + + + MobiCom + + + + + + + + + + + 3 / Hutchison + + + + + hutchison + 1234 + + + + + CTM + + + + + + + + China Telecom + + + + + + + + GO Mobile + + + + Postpaid + + + Prepaid + + + + + Vodafone + + + + Internet + Internet + + + + + + + + + Emtel + + + + + + + + + + + Dhiraagu + + + + + + + Wataniya + + + + + + + + + + + Telcel + + + + webgprs + webgprs2002 + 148.233.151.245 + + + + + Movistar + + + + movistar + movistar + + + + + Iusacell + + + + + + + + DiGi + + + + Mobile Internet + 203.92.128.131 + 203.92.128.132 + + + Broadband + + + + + Maxis + + + + + Broadband + maxis + wap + + + GPRS + maxis + net + + + 3G (handsets) + maxis + wap + 10.213.17.1 + 10.213.17.2 + + + + + Celcom + + + + + + + + + + + + MCel + + + + guest + guest + 212.96.24.2 + 212.96.24.1 + + + + + Vodacom + + + + + + + + + + + Zain + + + + + web + web + + + + + MTN + + + + + web + web + + + + + Glo Mobile + + + + + Pay as You Go + gprs + gprs + + + Glo 3G Packs + flat + flat + + + + + Etisalat + + + + Etisalat Internet + + + + + + + + + Claro + + + + + WAP + wapemovil + wapemovil + + + Web + webemovil + webemovil + + + Web (Alo pcs) + internet + internet + + + WAP (Alo pcs) + wap + wap + + + + + Movistar + + + + internet + internet + + + + + + + + + Hi + + + + + + KPN Mobile + + + + KPN + gprs + 62.133.126.28 + 62.133.126.29 + + + + + Telfort + + + + telfortnl + + + + + T-Mobile + + + + 193.78.240.12 + 193.79.242.39 + + + + + Ben + + + + 193.78.240.12 + 193.79.242.39 + + + + + Orange + + + + orange + orange + + + + + XS4ALL Mobiel Internet + + + + + + Vodafone + + + + Non-business + vodafone + vodafone + + + Business + vodafone + vodafone + + + + + + + + + Netcom + + + + netcom + netcom + 212.169.123.67 + 212.45.188.254 + + + + + + ice.net (Nordisk Mobiltelefon) + + cdma + cdma + + + + Telenor + + + + 212.17.131.3 + 148.122.161.2 + + + + + TDC + + + + 80.232.41.10 + 80.232.41.20 + + + + + NetworkNorway + + + + + + + OneCall + + + + + + Lebara + + + + + + Altibox + + + + + + SheTalks + + + + + + Telipol + + + + + + Ventelo + + + + + + + Ludo Mobil + + + + + + + + + + + Nepal Telecom + + + + + + + Mero Mobile + + + + + + + + + + + Telecom New Zealand + + + + + XT mobile (WAP) + + + XT mobile (Internet with Firewall) + + + XT mobile (Direct Internet) + + + XT mobile (One Office/Remote Office) + + + + + Vodafone + + + + WAP + 202.73.206.16 + 202.73.198.16 + + + Restricted + 202.73.206.16 + 202.73.198.16 + + + Unrestricted (public) + 202.73.206.16 + 202.73.198.16 + + + + + + + + + Oman Mobile + + + + + + + Nawras + + + + + + + + + + + Cable and Wireless + + + + + + + + Movistar + + + + movistarpa + movistarpa + 200.39.10.1 + 200.36.160.237 + + + + + + + + + Claro + + + + tim + tulibertad + + + + + Movistar + + + + movistar@datos + movistar + + + + + + + + + Globe Telecom + + + + Internet + globe + globe + 203.127.225.10 + 203.127.225.11 + + + WAP + globe + globe + 203.127.225.10 + 203.127.225.11 + + + + + Smart + + + + witsductoor + banonoy + 202.57.96.3 + 202.57.96.4 + + + + + Digitel (Sun Cellular) + + + + + + + + + + + Djuice + + + + telenor + telenor + + + + + Mobilink + + + + Internet + + + Jazz + + + + + Telenor + + + + telenor + telenor + + + + + Ufone + + + + ufone + ufone + + + + + Warid + + + + + + + ZONG + + + + + + + + + + + ERA + + + + erainternet + erainternet + 213.158.194.1 + 213.158.193.38 + + + + + Play Online + + + + + + + Heyah + + + heyah + heyah + 213.158.194.1 + 213.158.193.38 + + + + + Orange + + + + internet + internet + 194.9.223.79 + 194.204.159.1 + + + + + iPlus + + + + 212.2.96.51 + 212.2.96.52 + + + + + GaduAIR + + + + + + + + + + Kanguru + + + + 62.169.67.172 + 62.169.67.171 + + + Fixo + 62.169.67.172 + 62.169.67.171 + + + + + Optimus + + + + 194.79.69.129 + + + + + TMN + + + + 194.65.3.20 + 194.65.3.21 + + + + + Vodafone + + + + 212.18.160.133 + 212.18.160.134 + + + + + + + + + VOX + + + + + + + Personal + + + + + + + Tigo + + + + Internet + + + Broadband + Banda Ancha Móvil + tigo + tigo + + + + + + + + + Vodafone + + + + + + + Q-Tel + + + + Qatarnet + gprs + gprs + + + + + + + + + Orange + + + + 172.22.7.21 + 172.22.7.20 + + + + + Vodafone + + + + Mobile Internet (Postpaid) + internet.vodafone.ro + vodafone + + + Mobile Internet (Prepaid) + internet.pre.vodafone.ro + vodafone + + + Live! (Postpaid) + live + vodafone + + + Live! (Prepaid) + live.pre.vodafone.com + vodafone + + + + + Zapp + + zapp + zapp + + + + Digi.Net Mobil + + + + Home + + + Business (static) + + + + + + + + + Telenor + + + + telenor + gprs + + + + + Telekom Srbija + + + + mts + 064 + 195.178.38.3 + + + + + VIP Mobile + + + + vipmobile + vipmobile + + + + + + + + + BaikalWestCom + БайкалВеÑтКом + + + + bwc + bwc + 81.18.113.2 + 81.18.112.50 + + + + + Beeline + Билайн + + + + + beeline + beeline + 217.118.66.243 + 217.118.66.244 + + + + + ETK + + + + + + + MTS + + + + mts + mts + 213.87.0.1 + 213.87.1.1 + + + + + Megafon + Мегафон + + + + + + NW + Северо-Запад + 10.140.142.42 + 10.140.142.45 + + + UGSM + Урал + 83.149.32.2 + 83.149.33.2 + + + usi + 212.120.160.130 + 212.120.160.130 + + + DV + Дальний ВоÑток + 83.149.52.77 + 194.186.112.18 + + + kvk + Кавказ + 83.149.24.244 + 62.183.50.230 + + + ltmsk + 10.22.10.20 + 10.22.10.21 + + + sib + Сибирь + 83.149.51.65 + 83.149.50.65 + + + volga + Поволжье + 83.149.16.7 + 195.128.128.1 + + + mc + Центр + 81.18.129.252 + 217.150.34.1 + + + Moscow + МоÑква + gdata + gdata + + + + + NCC + + + + ncc + 10.0.3.5 + 10.0.3.2 + + + + + NTC + + + + 80.243.64.67 + 80.243.68.34 + + + + + Enisey TeleCom + ЕниÑей Телеком + + + + etk + 10.10.30.3 + 10.10.30.4 + + + + + Motiv + Мотив + + + + motiv + 217.148.52.34 + 217.148.52.3 + + + + + Tatincom + Татинком + + + tatincom + tatincom + 89.207.96.2 + 89.207.97.18 + + + + + Tele2 + Теле2 + + + + gprs + 130.244.127.161 + 130.244.127.169 + + + + + Skylink + Скайлинк + + mobile + internet + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + U-tel + + + + + + + + + + + Mobily + + + + Postpaid + + + Prepaid + + + + + STC + + + + 212.118.133.101 + 212.118.133.102 + + + + + Zain + + + + + + + + + + + + 3 + + + + + + Mobiltelefon + + + + Bredband + + + Bredband Kontantkort + + + + + Glocalnet + + + + Mobilt Bredband + + + + Glocalnet Internet + + + + + Halebop + + + + + + + + + + ice.net (Nordisk Mobiltelefon) + + cdma + cdma + + + + Tele2 + + + + + + Mobilt Internet + + + + Mobilt Bredband + + + + + Comviq + + + + + Surf + + + + + Multicom Security + + + + + + + Mobiflex + + + + + Telenor + + + + + + + + Mobilt Internet + + + Mobilsurf med maxtaxa + + + Mobilt Bredband + + + + + Telia + + + + + + + + + + TDC + + + + + + + djuice + + + + + + + Com Hem + + + + + + + + + Parlino + + + + + + Universal Telecom + + + + Mobilt Bredband + + + + Mobilt Internet + + + + + + + + + M1 + + + + + SunSurf/Mobile Broadband (postpaid) + 65 + user123 + 202.79.64.21 + 202.79.64.26 + + + MiWorld Mobile (postpaid) + user123 + + + MiWorld Mobile (prepaid) + user123 + + + Mobile Broadband (prepaid) + + + M Card (prepaid) + + + + + SingTel + + + + + 165.21.100.88 + 165.21.83.88 + + + + + Starhub + + + + WAP + star + hub + 203.116.1.78 + + + MaxMobile Broadband (prepaid) + + + MaxMobile Broadband (postpaid) + + + + + + + + + Mobitel + + + + + Postpaid + mobitel + internet + 213.229.248.161 + 193.189.160.11 + + + mobitel + internet + 213.229.248.161 + 193.189.160.11 + + + + + Vodafone / Simobil + + + + simobil + internet + 121.30.86.130 + 193.189.160.11 + + + + + T-2 + + + + + + + + + + + T-Mobile (EuroTel) + + + + + 194.154.230.66 + 194.154.230.74 + + + + + Orange + + + + 213.151.200.30 + 213.151.208.161 + + + + + O2 + + + + Internet + + + + + + + + + Tigo + + + + 200.85.0.104 + 200.85.0.107 + + + + + + + + + movistar + + + + movistarsv + movistarsv + + + + + digicel + + + + + + + Tigo + + + + + + + Claro + + + + Internet + + + + + + + + + Zain + + + + + + + + + + + AIS + + + + 202.183.255.20 + 202.183.255.21 + + + + + DTAC + + + + 202.44.202.2 + 203.44.144.33 + + + + + True Move + + + + true + true + + + + + + + + + Avea + + + + + 212.156.4.4 + 212.156.4.20 + + + + (former Aycell) + 212.156.4.1 + 212.156.4.4 + + + + + Turkcell + + + + gprs + gprs + 86.108.136.27 + 86.108.136.26 + + + + + Vodafone + + + + Postpaid + telsim + telsim + 212.65.128.20 + 212.156.4.7 + + + Prepaid + 212.65.128.20 + 212.156.4.7 + + + + + + + + + Digicel + + + + wap + wap + + + + + bmobile / TSTT + + + + wap + wap + + + + + + + + + Chunghwa Telecom (emome) + 中è¯é›»ä¿¡ (emome) + + + + + + + Far EasTone / KGT + é å‚³é›»ä¿¡ / 和信電訊 + + + + + + + TW Mobile + å°æ¹¾å¤§å“¥å¤§ + + + + + + + TransAsia + 泛亞電信 + + + + + + + Vibo Telecom / Aurora + å¨å¯¶é›»ä¿¡ (Vibo) / 震旦電信 (Aurora) + + + + + + + Asia Pacific Telecom (APBW) + 亞太電信 (亞太行動寬頻電信) + + + + + + + + Zain + + + + + + + Vodacom + + + + + + + Zantel + + + + + + + + + + + kyivstar + + + + + Ace&Base + igprs + internet + + + Contract GPRS + + + Internet 3G + + + + + Djuice + + + + + Internet GPRS + + + Internet XL + + + Internet 3G + + + + + Life + + + + + Standard + 212.58.160.33 + 212.58.160.34 + + + Faster + 212.58.160.33 + 212.58.160.34 + + + + + Beeline + + + + + + + Jeans + + + 80.255.64.23 + 80.255.64.24 + + + Hyper.NET + 212.58.160.33 + 212.58.160.34 + + + + + MTS + + + + + GPRS Internet + internet + 212.58.160.33 + 212.58.160.34 + + + Hyper.NET + + + HyperActive + + + umc.ua + 80.255.64.23 + 80.255.64.24 + + + + MTS Connect 3G + mobile + internet + + + + + Utel + + + + + + + CDMA Ukraine + + cdma + cdma + + + + InterTelecom + + IT@IT + IT + + + + + PEOPLEnet + + + + + + + + MTN + + + + 193.108.252.50 + 193.108.252.51 + + + + + Orange + + + + + + + UTL + + + + Mobile Broadband + + + Mobile Internet + + + + + Warid + + + + + + + + Zain + + + + + + + + + + + AT&T + + + + + + + + + MEdia Net + WAP@CINGULARGPRS.COM + CINGULAR1 + + + Data Connect + ISP@CINGULARGPRS.COM + CINGULAR1 + + + Data Connect (Accelerated) + ISPDA@CINGULARGPRS.COM + CINGULAR1 + + + + + T-Mobile + + + + + + + + + + + + + + + + + + Web2Go/t-zones + + + Internet + + + Internet with VPN + + + T-Mobile G1 + + + + + Cincinnati Bell Wireless + + + + cbw + + + + + Sprint + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Boost Mobile (Prepaid) + + + + Verizon + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + US Cellular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Alltel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Leap Wireless + + + + Cricket Communications + + + + Jump Mobile (Prepaid) + + + + MetroPCS + + + + + + + + + + + + + + + + + + + + + Virgin Mobile / Helio + + + + Cellular South + + + + + + + + + + + BendBroadband + + + + + + + + + + + Ancel + + + + + ADSL Móvil + 200.40.30.245 + 200.40.220.245 + + + GPRS + 200.40.30.245 + 200.40.220.245 + + + + + Claro + + + + 3G Internet + ctigprs + ctigprs999 + + + 2G Internet + ctiweb + ctiweb999 + + + + + Movistar + + + + 3G Internet + movistar + movistar + + + 2G Internet + movistar + movistar + + + + + + + + + Uzdunrobita / MTS + + + + user + pass + + + + + + + + + Digicel + + + + wapoecs + wap03oecs + + + + + + + + + Digitel TIM + + + + + + 57.67.127.195 + + + + + + + + + MobiFone + + + + mms + mms + + + + + Vinaphone + + + + mms + mms + + + + + S-Fone + + + S-Fone + + + + + + Viettel Mobile + + + + + + + Vietnamobile + + + + + + + E-Mobile + + evntelecom + evntelecom + + + + Beeline VN + + + + + + + + + + + Cell-c + + + + Cellcis + 196.7.0.138 + 196.7.142.132 + + + + + MTN + + + + 196.11.240.241 + 209.212.97.1 + + + + + Vodacom + + + + 196.207.40.165 + 196.43.46.190 + + + Unrestricted + 196.207.32.69 + 196.43.45.190 + + + + + Virgin Mobile + + + 196.7.0.138 + 196.7.142.132 + + + + + + + diff --git a/usr/local/www/diag_logs.php b/usr/local/www/diag_logs.php index 58470f9c21..85b61df38e 100755 --- a/usr/local/www/diag_logs.php +++ b/usr/local/www/diag_logs.php @@ -79,6 +79,7 @@ include("head.inc"); $tab_array[] = array("DHCP", false, "diag_logs_dhcp.php"); $tab_array[] = array("Portal Auth", false, "diag_logs_auth.php"); $tab_array[] = array("IPsec", false, "diag_logs_ipsec.php"); + $tab_array[] = array("PPP", false, "diag_logs_ppp.php"); $tab_array[] = array("VPN", false, "diag_logs_vpn.php"); $tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php"); $tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php"); diff --git a/usr/local/www/diag_logs_auth.php b/usr/local/www/diag_logs_auth.php index 25e92d6378..700b6dcfa2 100755 --- a/usr/local/www/diag_logs_auth.php +++ b/usr/local/www/diag_logs_auth.php @@ -67,6 +67,7 @@ include("head.inc"); $tab_array[] = array("DHCP", false, "diag_logs_dhcp.php"); $tab_array[] = array("Portal Auth", true, "diag_logs_auth.php"); $tab_array[] = array("IPsec", false, "diag_logs_ipsec.php"); + $tab_array[] = array("PPP", false, "diag_logs_ppp.php"); $tab_array[] = array("VPN", false, "diag_logs_vpn.php"); $tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php"); $tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php"); diff --git a/usr/local/www/diag_logs_dhcp.php b/usr/local/www/diag_logs_dhcp.php index 0b94962b9b..b95b96987f 100755 --- a/usr/local/www/diag_logs_dhcp.php +++ b/usr/local/www/diag_logs_dhcp.php @@ -69,6 +69,7 @@ include("head.inc"); $tab_array[] = array("DHCP", true, "diag_logs_dhcp.php"); $tab_array[] = array("Portal Auth", false, "diag_logs_auth.php"); $tab_array[] = array("IPsec", false, "diag_logs_ipsec.php"); + $tab_array[] = array("PPP", false, "diag_logs_ppp.php"); $tab_array[] = array("VPN", false, "diag_logs_vpn.php"); $tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php"); $tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php"); diff --git a/usr/local/www/diag_logs_filter.php b/usr/local/www/diag_logs_filter.php index 819a4cef28..9d8d9cd9eb 100755 --- a/usr/local/www/diag_logs_filter.php +++ b/usr/local/www/diag_logs_filter.php @@ -103,6 +103,7 @@ include("head.inc"); $tab_array[] = array("DHCP", false, "diag_logs_dhcp.php"); $tab_array[] = array("Portal Auth", false, "diag_logs_auth.php"); $tab_array[] = array("IPsec", false, "diag_logs_ipsec.php"); + $tab_array[] = array("PPP", false, "diag_logs_ppp.php"); $tab_array[] = array("VPN", false, "diag_logs_vpn.php"); $tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php"); $tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php"); diff --git a/usr/local/www/diag_logs_filter_dynamic.php b/usr/local/www/diag_logs_filter_dynamic.php index a8ac4b5fa9..a07b52ba1d 100755 --- a/usr/local/www/diag_logs_filter_dynamic.php +++ b/usr/local/www/diag_logs_filter_dynamic.php @@ -102,6 +102,7 @@ include("head.inc"); $tab_array[] = array("DHCP", false, "diag_logs_dhcp.php"); $tab_array[] = array("Portal Auth", false, "diag_logs_auth.php"); $tab_array[] = array("IPsec", false, "diag_logs_ipsec.php"); + $tab_array[] = array("PPP", false, "diag_logs_ppp.php"); $tab_array[] = array("VPN", false, "diag_logs_vpn.php"); $tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php"); $tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php"); diff --git a/usr/local/www/diag_logs_filter_summary.php b/usr/local/www/diag_logs_filter_summary.php index 485e26bc20..49041273b7 100644 --- a/usr/local/www/diag_logs_filter_summary.php +++ b/usr/local/www/diag_logs_filter_summary.php @@ -186,6 +186,7 @@ include("head.inc"); ?> $tab_array[] = array("DHCP", false, "diag_logs_dhcp.php"); $tab_array[] = array("Portal Auth", false, "diag_logs_auth.php"); $tab_array[] = array("IPsec", false, "diag_logs_ipsec.php"); + $tab_array[] = array("PPP", false, "diag_logs_ppp.php"); $tab_array[] = array("VPN", false, "diag_logs_vpn.php"); $tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php"); $tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php"); diff --git a/usr/local/www/diag_logs_ipsec.php b/usr/local/www/diag_logs_ipsec.php index 33052b5e3b..039193b5be 100755 --- a/usr/local/www/diag_logs_ipsec.php +++ b/usr/local/www/diag_logs_ipsec.php @@ -89,6 +89,7 @@ include("head.inc"); $tab_array[] = array("DHCP", false, "diag_logs_dhcp.php"); $tab_array[] = array("Portal Auth", false, "diag_logs_auth.php"); $tab_array[] = array("IPsec", true, "diag_logs_ipsec.php"); + $tab_array[] = array("PPP", false, "diag_logs_ppp.php"); $tab_array[] = array("VPN", false, "diag_logs_vpn.php"); $tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php"); $tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php"); diff --git a/usr/local/www/diag_logs_ntpd.php b/usr/local/www/diag_logs_ntpd.php index 033b6fc689..d168f707e0 100644 --- a/usr/local/www/diag_logs_ntpd.php +++ b/usr/local/www/diag_logs_ntpd.php @@ -67,6 +67,7 @@ include("head.inc"); $tab_array[] = array("DHCP", false, "diag_logs_dhcp.php"); $tab_array[] = array("Portal Auth", false, "diag_logs_auth.php"); $tab_array[] = array("IPsec", false, "diag_logs_ipsec.php"); + $tab_array[] = array("PPP", false, "diag_logs_ppp.php"); $tab_array[] = array("VPN", false, "diag_logs_vpn.php"); $tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php"); $tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php"); diff --git a/usr/local/www/diag_logs_openvpn.php b/usr/local/www/diag_logs_openvpn.php index 73e6ed5bbb..aa50856ba8 100644 --- a/usr/local/www/diag_logs_openvpn.php +++ b/usr/local/www/diag_logs_openvpn.php @@ -71,6 +71,7 @@ include("head.inc"); $tab_array[] = array("DHCP", false, "diag_logs_dhcp.php"); $tab_array[] = array("Portal Auth", false, "diag_logs_auth.php"); $tab_array[] = array("IPsec", false, "diag_logs_ipsec.php"); + $tab_array[] = array("PPP", false, "diag_logs_ppp.php"); $tab_array[] = array("VPN", false, "diag_logs_vpn.php"); $tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php"); $tab_array[] = array("OpenVPN", true, "diag_logs_openvpn.php"); diff --git a/usr/local/www/diag_logs_ppp.php b/usr/local/www/diag_logs_ppp.php new file mode 100755 index 0000000000..470d33d55c --- /dev/null +++ b/usr/local/www/diag_logs_ppp.php @@ -0,0 +1,124 @@ +. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + pfSense_BUILDER_BINARIES: /sbin/ifconfig /usr/bin/awk + pfSense_MODULE: +*/ + +##|+PRIV +##|*IDENT=page-status-systemlogs-ppp +##|*NAME=Status: System logs: IPsec VPN page +##|*DESCR=Allow access to the 'Status: System logs: IPsec VPN' page. +##|*MATCH=diag_logs_ppp.php* +##|-PRIV + +require("guiconfig.inc"); + +$ppp_logfile = "{$g['varlog_path']}/ppp.log"; + +$nentries = $config['syslog']['nentries']; +if (!$nentries) + $nentries = 50; + +if ($_POST['clear']) + clear_log_file($ppp_logfile); + +$ppp_logarr = return_clog($ppp_logfile, $nentries); + +$pgtitle = array("Status","System logs","PPP"); +include("head.inc"); + +?> + + + + + + + + + +
+ +
+
+ + + + + [Unknown Gateway/Dynamic]: $2$3$4"; + $logent = preg_replace($searchs, $replaces, $logent); + } + $logent = preg_split("/\s+/", $logent, 6); + echo "\n"; + $entry_date_time = htmlspecialchars(join(" ", array_slice($logent, 0, 3))); + echo "\n"; + echo "\n"; + echo "\n"; + } + ?> + + + +
Last PPP log entries
" . $entry_date_time . "" . $logent[4] . " " . $logent[5] . "
+
+
+ +
+
+
+
+ + + diff --git a/usr/local/www/diag_logs_relayd.php b/usr/local/www/diag_logs_relayd.php index a7a52a0f45..f267c741e9 100755 --- a/usr/local/www/diag_logs_relayd.php +++ b/usr/local/www/diag_logs_relayd.php @@ -67,6 +67,7 @@ include("head.inc"); $tab_array[] = array("Firewall", false, "diag_logs_filter.php"); $tab_array[] = array("DHCP", false, "diag_logs_dhcp.php"); $tab_array[] = array("Portal Auth", false, "diag_logs_auth.php"); + $tab_array[] = array("PPP", false, "diag_logs_ppp.php"); $tab_array[] = array("IPsec", false, "diag_logs_ipsec.php"); $tab_array[] = array("VPN", false, "diag_logs_vpn.php"); $tab_array[] = array("Load Balancer", true, "diag_logs_relayd.php"); diff --git a/usr/local/www/diag_logs_settings.php b/usr/local/www/diag_logs_settings.php index 93e1169cb6..f2b7861339 100755 --- a/usr/local/www/diag_logs_settings.php +++ b/usr/local/www/diag_logs_settings.php @@ -171,6 +171,7 @@ function enable_change(enable_over) { $tab_array[] = array("DHCP", false, "diag_logs_dhcp.php"); $tab_array[] = array("Portal Auth", false, "diag_logs_auth.php"); $tab_array[] = array("IPsec", false, "diag_logs_ipsec.php"); + $tab_array[] = array("PPP", false, "diag_logs_ppp.php"); $tab_array[] = array("VPN", false, "diag_logs_vpn.php"); $tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php"); $tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php"); diff --git a/usr/local/www/diag_logs_vpn.php b/usr/local/www/diag_logs_vpn.php index e0faf23c53..83d0ecd34b 100755 --- a/usr/local/www/diag_logs_vpn.php +++ b/usr/local/www/diag_logs_vpn.php @@ -103,6 +103,7 @@ include("head.inc"); $tab_array[] = array("DHCP", false, "diag_logs_dhcp.php"); $tab_array[] = array("Portal Auth", false, "diag_logs_auth.php"); $tab_array[] = array("IPsec", false, "diag_logs_ipsec.php"); + $tab_array[] = array("PPP", false, "diag_logs_ppp.php"); $tab_array[] = array("VPN", true, "diag_logs_vpn.php"); $tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php"); $tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php"); diff --git a/usr/local/www/firewall_virtual_ip_edit.php b/usr/local/www/firewall_virtual_ip_edit.php index 415ced4f30..b84d8b0012 100755 --- a/usr/local/www/firewall_virtual_ip_edit.php +++ b/usr/local/www/firewall_virtual_ip_edit.php @@ -155,7 +155,7 @@ if ($_POST) { if (isset($id) && ($a_vip[$id])) { if ($a_vip[$id]['mode'] != $_POST['mode']) - interface_bring_down($a_vip[$id]); + interface_bring_down($a_vip[$id]['interface']); } if (!$input_errors) { diff --git a/usr/local/www/getserviceproviders.php b/usr/local/www/getserviceproviders.php new file mode 100644 index 0000000000..576795014d --- /dev/null +++ b/usr/local/www/getserviceproviders.php @@ -0,0 +1,145 @@ + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +/* + pfSense_MODULE: ajax +*/ + +##|+PRIV +##|*IDENT=page-getserviceproviders +##|*NAME=AJAX: Get Service Providers +##|*DESCR=Allow access to the 'AJAX: Service Providers' page. +##|*MATCH=getserviceproviders.php* +##|-PRIV +require_once("pfsense-utils.inc"); + +$serviceproviders_xml = "/usr/local/share/mobile-broadband-provider-info/serviceproviders.xml"; +$serviceproviders_contents = file_get_contents($serviceproviders_xml); +$serviceproviders_attr = xml2array($serviceproviders_contents,1,"attr"); + +$serviceproviders = &$serviceproviders_attr['serviceproviders']['country']; + +function get_country_providers($country) { + global $serviceproviders; + foreach($serviceproviders as $sp) { + if($sp['attr']['code'] == strtolower($country)) { + return is_array($sp['provider'][0]) ? $sp['provider'] : array($sp['provider']); + } + } + return $provider_list; +} + +function country_list() { + global $serviceproviders; + $country_list = get_country_name("ALL"); + foreach($serviceproviders as $sp) { + foreach($country_list as $country) { + if(strtoupper($sp['attr']['code']) == $country['code']) { + echo $country['name'] . ":" . $country['code'] . "\n"; + } + } + } +} + +function providers_list($country) { + $serviceproviders = get_country_providers($country); + foreach($serviceproviders as $sp) { + echo $sp['name']['value'] . "\n"; + } +} + +function provider_plan_data($country,$provider,$connection) { + Header("Content-type: application/xml; charset=iso-8859-1"); + echo "\n"; + echo "\n"; + $serviceproviders = get_country_providers($country); + foreach($serviceproviders as $sp) { + if(strtolower($sp['name']['value']) == strtolower($provider)) { + if(strtoupper($connection) == "CDMA") { + $conndata = $sp['cdma']; + } else { + if(!is_array($sp['gsm']['apn'][0])) { + $conndata = $sp['gsm']['apn']; + } else { + foreach($sp['gsm']['apn'] as $apn) { + if($apn['attr']['value'] == $connection) { + $conndata = $apn; + break; + } + } + } + } + if(is_array($conndata)) { + echo "" . $connection . "\n"; + echo "" . $conndata['username']['value'] . "\n"; + echo "" . $conndata['password']['value'] . "\n"; + + $dns_arr = is_array($conndata['dns'][0]) ? $conndata['dns'] : array( $conndata['dns'] ); + foreach($dns_arr as $dns) { + echo '' . $dns['value'] . "\n"; + } + } + break; + } + } + echo ""; +} + +function provider_plans_list($country,$provider) { + $serviceproviders = get_country_providers($country); + foreach($serviceproviders as $sp) { + if(strtolower($sp['name']['value']) == strtolower($provider)) { + if(array_key_exists('gsm',$sp)) { + if(array_key_exists('attr',$sp['gsm']['apn'])) { + $name = ($sp['gsm']['apn']['name'] ? $sp['gsm']['apn']['name'] : $sp['name']['value']); + echo $name . ":" . $sp['gsm']['apn']['attr']['value']; + } else { + foreach($sp['gsm']['apn'] as $apn_info) { + $name = ($apn_info['name']['value'] ? $apn_info['name']['value'] : $apn_info['gsm']['apn']['name']); + echo $name . ":" . $apn_info['attr']['value'] . "\n"; + } + } + } + if(array_key_exists('cdma',$sp)) { + $name = $sp['cdma']['name']['value'] ? $sp['cdma']['name']['value']:$sp['name']['value']; + echo $name . ":" . "CDMA"; + } + } + } +} + +if(isset($_POST['country']) && !isset($_POST['provider'])) { + providers_list($_POST['country']); +} elseif(isset($_POST['country']) && isset($_POST['provider'])) { + if(isset($_POST['plan'])) + provider_plan_data($_POST['country'],$_POST['provider'],$_POST['plan']); + else + provider_plans_list($_POST['country'],$_POST['provider']); +} else { + country_list(); +} +?> diff --git a/usr/local/www/help.php b/usr/local/www/help.php index 8a7514d4c8..e5ac529308 100644 --- a/usr/local/www/help.php +++ b/usr/local/www/help.php @@ -58,6 +58,7 @@ $helppages = array( 'diag_logs_filter_dynamic.php' => 'http://doc.pfsense.org/index.php/Firewall_Logs', 'diag_logs_filter_summary.php' => 'http://doc.pfsense.org/index.php/Firewall_Logs', 'diag_logs_ntpd.php' => 'http://doc.pfsense.org/index.php/NTP_Logs', + 'diag_logs_ppp.php' => 'http://doc.pfsense.org/index.php/PPP_Logs', 'diag_logs_relayd.php' => 'http://doc.pfsense.org/index.php/Load_Balancer_Logs', 'diag_logs_settings.php' => 'http://doc.pfsense.org/index.php/Log_Settings', 'diag_logs_vpn.php' => 'http://doc.pfsense.org/index.php/PPTP_VPN_Logs', diff --git a/usr/local/www/index.php b/usr/local/www/index.php index 4125b5173a..0463750dd7 100755 --- a/usr/local/www/index.php +++ b/usr/local/www/index.php @@ -165,7 +165,7 @@ EOF; if ($fd) { while (!feof($fd)) { $dmesgl = fgets($fd); - if (preg_match("/^hifn.: (.*?),/", $dmesgl, $matches) or preg_match("/^safe.: (.*?),/", $dmesgl, $matches) or preg_match("/^ubsec.: (.*?),/", $dmesgl, $matches) or preg_match("/^padlock.: <(.*?)>,/", $dmesgl, $matches) or preg_match("/^glxsb.: (.*?),/", $dmesgl, $matches)) { + if (preg_match("/^hifn.: (.*?),/", $dmesgl, $matches) or preg_match("/.*(VIA Padlock)/", $dmesgl, $matches) or preg_match("/^safe.: (.*?),/", $dmesgl, $matches) or preg_match("/^ubsec.: (.*?),/", $dmesgl, $matches) or preg_match("/^padlock.: <(.*?)>,/", $dmesgl, $matches) or preg_match("/^glxsb.: (.*?),/", $dmesgl, $matches)) { $hwcrypto = $matches[1]; break; } diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 414a10ef58..0cf637cb6b 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -44,14 +44,14 @@ ##|*MATCH=interfaces.php* ##|-PRIV -require("guiconfig.inc"); -require("ipsec.inc"); -require("functions.inc"); -require("captiveportal.inc"); -require("filter.inc"); -require("shaper.inc"); -require("rrd.inc"); -require("vpn.inc"); +require_once("guiconfig.inc"); +require_once("ipsec.inc"); +require_once("functions.inc"); +require_once("captiveportal.inc"); +require_once("filter.inc"); +require_once("shaper.inc"); +require_once("rrd.inc"); +require_once("vpn.inc"); if ($_REQUEST['if']) { $if = $_REQUEST['if']; @@ -59,34 +59,15 @@ if ($_REQUEST['if']) { $if = "wan"; } -define("CRON_PPPOE_CMD_FILE", "/conf/pppoe{$if}restart"); define("CRON_MONTHLY_PATTERN", "0 0 1 * *"); define("CRON_WEEKLY_PATTERN", "0 0 * * 0"); define("CRON_DAILY_PATTERN", "0 0 * * *"); define("CRON_HOURLY_PATTERN", "0 * * * *"); -function getMPDCRONSettings() { - global $config; - if (is_array($config['cron']['item'])) { - for ($i = 0; $i < count($config['cron']['item']); $i++) { - $item = $config['cron']['item'][$i]; - if (strpos($item['command'], CRON_PPPOE_CMD_FILE) !== false) { - return array("ID" => $i, "ITEM" => $item); - } - } - } - return NULL; -} +if (!is_array($config['ppps']['ppp'])) + $config['ppps']['ppp'] = array(); -function getMPDResetTimeFromConfig() { - $itemhash = getMPDCRONSettings(); - $cronitem = $itemhash['ITEM']; - if (isset($cronitem)) { - return "{$cronitem['minute']} {$cronitem['hour']} {$cronitem['mday']} {$cronitem['month']} {$cronitem['wday']}"; - } else { - return NULL; - } -} +$a_ppps = &$config['ppps']['ppp']; function remove_bad_chars($string) { return preg_replace('/[^a-z|_|0-9]/i','',$string); @@ -99,56 +80,86 @@ $a_gateways = &$config['gateways']['gateway_item']; $wancfg = &$config['interfaces'][$if]; -$pconfig['pppoe_username'] = $wancfg['pppoe_username']; -$pconfig['pppoe_password'] = $wancfg['pppoe_password']; -$pconfig['provider'] = $wancfg['provider']; -$pconfig['pppoe_dialondemand'] = isset($wancfg['ondemand']); -$pconfig['pppoe_idletimeout'] = $wancfg['timeout']; - -/* ================================================ */ -/* = force a connection reset at a specific time? = */ -/* ================================================ */ - -if (isset($wancfg['pppoe']['pppoe-reset-type'])) { - $resetTime = getMPDResetTimeFromConfig(); - $pconfig['pppoe_preset'] = true; - if ($wancfg['pppoe']['pppoe-reset-type'] == "custom") { - $resetTime_a = split(" ", $resetTime); - $pconfig['pppoe_pr_custom'] = true; - $pconfig['pppoe_resetminute'] = $resetTime_a[0]; - $pconfig['pppoe_resethour'] = $resetTime_a[1]; - /* just initialize $pconfig['pppoe_resetdate'] if the - * coresponding item contains appropriate numeric values. - */ - if ($resetTime_a[2] <> "*" && $resetTime_a[3] <> "*") - $pconfig['pppoe_resetdate'] = "{$resetTime_a[3]}/{$resetTime_a[2]}/" . date("Y"); - } else if ($wancfg['pppoe']['pppoe-reset-type'] == "preset") { - $pconfig['pppoe_pr_preset'] = true; - switch ($resetTime) { - case CRON_MONTHLY_PATTERN: - $pconfig['pppoe_monthly'] = true; - break; - case CRON_WEEKLY_PATTERN: - $pconfig['pppoe_weekly'] = true; - break; - case CRON_DAILY_PATTERN: - $pconfig['pppoe_daily'] = true; - break; - case CRON_HOURLY_PATTERN: - $pconfig['pppoe_hourly'] = true; - break; - } - } +foreach ($a_ppps as $pppid => $ppp) { + if ($wancfg['if'] == $ppp['if']) + break; } -$pconfig['pptp_username'] = $wancfg['pptp_username']; -$pconfig['pptp_password'] = $wancfg['pptp_password']; -$pconfig['pptp_local'] = $wancfg['local']; -$pconfig['pptp_subnet'] = $wancfg['subnet']; -$pconfig['pptp_remote'] = $wancfg['remote']; -$pconfig['pptp_dialondemand'] = isset($wancfg['ondemand']); -$pconfig['pptp_idletimeout'] = $wancfg['timeout']; +if ($wancfg['if'] == $a_ppps[$pppid]['if']) { + $pconfig['pppid'] = $pppid; + $pconfig['ptpid'] = $a_ppps[$pppid]['ptpid']; + $pconfig['port'] = $a_ppps[$pppid]['ports']; + if ($a_ppps[$pppid]['type'] == "ppp"){ + $pconfig['username'] = $a_ppps[$pppid]['username']; + $pconfig['password'] = base64_decode($a_ppps[$pppid]['password']); + + $pconfig['phone'] = $a_ppps[$pppid]['phone']; + $pconfig['apn'] = $a_ppps[$pppid]['apn']; + } + + if ($a_ppps[$pppid]['type'] == "pppoe"){ + $pconfig['pppoe_username'] = $a_ppps[$pppid]['username']; + $pconfig['pppoe_password'] = base64_decode($a_ppps[$pppid]['password']); + $pconfig['provider'] = $a_ppps[$pppid]['provider']; + $pconfig['pppoe_dialondemand'] = isset($a_ppps[$pppid]['ondemand']); + $pconfig['pppoe_idletimeout'] = $a_ppps[$pppid]['idletimeout']; + /* ================================================ */ + /* = force a connection reset at a specific time? = */ + /* ================================================ */ + + if (isset($a_ppps[$pppid]['pppoe-reset-type'])) { + $pconfig['pppoe-reset-type'] = $a_ppps[$pppid]['pppoe-reset-type']; + $itemhash = getMPDCRONSettings($a_ppps[$pppid]['if']); + $cronitem = $itemhash['ITEM']; + if (isset($cronitem)) { + $resetTime = "{$cronitem['minute']} {$cronitem['hour']} {$cronitem['mday']} {$cronitem['month']} {$cronitem['wday']}"; + } else { + $resetTime = NULL; + } + log_error("ResetTime:".$resetTime); + if ($a_ppps[$pppid]['pppoe-reset-type'] == "custom") { + $resetTime_a = split(" ", $resetTime); + $pconfig['pppoe_pr_custom'] = true; + $pconfig['pppoe_resetminute'] = $resetTime_a[0]; + $pconfig['pppoe_resethour'] = $resetTime_a[1]; + /* just initialize $pconfig['pppoe_resetdate'] if the + * coresponding item contains appropriate numeric values. + */ + if ($resetTime_a[2] <> "*" && $resetTime_a[3] <> "*") + $pconfig['pppoe_resetdate'] = "{$resetTime_a[3]}/{$resetTime_a[2]}/" . date("Y"); + } else if ($a_ppps[$pppid]['pppoe-reset-type'] == "preset") { + $pconfig['pppoe_pr_preset'] = true; + switch ($resetTime) { + case CRON_MONTHLY_PATTERN: + $pconfig['pppoe_monthly'] = true; + break; + case CRON_WEEKLY_PATTERN: + $pconfig['pppoe_weekly'] = true; + break; + case CRON_DAILY_PATTERN: + $pconfig['pppoe_daily'] = true; + break; + case CRON_HOURLY_PATTERN: + $pconfig['pppoe_hourly'] = true; + break; + } + } + }// End force pppoe reset at specific time + }// End if type == pppoe + if ($a_ppps[$pppid]['type'] == "pptp"){ + $pconfig['pptp_username'] = $a_ppps[$pppid]['username']; + $pconfig['pptp_password'] = base64_decode($a_ppps[$pppid]['password']); + $pconfig['pptp_local'] = $a_ppps[$pppid]['localip']; + $pconfig['pptp_subnet'] = $a_ppps[$pppid]['subnet']; + $pconfig['pptp_remote'] = $a_ppps[$pppid]['gateway']; + $pconfig['pptp_dialondemand'] = isset($a_ppps[$pppid]['ondemand']); + $pconfig['pptp_idletimeout'] = $a_ppps[$pppid]['timeout']; + } +} else { + $pconfig['ptpid'] = interfaces_ptpid_next(); + $pppid = count($a_ppps); +} $pconfig['dhcphostname'] = $wancfg['dhcphostname']; $pconfig['alias-address'] = $wancfg['alias-address']; $pconfig['alias-subnet'] = $wancfg['alias-subnet']; @@ -180,13 +191,9 @@ switch($wancfg['ipaddr']) { $pconfig['ipaddr'] = ""; break; case "pppoe": - $pconfig['type'] = "pppoe"; - break; case "pptp": - $pconfig['type'] = "pptp"; - break; case "ppp": - $pconfig['type'] = "ppp"; + $pconfig['type'] = $wancfg['ipaddr']; break; default: if(is_ipaddr($wancfg['ipaddr'])) { @@ -327,7 +334,7 @@ if ($_POST) { * data validation procedure below, may trigger a false error * message. */ - if (empty($_POST['pppoe_preset'])) { + if (empty($_POST['pppoe-reset-type'])) { unset($_POST['pppoe_pr_type']); unset($_POST['pppoe_resethour']); unset($_POST['pppoe_resetminute']); @@ -351,6 +358,11 @@ if ($_POST) { $reqdfieldsn = explode(",", "IP address,Subnet bit count,Gateway"); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); break; + case "ppp": + $reqdfields = explode(" ", "port phone"); + $reqdfieldsn = explode(",", "Modem Port,Phone Number"); + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + break; case "PPPoE": if ($_POST['pppoe_dialondemand']) { $reqdfields = explode(" ", "pppoe_username pppoe_password pppoe_dialondemand pppoe_idletimeout"); @@ -467,6 +479,7 @@ if ($_POST) { } } if (!$input_errors) { + $ppp = array(); if ($wancfg['ipaddr'] != "ppp") unset($wancfg['ipaddr']); unset($wancfg['subnet']); @@ -479,12 +492,18 @@ if ($_POST) { unset($wancfg['provider']); unset($wancfg['ondemand']); unset($wancfg['timeout']); - if ($wancfg['pppoe']['pppoe-reset-type']) - unset($wancfg['pppoe']['pppoe-reset-type']); + unset($wancfg['pppoe']['pppoe-reset-type']); unset($wancfg['local']); unset($wancfg['subnet']); unset($wancfg['remote']); - + unset($a_ppps[$pppid]['apn']); + unset($a_ppps[$pppid]['phone']); + unset($a_ppps[$pppid]['localip']); + unset($a_ppps[$pppid]['subnet']); + unset($a_ppps[$pppid]['gateway']); + unset($a_ppps[$pppid]['pppoe-reset-type']); + unset($a_ppps[$pppid]['provider']); + $wancfg['descr'] = remove_bad_chars($_POST['descr']); $wancfg['enable'] = $_POST['enable'] == "yes" ? true : false; @@ -509,7 +528,7 @@ if ($_POST) { unset($gateway_item); } } - + switch($_POST['type']) { case "static": $wancfg['ipaddr'] = $_POST['ipaddr']; @@ -536,40 +555,82 @@ if ($_POST) { $a_gateways[] = $gateway_item; } break; + case "ppp": + $a_ppps[$pppid]['ptpid'] = $_POST['ptpid']; + $a_ppps[$pppid]['type'] = $_POST['type']; + $a_ppps[$pppid]['if'] = $_POST['type'].$_POST['ptpid']; + $a_ppps[$pppid]['ports'] = $_POST['port']; + $a_ppps[$pppid]['username'] = $_POST['username']; + $a_ppps[$pppid]['password'] = base64_encode($_POST['password']); + $a_ppps[$pppid]['phone'] = $_POST['phone']; + $a_ppps[$pppid]['apn'] = $_POST['apn']; + $wancfg['if'] = $_POST['type'] . $_POST['ptpid']; + $wancfg['ipaddr'] = $_POST['type']; + unset($a_ppps[$pppid]['ondemand']); + unset($a_ppps[$pppid]['idletimeout']); + break; + case "pppoe": - $wancfg['ipaddr'] = "pppoe"; - $wancfg['pppoe_username'] = $_POST['pppoe_username']; - $wancfg['pppoe_password'] = $_POST['pppoe_password']; - $wancfg['provider'] = $_POST['provider']; - $wancfg['ondemand'] = $_POST['pppoe_dialondemand'] ? true : false; - $wancfg['timeout'] = $_POST['pppoe_idletimeout']; + $a_ppps[$pppid]['ptpid'] = $_POST['ptpid']; + $a_ppps[$pppid]['type'] = $_POST['type']; + $a_ppps[$pppid]['if'] = $_POST['type'].$_POST['ptpid']; + if (isset($_POST['ppp_port'])) + $a_ppps[$pppid]['ports'] = $_POST['ppp_port']; + else + $a_ppps[$pppid]['ports'] = $wancfg['if']; + $a_ppps[$pppid]['username'] = $_POST['pppoe_username']; + $a_ppps[$pppid]['password'] = base64_encode($_POST['pppoe_password']); + if (!empty($_POST['provider'])) + $a_ppps[$pppid]['provider'] = $_POST['provider']; + else + unset($a_ppps[$pppid]['provider']); + $a_ppps[$pppid]['ondemand'] = $_POST['pppoe_dialondemand'] ? true : false; + if (!empty($_POST['idletimeout'])) + $a_ppps[$pppid]['idletimeout'] = $_POST['pppoe_idletimeout']; + else + unset($a_ppps[$pppid]['idletimeout']); + + if (!empty($_POST['pppoe-reset-type'])) + $a_ppps[$pppid]['pppoe-reset-type'] = $_POST['pppoe-reset-type']; + else + unset($a_ppps[$pppid]['pppoe-reset-type']); + $wancfg['if'] = $_POST['type'].$_POST['ptpid']; + $wancfg['ipaddr'] = $_POST['type']; if($gateway_item) { $a_gateways[] = $gateway_item; } + break; case "pptp": - $wancfg['ipaddr'] = "pptp"; - $wancfg['pptp_username'] = $_POST['pptp_username']; - $wancfg['pptp_password'] = $_POST['pptp_password']; - $wancfg['local'] = $_POST['pptp_local']; - $wancfg['subnet'] = $_POST['pptp_subnet']; - $wancfg['remote'] = $_POST['pptp_remote']; - $wancfg['ondemand'] = $_POST['pptp_dialondemand'] ? true : false; - $wancfg['timeout'] = $_POST['pptp_idletimeout']; + $a_ppps[$pppid]['ptpid'] = $_POST['ptpid']; + $a_ppps[$pppid]['type'] = $_POST['type']; + $a_ppps[$pppid]['if'] = $_POST['type'].$_POST['ptpid']; + if (isset($_POST['ppp_port'])) + $a_ppps[$pppid]['ports'] = $_POST['ppp_port']; + else + $a_ppps[$pppid]['ports'] = $wancfg['if']; + $a_ppps[$pppid]['username'] = $_POST['pptp_username']; + $a_ppps[$pppid]['password'] = base64_encode($_POST['pptp_password']); + $a_ppps[$pppid]['localip'] = $_POST['pptp_local']; + $a_ppps[$pppid]['subnet'] = $_POST['pptp_subnet']; + $a_ppps[$pppid]['gateway'] = $_POST['pptp_remote']; + $a_ppps[$pppid]['ondemand'] = $_POST['pptp_dialondemand'] ? true : false; + if (!empty($_POST['idletimeout'])) + $a_ppps[$pppid]['idletimeout'] = $_POST['pptp_idletimeout']; + else + unset($a_ppps[$pppid]['idletimeout']); + + $wancfg['if'] = $_POST['type'].$_POST['ptpid']; + $wancfg['ipaddr'] = $_POST['type']; if($gateway_item) { $a_gateways[] = $gateway_item; } break; + case "none": + break; } - handle_pppoe_reset(); - /* reset cron items if necessary */ - if (empty($_POST['pppoe_preset'])) { - /* test whether a cron item exists and unset() it if necessary */ - $itemhash = getMPDCRONSettings(); - $item = $itemhash['ITEM']; - if (isset($item)) - unset($config['cron']['item'][$itemhash['ID']]); - } + handle_pppoe_reset($_POST); + if($_POST['blockpriv'] == "yes") { $wancfg['blockpriv'] = true; } else { @@ -589,6 +650,7 @@ if ($_POST) { if (isset($wancfg['wireless'])) { handle_wireless_post(); } + write_config(); mark_subsystem_dirty('interfaces'); /* regenerate cron settings/crontab file */ @@ -597,96 +659,11 @@ if ($_POST) { header("Location: interfaces.php?if={$if}"); exit; } + + + } // end if($_POST) -function handle_pppoe_reset() { - global $_POST, $config, $g, $wancfg, $if; - /* perform a periodic reset? */ - if(!isset($_POST['pppoe_preset'])) { - setup_pppoe_reset_file($if, false); - return; - } - if (!is_array($config['cron']['item'])) - $config['cron']['item'] = array(); - $itemhash = getMPDCRONSettings(); - $item = $itemhash['ITEM']; - if (empty($item)) - $item = array(); - if (isset($_POST['pppoe_pr_type']) && $_POST['pppoe_pr_type'] == "custom") { - $wancfg['pppoe']['pppoe-reset-type'] = "custom"; - $pconfig['pppoe_pr_custom'] = true; - $item['minute'] = $_POST['pppoe_resetminute']; - $item['hour'] = $_POST['pppoe_resethour']; - if (isset($_POST['pppoe_resetdate']) && $_POST['pppoe_resetdate'] <> "" && strlen($_POST['pppoe_resetdate']) == 10) { - $date = explode("/", $_POST['pppoe_resetdate']); - $item['mday'] = $date[1]; - $item['month'] = $date[0]; - } else { - $item['mday'] = "*"; - $item['month'] = "*"; - } - $item['wday'] = "*"; - $item['who'] = "root"; - $item['command'] = CRON_PPPOE_CMD_FILE; - } else if (isset($_POST['pppoe_pr_type']) && $_POST['pppoe_pr_type'] = "preset") { - $wancfg['pppoe']['pppoe-reset-type'] = "preset"; - $pconfig['pppoe_pr_preset'] = true; - switch ($_POST['pppoe_pr_preset_val']) { - case "monthly": - $item['minute'] = "0"; - $item['hour'] = "0"; - $item['mday'] = "1"; - $item['month'] = "*"; - $item['wday'] = "*"; - $item['who'] = "root"; - $item['command'] = CRON_PPPOE_CMD_FILE; - break; - case "weekly": - $item['minute'] = "0"; - $item['hour'] = "0"; - $item['mday'] = "*"; - $item['month'] = "*"; - $item['wday'] = "0"; - $item['who'] = "root"; - $item['command'] = CRON_PPPOE_CMD_FILE; - break; - case "daily": - $item['minute'] = "0"; - $item['hour'] = "0"; - $item['mday'] = "*"; - $item['month'] = "*"; - $item['wday'] = "*"; - $item['who'] = "root"; - $item['command'] = CRON_PPPOE_CMD_FILE; - break; - case "hourly": - $item['minute'] = "0"; - $item['hour'] = "*"; - $item['mday'] = "*"; - $item['month'] = "*"; - $item['wday'] = "*"; - $item['who'] = "root"; - $item['command'] = CRON_PPPOE_CMD_FILE; - break; - } // end switch - } // end if - if (isset($itemhash['ID'])) - $config['cron']['item'][$itemhash['ID']] = $item; - else - $config['cron']['item'][] = $item; - /* finally install the pppoerestart file */ - if (isset($_POST['pppoe_preset'])) { - setup_pppoe_reset_file($if, true); - $wancfg['pppoe_reset'] = true; - $wancfg['pppoe_preset'] = true; - sigkillbypid("{$g['varrun_path']}/cron.pid", "HUP"); - } else { - unset($wancfg['pppoe_reset']); - unset($wancfg['pppoe_preset']); - setup_pppoe_reset_file($if, false); - } -} - function handle_wireless_post() { global $_POST, $config, $g, $wancfg, $if, $wl_countries_attr; if (!is_array($wancfg['wireless'])) @@ -832,7 +809,7 @@ $statusurl = "status_interfaces.php"; $closehead = false; include("head.inc"); -$types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe" => "PPPoE", "pptp" => "PPTP" /* , "carpdev-dhcp" => "CarpDev"*/); +$types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" => "PPTP" /* , "carpdev-dhcp" => "CarpDev"*/); ?> @@ -842,21 +819,33 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe" @@ -923,7 +1002,6 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
Enter a description (name) for the interface here. - Type @@ -940,7 +1018,6 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe" - MAC address @@ -1117,6 +1194,103 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PPP configuration
+ + + + + + + + + + + + + +
:   + +
+
+
+ +
+ +
+ +
+ +
+ +
+ Click here + to edit PPP configuration. + + Click here + to create a PPP configuration. +
+ + @@ -1158,63 +1332,71 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe" - -
- onclick="show_periodic_reset(this);" /> - -
- - - -
+ + + - - -
+

+ +

+ +

+ +

-

- onclick="if (this.checked) { Effect.Appear('pppoecustomwrap', { duration: 0.0 }); Effect.Fade('pppoepresetwrap', { duration: 0.0 }); }" /> - -
- onclick="if (this.checked) { Effect.Appear('pppoepresetwrap', { duration: 0.0 }); Effect.Fade('pppoecustomwrap', { duration: 0.0 }); }" /> - -

- -

- -

- -

- -

-
-
+ +
+ +
+ + +
 
+ Note: + +

+ +

+ +

+ + + + + + Advanced and MLPPP + + + Click here + for additional PPPoE configuration options. Save first if you made changes. + + + + Click here + for advanced PPPoE configuration options and MLPPP configuration. + + + + + + @@ -1241,8 +1423,7 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe" @@ -1684,9 +1865,9 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe" and obviously should not appear as the source address in any packets you receive. - -
- + + +
@@ -1697,14 +1878,21 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe" + + + +
- + + + diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php index 107aaea809..2c38e804ed 100755 --- a/usr/local/www/interfaces_assign.php +++ b/usr/local/www/interfaces_assign.php @@ -130,10 +130,16 @@ if (is_array($config['qinqs']['qinqentry']) && count($config['qinqs']['qinqentry /* add PPP interfaces */ if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) { foreach ($config['ppps']['ppp'] as $pppid => $ppp) { - $portname = basename($ppp['port']); + $portname = $ppp['if']; $portlist[$portname] = $ppp; $portlist[$portname]['isppp'] = true; - $portlist[$portname]['descr'] = "PPP " . basename($ppp['port']); + $ports_base = basename($ppp['ports']); + if (isset($ppp['descr'])) + $portlist[$portname]['descr'] = strtoupper($ppp['if']). "({$ports_base}) - {$ppp['descr']}"; + else if (isset($ppp['username'])) + $portlist[$portname]['descr'] = strtoupper($ppp['if']). "({$ports_base}) - {$ppp['username']}"; + else + $portlist[$portname]['descr'] = strtoupper($ppp['if']). "({$ports_base})"; } } @@ -203,11 +209,9 @@ if ($_POST['apply']) { $reloadif = true; } $config['interfaces'][$ifname]['if'] = $ifport; - if (file_exists("/dev/{$ifport}")) { - $config['interfaces'][$ifname]['if'] = basename($portlist[$ifport]['port']); - $config['interfaces'][$ifname]['ipaddr'] = "ppp"; - } - + if (isset($portlist[$ifport]['isppp'])) + $config['interfaces'][$ifname]['ipaddr'] = $portlist[$ifport]['type']; + /* check for wireless interfaces, set or clear ['wireless'] */ if (preg_match($g['wireless_regex'], $ifport)) { if (!is_array($config['interfaces'][$ifname]['wireless'])) @@ -219,6 +223,7 @@ if ($_POST['apply']) { /* make sure there is a descr for all interfaces */ if (!isset($config['interfaces'][$ifname]['descr'])) $config['interfaces'][$ifname]['descr'] = strtoupper($ifname); + if ($reloadif == true) { if (preg_match($g['wireless_regex'], $ifport)) interface_sync_wireless_clones($config['interfaces'][$ifname], false); @@ -265,23 +270,23 @@ if ($_GET['act'] == "del") { } if (count($config['filter']['rule']) > 0) { - foreach ($config['filter']['rule'] as $x => $rule) { - if($rule['interface'] == $id) - unset($config['filter']['rule'][$x]); + foreach ($config['filter']['rule'] as $x => $rule) { + if($rule['interface'] == $id) + unset($config['filter']['rule'][$x]); } } if (is_array($config['nat']['advancedoutbound']) && count($config['nat']['advancedoutbound']['rule']) > 0) { - foreach ($config['nat']['advancedoutbound']['rule'] as $x => $rule) { - if($rule['interface'] == $id) - unset($config['nat']['advancedoutbound']['rule'][$x]['interface']); + foreach ($config['nat']['advancedoutbound']['rule'] as $x => $rule) { + if($rule['interface'] == $id) + unset($config['nat']['advancedoutbound']['rule'][$x]['interface']); } } - if (is_array($config['nat']['rule']) && count($config['nat']['rule']) > 0) { - foreach ($config['nat']['rule'] as $x => $rule) { - if($rule['interface'] == $id) - unset($config['nat']['rule'][$x]['interface']); + if (is_array($config['nat']['rule']) && count($config['nat']['rule']) > 0) { + foreach ($config['nat']['rule'] as $x => $rule) { + if($rule['interface'] == $id) + unset($config['nat']['rule'][$x]['interface']); } - } + } write_config(); @@ -394,11 +399,11 @@ if(file_exists("/var/run/interface_mismatch_reboot_needed")) $tab_array[2] = array("Wireless", false, "interfaces_wireless.php"); $tab_array[3] = array("VLANs", false, "interfaces_vlan.php"); $tab_array[4] = array("QinQs", false, "interfaces_qinq.php"); - $tab_array[5] = array("PPP", false, "interfaces_ppp.php"); - $tab_array[6] = array("GRE", false, "interfaces_gre.php"); - $tab_array[7] = array("GIF", false, "interfaces_gif.php"); - $tab_array[8] = array("Bridges", false, "interfaces_bridge.php"); - $tab_array[9] = array("LAGG", false, "interfaces_lagg.php"); + $tab_array[5] = array("PPPs", false, "interfaces_ppps.php"); + $tab_array[7] = array("GRE", false, "interfaces_gre.php"); + $tab_array[8] = array("GIF", false, "interfaces_gif.php"); + $tab_array[9] = array("Bridges", false, "interfaces_bridge.php"); + $tab_array[10] = array("LAGG", false, "interfaces_lagg.php"); display_top_tabs($tab_array); ?> @@ -422,45 +427,44 @@ if(file_exists("/var/run/interface_mismatch_reboot_needed")) diff --git a/usr/local/www/interfaces_bridge.php b/usr/local/www/interfaces_bridge.php index 9e009ba5b3..e7aa71d969 100644 --- a/usr/local/www/interfaces_bridge.php +++ b/usr/local/www/interfaces_bridge.php @@ -91,7 +91,7 @@ include("head.inc"); $tab_array[2] = array("Wireless", false, "interfaces_wireless.php"); $tab_array[3] = array("VLANs", false, "interfaces_vlan.php"); $tab_array[4] = array("QinQs", false, "interfaces_qinq.php"); - $tab_array[5] = array("PPP", false, "interfaces_ppp.php"); + $tab_array[5] = array("PPPs", false, "interfaces_ppps.php"); $tab_array[6] = array("GRE", false, "interfaces_gre.php"); $tab_array[7] = array("GIF", false, "interfaces_gif.php"); $tab_array[8] = array("Bridges", true, "interfaces_bridge.php"); diff --git a/usr/local/www/interfaces_gif.php b/usr/local/www/interfaces_gif.php index 64eb6a4660..92439fa256 100644 --- a/usr/local/www/interfaces_gif.php +++ b/usr/local/www/interfaces_gif.php @@ -73,7 +73,7 @@ if ($_GET['act'] == "del") { } } -$pgtitle = array("Interfaces","gif"); +$pgtitle = array("Interfaces","GIF"); include("head.inc"); ?> @@ -90,7 +90,7 @@ include("head.inc"); $tab_array[2] = array("Wireless", false, "interfaces_wireless.php"); $tab_array[3] = array("VLANs", false, "interfaces_vlan.php"); $tab_array[4] = array("QinQs", false, "interfaces_qinq.php"); - $tab_array[5] = array("PPP", false, "interfaces_ppp.php"); + $tab_array[5] = array("PPPs", false, "interfaces_ppps.php"); $tab_array[6] = array("GRE", false, "interfaces_gre.php"); $tab_array[7] = array("GIF", true, "interfaces_gif.php"); $tab_array[8] = array("Bridges", false, "interfaces_bridge.php"); diff --git a/usr/local/www/interfaces_gre.php b/usr/local/www/interfaces_gre.php index bcef63adbf..a1a959e660 100644 --- a/usr/local/www/interfaces_gre.php +++ b/usr/local/www/interfaces_gre.php @@ -90,7 +90,7 @@ include("head.inc"); $tab_array[2] = array("Wireless", false, "interfaces_wireless.php"); $tab_array[3] = array("VLANs", false, "interfaces_vlan.php"); $tab_array[4] = array("QinQs", false, "interfaces_qinq.php"); - $tab_array[5] = array("PPP", false, "interfaces_ppp.php"); + $tab_array[5] = array("PPPs", false, "interfaces_ppps.php"); $tab_array[6] = array("GRE", true, "interfaces_gre.php"); $tab_array[7] = array("GIF", false, "interfaces_gif.php"); $tab_array[8] = array("Bridges", false, "interfaces_bridge.php"); diff --git a/usr/local/www/interfaces_groups.php b/usr/local/www/interfaces_groups.php index 65564ddcd9..27a088a583 100755 --- a/usr/local/www/interfaces_groups.php +++ b/usr/local/www/interfaces_groups.php @@ -70,18 +70,18 @@ include("head.inc"); diff --git a/usr/local/www/interfaces_lagg.php b/usr/local/www/interfaces_lagg.php index 0beac77dd1..a8445e2972 100644 --- a/usr/local/www/interfaces_lagg.php +++ b/usr/local/www/interfaces_lagg.php @@ -96,11 +96,11 @@ include("head.inc"); $tab_array[2] = array("Wireless", false, "interfaces_wireless.php"); $tab_array[3] = array("VLANs", false, "interfaces_vlan.php"); $tab_array[4] = array("QinQs", false, "interfaces_qinq.php"); - $tab_array[5] = array("PPP", false, "interfaces_ppp.php"); + $tab_array[5] = array("PPPs", false, "interfaces_ppps.php"); $tab_array[6] = array("GRE", false, "interfaces_gre.php"); $tab_array[7] = array("GIF", false, "interfaces_gif.php"); $tab_array[8] = array("Bridges", false, "interfaces_bridge.php"); - $tab_array[9] = array("LAGG", true, "interfaces_lagg.php"); + $tab_array[9] = array("LAGG", true, "interfaces_lagg.php"); display_top_tabs($tab_array); ?> diff --git a/usr/local/www/interfaces_ppp_edit.php b/usr/local/www/interfaces_ppp_edit.php deleted file mode 100644 index fb6fe3f6c4..0000000000 --- a/usr/local/www/interfaces_ppp_edit.php +++ /dev/null @@ -1,328 +0,0 @@ - - Changes by Chris Buechler - Additions by Scott Ullrich - - Copyright (C) 2004-2009 BSD Perimeter LLC. - Copyright (C) 2009 Scott Ullrich - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ -/* - pfSense_MODULE: interfaces -*/ - -##|+PRIV -##|*IDENT=page-interfaces-ppp-edit -##|*NAME=Interfaces: PPP: Edit page -##|*DESCR=Allow access to the 'Interfaces: PPP: Edit' page. -##|*MATCH=interfaces_ppp_edit.php* -##|-PRIV - -require("guiconfig.inc"); - -if (!is_array($config['ppps']['ppp'])) - $config['ppps']['ppp'] = array(); - -$a_ppps = &$config['ppps']['ppp']; - -$id = $_GET['id']; -if (isset($_POST['id'])) - $id = $_POST['id']; - -if (isset($id) && $a_ppps[$id]) { - $pconfig['port'] = $a_ppps[$id]['port']; - $pconfig['initstr'] = base64_decode($a_ppps[$id]['initstr']); - $pconfig['simpin'] = $a_ppps[$id]['simpin']; - $pconfig['pin-wait'] = $a_ppps[$id]['pin-wait']; - $pconfig['apn'] = $a_ppps[$id]['apn']; - $pconfig['apnum'] = $a_ppps[$id]['apnum']; - $pconfig['phone'] = $a_ppps[$id]['phone']; - $pconfig['username'] = $a_ppps[$id]['username']; - $pconfig['password'] = $a_ppps[$id]['password']; - $pconfig['localip'] = $a_ppps[$id]['localip']; - $pconfig['gateway'] = $a_ppps[$id]['gateway']; - if (isset($a_ppps[$id]['defaultgw'])) - $pconfig['defaultgw'] = true; - $pconfig['connect-timeout'] = $a_ppps[$id]['connect-timeout']; - $pconfig['descr'] = $a_ppps[$id]['descr']; -} - -if ($_POST) { - - unset($input_errors); - $pconfig = $_POST; - - /* input validation */ - $reqdfields = explode(" ", "port"); - $reqdfieldsn = explode(",", "Serial Port"); - - do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); - - foreach ($a_ppps as $ppp) { - if (isset($id) && ($a_ppps[$id]) && ($a_ppps[$id] === $ppp)) - continue; - - if ($ppp['port'] == $_POST['port']) { - $input_errors[] = "Port is in use"; - break; - } - } - - if (!$input_errors) { - $ppp = array(); - - $ppp['port'] = $_POST['port']; - if ($_POST['initstr'] <> "") - $ppp['initstr'] = base64_encode($_POST['initstr']); - else - unset($ppp['initstr']); - - if ($_POST['simpin'] <> "") { - $ppp['simpin'] = $_POST['simpin']; - $ppp['pin-wait'] = $_POST['pin-wait']; - } else { - unset($ppp['simpin']); - unset($ppp['pin-wait']); - } - - $ppp['apn'] = $_POST['apn']; - if ($ppp['apn'] <> ""){ - if ($_POST['apnum'] <> "") - $ppp['apnum'] = $_POST['apnum']; - else - $ppp['apnum'] = "1"; - } else { - unset($ppp['apn']); - unset($ppp['apnum']); - } - - $ppp['phone'] = $_POST['phone']; - $ppp['username'] = $_POST['username']; - $ppp['password'] = $_POST['password']; - $ppp['localip'] = $_POST['localip']; - $ppp['gateway'] = $_POST['gateway']; - if ($_POST['defaultgw'] == "on") - $ppp['defaultgw'] = true; - else - unset($ppp['defaultgw']); - if ($_POST['connect-timeout'] <> "") - $ppp['connect-timeout'] = $_POST['connect-timeout']; - else - unset($ppp['connect-timeout']); - $ppp['descr'] = $_POST['descr']; - - $iflist = get_configured_interface_list(); - foreach ($iflist as $if) { - if ($config['interfaces'][$if]['if'] == basename($a_ppps[$id]['port'])) { - $config['interfaces'][$if]['if'] = basename($ppp['port']); - $thisif = $if; - } - } - if (isset($id) && $a_ppps[$id]) - $a_ppps[$id] = $ppp; - else - $a_ppps[] = $ppp; - - write_config(); - - if (!empty($thisif)) - interface_ppp_configure($thisif); - - header("Location: interfaces_ppp.php"); - exit; - } -} - -$pgtitle = "Interfaces: PPP: Edit"; -include("head.inc"); - -?> - - - - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PPP configuration
Parent interface - -

- Pre-fill connection information: - ATT - Sprint - Verizon -

Link Type - >This link will be used as the default gateway. -
Init String - -
Note: Enter the modem initialization string here. Do NOT include the "AT" string at the beginning of the command. -
Sim PIN - -
Sim PIN wait - -
Note: Time to wait for SIM to discover network after PIN is sent to SIM (seconds). -
Access Point Name (APN) - -
APN number (optional) - -
Note: Defaults to 1 if you set APN above. Ignored if you set no APN above. -
Phone Number - -
Note: Typically (*99# or *99***# or *99***1#) for GSM networks and *777 for CDMA networks -
Username - -
Password - -
Local IP - -
Note: Enter your IP address here if it is not automatically assigned. -
Remote IP (Gateway) - -
Note: Enter the remote IP here if not automatically assigned. This is where the packets will be routed. -
Connection Timeout - -
Note: Enter timeout in seconds for connection to be established (sec.) Default is 45 sec. -
Description - -
You may enter a description here for your reference (not parsed). -
  - - - - - -
- - - - diff --git a/usr/local/www/interfaces_ppp.php b/usr/local/www/interfaces_ppps.php similarity index 66% rename from usr/local/www/interfaces_ppp.php rename to usr/local/www/interfaces_ppps.php index 41d36f91f3..9c7617999c 100644 --- a/usr/local/www/interfaces_ppp.php +++ b/usr/local/www/interfaces_ppps.php @@ -1,13 +1,10 @@ - Changes by Chris Buechler - - Copyright (C) 2004-2008 BSD Perimeter LLC. - Copyright (C) 2004-2009 Scott Ullrich + Copyright (C) 2003-2004 Manuel Kasper . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -32,15 +29,15 @@ POSSIBILITY OF SUCH DAMAGE. */ /* - pfSense_BUILDER_BINARIES: /bin/kill /sbin/ifconfig + pfSense_BUILDER_BINARIES: /sbin/ifconfig pfSense_MODULE: interfaces */ ##|+PRIV -##|*IDENT=page-interfaces-ppp -##|*NAME=Interfaces: PPP page -##|*DESCR=Allow access to the 'Interfaces: PPP' page. -##|*MATCH=interfaces_ppp.php* +##|*IDENT=page-interfaces-ppps +##|*NAME=Interfaces: ppps page +##|*DESCR=Allow access to the 'Interfaces: ppps' page. +##|*MATCH=interfaces_ppps.php* ##|-PRIV require("guiconfig.inc"); @@ -54,7 +51,7 @@ function ppp_inuse($num) { global $config, $g, $a_ppps; $iflist = get_configured_interface_list(false, true); foreach ($iflist as $if) { - if ($config['interfaces'][$if]['if'] == $a_ppps[$num]['port']) + if (isset($config['interfaces'][$if]['ptpid']) && $config['interfaces'][$if]['ptpid'] == $a_ppps[$num]['ptpid']) return true; } return false; @@ -63,16 +60,18 @@ function ppp_inuse($num) { if ($_GET['act'] == "del") { /* check if still in use */ if (ppp_inuse($_GET['id'])) { - $input_errors[] = "This PPP interface cannot be deleted because it is still being used as an interface."; + $input_errors[] = "This point-to-point link cannot be deleted because it is still being used as an interface."; } else { + unset($a_ppps[$_GET['id']]['pppoe-reset-type']); + handle_pppoe_reset($a_ppps[$_GET['id']]); unset($a_ppps[$_GET['id']]); write_config(); - header("Location: interfaces_ppp.php"); + header("Location: interfaces_ppps.php"); exit; } } -$pgtitle = "Interfaces: PPP"; +$pgtitle = "Interfaces: PPPs"; include("head.inc"); ?> @@ -89,7 +88,7 @@ include("head.inc"); $tab_array[2] = array("Wireless", false, "interfaces_wireless.php"); $tab_array[3] = array("VLANs", false, "interfaces_vlan.php"); $tab_array[4] = array("QinQs", false, "interfaces_qinq.php"); - $tab_array[5] = array("PPP", true, "interfaces_ppp.php"); + $tab_array[5] = array("PPPs", false, "interfaces_ppps.php"); $tab_array[6] = array("GRE", false, "interfaces_gre.php"); $tab_array[7] = array("GIF", false, "interfaces_gif.php"); $tab_array[8] = array("Bridges", false, "interfaces_bridge.php"); @@ -102,25 +101,29 @@ include("head.inc");
- + + $ppp): ?> - + + - + - - + +
Serial PortTypeInterface(s)/Port(s) Description
+ + - +   -   +  
   
diff --git a/usr/local/www/interfaces_ppps_edit.php b/usr/local/www/interfaces_ppps_edit.php new file mode 100644 index 0000000000..78ae49cfa6 --- /dev/null +++ b/usr/local/www/interfaces_ppps_edit.php @@ -0,0 +1,789 @@ +. + All rights reserved. + Copyright (C) 2010 Gabriel B. . + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +/* + pfSense_MODULE: interfaces +*/ + +##|+PRIV +##|*IDENT=page-interfaces-ppps-edit +##|*NAME=Interfaces: PPPs: Edit page +##|*DESCR=Allow access to the 'Interfaces: PPPs: Edit' page. +##|*MATCH=interfaces_ppps_edit.php* +##|-PRIV + +require("guiconfig.inc"); +require("functions.inc"); + +define("CRON_MONTHLY_PATTERN", "0 0 1 * *"); +define("CRON_WEEKLY_PATTERN", "0 0 * * 0"); +define("CRON_DAILY_PATTERN", "0 0 * * *"); +define("CRON_HOURLY_PATTERN", "0 * * * *"); + +if (!is_array($config['ppps']['ppp'])) + $config['ppps']['ppp'] = array(); + +$a_ppps = &$config['ppps']['ppp']; + +$portlist = get_interface_list(); + +$id = $_GET['id']; +if (isset($_POST['id'])) + $id = $_POST['id']; + +if (isset($id) && $a_ppps[$id]) { + $pconfig['ptpid'] = $a_ppps[$id]['ptpid']; + $pconfig['type'] = $a_ppps[$id]['type']; + //$pconfig['if'] = $a_ppps[$id]['if']; + $pconfig['interfaces'] = $a_ppps[$id]['ports']; + $pconfig['username'] = $a_ppps[$id]['username']; + $pconfig['password'] = base64_decode($a_ppps[$id]['password']); + if (isset($a_ppps[$id]['ondemand'])) + $pconfig['ondemand'] = true; + $pconfig['idletimeout'] = $a_ppps[$id]['idletimeout']; + $pconfig['uptime'] = $a_ppps[$id]['uptime']; + $pconfig['descr'] = $a_ppps[$id]['descr']; + $pconfig['bandwidth'] = explode(",",$a_ppps[$id]['bandwidth']); + $pconfig['mtu'] = explode(",",$a_ppps[$id]['mtu']); + $pconfig['mru'] = explode(",",$a_ppps[$id]['mru']); + $pconfig['mrru'] = $a_ppps[$id]['mrru']; + if (isset($a_ppps[$id]['shortseq'])) + $pconfig['shortseq'] = true; + if (isset($a_ppps[$id]['acfcomp'])) + $pconfig['acfcomp'] = true; + if (isset($a_ppps[$id]['protocomp'])) + $pconfig['protocomp'] = true; + if (isset($a_ppps[$id]['vjcomp'])) + $pconfig['vjcomp'] = true; + if (isset($a_ppps[$id]['tcpmssfix'])) + $pconfig['tcpmssfix'] = true; + switch($a_ppps[$id]['type']) { + case "ppp": + $pconfig['initstr'] = base64_decode($a_ppps[$id]['initstr']); + $pconfig['simpin'] = $a_ppps[$id]['simpin']; + $pconfig['pin-wait'] = $a_ppps[$id]['pin-wait']; + $pconfig['apn'] = $a_ppps[$id]['apn']; + $pconfig['apnum'] = $a_ppps[$id]['apnum']; + $pconfig['phone'] = $a_ppps[$id]['phone']; + $pconfig['connect-timeout'] = $a_ppps[$id]['connect-timeout']; + $pconfig['localip'] = explode(",",$a_ppps[$id]['localip']); + $pconfig['gateway'] = explode(",",$a_ppps[$id]['gateway']); + break; + case "l2tp": + case "pptp": + $pconfig['localip'] = explode(",",$a_ppps[$id]['localip']); + foreach ($pconfig['localip'] as $key => $value){ + if ($value == "dhcp") + $pconfig['localip'][$key] = ""; + } + $pconfig['subnet'] = explode(",",$a_ppps[$id]['subnet']); + $pconfig['gateway'] = explode(",",$a_ppps[$id]['gateway']); + if (isset($a_ppps[$id]['dhcp'])) + $pconfig['pptp_dhcp'] = true; + break; + case "pppoe": + $pconfig['provider'] = $a_ppps[$id]['provider']; + /* ================================================ */ + /* = force a connection reset at a specific time? = */ + /* ================================================ */ + + if (isset($a_ppps[$id]['pppoe-reset-type'])) { + $pconfig['pppoe-reset-type'] = $a_ppps[$id]['pppoe-reset-type']; + $itemhash = getMPDCRONSettings($a_ppps[$id]['if']); + $cronitem = $itemhash['ITEM']; + if (isset($cronitem)) { + $resetTime = "{$cronitem['minute']} {$cronitem['hour']} {$cronitem['mday']} {$cronitem['month']} {$cronitem['wday']}"; + } else { + $resetTime = NULL; + } + + if ($a_ppps[$id]['pppoe-reset-type'] == "custom") { + $resetTime_a = split(" ", $resetTime); + $pconfig['pppoe_pr_custom'] = true; + $pconfig['pppoe_resetminute'] = $resetTime_a[0]; + $pconfig['pppoe_resethour'] = $resetTime_a[1]; + /* just initialize $pconfig['pppoe_resetdate'] if the + * coresponding item contains appropriate numeric values. + */ + if ($resetTime_a[2] <> "*" && $resetTime_a[3] <> "*") + $pconfig['pppoe_resetdate'] = "{$resetTime_a[3]}/{$resetTime_a[2]}/" . date("Y"); + } else if ($a_ppps[$id]['pppoe-reset-type'] == "preset") { + $pconfig['pppoe_pr_preset'] = true; + switch ($resetTime) { + case CRON_MONTHLY_PATTERN: + $pconfig['pppoe_monthly'] = true; + break; + case CRON_WEEKLY_PATTERN: + $pconfig['pppoe_weekly'] = true; + break; + case CRON_DAILY_PATTERN: + $pconfig['pppoe_daily'] = true; + break; + case CRON_HOURLY_PATTERN: + $pconfig['pppoe_hourly'] = true; + break; + } + } + } + break; + } + +} else + $pconfig['ptpid'] = interfaces_ptpid_next(); + +if ($_POST) { + + unset($input_errors); + $pconfig = $_POST; + + /* okay first of all, cause we are just hiding the PPPoE HTML + * fields releated to PPPoE resets, we are going to unset $_POST + * vars, if the reset feature should not be used. Otherwise the + * data validation procedure below, may trigger a false error + * message. + */ + if (empty($_POST['pppoe-reset-type'])) { + unset($_POST['pppoe_resethour']); + unset($_POST['pppoe_resetminute']); + unset($_POST['pppoe_resetdate']); + unset($_POST['pppoe_pr_preset_val']); + } + + /* input validation */ + switch($_POST['type']) { + case "ppp": + $reqdfields = explode(" ", "interfaces phone"); + $reqdfieldsn = explode(",", "Link Interface(s),Phone Number"); + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + break; + case "pppoe": + if ($_POST['ondemand']) { + $reqdfields = explode(" ", "interfaces username password ondemand idletimeout"); + $reqdfieldsn = explode(",", "Link Interface(s),Username,Password,Dial on demand,Idle timeout value"); + } else { + $reqdfields = explode(" ", "interfaces username password"); + $reqdfieldsn = explode(",", "Link Interface(s),Username,Password"); + } + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + break; + case "l2tp": + case "pptp": + if ($_POST['ondemand']) { + $reqdfields = explode(" ", "interfaces username password localip subnet gateway ondemand idletimeout"); + $reqdfieldsn = explode(",", "Link Interface(s),Username,Password,Local IP address,Subnet,Remote IP address,Dial on demand,Idle timeout value"); + } else { + $reqdfields = explode(" ", "interfaces username password localip subnet gateway"); + $reqdfieldsn = explode(",", "Link Interface(s),Username,Password,Local IP address,Subnet,Remote IP address"); + } + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + break; + default: + $input_errors[] = "Please choose a Link Type."; + break; + } + if ($_POST['type'] == "ppp" && count($_POST['interfaces']) > 1) + $input_errors[] = "Multilink connections (MLPPP) using the PPP link type is not currently supported. Please select only one Link Interface."; + if (($_POST['provider'] && !is_domain($_POST['provider']))) + $input_errors[] = "The service name contains invalid characters."; + if (($_POST['idletimeout'] != "") && !is_numericint($_POST['idletimeout'])) + $input_errors[] = "The idle timeout value must be an integer."; + if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resethour'] <> "" && !is_numericint($_POST['pppoe_resethour']) && + $_POST['pppoe_resethour'] >= 0 && $_POST['pppoe_resethour'] <=23) + $input_errors[] = gettext("A valid PPPoE reset hour must be specified (0-23)."); + if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resetminute'] <> "" && !is_numericint($_POST['pppoe_resetminute']) && + $_POST['pppoe_resetminute'] >= 0 && $_POST['pppoe_resetminute'] <=59) + $input_errors[] = gettext("A valid PPPoE reset minute must be specified (0-59)."); + if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resetdate'] <> "" && !is_numeric(str_replace("/", "", $_POST['pppoe_resetdate']))) + $input_errors[] = gettext("A valid PPPoE reset date must be specified (mm/dd/yyyy)."); + if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resetdate'] <> "" && is_numeric(str_replace("/", "", $_POST['pppoe_resetdate']))){ + $date_nums = explode("/",$_POST['pppoe_resetdate']); + if ($date_nums[0] < 1 || $date_nums[0] > 12) + $input_errors[] = gettext("A valid PPPoE reset month must be specified (1-12) in the Custom PPPoE Periodic reset fields."); + if ($date_nums[1] < 1 || $date_nums[1] > 31) + $input_errors[] = gettext("A valid PPPoE reset day of month must be specified (1-31) in the Custom PPPoE Periodic reset fields. No checks are done on valid # of days per month"); + if ($date_nums[2] < date("Y")) + $input_errors[] = gettext("A valid PPPoE reset year must be specified. Don't select a year in the past!"); + } + + foreach($_POST['interfaces'] as $iface){ + if ($_POST['localip'][$iface] && !is_ipaddr($_POST['localip'][$iface])) + $input_errors[] = "A valid local IP address must be specified for {$iface}."; + if ($_POST['gateway'][$iface] && !is_ipaddr($_POST['gateway'][$iface]) && !is_hostname($_POST['gateway'][$iface])) + $input_errors[] = "A valid gateway IP address OR hostname must be specified for {$iface}."; + if ($_POST['bandwidth'][$iface] && !is_numericint($_POST['bandwidth'][$iface])) + $input_errors[] = "The bandwidth value for {$iface} must be an integer."; + if ($_POST['mtu'][$iface] && ($_POST['mtu'][$iface] < 576)) + $input_errors[] = "The MTU for {$iface} must be greater than 576 bytes."; + if ($_POST['mru'][$iface] && ($_POST['mru'][$iface] < 576)) + $input_errors[] = "The MRU for {$iface} must be greater than 576 bytes."; + } + +/* + foreach ($a_ppps as $ppp) { + if (isset($id) && ($a_ppps[$id]) && ($a_ppps[$id] === $ppp)) + continue; + + if ($ppp['serialport'] == $_POST['serialport']) { + $input_errors[] = "Serial port is in use"; + break; + } + } +*/ + + if (!$input_errors) { + $ppp = array(); + $ppp['ptpid'] = $_POST['ptpid']; + $ppp['type'] = $_POST['type']; + $ppp['if'] = $ppp['type'].$ppp['ptpid']; + $ppp['ports'] = implode(',',$_POST['interfaces']); + $ppp['username'] = $_POST['username']; + $ppp['password'] = base64_encode($_POST['password']); + $ppp['ondemand'] = $_POST['ondemand'] ? true : false; + if (!empty($_POST['idletimeout'])) + $ppp['idletimeout'] = $_POST['idletimeout']; + else + unset($ppp['idletimeout']); + $ppp['uptime'] = $_POST['uptime'] ? true : false; + if (!empty($_POST['descr'])) + $ppp['descr'] = $_POST['descr']; + else + unset($ppp['descr']); + + // Loop through fields associated with a individual link/port and make an array of the data + $port_fields = array("localip", "gateway", "subnet", "bandwidth", "mtu", "mru", "mrru"); + foreach($_POST['interfaces'] as $iface){ + foreach($port_fields as $field_label){ + if (isset($_POST[$field_label][$iface])) + $port_data[$field_label][] = $_POST[$field_label][$iface]; + } + } + + switch($_POST['type']) { + case "ppp": + if (!empty($_POST['initstr'])) + $ppp['initstr'] = base64_encode($_POST['initstr']); + else + unset($ppp['initstr']); + if (!empty($_POST['simpin'])) { + $ppp['simpin'] = $_POST['simpin']; + $ppp['pin-wait'] = $_POST['pin-wait']; + } else { + unset($ppp['simpin']); + unset($ppp['pin-wait']); + } + + if (!empty($_POST['apn'])){ + $ppp['apn'] = $_POST['apn']; + $ppp['apnum'] = $_POST['apnum']; + } else { + unset($ppp['apn']); + unset($ppp['apnum']); + } + $ppp['phone'] = $_POST['phone']; + $ppp['localip'] = implode(',',$port_data['localip']); + $ppp['gateway'] = implode(',',$port_data['gateway']); + if (!empty($_POST['connect-timeout'])) + $ppp['connect-timeout'] = $_POST['connect-timeout']; + else + unset($ppp['connect-timeout']); + break; + case "pppoe": + if (!empty($_POST['provider'])) + $ppp['provider'] = $_POST['provider']; + else + unset($ppp['provider']); + if (!empty($_POST['pppoe-reset-type'])) + $ppp['pppoe-reset-type'] = $_POST['pppoe-reset-type']; + else + unset($ppp['pppoe-reset-type']); + + break; + case "pptp": + case "l2tp": + $ppp['dhcp'] = $_POST['pptp_dhcp'] ? true : false; + foreach ($port_data['localip'] as $key => $value){ + if (empty($value)){ + $port_data['localip'][$key] = "dhcp"; + $port_data['subnet'][$key] = ""; + } + } + $ppp['localip'] = implode(',',$port_data['localip']); + $ppp['subnet'] = implode(',',$port_data['subnet']); + $ppp['gateway'] = implode(',',$port_data['gateway']); + break; + default: + break; + + } + + $ppp['shortseq'] = $_POST['shortseq'] ? true : false; + $ppp['acfcomp'] = $_POST['acfcomp'] ? true : false; + $ppp['protocomp'] = $_POST['protocomp'] ? true : false; + $ppp['vjcomp'] = $_POST['vjcomp'] ? true : false; + $ppp['tcpmssfix'] = $_POST['tcpmssfix'] ? true : false; + $ppp['bandwidth'] = implode(',', $port_data['bandwidth']); + $ppp['mtu'] = implode(',', $port_data['mtu']); + $ppp['mru'] = implode(',', $port_data['mru']); + + /* handle_pppoe_reset is called here because if user changes Link Type from PPPoE to another type we + must be able to clear the config data in the section of config.xml if it exists + */ + handle_pppoe_reset($_POST); + + $iflist = get_configured_interface_list(); + foreach ($iflist as $if) { + if ($config['interfaces'][$if]['if'] == $ppp['if']){ + $thisif = $if; + break; + } + } + if (isset($id) && $a_ppps[$id]) + $a_ppps[$id] = $ppp; + else + $a_ppps[] = $ppp; + + write_config(); + configure_cron(); + + if (isset($thisif)){ + interface_ppps_configure($thisif); + } + header("Location: interfaces_ppps.php"); + exit; + } +} // end if($_POST) + +$closehead = false; +$pgtitle = array("Interfaces","PPPs","Edit"); +include("head.inc"); + +$types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" => "PPTP", "l2tp" => "L2TP"/*, "tcp" => "TCP", "udp" => "UDP"*/ ); + +?> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
  +

+
  + + + + + + +
+
+ + + diff --git a/usr/local/www/interfaces_qinq.php b/usr/local/www/interfaces_qinq.php index 604d778ac2..f25a5dccee 100755 --- a/usr/local/www/interfaces_qinq.php +++ b/usr/local/www/interfaces_qinq.php @@ -98,9 +98,9 @@ include("head.inc"); $tab_array[2] = array("Wireless", false, "interfaces_wireless.php"); $tab_array[3] = array("VLANs", false, "interfaces_vlan.php"); $tab_array[4] = array("QinQs", true, "interfaces_qinq.php"); - $tab_array[5] = array("PPP", false, "interfaces_ppp.php"); - $tab_array[6] = array("GRE", false, "interfaces_gre.php"); - $tab_array[7] = array("GIF", false, "interfaces_gif.php"); + $tab_array[5] = array("PPPs", false, "interfaces_ppps.php"); + $tab_array[6] = array("GRE", false, "interfaces_gre.php"); + $tab_array[7] = array("GIF", false, "interfaces_gif.php"); $tab_array[8] = array("Bridges", false, "interfaces_bridge.php"); $tab_array[9] = array("LAGG", false, "interfaces_lagg.php"); display_top_tabs($tab_array); diff --git a/usr/local/www/interfaces_vlan.php b/usr/local/www/interfaces_vlan.php index 0adfa7d230..cd8975c038 100755 --- a/usr/local/www/interfaces_vlan.php +++ b/usr/local/www/interfaces_vlan.php @@ -92,9 +92,9 @@ include("head.inc"); $tab_array[2] = array("Wireless", false, "interfaces_wireless.php"); $tab_array[3] = array("VLANs", true, "interfaces_vlan.php"); $tab_array[4] = array("QinQs", false, "interfaces_qinq.php"); - $tab_array[5] = array("PPP", false, "interfaces_ppp.php"); - $tab_array[6] = array("GRE", false, "interfaces_gre.php"); - $tab_array[7] = array("GIF", false, "interfaces_gif.php"); + $tab_array[5] = array("PPPs", false, "interfaces_ppps.php"); + $tab_array[6] = array("GRE", false, "interfaces_gre.php"); + $tab_array[7] = array("GIF", false, "interfaces_gif.php"); $tab_array[8] = array("Bridges", false, "interfaces_bridge.php"); $tab_array[9] = array("LAGG", false, "interfaces_lagg.php"); display_top_tabs($tab_array); diff --git a/usr/local/www/interfaces_wireless.php b/usr/local/www/interfaces_wireless.php index f833fba581..42fd14954d 100644 --- a/usr/local/www/interfaces_wireless.php +++ b/usr/local/www/interfaces_wireless.php @@ -90,7 +90,7 @@ include("head.inc"); $tab_array[2] = array("Wireless", true, "interfaces_wireless.php"); $tab_array[3] = array("VLANs", false, "interfaces_vlan.php"); $tab_array[4] = array("QinQs", false, "interfaces_qinq.php"); - $tab_array[5] = array("PPP", false, "interfaces_ppp.php"); + $tab_array[5] = array("PPPs", false, "interfaces_ppps.php"); $tab_array[6] = array("GRE", false, "interfaces_gre.php"); $tab_array[7] = array("GIF", false, "interfaces_gif.php"); $tab_array[8] = array("Bridges", false, "interfaces_bridge.php"); diff --git a/usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js b/usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js new file mode 100644 index 0000000000..fe435fbac2 --- /dev/null +++ b/usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js @@ -0,0 +1,240 @@ + +function update_select_list(new_options, select_list){ + var option_array = new_options.split("|"); + var i = 0; + select_list.length = 0; + for(var j=0; j < option_array.length-1; j++){ + var option = option_array[j].split(","); + var selected = Boolean(parseInt(option[2])); + select_list[j] = new Option(option[0], option[1], false, selected); + //for testing and debugging + //select_list.options[option_array.length-1+j] = new Option(option[2].toString() +" "+ selected.toString()); + //select_list.options[option_array.length-1+j] = new Option("Link Label: " + linklabel + " Label Text:" + label_text); + } + show_hide_linkfields(select_list); +} + +function show_advanced(hide){ + var select_list = document.iform["interfaces[]"].options; + var adv_rows = parseInt($('adv_rows').innerHTML); + var adv_show = Boolean(parseInt($('adv_show').innerHTML)); + var status = Boolean(parseInt(hide)); + if (status){ + $('advanced_').hide(); + for(var j=0; j < adv_rows; j++){ + var advanced = "advanced_" + j.toString(); + $(advanced).show(); + } + $('adv_show').innerHTML = "1"; + show_hide_linkfields(select_list); + } else { + $('advanced_').show(); + for(var j=0; j < adv_rows; j++){ + var advanced = "advanced_" + j.toString(); + $(advanced).hide(); + } + $('adv_show').innerHTML = "0"; + show_hide_linkfields(select_list); + } +} + +function show_hide_linkfields(options){ + var i = 0; + var port_count = parseInt($('port_count').innerHTML); + var adv_show = Boolean(parseInt($('adv_show').innerHTML)); + for(var j=0; j < port_count; j++){ + var count = j.toString(); + var type = $('type').value; + var link = "link" + count; + var lnklabel = "linklabel" + count; + var bw = "bandwidth" + count; + var bwlabel = "bwlabel" + count; + var mtu = "mtu" + count; + var mru = "mru" + count; + var ipfields = "ip_fields" + count; + var gwfields = "gw_fields" + count; + var localip = "localip" + count; + var localiplabel = "localiplabel" + count; + var subnet = "subnet" + count; + var gateway = "gateway" + count; + var gatewaylabel = "gatewaylabel" + count; + + $(ipfields, gwfields ,link).invoke('hide'); + $(subnet).disabled = true; + + $(bw).name = "bandwidth[]"; + $(mtu).name = "mtu[]"; + $(mru).name = "mru[]"; + $(localip).name = "localip[]"; + $(subnet).name = "subnet[]"; + $(gateway).name = "gateway[]"; + + while(i < options.length){ + if (options[i].selected ){ + $(lnklabel).innerHTML = "Link Parameters (" + options[i].value + ")"; + $(bwlabel).innerHTML = "Bandwidth (" + options[i].value + ")"; + $(bw).name = "bandwidth[" + options[i].value + "]"; + $(mtu).name = "mtu[" + options[i].value + "]"; + $(mru).name = "mru[" + options[i].value + "]"; + $(localiplabel).innerHTML = "Local IP (" + options[i].value + ")"; + $(gatewaylabel).innerHTML = "Gateway (" + options[i].value + ")"; + $(localip).name = "localip[" + options[i].value + "]"; + $(subnet).name = "subnet[" + options[i].value + "]"; + $(gateway).name = "gateway[" + options[i].value + "]"; + if (type == 'ppp' && adv_show){ + $(ipfields, gwfields).invoke('show'); + } + if (type == 'pptp' || type == 'l2tp'){ + $(subnet).disabled = false; + $(ipfields, gwfields).invoke('show'); + } + if (adv_show){ + $(link).show(); + } + i++; + break; + } + i++; + } + } +} + + +function updateType(t){ + var serialports = $('serialports').innerHTML; + var ports = $('ports').innerHTML; + var select_list = document.iform["interfaces[]"].options; + $('adv_show').innerHTML = "0"; + show_advanced('0'); + switch(t) { + case "select": { + $('ppp','pppoe','ppp_provider','phone_num','apn_').invoke('hide'); + select_list.length = 0; + select_list[0] = new Option("Select Link Type First",""); + break; + } + case "ppp": { + update_select_list(serialports, select_list); + $('select','pppoe').invoke('hide'); + $('ppp_provider','phone_num','apn_').invoke('show'); + country_list(); + break; + } + case "pppoe": { + update_select_list(ports, select_list); + $('select','ppp','ppp_provider','phone_num','apn_').invoke('hide'); + break; + } + case "l2tp": + case "pptp": { + update_select_list(ports, select_list); + $('select','ppp','pppoe','ppp_provider','phone_num','apn_').invoke('hide'); + break; + } + default: + select_list.length = 0; + select_list[0] = new Option("Select Link Type First",""); + break; + } + if (t == "pppoe" || t == "ppp"){ + $(t).show(); + } +} + +function show_reset_settings(reset_type) { + if (reset_type == 'preset') { + Effect.Appear('pppoepresetwrap', { duration: 0.0 }); + Effect.Fade('pppoecustomwrap', { duration: 0.0 }); + } + else if (reset_type == 'custom') { + Effect.Appear('pppoecustomwrap', { duration: 0.0 }); + Effect.Fade('pppoepresetwrap', { duration: 0.0 }); + } else { + Effect.Fade('pppoecustomwrap', { duration: 0.0 }); + Effect.Fade('pppoepresetwrap', { duration: 0.0 }); + } +} + +function country_list() { + $('country').childElements().each(function(node) { node.remove(); }); + $('provider').childElements().each(function(node) { node.remove(); }); + $('providerplan').childElements().each(function(node) { node.remove(); }); + new Ajax.Request("getserviceproviders.php",{ + onSuccess: function(response) { + var responseTextArr = response.responseText.split("\n"); + responseTextArr.sort(); + responseTextArr.each( function(value) { + var option = new Element('option'); + country = value.split(":"); + option.text = country[0]; + option.value = country[1]; + $('country').insert({ bottom : option }); + }); + } + }); + $('trcountry').setStyle({display : "table-row"}); +} + +function providers_list() { + $('provider').childElements().each(function(node) { node.remove(); }); + $('providerplan').childElements().each(function(node) { node.remove(); }); + new Ajax.Request("getserviceproviders.php",{ + parameters: {country : $F('country')}, + onSuccess: function(response) { + var responseTextArr = response.responseText.split("\n"); + responseTextArr.sort(); + responseTextArr.each( function(value) { + var option = new Element('option'); + option.text = value; + option.value = value; + $('provider').insert({ bottom : option }); + }); + } + }); + $('trprovider').setStyle({display : "table-row"}); + $('trproviderplan').setStyle({display : "none"}); +} + +function providerplan_list() { + $('providerplan').childElements().each(function(node) { node.remove(); }); + $('providerplan').insert( new Element('option') ); + new Ajax.Request("getserviceproviders.php",{ + parameters: {country : $F('country'), provider : $F('provider')}, + onSuccess: function(response) { + var responseTextArr = response.responseText.split("\n"); + responseTextArr.sort(); + responseTextArr.each( function(value) { + if(value != "") { + providerplan = value.split(":"); + + var option = new Element('option'); + option.text = providerplan[0] + " - " + providerplan[1]; + option.value = providerplan[1]; + $('providerplan').insert({ bottom : option }); + } + }); + } + }); + $('trproviderplan').setStyle({display : "table-row"}); +} + +function prefill_provider() { + new Ajax.Request("getserviceproviders.php",{ + parameters: {country : $F('country'), provider : $F('provider'), plan : $F('providerplan')}, + onSuccess: function(response) { + var xmldoc = response.responseXML; + var provider = xmldoc.getElementsByTagName('connection')[0]; + $('username').setValue(''); + $('password').setValue(''); + if(provider.getElementsByTagName('apn')[0].firstChild.data == "CDMA") { + $('phone').setValue('*777'); + $('apn').setValue(''); + } else { + $('phone').setValue('*99#'); + $('apn').setValue(provider.getElementsByTagName('apn')[0].firstChild.data); + } + $('username').setValue(provider.getElementsByTagName('username')[0].firstChild.data); + $('password').setValue(provider.getElementsByTagName('password')[0].firstChild.data); + } + }); +} diff --git a/usr/local/www/status_gateway_groups.php b/usr/local/www/status_gateway_groups.php index 353f0252be..d4f0d857f5 100755 --- a/usr/local/www/status_gateway_groups.php +++ b/usr/local/www/status_gateway_groups.php @@ -116,29 +116,24 @@ include("head.inc"); echo ""; $c = 1; while($c <= $priority_count) { + $monitor = lookup_gateway_monitor_ip_by_name($member); if($p == $c) { - $monitor = lookup_gateway_monitor_ip_by_name($member); - switch($gateways_status[$monitor]['status']) { - case "None": - $online = "Online"; - $bgcolor = "lightgreen"; - break; - case "\"down\"": - $online = "Offline"; - $bgcolor = "lightcoral"; - break; - case "\"delay\"": - $online = "Latency"; - $bgcolor = "khaki"; - break; - case "\"loss\"": - $online = "Packetloss"; - $bgcolor = "khaki"; - break; - default: - $online = "Unknown"; - $bgcolor = "lightblue"; - break; + $status = $gateways_status[$monitor]['status']; + if (stristr($status, "down")) { + $online = "Offline"; + $bgcolor = "lightcoral"; + } elseif (stristr($status, "loss")) { + $online = "Warning, Packetloss"; + $bgcolor = "khaki"; + } elseif (stristr($status, "delay")) { + $online = "Warning, Latency"; + $bgcolor = "khaki"; + } elseif (stristr($status, "none")) { + $online = "Online"; + $bgcolor = "lightgreen"; + } else { + $online = "Unknown"; + $bgcolor = "lightblue"; } echo "". htmlspecialchars($member) .", $online"; } else { diff --git a/usr/local/www/status_gateways.php b/usr/local/www/status_gateways.php index fa9aa72f2a..125100b905 100755 --- a/usr/local/www/status_gateways.php +++ b/usr/local/www/status_gateways.php @@ -42,7 +42,6 @@ require("guiconfig.inc"); $a_gateways = return_gateways_array(); - $gateways_status = array(); $gateways_status = return_gateways_status(); @@ -76,51 +75,36 @@ include("head.inc"); Status Description - $gateway) { ?> - + - + "; + echo ""; ?>
$online "; - $lastchange = $gateways_status[$monitor]['lastcheck']; + echo "
$online "; + $lastchange = $gateway['lastcheck']; if(!empty($lastchange)) { $lastchange = explode(" ", $lastchange); array_shift($lastchange); @@ -130,13 +114,11 @@ include("head.inc"); } else { print "Gathering data"; } - PRINT "
- - - + diff --git a/usr/local/www/status_interfaces.php b/usr/local/www/status_interfaces.php index eaa968be70..11b74fd89d 100755 --- a/usr/local/www/status_interfaces.php +++ b/usr/local/www/status_interfaces.php @@ -76,9 +76,7 @@ include("head.inc"); - - interface - () + interface () diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index 69cc405f97..700ba41a80 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -193,8 +193,12 @@ if ($_POST) { if (!$input_errors) { $reloadif = false; + $save = false; + if ($_POST['weight'] > 1 || $_POST['latencylow'] || $_POST['latencyhigh'] || $_POST['losslow'] || $_POST['losshigh'] || $_POST['down'] || + $_POST['defaultgw']) + $save = true; /* if we are processing a system gateway only save the monitorip */ - if ($_POST['weight'] == 1 && (($_POST['attribute'] == "system" && empty($_POST['defaultgw'])) || (empty($_POST['interface']) && empty($_POST['gateway']) && empty($_POST['defaultgw'])))) { + if (!$save && empty($_POST['interface']) && empty($_POST['gateway'])) { if (is_ipaddr($_POST['monitor'])) { if (empty($_POST['interface'])) $interface = $pconfig['friendlyiface']; diff --git a/usr/local/www/vpn_pppoe.php b/usr/local/www/vpn_pppoe.php index d95302e768..931d15de64 100755 --- a/usr/local/www/vpn_pppoe.php +++ b/usr/local/www/vpn_pppoe.php @@ -214,7 +214,7 @@ function enable_change(enable_over) { document.iform.radius_nasip.disabled = 0; document.iform.radiusissueips.disabled = 0; document.iform.radius_nasip.disabled = 0; - document.iform.radius_acct_update = 0; + document.iform.radius_acct_update.disabled = 0; document.iform.radiussecenable.disabled = 0; if (document.iform.radiussecenable.checked || enable_over) { document.iform.radiusserver2.disabled = 0; @@ -236,7 +236,7 @@ function enable_change(enable_over) { document.iform.radiusserveracctport.disabled = 1; document.iform.radiusissueips.disabled = 1; document.iform.radius_nasip.disabled = 1; - document.iform.radius_acct_update = 1; + document.iform.radius_acct_update.disabled = 1; document.iform.radiussecenable.disabled = 1; } } else { @@ -260,7 +260,7 @@ function enable_change(enable_over) { document.iform.radiusserver2acctport.disabled = 1; document.iform.radiusissueips.disabled = 1; document.iform.radius_nasip.disabled = 1; - document.iform.radius_acct_update = 1; + document.iform.radius_acct_update.disabled = 1; } } //--> @@ -366,7 +366,7 @@ function enable_change(enable_over) { DNS servers - +

diff --git a/usr/local/www/widgets/widgets/gateways.widget.php b/usr/local/www/widgets/widgets/gateways.widget.php index 7d675701a4..b8bca28c5d 100644 --- a/usr/local/www/widgets/widgets/gateways.widget.php +++ b/usr/local/www/widgets/widgets/gateways.widget.php @@ -30,8 +30,6 @@ require_once("guiconfig.inc"); require_once("pfsense-utils.inc"); require_once("functions.inc"); -$a_gateways = return_gateways_array(); - $gateways_status = array(); $gateways_status = return_gateways_status(); @@ -46,57 +44,47 @@ $counter = 1; Loss Status - + $gateway) { ?> + $monitor = $target; + if(empty($monitor)) { + $monitor = $gateway['gateway']; + } + ?> - + - + - + \" > "; $counter++; ?> @@ -104,7 +92,6 @@ $counter = 1;
$online
diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php index e733834a90..8c2ae36d15 100755 --- a/usr/local/www/wizard.php +++ b/usr/local/www/wizard.php @@ -365,7 +365,10 @@ function showchange() { $arraynum = "[" . $field['arraynum'] . "]"; foreach ($field_split as $f) $field_conv .= "['" . $f . "']"; - $toeval = "if (isset(\$config" . $field_conv . $arraynum . ")) { \$value = \$config" . $field_conv . $arraynum . "; if (empty(\$value)) \$value = true; }"; + if($field['type'] == "checkbox") + $toeval = "if (isset(\$config" . $field_conv . $arraynum . ")) { \$value = \$config" . $field_conv . $arraynum . "; if (empty(\$value)) \$value = true; }"; + else + $toeval = "if (isset(\$config" . $field_conv . $arraynum . ")) \$value = \$config" . $field_conv . $arraynum . ";"; eval($toeval); }