summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local/www')
-rw-r--r--usr/local/www/diag_arp.php20
-rw-r--r--usr/local/www/diag_authentication.php85
-rw-r--r--usr/local/www/diag_backup.php4
-rw-r--r--usr/local/www/diag_confbak.php26
-rwxr-xr-xusr/local/www/diag_defaults.php2
-rw-r--r--usr/local/www/diag_dns.php229
-rwxr-xr-xusr/local/www/diag_dump_states.php59
-rw-r--r--usr/local/www/diag_dump_states_sources.php46
-rw-r--r--usr/local/www/diag_gmirror.php236
-rw-r--r--usr/local/www/diag_ipsec.php6
-rw-r--r--usr/local/www/diag_ipsec_leases.php2
-rw-r--r--usr/local/www/diag_ipsec_sad.php2
-rw-r--r--usr/local/www/diag_ipsec_spd.php2
-rw-r--r--usr/local/www/diag_ipsec_xml.php6
-rw-r--r--usr/local/www/diag_limiter_info.php26
-rw-r--r--usr/local/www/diag_ndp.php5
-rw-r--r--usr/local/www/diag_packet_capture.php125
-rw-r--r--usr/local/www/diag_pf_info.php12
-rw-r--r--usr/local/www/diag_ping.php191
-rwxr-xr-xusr/local/www/diag_pkglogs.php8
-rw-r--r--usr/local/www/diag_routes.php2
-rw-r--r--usr/local/www/diag_smart.php9
-rw-r--r--usr/local/www/diag_sockets.php2
-rw-r--r--usr/local/www/diag_states_summary.php2
-rw-r--r--usr/local/www/diag_system_activity.php2
-rw-r--r--usr/local/www/diag_system_pftop.php4
-rw-r--r--usr/local/www/diag_testport.php172
-rw-r--r--usr/local/www/diag_traceroute.php232
28 files changed, 796 insertions, 721 deletions
diff --git a/usr/local/www/diag_arp.php b/usr/local/www/diag_arp.php
index 00af12f..e5615f4 100644
--- a/usr/local/www/diag_arp.php
+++ b/usr/local/www/diag_arp.php
@@ -142,7 +142,7 @@ while ($i < $leases_count) {
$f = $f+3;
break;
case "binding":
- switch($data[$f+2]) {
+ switch ($data[$f+2]) {
case "active":
$leases[$l]['act'] = "active";
break;
@@ -180,7 +180,7 @@ while ($i < $leases_count) {
break;
case "client-hostname":
if ($data[$f+1] <> "") {
- $leases[$l]['hostname'] = preg_replace('/"/','',$data[$f+1]);
+ $leases[$l]['hostname'] = preg_replace('/"/', '', $data[$f+1]);
} else {
$hostname = gethostbyaddr($leases[$l]['ip']);
if ($hostname <> "") {
@@ -201,11 +201,11 @@ while ($i < $leases_count) {
/* remove duplicate items by mac address */
if (count($leases) > 0) {
- $leases = remove_duplicate($leases,"ip");
+ $leases = remove_duplicate($leases, "ip");
}
if (count($pools) > 0) {
- $pools = remove_duplicate($pools,"name");
+ $pools = remove_duplicate($pools, "name");
asort($pools);
}
@@ -218,7 +218,7 @@ foreach ($leases as $value) {
$dhcpip[$value['ip']] = $value['hostname'];
}
-exec("/usr/sbin/arp -an",$rawdata);
+exec("/usr/sbin/arp -an", $rawdata);
$i = 0;
@@ -234,18 +234,18 @@ foreach ($ifdescrs as $key => $interface) {
$data = array();
foreach ($rawdata as $line) {
- $elements = explode(' ',$line);
+ $elements = explode(' ', $line);
if ($elements[3] != "(incomplete)") {
$arpent = array();
- $arpent['ip'] = trim(str_replace(array('(',')'),'',$elements[1]));
+ $arpent['ip'] = trim(str_replace(array('(', ')'), '', $elements[1]));
$arpent['mac'] = trim($elements[3]);
$arpent['interface'] = trim($elements[5]);
$data[] = $arpent;
}
}
-function _getHostName($mac,$ip) {
+function _getHostName($mac, $ip) {
global $dhcpmac, $dhcpip;
if ($dhcpmac[$mac]) {
@@ -254,7 +254,7 @@ function _getHostName($mac,$ip) {
return $dhcpip[$ip];
} else {
exec("host -W 1 " . escapeshellarg($ip), $output);
- if (preg_match('/.*pointer ([A-Za-z_0-9.-]+)\..*/',$output[0],$matches)) {
+ if (preg_match('/.*pointer ([A-Za-z_0-9.-]+)\..*/', $output[0], $matches)) {
if ($matches[1] <> $ip) {
return $matches[1];
}
@@ -263,7 +263,7 @@ function _getHostName($mac,$ip) {
return "";
}
-$pgtitle = array(gettext("Diagnostics"),gettext("ARP Table"));
+$pgtitle = array(gettext("Diagnostics"), gettext("ARP Table"));
include("head.inc");
?>
diff --git a/usr/local/www/diag_authentication.php b/usr/local/www/diag_authentication.php
index 1c02828..de8a43b 100644
--- a/usr/local/www/diag_authentication.php
+++ b/usr/local/www/diag_authentication.php
@@ -69,7 +69,7 @@ if ($_POST) {
}
}
}
-$pgtitle = array(gettext("Diagnostics"),gettext("Authentication"));
+$pgtitle = array(gettext("Diagnostics"), gettext("Authentication"));
$shortcut_section = "authentication";
include("head.inc");
@@ -86,49 +86,50 @@ include("head.inc");
<td class="tabnavtbl"></td>
</tr>
<tr>
- <td>
- <div id="mainarea">
- <form id="iform" name="iform" action="diag_authentication.php" method="post">
- <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="6" summary="test">
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Authentication Server"); ?></td>
- <td width="78%" class="vtable">
- <select name="authmode" id="authmode" class="formselect" >
- <?php
- $auth_servers = auth_get_authserver_list();
- foreach ($auth_servers as $auth_server):
- $selected = "";
- if ($auth_server['name'] == $pconfig['authmode']) {
- $selected = "selected=\"selected\"";
- }
- ?>
- <option value="<?=$auth_server['name'];?>" <?=$selected;?>><?=$auth_server['name'];?></option>
- <?php endforeach; ?>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Username"); ?></td>
- <td width="78%" class="vtable">
- <input class="formfld unknown" size="20" id="username" name="username" value="<?=htmlspecialchars($pconfig['username']);?>" />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Password"); ?></td>
- <td width="78%" class="vtable">
- <input class="formfld pwd" type="password" size="20" id="passwordfld" name="passwordfld" value="<?=htmlspecialchars($pconfig['passwordfld']);?>" />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="save" name="save" type="submit" class="formbtn" value="<?=gettext("Test");?>" />
+ <td>
+ <div id="mainarea">
+ <form id="iform" name="iform" action="diag_authentication.php" method="post">
+ <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="6" summary="test">
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Authentication Server"); ?></td>
+ <td width="78%" class="vtable">
+ <select name="authmode" id="authmode" class="formselect" >
+ <?php
+ $auth_servers = auth_get_authserver_list();
+ foreach ($auth_servers as $auth_server):
+ $selected = "";
+ if ($auth_server['name'] == $pconfig['authmode']) {
+ $selected = "selected=\"selected\"";
+ }
+ ?>
+ <option value="<?=$auth_server['name'];?>" <?=$selected;?>><?=$auth_server['name'];?></option>
+ <?php endforeach; ?>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Username"); ?></td>
+ <td width="78%" class="vtable">
+ <input class="formfld unknown" size="20" id="username" name="username" value="<?=htmlspecialchars($pconfig['username']);?>" />
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Password"); ?></td>
+ <td width="78%" class="vtable">
+ <input class="formfld pwd" type="password" size="20" id="passwordfld" name="passwordfld" value="<?=htmlspecialchars($pconfig['passwordfld']);?>" />
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input id="save" name="save" type="submit" class="formbtn" value="<?=gettext("Test");?>" />
+ </td>
+ </tr>
+ </table>
+ </form>
+ </div>
</td>
</tr>
- </table>
- </form>
- </div>
- </td></tr>
</table>
<?php include("fend.inc"); ?>
diff --git a/usr/local/www/diag_backup.php b/usr/local/www/diag_backup.php
index 6c25f02..bede178 100644
--- a/usr/local/www/diag_backup.php
+++ b/usr/local/www/diag_backup.php
@@ -167,7 +167,7 @@ function add_base_packages_menu_items() {
}
function remove_bad_chars($string) {
- return preg_replace('/[^a-z_0-9]/i','',$string);
+ return preg_replace('/[^a-z_0-9]/i', '', $string);
}
function check_and_returnif_section_exists($section) {
@@ -603,7 +603,7 @@ $id = rand() . '.' . time();
$mth = ini_get('upload_progress_meter.store_method');
$dir = ini_get('upload_progress_meter.file.filename_template');
-$pgtitle = array(gettext("Diagnostics"),gettext("Backup/restore"));
+$pgtitle = array(gettext("Diagnostics"), gettext("Backup/restore"));
include("head.inc");
?>
diff --git a/usr/local/www/diag_confbak.php b/usr/local/www/diag_confbak.php
index babdbfe..cc1da99 100644
--- a/usr/local/www/diag_confbak.php
+++ b/usr/local/www/diag_confbak.php
@@ -109,7 +109,7 @@ cleanup_backupcache(false);
$confvers = get_backups();
unset($confvers['versions']);
-$pgtitle = array(gettext("Diagnostics"),gettext("Configuration History"));
+$pgtitle = array(gettext("Diagnostics"), gettext("Configuration History"));
include("head.inc");
?>
@@ -123,7 +123,9 @@ include("head.inc");
?>
<?php if ($diff) { ?>
<table align="center" width="100%" border="0" cellspacing="0" style="padding-top: 4px; padding-bottom: 4px; vertical-align:middle;" summary="diag confbak">
- <tr><td><?=gettext("Configuration diff from");?> <?php echo date(gettext("n/j/y H:i:s"), $oldtime); ?> <?=gettext("to");?> <?php echo date(gettext("n/j/y H:i:s"), $newtime); ?></td></tr>
+ <tr>
+ <td><?=gettext("Configuration diff from");?> <?php echo date(gettext("n/j/y H:i:s"), $oldtime); ?> <?=gettext("to");?> <?php echo date(gettext("n/j/y H:i:s"), $newtime); ?></td>
+ </tr>
<?php foreach ($diff as $line) {
switch (substr($line, 0, 1)) {
case "+":
@@ -194,17 +196,17 @@ include("head.inc");
<td width="10%">&nbsp;</td>
<td width="15%" valign="top"><?=gettext("Backup Count");?></td>
<td width="10%">
- <input name="backupcount" type="text" class="formfld unknown" size="5" value="<?=htmlspecialchars($config['system']['backupcount']);?>"/>
+ <input name="backupcount" type="text" class="formfld unknown" size="5" value="<?=htmlspecialchars($config['system']['backupcount']);?>"/>
</td>
<td width="60%">
- <?= gettext("Enter the number of older configurations to keep in the local backup cache. By default this is 30 for a full install or 5 on NanoBSD."); ?>
+ <?= gettext("Enter the number of older configurations to keep in the local backup cache. By default this is 30 for a full install or 5 on NanoBSD."); ?>
</td>
<td width= "5%"><input name="save" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" /></td>
</tr>
<tr>
<td class="vncell">&nbsp;</td>
<td colspan="4" class="vncell">
- <?= gettext("NOTE: Be aware of how much space is consumed by backups before adjusting this value. Current space used by backups: "); ?> <?= exec("/usr/bin/du -sh /conf/backup | /usr/bin/awk '{print $1;}'") ?>
+ <?= gettext("NOTE: Be aware of how much space is consumed by backups before adjusting this value. Current space used by backups: "); ?> <?= exec("/usr/bin/du -sh /conf/backup | /usr/bin/awk '{print $1;}'") ?>
</td>
</tr>
</table>
@@ -214,8 +216,8 @@ include("head.inc");
<?php if (is_array($confvers)): ?>
<tr>
<td colspan="7" class="list">
- <?= gettext("To view the differences between an older configuration and a newer configuration, select the older configuration using the left column of radio options and select the newer configuration in the right column, then press the Diff button."); ?>
- <br /><br />
+ <?= gettext("To view the differences between an older configuration and a newer configuration, select the older configuration using the left column of radio options and select the newer configuration in the right column, then press the Diff button."); ?>
+ <br /><br />
</td>
</tr>
<tr>
@@ -263,14 +265,14 @@ include("head.inc");
<td class="listr"> <?= format_bytes($version['filesize']) ?></td>
<td class="listr"> <?= htmlspecialchars($version['description']) ?></td>
<td valign="middle" class="list nowrap">
- <a href="diag_confbak.php?newver=<?=$version['time'];?>">
- <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="<?=gettext("Revert to this configuration");?>" title="<?=gettext("Revert to this configuration");?>" />
+ <a href="diag_confbak.php?newver=<?=$version['time'];?>">
+ <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="<?=gettext("Revert to this configuration");?>" title="<?=gettext("Revert to this configuration");?>" />
</a>
- <a href="diag_confbak.php?rmver=<?=$version['time'];?>">
- <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="<?=gettext("Remove this backup");?>" title="<?=gettext("Remove this backup");?>" />
+ <a href="diag_confbak.php?rmver=<?=$version['time'];?>">
+ <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="<?=gettext("Remove this backup");?>" title="<?=gettext("Remove this backup");?>" />
</a>
<a href="diag_confbak.php?getcfg=<?=$version['time'];?>">
- <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_down.gif" width="17" height="17" border="0" alt="<?=gettext("Download this backup");?>" title="<?=gettext("Download this backup");?>" />
+ <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_down.gif" width="17" height="17" border="0" alt="<?=gettext("Download this backup");?>" title="<?=gettext("Download this backup");?>" />
</a>
</td>
</tr>
diff --git a/usr/local/www/diag_defaults.php b/usr/local/www/diag_defaults.php
index 15ab264..7c17511 100755
--- a/usr/local/www/diag_defaults.php
+++ b/usr/local/www/diag_defaults.php
@@ -50,7 +50,7 @@ if ($_POST['Submit'] == " " . gettext("No") . " ") {
exit;
}
-$pgtitle = array(gettext("Diagnostics"),gettext("Factory defaults"));
+$pgtitle = array(gettext("Diagnostics"), gettext("Factory defaults"));
include("head.inc");
?>
diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php
index 5ee7927..c234bea 100644
--- a/usr/local/www/diag_dns.php
+++ b/usr/local/www/diag_dns.php
@@ -32,7 +32,7 @@
pfSense_MODULE: dns
*/
-$pgtitle = array(gettext("Diagnostics"),gettext("DNS Lookup"));
+$pgtitle = array(gettext("Diagnostics"), gettext("DNS Lookup"));
require("guiconfig.inc");
$host = trim($_REQUEST['host'], " \t\n\r\0\x0B[];\"'");
@@ -45,7 +45,7 @@ if (!is_array($config['aliases']['alias'])) {
}
$a_aliases = &$config['aliases']['alias'];
-$aliasname = str_replace(array(".","-"), "_", $host);
+$aliasname = str_replace(array(".", "-"), "_", $host);
$alias_exists = false;
$counter=0;
foreach ($a_aliases as $a) {
@@ -155,11 +155,11 @@ if ($_POST) {
}
if (($_POST['host']) && ($_POST['dialog_output'])) {
- display_host_results ($host,$resolved,$dns_speeds);
+ display_host_results ($host, $resolved, $dns_speeds);
exit;
}
-function display_host_results ($address,$hostname,$dns_speeds) {
+function display_host_results ($address, $hostname, $dns_speeds) {
$map_lengths = function($element) { return strlen($element[0]); };
echo gettext("IP Address") . ": {$address} \n";
@@ -182,114 +182,139 @@ include("head.inc"); ?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="diag dns">
- <tr>
- <td>
+ <tr>
+ <td>
<?php if ($input_errors) print_input_errors($input_errors); ?>
- <form action="diag_dns.php" method="post" name="iform" id="iform">
- <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="tabcont">
- <tr>
- <td colspan="2" valign="top" class="listtopic"> <?=gettext("Resolve DNS hostname or IP");?></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Hostname or IP");?></td>
- <td width="78%" class="vtable">
- <?=$mandfldhtml;?>
- <table summary="results">
- <tr><td valign="top">
- <input name="host" type="text" class="formfld unknown" id="host" size="20" value="<?=htmlspecialchars($host);?>" />
- </td>
- <?php if ($resolved && $type) { ?>
- <td valign="middle">&nbsp;=&nbsp;</td><td>
- <font size="+1">
+ <form action="diag_dns.php" method="post" name="iform" id="iform">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="tabcont">
+ <tr>
+ <td colspan="2" valign="top" class="listtopic"> <?=gettext("Resolve DNS hostname or IP");?></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Hostname or IP");?></td>
+ <td width="78%" class="vtable">
+ <?=$mandfldhtml;?>
+ <table summary="results">
+ <tr>
+ <td valign="top">
+ <input name="host" type="text" class="formfld unknown" id="host" size="20" value="<?=htmlspecialchars($host);?>" />
+ </td>
<?php
- $found = 0;
- if (is_array($resolved)) {
- foreach ($resolved as $hostitem) {
- if ($hostitem <> "") {
- echo $hostitem . "<br />";
- $found++;
- }
- }
- } else {
- echo $resolved;
+ if ($resolved && $type) {
+?>
+ <td valign="middle">&nbsp;=&nbsp;</td>
+ <td>
+ <font size="+1">
+<?php
+ $found = 0;
+ if (is_array($resolved)) {
+ foreach ($resolved as $hostitem) {
+ if ($hostitem <> "") {
+ echo $hostitem . "<br />";
+ $found++;
}
- if ($found > 0) { ?>
- <br/></font><font size='-2'>
- <?php if ($alias_exists) { ?>
- An alias already exists for the hostname <?= htmlspecialchars($host) ?>. <br />
- <input type="hidden" name="override" value="true"/>
- <input type="submit" name="create_alias" value="Overwrite Alias"/>
- <?php } else {
- if (!$createdalias) { ?>
- <input type="submit" name="create_alias" value="Create Alias from These Entries"/>
- <?php } else { ?>
- Alias created with name <?= htmlspecialchars($newalias['name']) ?>
- <?php }
- }
+ }
+ } else {
+ echo $resolved;
+ }
+ if ($found > 0) {
+?>
+ <br/>
+ </font>
+ <font size='-2'>
+<?php
+ if ($alias_exists) {
+?>
+ An alias already exists for the hostname <?= htmlspecialchars($host) ?>. <br />
+ <input type="hidden" name="override" value="true"/>
+ <input type="submit" name="create_alias" value="Overwrite Alias"/>
+<?php
+ } else {
+ if (!$createdalias) {
+?>
+ <input type="submit" name="create_alias" value="Create Alias from These Entries"/>
+<?php
+ } else {
+?>
+ Alias created with name <?= htmlspecialchars($newalias['name']) ?>
+<?php
}
+ }
+ }
+ }
?>
-
- <?php } ?>
- </font></td></tr></table>
- </td>
- </tr>
-<?php if ($_POST): ?>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Resolution time per server");?></td>
- <td width="78%" class="vtable">
- <table width="170" border="0" cellpadding="6" cellspacing="0" summary="resolution time">
- <tr>
- <td class="listhdrr">
- <?=gettext("Server");?>
- </td>
- <td class="listhdrr">
- <?=gettext("Query time");?>
- </td>
- </tr>
+ </font>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+<?php
+ if ($_POST):
+?>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Resolution time per server");?></td>
+ <td width="78%" class="vtable">
+ <table width="170" border="0" cellpadding="6" cellspacing="0" summary="resolution time">
+ <tr>
+ <td class="listhdrr">
+ <?=gettext("Server");?>
+ </td>
+ <td class="listhdrr">
+ <?=gettext("Query time");?>
+ </td>
+ </tr>
<?php
- if (is_array($dns_speeds)) {
- foreach ($dns_speeds as $qt):
+ if (is_array($dns_speeds)) {
+ foreach ($dns_speeds as $qt):
?>
- <tr>
- <td class="listlr">
- <?=$qt['dns_server']?>
- </td>
- <td class="listr">
- <?=$qt['query_time']?>
- </td>
- </tr>
+ <tr>
+ <td class="listlr">
+ <?=$qt['dns_server']?>
+ </td>
+ <td class="listr">
+ <?=$qt['query_time']?>
+ </td>
+ </tr>
<?php
- endforeach;
- }
+ endforeach;
+ }
+?>
+ </table>
+ </td>
+ </tr>
+<?php
+ endif;
+
+ if (!$input_errors && $ipaddr) {
+?>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("More Information:");?></td>
+ <td width="78%" class="vtable">
+ <a href ="/diag_ping.php?host=<?=htmlspecialchars($host)?>&amp;interface=wan&amp;count=3"><?=gettext("Ping");?></a> <br />
+ <a href ="/diag_traceroute.php?host=<?=htmlspecialchars($host)?>&amp;ttl=18"><?=gettext("Traceroute");?></a>
+ <p>
+ <?=gettext("NOTE: The following links are to external services, so their reliability cannot be guaranteed.");?><br /><br />
+ <a target="_blank" href="http://private.dnsstuff.com/tools/whois.ch?ip=<?php echo $ipaddr; ?>"><?=gettext("IP WHOIS @ DNS Stuff");?></a><br />
+ <a target="_blank" href="http://private.dnsstuff.com/tools/ipall.ch?ip=<?php echo $ipaddr; ?>"><?=gettext("IP Info @ DNS Stuff");?></a>
+ </p>
+ </td>
+ </tr>
+<?php
+ }
?>
- </table>
- </td>
- </tr>
- <?php endif; ?>
- <?php if (!$input_errors && $ipaddr) { ?>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("More Information:");?></td>
- <td width="78%" class="vtable">
- <a href ="/diag_ping.php?host=<?=htmlspecialchars($host)?>&amp;interface=wan&amp;count=3"><?=gettext("Ping");?></a> <br />
- <a href ="/diag_traceroute.php?host=<?=htmlspecialchars($host)?>&amp;ttl=18"><?=gettext("Traceroute");?></a>
- <p>
- <?=gettext("NOTE: The following links are to external services, so their reliability cannot be guaranteed.");?><br /><br />
- <a target="_blank" href="http://private.dnsstuff.com/tools/whois.ch?ip=<?php echo $ipaddr; ?>"><?=gettext("IP WHOIS @ DNS Stuff");?></a><br />
- <a target="_blank" href="http://private.dnsstuff.com/tools/ipall.ch?ip=<?php echo $ipaddr; ?>"><?=gettext("IP Info @ DNS Stuff");?></a>
- </p>
- </td>
- </tr>
- <?php } ?>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <br />&nbsp;
- <input name="Submit" type="submit" class="formbtn" value="<?=gettext("DNS Lookup");?>" />
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <br />&nbsp;
+ <input name="Submit" type="submit" class="formbtn" value="<?=gettext("DNS Lookup");?>" />
+ </td>
+ </tr>
+ </table>
+ </form>
</td>
- </tr>
- </table>
-</form>
-</td></tr></table>
+ </tr>
+</table>
<?php include("fend.inc"); ?>
</body>
</html>
diff --git a/usr/local/www/diag_dump_states.php b/usr/local/www/diag_dump_states.php
index 1cc844a..1a2f435 100755
--- a/usr/local/www/diag_dump_states.php
+++ b/usr/local/www/diag_dump_states.php
@@ -69,7 +69,7 @@ if (isset($_POST['filter']) && isset($_POST['killfilter'])) {
}
}
-$pgtitle = array(gettext("Diagnostics"),gettext("Show States"));
+$pgtitle = array(gettext("Diagnostics"), gettext("Show States"));
include("head.inc");
?>
@@ -80,10 +80,10 @@ include("head.inc");
<script type="text/javascript">
//<![CDATA[
function removeState(srcip, dstip) {
- var busy = function(index,icon) {
- jQuery(icon).bind("onclick","");
- jQuery(icon).attr('src',jQuery(icon).attr('src').replace("\.gif", "_d.gif"));
- jQuery(icon).css("cursor","wait");
+ var busy = function(index, icon) {
+ jQuery(icon).bind("onclick", "");
+ jQuery(icon).attr('src', jQuery(icon).attr('src').replace("\.gif", "_d.gif"));
+ jQuery(icon).css("cursor", "wait");
}
jQuery('img[name="i:' + srcip + ":" + dstip + '"]').each(busy);
@@ -110,7 +110,7 @@ include("head.inc");
}
jQuery('tr[id="r:' + values[1] + ":" + values[2] + '"]').each(
- function(index,row) { jQuery(row).fadeOut(1000); }
+ function(index, row) { jQuery(row).fadeOut(1000); }
);
}
//]]>
@@ -179,7 +179,7 @@ include("head.inc");
$row = 0;
/* get our states */
$grepline = (isset($_POST['filter'])) ? "| /usr/bin/egrep " . escapeshellarg(htmlspecialchars($_POST['filter'])) : "";
-$fd = popen("/sbin/pfctl -s state {$grepline}", "r" );
+$fd = popen("/sbin/pfctl -s state {$grepline}", "r");
while ($line = chop(fgets($fd))) {
if ($row >= 10000) {
break;
@@ -203,34 +203,35 @@ while ($line = chop(fgets($fd))) {
$dstip = trim($parts[0]);
?>
- <tr valign="top" id="r:<?= $srcip ?>:<?= $dstip ?>">
- <td class="listlr"><?= $iface ?></td>
- <td class="listr"><?= $proto ?></td>
- <td class="listr"><?= $info ?></td>
- <td class="listr"><?= $state ?></td>
- <td class="list">
- <img src="/themes/<?= $g['theme'] ?>/images/icons/icon_x.gif" height="17" width="17" border="0"
- onclick="removeState('<?= $srcip ?>', '<?= $dstip ?>');" style="cursor:pointer;"
- name="i:<?= $srcip ?>:<?= $dstip ?>"
- title="<?= gettext('Remove all state entries from') ?> <?= $srcip ?> <?= gettext('to') ?> <?= $dstip ?>" alt="" />
- </td>
- </tr>
+ <tr valign="top" id="r:<?= $srcip ?>:<?= $dstip ?>">
+ <td class="listlr"><?= $iface ?></td>
+ <td class="listr"><?= $proto ?></td>
+ <td class="listr"><?= $info ?></td>
+ <td class="listr"><?= $state ?></td>
+ <td class="list">
+ <img src="/themes/<?= $g['theme'] ?>/images/icons/icon_x.gif" height="17" width="17" border="0"
+ onclick="removeState('<?= $srcip ?>', '<?= $dstip ?>');" style="cursor:pointer;"
+ name="i:<?= $srcip ?>:<?= $dstip ?>"
+ title="<?= gettext('Remove all state entries from') ?> <?= $srcip ?> <?= gettext('to') ?> <?= $dstip ?>" alt="" />
+ </td>
+ </tr>
<?php
$row++;
ob_flush();
}
-if ($row == 0): ?>
- <tr>
- <td class="list" colspan="4" align="center" valign="top">
- <?= gettext("No states were found.") ?>
- </td>
- </tr>
+if ($row == 0):
+?>
+ <tr>
+ <td class="list" colspan="4" align="center" valign="top">
+ <?= gettext("No states were found.") ?>
+ </td>
+ </tr>
<?php
endif;
pclose($fd);
?>
- </tbody>
+ </tbody>
</table>
</td>
</tr>
@@ -245,9 +246,9 @@ pclose($fd);
<!-- End of tab content -->
- </div>
- </td>
- </tr>
+ </div>
+ </td>
+ </tr>
</table>
<?php require("fend.inc"); ?>
diff --git a/usr/local/www/diag_dump_states_sources.php b/usr/local/www/diag_dump_states_sources.php
index e46a316..4cb14c2 100644
--- a/usr/local/www/diag_dump_states_sources.php
+++ b/usr/local/www/diag_dump_states_sources.php
@@ -62,7 +62,7 @@ if ($_GET['filter']) {
exec("/sbin/pfctl -s Sources", $sources);
}
-$pgtitle = array(gettext("Diagnostics"),gettext("Show Source Tracking"));
+$pgtitle = array(gettext("Diagnostics"), gettext("Show Source Tracking"));
include("head.inc");
?>
@@ -74,10 +74,10 @@ include("head.inc");
<script type="text/javascript">
//<![CDATA[
function removeSource(srcip, dstip) {
- var busy = function(index,icon) {
- jQuery(icon).bind("onclick","");
- jQuery(icon).attr('src',jQuery(icon).attr('src').replace("\.gif", "_d.gif"));
- jQuery(icon).css("cursor","wait");
+ var busy = function(index, icon) {
+ jQuery(icon).bind("onclick", "");
+ jQuery(icon).attr('src', jQuery(icon).attr('src').replace("\.gif", "_d.gif"));
+ jQuery(icon).css("cursor", "wait");
}
jQuery('img[name="i:' + srcip + ":" + dstip + '"]').each(busy);
@@ -97,7 +97,7 @@ include("head.inc");
}
jQuery('tr[name="r:' + values[1] + ":" + values[2] + '"]').each(
- function(index,row) { jQuery(row).fadeOut(1000); }
+ function(index, row) { jQuery(row).fadeOut(1000); }
);
}
//]]>
@@ -170,19 +170,19 @@ if (count($sources) > 0) {
list($all, $srcip, $dstip) = $source_split;
?>
- <tr valign='top' name='r:<?php echo "{$srcip}:{$dstip}" ?>'>
- <td class='listlr'><?php echo $info;?></td>
- <td class='listr'><?php echo $numstates;?></td>
- <td class='listr'><?php echo $numconnections;?></td>
- <td class='listr'><?php echo $rate;?></td>
- <td class='list'>
- <img src='/themes/<?php echo $g['theme']; ?>/images/icons/icon_x.gif' height='17' width='17' border='0'
- onclick="removeSource(<?php echo "'{$srcip}', '{$dstip}'"; ?>);" style='cursor:pointer;'
- name='i:<?php echo "{$srcip}:{$dstip}"; ?>'
- title='<?php echo gettext("Remove all source tracking entries from") . " {$srcip} " . gettext("to") . " {$dstip}";?>' alt='' />
- </td>
- </tr>
- <?php
+ <tr valign='top' name='r:<?php echo "{$srcip}:{$dstip}" ?>'>
+ <td class='listlr'><?php echo $info;?></td>
+ <td class='listr'><?php echo $numstates;?></td>
+ <td class='listr'><?php echo $numconnections;?></td>
+ <td class='listr'><?php echo $rate;?></td>
+ <td class='list'>
+ <img src='/themes/<?php echo $g['theme']; ?>/images/icons/icon_x.gif' height='17' width='17' border='0'
+ onclick="removeSource(<?php echo "'{$srcip}', '{$dstip}'"; ?>);" style='cursor:pointer;'
+ name='i:<?php echo "{$srcip}:{$dstip}"; ?>'
+ title='<?php echo gettext("Remove all source tracking entries from") . " {$srcip} " . gettext("to") . " {$dstip}";?>' alt='' />
+ </td>
+ </tr>
+<?php
$row++;
}
} else {
@@ -193,7 +193,7 @@ if (count($sources) > 0) {
</tr>";
}
?>
- </tbody>
+ </tbody>
</table>
</td>
</tr>
@@ -201,9 +201,9 @@ if (count($sources) > 0) {
<!-- End of tab content -->
- </div>
- </td>
- </tr>
+ </div>
+ </td>
+ </tr>
</table>
<?php require("fend.inc"); ?>
diff --git a/usr/local/www/diag_gmirror.php b/usr/local/www/diag_gmirror.php
index f1ceef2..f0f5bff 100644
--- a/usr/local/www/diag_gmirror.php
+++ b/usr/local/www/diag_gmirror.php
@@ -125,7 +125,7 @@ if ($_POST) {
break;
}
-$result = 0;
+ $result = 0;
if (empty($input_errors)) {
switch ($_POST['action']) {
case "forget":
@@ -194,7 +194,9 @@ if ($_GET["error"] && ($_GET["error"] != 0)) {
<p/>
<table width="100%" border="0" cellpadding="6" cellspacing="0">
-<?php if ($_GET["action"]): ?>
+<?php
+ if ($_GET["action"]):
+?>
<tr>
<td colspan="2" valign="top" class="listtopic"><?php echo gettext("Confirm Action"); ?></td>
</tr>
@@ -217,7 +219,9 @@ if ($_GET["error"] && ($_GET["error"] != 0)) {
<br /><input type="submit" name="confirm" value="<?php echo gettext("Confirm"); ?>" />
</td>
</tr>
-<?php else: ?>
+<?php
+ else:
+?>
<tr>
<td colspan="2" valign="top" class="listtopic"><?php echo gettext("GEOM Mirror information"); ?></td>
</tr>
@@ -225,63 +229,86 @@ if ($_GET["error"] && ($_GET["error"] != 0)) {
<tr>
<td width="22%" valign="top" class="vncell"><?php echo gettext("Mirror Status"); ?></td>
<td width="78%" class="vtable">
-
- <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="gmirror status">
- <tbody id="gmirror_status_table">
- <?php if (count($mirror_status) > 0): ?>
- <tr>
- <td width="30%" class="vncellt"><?php echo gettext("Name"); ?></td>
- <td width="30%" class="vncellt"><?php echo gettext("Status"); ?></td>
- <td width="40%" class="vncellt"><?php echo gettext("Component"); ?></td>
- </tr>
- <?php foreach ($mirror_status as $mirror => $name):
- $components = count($name["components"]); ?>
+ <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="gmirror status">
+ <tbody id="gmirror_status_table">
+<?php
+ if (count($mirror_status) > 0):
+?>
<tr>
- <td width="30%" rowspan="<?php echo $components; ?>" class="listr">
- <?php echo htmlspecialchars($name['name']); ?>
- <br />Size: <?php echo gmirror_get_mirror_size($name['name']); ?>
- </td>
- <td width="30%" rowspan="<?php echo $components; ?>" class="listr">
- <?php echo htmlspecialchars($name['status']); ?>
- <?php if (strtoupper($name['status']) == "DEGRADED"): ?>
- <br /><a href="diag_gmirror.php?action=forget&amp;mirror=<?php echo htmlspecialchars($name['name']); ?>">[<?php echo gettext("Forget Disconnected Disks"); ?>]</a>
- <?php endif; ?>
- </td>
- <td width="40%" class="listr">
- <?php echo $name['components'][0]; ?>
- <?php list($cname, $cstatus) = explode(" ", $name['components'][0], 2); ?>
- <br />
- <?php if ((strtoupper($name['status']) == "COMPLETE") && (count($name["components"]) > 1)): ?>
- <a href="diag_gmirror.php?action=rebuild&amp;consumer=<?php echo htmlspecialchars($cname); ?>&amp;mirror=<?php echo htmlspecialchars($name['name']); ?>">[<?php echo gettext("Rebuild"); ?>]</a>
- <a href="diag_gmirror.php?action=deactivate&amp;consumer=<?php echo htmlspecialchars($cname); ?>&amp;mirror=<?php echo htmlspecialchars($name['name']); ?>">[<?php echo gettext("Deactivate"); ?>]</a>
- <a href="diag_gmirror.php?action=remove&amp;consumer=<?php echo htmlspecialchars($cname); ?>&amp;mirror=<?php echo htmlspecialchars($name['name']); ?>">[<?php echo gettext("Remove"); ?>]</a>
- <?php endif; ?>
- </td>
+ <td width="30%" class="vncellt"><?php echo gettext("Name"); ?></td>
+ <td width="30%" class="vncellt"><?php echo gettext("Status"); ?></td>
+ <td width="40%" class="vncellt"><?php echo gettext("Component"); ?></td>
+ </tr>
+<?php
+ foreach ($mirror_status as $mirror => $name):
+ $components = count($name["components"]);
+?>
+ <tr>
+ <td width="30%" rowspan="<?php echo $components; ?>" class="listr">
+ <?php echo htmlspecialchars($name['name']); ?>
+ <br />Size: <?php echo gmirror_get_mirror_size($name['name']); ?>
+ </td>
+ <td width="30%" rowspan="<?php echo $components; ?>" class="listr">
+ <?php echo htmlspecialchars($name['status']); ?>
+<?php
+ if (strtoupper($name['status']) == "DEGRADED"):
+?>
+ <br /><a href="diag_gmirror.php?action=forget&amp;mirror=<?php echo htmlspecialchars($name['name']); ?>">[<?php echo gettext("Forget Disconnected Disks"); ?>]</a>
+<?php
+ endif;
+?>
+ </td>
+ <td width="40%" class="listr">
+ <?php echo $name['components'][0]; ?>
+ <?php list($cname, $cstatus) = explode(" ", $name['components'][0], 2); ?>
+ <br />
+<?php
+ if ((strtoupper($name['status']) == "COMPLETE") && (count($name["components"]) > 1)):
+?>
+ <a href="diag_gmirror.php?action=rebuild&amp;consumer=<?php echo htmlspecialchars($cname); ?>&amp;mirror=<?php echo htmlspecialchars($name['name']); ?>">[<?php echo gettext("Rebuild"); ?>]</a>
+ <a href="diag_gmirror.php?action=deactivate&amp;consumer=<?php echo htmlspecialchars($cname); ?>&amp;mirror=<?php echo htmlspecialchars($name['name']); ?>">[<?php echo gettext("Deactivate"); ?>]</a>
+ <a href="diag_gmirror.php?action=remove&amp;consumer=<?php echo htmlspecialchars($cname); ?>&amp;mirror=<?php echo htmlspecialchars($name['name']); ?>">[<?php echo gettext("Remove"); ?>]</a>
+<?php
+ endif;
+?>
+ </td>
+ </tr>
+<?php
+ if (count($name["components"]) > 1):
+ $morecomponents = array_slice($name["components"], 1);
+ foreach ($morecomponents as $component):
+?>
+ <tr>
+ <td width="40%" class="listr">
+ <?php echo $component; ?>
+ <?php list($cname, $cstatus) = explode(" ", $component, 2); ?>
+ <br />
+<?php
+ if ((strtoupper($name['status']) == "COMPLETE") && (count($name["components"]) > 1)):
+?>
+ <a href="diag_gmirror.php?action=rebuild&amp;consumer=<?php echo htmlspecialchars($cname); ?>&amp;mirror=<?php echo htmlspecialchars($name['name']); ?>">[<?php echo gettext("Rebuild"); ?>]</a>
+ <a href="diag_gmirror.php?action=deactivate&amp;consumer=<?php echo htmlspecialchars($cname); ?>&amp;mirror=<?php echo htmlspecialchars($name['name']); ?>">[<?php echo gettext("Deactivate"); ?>]</a>
+ <a href="diag_gmirror.php?action=remove&amp;consumer=<?php echo htmlspecialchars($cname); ?>&amp;mirror=<?php echo htmlspecialchars($name['name']); ?>">[<?php echo gettext("Remove"); ?>]</a>
+<?php
+ endif;
+?>
+ </td>
</tr>
- <?php if (count($name["components"]) > 1):
- $morecomponents = array_slice($name["components"], 1); ?>
- <?php foreach ($morecomponents as $component): ?>
- <tr>
- <td width="40%" class="listr">
- <?php echo $component; ?>
- <?php list($cname, $cstatus) = explode(" ", $component, 2); ?>
- <br />
- <?php if ((strtoupper($name['status']) == "COMPLETE") && (count($name["components"]) > 1)): ?>
- <a href="diag_gmirror.php?action=rebuild&amp;consumer=<?php echo htmlspecialchars($cname); ?>&amp;mirror=<?php echo htmlspecialchars($name['name']); ?>">[<?php echo gettext("Rebuild"); ?>]</a>
- <a href="diag_gmirror.php?action=deactivate&amp;consumer=<?php echo htmlspecialchars($cname); ?>&amp;mirror=<?php echo htmlspecialchars($name['name']); ?>">[<?php echo gettext("Deactivate"); ?>]</a>
- <a href="diag_gmirror.php?action=remove&amp;consumer=<?php echo htmlspecialchars($cname); ?>&amp;mirror=<?php echo htmlspecialchars($name['name']); ?>">[<?php echo gettext("Remove"); ?>]</a>
- <?php endif; ?>
- </td>
- </tr>
- <?php endforeach; ?>
- <?php endif; ?>
- <?php endforeach; ?>
- <?php else: ?>
- <tr><td colspan="3" class="listr"><?php echo gettext("No Mirrors Found"); ?></td></tr>
- <?php endif; ?>
- </tbody>
- </table>
- <br /><?php echo gettext("Some disk operations may only be performed when there are multiple consumers present in a mirror."); ?>
+<?php
+ endforeach;
+ endif;
+ endforeach;
+ else:
+?>
+ <tr>
+ <td colspan="3" class="listr"><?php echo gettext("No Mirrors Found"); ?></td>
+ </tr>
+<?php
+ endif;
+?>
+ </tbody>
+ </table>
+ <br /><?php echo gettext("Some disk operations may only be performed when there are multiple consumers present in a mirror."); ?>
</td>
</tr>
@@ -293,44 +320,61 @@ if ($_GET["error"] && ($_GET["error"] != 0)) {
<td width="22%" valign="top" class="vncell"><?php echo gettext("Available Consumers"); ?></td>
<td width="78%" class="vtable">
- <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="consumer list">
- <tbody id="consumer_list">
- <?php if (count($unused_consumers) > 0): ?>
- <tr>
- <td width="30%" class="vncellt"><?php echo gettext("Name"); ?></td>
- <td width="30%" class="vncellt"><?php echo gettext("Size"); ?></td>
- <td width="40%" class="vncellt"><?php echo gettext("Add to Mirror"); ?></td>
- </tr>
- <?php foreach ($unused_consumers as $consumer): ?>
+ <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="consumer list">
+ <tbody id="consumer_list">
+<?php
+ if (count($unused_consumers) > 0):
+?>
+ <tr>
+ <td width="30%" class="vncellt"><?php echo gettext("Name"); ?></td>
+ <td width="30%" class="vncellt"><?php echo gettext("Size"); ?></td>
+ <td width="40%" class="vncellt"><?php echo gettext("Add to Mirror"); ?></td>
+ </tr>
+<?php
+ foreach ($unused_consumers as $consumer):
+?>
+ <tr>
+ <td width="30%" class="listr">
+ <?php echo htmlspecialchars($consumer['name']); ?>
+ </td>
+ <td width="30%" class="listr"><?php echo htmlspecialchars($consumer['size']); ?> <?php echo htmlspecialchars($consumer['humansize']); ?></td>
+ <td width="40%" class="listr">
+<?php
+ $oldmirror = gmirror_get_consumer_metadata_mirror($consumer['name']);
+ if ($oldmirror):
+?>
+ <a href="diag_gmirror.php?action=activate&amp;consumer=<?php echo htmlspecialchars($consumer['name']); ?>&amp;mirror=<?php echo htmlspecialchars($oldmirror); ?>">[<?php echo gettext("Reactivate on:") . ' ' . htmlspecialchars($oldmirror); ?>]</a>
+ <br /><a href="diag_gmirror.php?action=clear&amp;consumer=<?php echo htmlspecialchars($consumer['name']); ?>">[<?php echo gettext("Remove metadata from disk"); ?>]</a>
+<?php
+ else:
+ foreach ($mirror_list as $mirror):
+ $mirror_size = gmirror_get_mirror_size($mirror);
+ $consumer_size = gmirror_get_unused_consumer_size($consumer['name']);
+ if ($consumer_size > $mirror_size):
+?>
+ <a href="diag_gmirror.php?action=insert&amp;consumer=<?php echo htmlspecialchars($consumer['name']); ?>&amp;mirror=<?php echo htmlspecialchars($mirror); ?>"><?php echo htmlspecialchars($mirror); ?></a>
+<?php
+ endif;
+ endforeach;
+ endif;
+?>
+ </td>
+ </tr>
+<?php
+ endforeach;
+ else:
+?>
<tr>
- <td width="30%" class="listr">
- <?php echo htmlspecialchars($consumer['name']); ?>
- </td>
- <td width="30%" class="listr"><?php echo htmlspecialchars($consumer['size']); ?> <?php echo htmlspecialchars($consumer['humansize']); ?></td>
- <td width="40%" class="listr">
- <?php $oldmirror = gmirror_get_consumer_metadata_mirror($consumer['name']);
- if ($oldmirror): ?>
- <a href="diag_gmirror.php?action=activate&amp;consumer=<?php echo htmlspecialchars($consumer['name']); ?>&amp;mirror=<?php echo htmlspecialchars($oldmirror); ?>">[<?php echo gettext("Reactivate on:") . ' ' . htmlspecialchars($oldmirror); ?>]</a>
- <br /><a href="diag_gmirror.php?action=clear&amp;consumer=<?php echo htmlspecialchars($consumer['name']); ?>">[<?php echo gettext("Remove metadata from disk"); ?>]</a>
- <?php else: ?>
- <?php foreach ($mirror_list as $mirror):
- $mirror_size = gmirror_get_mirror_size($mirror);
- $consumer_size = gmirror_get_unused_consumer_size($consumer['name']);
- ?>
- <?php if ($consumer_size > $mirror_size): ?>
- <a href="diag_gmirror.php?action=insert&amp;consumer=<?php echo htmlspecialchars($consumer['name']); ?>&amp;mirror=<?php echo htmlspecialchars($mirror); ?>"><?php echo htmlspecialchars($mirror); ?></a>
- <?php endif; ?>
- <?php endforeach; ?>
- <?php endif; ?>
- </td>
+ <td colspan="3" class="listr">
+ <?php echo gettext("No unused consumers found"); ?>
+ </td>
</tr>
- <?php endforeach; ?>
- <?php else: ?>
- <tr><td colspan="3" class="listr"><?php echo gettext("No unused consumers found"); ?></td></tr>
- <?php endif; ?>
- </tbody>
- </table>
- <br /><?php echo gettext("Consumers may only be added to a mirror if they are larger than the size of the mirror."); ?>
+<?php
+ endif;
+?>
+ </tbody>
+ </table>
+ <br /><?php echo gettext("Consumers may only be added to a mirror if they are larger than the size of the mirror."); ?>
</td>
</tr>
<tr>
@@ -339,7 +383,9 @@ if ($_GET["error"] && ($_GET["error"] != 0)) {
<tr>
<td colspan="2" valign="top" class=""><?php echo gettext("To repair a failed mirror, first perform a 'Forget' command on the mirror, followed by an 'insert' action on the new consumer."); ?></td>
</tr>
-<?php endif;?>
+<?php
+ endif;
+?>
</table>
</div>
</td>
diff --git a/usr/local/www/diag_ipsec.php b/usr/local/www/diag_ipsec.php
index 4492b86..7f259c3 100644
--- a/usr/local/www/diag_ipsec.php
+++ b/usr/local/www/diag_ipsec.php
@@ -46,7 +46,7 @@
global $g;
-$pgtitle = array(gettext("Status"),gettext("IPsec"));
+$pgtitle = array(gettext("Status"), gettext("IPsec"));
$shortcut_section = "ipsec";
require("guiconfig.inc");
@@ -529,8 +529,8 @@ $status = ipsec_smp_dump_status();
<tr style="display:none;"><td></td></tr>
</tbody>
</table>
- </div>
- </td>
+ </div>
+ </td>
</tr>
</table>
diff --git a/usr/local/www/diag_ipsec_leases.php b/usr/local/www/diag_ipsec_leases.php
index 7dad542..501c83a 100644
--- a/usr/local/www/diag_ipsec_leases.php
+++ b/usr/local/www/diag_ipsec_leases.php
@@ -43,7 +43,7 @@
require("guiconfig.inc");
require("ipsec.inc");
-$pgtitle = array(gettext("Status"),gettext("IPsec"),gettext("Leases"));
+$pgtitle = array(gettext("Status"), gettext("IPsec"), gettext("Leases"));
$shortcut_section = "ipsec";
include("head.inc");
diff --git a/usr/local/www/diag_ipsec_sad.php b/usr/local/www/diag_ipsec_sad.php
index 15bd995..f958d29 100644
--- a/usr/local/www/diag_ipsec_sad.php
+++ b/usr/local/www/diag_ipsec_sad.php
@@ -47,7 +47,7 @@
require("guiconfig.inc");
require("ipsec.inc");
-$pgtitle = array(gettext("Status"),gettext("IPsec"),gettext("SAD"));
+$pgtitle = array(gettext("Status"), gettext("IPsec"), gettext("SAD"));
$shortcut_section = "ipsec";
include("head.inc");
diff --git a/usr/local/www/diag_ipsec_spd.php b/usr/local/www/diag_ipsec_spd.php
index ba5231c..5efeda3 100644
--- a/usr/local/www/diag_ipsec_spd.php
+++ b/usr/local/www/diag_ipsec_spd.php
@@ -47,7 +47,7 @@
require("guiconfig.inc");
require("ipsec.inc");
-$pgtitle = array(gettext("Status"),gettext("IPsec"),gettext("SPD"));
+$pgtitle = array(gettext("Status"), gettext("IPsec"), gettext("SPD"));
$shortcut_section = "ipsec";
include("head.inc");
diff --git a/usr/local/www/diag_ipsec_xml.php b/usr/local/www/diag_ipsec_xml.php
index a219da9..82dcbea 100644
--- a/usr/local/www/diag_ipsec_xml.php
+++ b/usr/local/www/diag_ipsec_xml.php
@@ -56,12 +56,12 @@ $status = ipsec_smp_dump_status();
if (is_array($status['query']) && $status['query']['ikesalist'] && $status['query']['ikesalist']['ikesa']) {
foreach ($a_phase2 as $ph2ent) {
- ipsec_lookup_phase1($ph2ent,$ph1ent);
+ ipsec_lookup_phase1($ph2ent, $ph1ent);
$tunnel = array();
if (!isset($ph2ent['disabled']) && !isset($ph1ent['disabled'])) {
- if(ipsec_phase1_status($status['query']['ikesalist']['ikesa'], $ph1ent['ikeid'])) {
+ if (ipsec_phase1_status($status['query']['ikesalist']['ikesa'], $ph1ent['ikeid'])) {
$tunnel['state'] = "up";
- } elseif(!isset($config['ipsec']['enable'])) {
+ } elseif (!isset($config['ipsec']['enable'])) {
$tunnel['state'] = "disabled";
} else {
$tunnel['state'] = "down";
diff --git a/usr/local/www/diag_limiter_info.php b/usr/local/www/diag_limiter_info.php
index 66574ed..98d2663 100644
--- a/usr/local/www/diag_limiter_info.php
+++ b/usr/local/www/diag_limiter_info.php
@@ -99,19 +99,19 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="diag limiter info">
<tr>
<td>
- <table id="backuptable" class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0" summary="tabcont">
- <tr>
- <td align="center">
- <table summary="results">
- <tr><td>
- <div id="limiteractivitydiv">
- <?=gettext("Gathering Limiter information, please wait...");?>
- </div>
- </td></tr>
- </table>
- </td>
- </tr>
- </table>
+ <table id="backuptable" class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0" summary="tabcont">
+ <tr>
+ <td align="center">
+ <table summary="results">
+ <tr><td>
+ <div id="limiteractivitydiv">
+ <?=gettext("Gathering Limiter information, please wait...");?>
+ </div>
+ </td></tr>
+ </table>
+ </td>
+ </tr>
+ </table>
</td>
</tr>
</table>
diff --git a/usr/local/www/diag_ndp.php b/usr/local/www/diag_ndp.php
index f2fcfd5..233d8ee 100644
--- a/usr/local/www/diag_ndp.php
+++ b/usr/local/www/diag_ndp.php
@@ -76,8 +76,7 @@ foreach ($rawdata as $line) {
}
/* FIXME: Not ipv6 compatible dns resolving. PHP needs fixing */
-function _getHostName($mac,$ip)
-{
+function _getHostName($mac, $ip) {
if (is_ipaddr($ip)) {
list($ip, $scope) = explode("%", $ip);
if (gethostbyaddr($ip) <> "" and gethostbyaddr($ip) <> $ip) {
@@ -106,7 +105,7 @@ $data = msort($data, "dnsresolve");
// Load MAC-Manufacturer table
$mac_man = load_mac_manufacturer_table();
-$pgtitle = array(gettext("Diagnostics"),gettext("NDP Table"));
+$pgtitle = array(gettext("Diagnostics"), gettext("NDP Table"));
include("head.inc");
?>
diff --git a/usr/local/www/diag_packet_capture.php b/usr/local/www/diag_packet_capture.php
index 71ed928..ae41a67 100644
--- a/usr/local/www/diag_packet_capture.php
+++ b/usr/local/www/diag_packet_capture.php
@@ -190,7 +190,7 @@ if ($_POST) {
$disabledns = "-n";
}
- if ($_POST['startbtn'] != "" ) {
+ if ($_POST['startbtn'] != "") {
$action = gettext("Start");
//delete previous packet capture if it exists
@@ -198,7 +198,7 @@ if ($_POST) {
unlink ($fp.$fn);
}
- } elseif ($_POST['stopbtn']!= "") {
+ } elseif ($_POST['stopbtn'] != "") {
$action = gettext("Stop");
$processes_running = trim(shell_exec("/bin/ps axw -O pid= | /usr/bin/grep tcpdump | /usr/bin/grep {$fn} | /usr/bin/egrep -v '(pflog|grep)'"));
@@ -212,7 +212,7 @@ if ($_POST) {
exec("kill $process_id");
}
- } elseif ($_POST['downloadbtn']!= "") {
+ } elseif ($_POST['downloadbtn'] != "") {
//download file
$fs = filesize($fp.$fn);
header("Content-Type: application/octet-stream");
@@ -246,98 +246,99 @@ include("fbegin.inc");
<tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Interface");?></td>
<td width="32%" class="vtable">
- <select name="interface">
- <?php foreach ($interfaces as $iface => $ifacename): ?>
- <option value="<?=$iface;?>" <?php if ($selectedif == $iface) echo "selected=\"selected\""; ?>>
- <?php echo $ifacename;?>
- </option>
- <?php endforeach; ?>
- </select>
- <br /><?=gettext("Select the interface on which to capture traffic.");?>
+ <select name="interface">
+ <?php foreach ($interfaces as $iface => $ifacename): ?>
+ <option value="<?=$iface;?>" <?php if ($selectedif == $iface) echo "selected=\"selected\""; ?>>
+ <?php echo $ifacename;?>
+ </option>
+ <?php endforeach; ?>
+ </select>
+ <br /><?=gettext("Select the interface on which to capture traffic.");?>
</td>
</tr>
<tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Promiscuous");?></td>
<td width="51%" class="vtable">
- <input name="promiscuous" type="checkbox"<?php if ($_POST['promiscuous']) echo " checked=\"checked\""; ?> />
- <br /><?=gettext("If checked, the");?> <a target="_blank" href="http://www.freebsd.org/cgi/man.cgi?query=tcpdump&amp;apropos=0&amp;sektion=0&amp;manpath=FreeBSD+8.3-stable&amp;arch=default&amp;format=html"><?= gettext("packet capture")?></a> <?= gettext("will be performed using promiscuous mode.");?>
- <br /><b><?=gettext("Note");?>: </b><?=gettext("Some network adapters do not support or work well in promiscuous mode.");?>
+ <input name="promiscuous" type="checkbox"<?php if ($_POST['promiscuous']) echo " checked=\"checked\""; ?> />
+ <br /><?=gettext("If checked, the");?> <a target="_blank" href="http://www.freebsd.org/cgi/man.cgi?query=tcpdump&amp;apropos=0&amp;sektion=0&amp;manpath=FreeBSD+8.3-stable&amp;arch=default&amp;format=html"><?= gettext("packet capture")?></a> <?= gettext("will be performed using promiscuous mode.");?>
+ <br /><b><?=gettext("Note");?>: </b><?=gettext("Some network adapters do not support or work well in promiscuous mode.");?>
</td>
</tr>
<tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Address Family");?></td>
<td colspan="2" width="83%" class="vtable">
- <select name="fam">
- <option value="">Any</option>
- <option value="ip" <?php if ($fam == "ip") echo "selected=\"selected\""; ?>>IPv4 Only</option>
- <option value="ip6" <?php if ($fam == "ip6") echo "selected=\"selected\""; ?>>IPv6 Only</option>
- </select>
- <br /><?=gettext("Select the type of traffic to be captured, either Any, IPv4 only or IPv6 only.");?>
+ <select name="fam">
+ <option value="">Any</option>
+ <option value="ip" <?php if ($fam == "ip") echo "selected=\"selected\""; ?>>IPv4 Only</option>
+ <option value="ip6" <?php if ($fam == "ip6") echo "selected=\"selected\""; ?>>IPv6 Only</option>
+ </select>
+ <br /><?=gettext("Select the type of traffic to be captured, either Any, IPv4 only or IPv6 only.");?>
</td>
</tr>
<tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Protocol");?></td>
<td colspan="2" width="83%" class="vtable">
- <select name="proto">
- <option value="">Any</option>
- <option value="icmp" <?php if ($proto == "icmp") echo "selected=\"selected\""; ?>>ICMP</option>
- <option value="!icmp" <?php if ($proto == "!icmp") echo "selected=\"selected\""; ?>>Exclude ICMP</option>
- <option value="icmp6" <?php if ($proto == "icmp6") echo "selected=\"selected\""; ?>>ICMPv6</option>
- <option value="!icmp6" <?php if ($proto == "!icmp6") echo "selected=\"selected\""; ?>>Exclude ICMPv6</option>
- <option value="tcp" <?php if ($proto == "tcp") echo "selected=\"selected\""; ?>>TCP</option>
- <option value="!tcp" <?php if ($proto == "!tcp") echo "selected=\"selected\""; ?>>Exclude TCP</option>
- <option value="udp" <?php if ($proto == "udp") echo "selected=\"selected\""; ?>>UDP</option>
- <option value="!udp" <?php if ($proto == "!udp") echo "selected=\"selected\""; ?>>Exclude UDP</option>
- <option value="arp" <?php if ($proto == "arp") echo "selected=\"selected\""; ?>>ARP</option>
- <option value="!arp" <?php if ($proto == "!arp") echo "selected=\"selected\""; ?>>Exclude ARP</option>
- <option value="carp" <?php if ($proto == "carp") echo "selected=\"selected\""; ?>>CARP (VRRP)</option>
- <option value="!carp" <?php if ($proto == "!carp") echo "selected=\"selected\""; ?>>Exclude CARP (VRRP)</option>
- <option value="esp" <?php if ($proto == "esp") echo "selected=\"selected\""; ?>>ESP</option>
- </select>
- <br /><?=gettext("Select the protocol to capture, or Any.");?>
+ <select name="proto">
+ <option value="">Any</option>
+ <option value="icmp" <?php if ($proto == "icmp") echo "selected=\"selected\""; ?>>ICMP</option>
+ <option value="!icmp" <?php if ($proto == "!icmp") echo "selected=\"selected\""; ?>>Exclude ICMP</option>
+ <option value="icmp6" <?php if ($proto == "icmp6") echo "selected=\"selected\""; ?>>ICMPv6</option>
+ <option value="!icmp6" <?php if ($proto == "!icmp6") echo "selected=\"selected\""; ?>>Exclude ICMPv6</option>
+ <option value="tcp" <?php if ($proto == "tcp") echo "selected=\"selected\""; ?>>TCP</option>
+ <option value="!tcp" <?php if ($proto == "!tcp") echo "selected=\"selected\""; ?>>Exclude TCP</option>
+ <option value="udp" <?php if ($proto == "udp") echo "selected=\"selected\""; ?>>UDP</option>
+ <option value="!udp" <?php if ($proto == "!udp") echo "selected=\"selected\""; ?>>Exclude UDP</option>
+ <option value="arp" <?php if ($proto == "arp") echo "selected=\"selected\""; ?>>ARP</option>
+ <option value="!arp" <?php if ($proto == "!arp") echo "selected=\"selected\""; ?>>Exclude ARP</option>
+ <option value="carp" <?php if ($proto == "carp") echo "selected=\"selected\""; ?>>CARP (VRRP)</option>
+ <option value="!carp" <?php if ($proto == "!carp") echo "selected=\"selected\""; ?>>Exclude CARP (VRRP)</option>
+ <option value="esp" <?php if ($proto == "esp") echo "selected=\"selected\""; ?>>ESP</option>
+ </select>
+ <br /><?=gettext("Select the protocol to capture, or Any.");?>
</td>
</tr>
<tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Host Address");?></td>
<td colspan="2" width="83%" class="vtable">
- <input name="host" class="formfld host" id="host" size="20" value="<?=htmlspecialchars($host);?>" />
- <br /><?=gettext("This value is either the Source or Destination IP address or subnet in CIDR notation. The packet capture will look for this address in either field.");?>
- <br /><?=gettext("Matching can be negated by preceding the value with \"!\". Multiple IP addresses or CIDR subnets may be specified. Comma (\",\") separated values perform a boolean \"and\". Separating with a pipe (\"|\") performs a boolean \"or\".");?>
- <br /><?=gettext("If you leave this field blank, all packets on the specified interface will be captured.");?>
+ <input name="host" class="formfld host" id="host" size="20" value="<?=htmlspecialchars($host);?>" />
+ <br /><?=gettext("This value is either the Source or Destination IP address or subnet in CIDR notation. The packet capture will look for this address in either field.");?>
+ <br /><?=gettext("Matching can be negated by preceding the value with \"!\". Multiple IP addresses or CIDR subnets may be specified. Comma (\",\") separated values perform a boolean \"and\". Separating with a pipe (\"|\") performs a boolean \"or\".");?>
+ <br /><?=gettext("If you leave this field blank, all packets on the specified interface will be captured.");?>
</td>
</tr>
<tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Port");?></td>
<td colspan="2" width="83%" class="vtable">
- <input name="port" class="formfld unknown" id="port" size="5" value="<?=$port;?>" />
- <br /><?=gettext("The port can be either the source or destination port. The packet capture will look for this port in either field.");?>
- <br /><?=gettext("Leave blank if you do not want to filter by port.");?>
+ <input name="port" class="formfld unknown" id="port" size="5" value="<?=$port;?>" />
+ <br /><?=gettext("The port can be either the source or destination port. The packet capture will look for this port in either field.");?>
+ <br /><?=gettext("Leave blank if you do not want to filter by port.");?>
</td>
</tr>
<tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Packet Length");?></td>
<td colspan="2" width="83%" class="vtable">
- <input name="snaplen" class="formfld unknown" id="snaplen" size="5" value="<?=$snaplen;?>" />
- <br /><?=gettext("The Packet length is the number of bytes of each packet that will be captured. Default value is 0, which will capture the entire frame regardless of its size.");?>
+ <input name="snaplen" class="formfld unknown" id="snaplen" size="5" value="<?=$snaplen;?>" />
+ <br /><?=gettext("The Packet length is the number of bytes of each packet that will be captured. Default value is 0, which will capture the entire frame regardless of its size.");?>
</td>
</tr>
<tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Count");?></td>
<td colspan="2" width="83%" class="vtable">
- <input name="count" class="formfld unknown" id="count" size="5" value="<?=$count;?>" />
- <br /><?=gettext("This is the number of packets the packet capture will grab. Default value is 100.") . "<br />" . gettext("Enter 0 (zero) for no count limit.");?>
+ <input name="count" class="formfld unknown" id="count" size="5" value="<?=$count;?>" />
+ <br /><?=gettext("This is the number of packets the packet capture will grab. Default value is 100.") . "<br />" . gettext("Enter 0 (zero) for no count limit.");?>
</td>
</tr>
<tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Level of Detail");?></td>
<td colspan="2" width="83%" class="vtable">
- <select name="detail" class="formselect" id="detail" size="1">
- <option value="normal" <?php if ($detail == "normal") echo "selected=\"selected\""; ?>><?=gettext("Normal");?></option>
- <option value="medium" <?php if ($detail == "medium") echo "selected=\"selected\""; ?>><?=gettext("Medium");?></option>
- <option value="high" <?php if ($detail == "high") echo "selected=\"selected\""; ?>><?=gettext("High");?></option>
- <option value="full" <?php if ($detail == "full") echo "selected=\"selected\""; ?>><?=gettext("Full");?></option>
- </select>
- <br /><?=gettext("This is the level of detail that will be displayed after hitting 'Stop' when the packets have been captured.") . "<br /><b>" .
+ <select name="detail" class="formselect" id="detail" size="1">
+ <option value="normal" <?php if ($detail == "normal") echo "selected=\"selected\""; ?>><?=gettext("Normal");?></option>
+ <option value="medium" <?php if ($detail == "medium") echo "selected=\"selected\""; ?>><?=gettext("Medium");?></option>
+ <option value="high" <?php if ($detail == "high") echo "selected=\"selected\""; ?>><?=gettext("High");?></option>
+ <option value="full" <?php if ($detail == "full") echo "selected=\"selected\""; ?>><?=gettext("Full");?></option>
+ </select>
+ <br />
+ <?=gettext("This is the level of detail that will be displayed after hitting 'Stop' when the packets have been captured.") . "<br /><b>" .
gettext("Note:") . "</b> " .
gettext("This option does not affect the level of detail when downloading the packet capture.");?>
</td>
@@ -345,9 +346,9 @@ include("fbegin.inc");
<tr>
<td width="17%" valign="top" class="vncellreq"><?=gettext("Reverse DNS Lookup");?></td>
<td colspan="2" width="83%" class="vtable">
- <input name="dnsquery" type="checkbox" <?php if ($_POST['dnsquery']) echo " checked=\"checked\""; ?> />
- <br /><?=gettext("This check box will cause the packet capture to perform a reverse DNS lookup associated with all IP addresses.");?>
- <br /><b><?=gettext("Note");?>: </b><?=gettext("This option can cause delays for large packet captures.");?>
+ <input name="dnsquery" type="checkbox" <?php if ($_POST['dnsquery']) echo " checked=\"checked\""; ?> />
+ <br /><?=gettext("This check box will cause the packet capture to perform a reverse DNS lookup associated with all IP addresses.");?>
+ <br /><b><?=gettext("Note");?>: </b><?=gettext("This option can cause delays for large packet captures.");?>
</td>
</tr>
<tr>
@@ -381,7 +382,7 @@ include("fbegin.inc");
</form>
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="results">
<tr>
- <td valign="top" colspan="2">
+ <td valign="top" colspan="2">
<?php
echo "<font face=\"terminal\" size=\"2\">";
if ($processisrunning == true) {
@@ -417,7 +418,7 @@ include("fbegin.inc");
}
}
- if ($count != "0" ) {
+ if ($count != "0") {
$searchcount = "-c " . $count;
} else {
$searchcount = "";
@@ -470,8 +471,8 @@ include("fbegin.inc");
}
}
?>
- &nbsp;</font>
- </td>
+ &nbsp;</font>
+ </td>
</tr>
</table>
</td></tr>
diff --git a/usr/local/www/diag_pf_info.php b/usr/local/www/diag_pf_info.php
index 1c454a8..b6ed73a 100644
--- a/usr/local/www/diag_pf_info.php
+++ b/usr/local/www/diag_pf_info.php
@@ -97,11 +97,13 @@ jQuery(document).ready(function() {setTimeout('getpfinfo()', 5000);});
<tr>
<td align="center">
<table summary="results">
- <tr><td>
- <div id="pfactivitydiv">
- <?=gettext("Gathering PF information, please wait...");?>
- </div>
- </td></tr>
+ <tr>
+ <td>
+ <div id="pfactivitydiv">
+ <?=gettext("Gathering PF information, please wait...");?>
+ </div>
+ </td>
+ </tr>
</table>
</td>
</tr>
diff --git a/usr/local/www/diag_ping.php b/usr/local/www/diag_ping.php
index 954d9f2..102b097 100644
--- a/usr/local/www/diag_ping.php
+++ b/usr/local/www/diag_ping.php
@@ -56,7 +56,7 @@ if ($_POST || $_REQUEST['host']) {
/* input validation */
$reqdfields = explode(" ", "host count");
- $reqdfieldsn = array(gettext("Host"),gettext("Count"));
+ $reqdfieldsn = array(gettext("Host"), gettext("Count"));
do_input_validation($_REQUEST, $reqdfields, $reqdfieldsn, $input_errors);
if (($_REQUEST['count'] < 1) || ($_REQUEST['count'] > MAX_COUNT)) {
@@ -76,7 +76,7 @@ if ($_POST || $_REQUEST['host']) {
$do_ping = true;
$sourceip = $_REQUEST['sourceip'];
$count = $_POST['count'];
- if (preg_match('/[^0-9]/', $count) ) {
+ if (preg_match('/[^0-9]/', $count)) {
$count = DEFAULT_COUNT;
}
}
@@ -95,103 +95,104 @@ include("head.inc"); ?>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="diag_ping.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="tabcont">
-<tr>
- <td colspan="2" valign="top" class="listtopic"><?=gettext("Ping"); ?></td>
-</tr>
-<tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Host"); ?></td>
- <td width="78%" class="vtable">
- <?=$mandfldhtml;?><input name="host" type="text" class="formfld unknown" id="host" size="20" value="<?=htmlspecialchars($host);?>" /></td>
-</tr>
-<tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("IP Protocol"); ?></td>
- <td width="78%" class="vtable">
- <select name="ipproto" class="formselect">
- <option value="ipv4" <?php if ($ipproto == "ipv4") echo "selected=\"selected\"" ?>>IPv4</option>
- <option value="ipv6" <?php if ($ipproto == "ipv6") echo "selected=\"selected\"" ?>>IPv6</option>
- </select>
- </td>
-</tr>
-<tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Source Address"); ?></td>
- <td width="78%" class="vtable">
- <select name="sourceip" class="formselect">
- <option value="">Default</option>
- <?php $sourceips = get_possible_traffic_source_addresses(true);
- foreach ($sourceips as $sipvalue => $sipname):
- $selected = "";
- if (!link_interface_to_bridge($sipvalue) && ($sipvalue == $sourceip)) {
- $selected = "selected=\"selected\"";
+ <tr>
+ <td colspan="2" valign="top" class="listtopic"><?=gettext("Ping"); ?></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Host"); ?></td>
+ <td width="78%" class="vtable">
+ <?=$mandfldhtml;?><input name="host" type="text" class="formfld unknown" id="host" size="20" value="<?=htmlspecialchars($host);?>" />
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("IP Protocol"); ?></td>
+ <td width="78%" class="vtable">
+ <select name="ipproto" class="formselect">
+ <option value="ipv4" <?php if ($ipproto == "ipv4") echo "selected=\"selected\"" ?>>IPv4</option>
+ <option value="ipv6" <?php if ($ipproto == "ipv6") echo "selected=\"selected\"" ?>>IPv6</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Source Address"); ?></td>
+ <td width="78%" class="vtable">
+ <select name="sourceip" class="formselect">
+ <option value="">Default</option>
+ <?php $sourceips = get_possible_traffic_source_addresses(true);
+ foreach ($sourceips as $sipvalue => $sipname):
+ $selected = "";
+ if (!link_interface_to_bridge($sipvalue) && ($sipvalue == $sourceip)) {
+ $selected = "selected=\"selected\"";
+ }
+ ?>
+ <option value="<?=$sipvalue;?>" <?=$selected;?>>
+ <?=htmlspecialchars($sipname);?>
+ </option>
+ <?php endforeach; ?>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?= gettext("Count"); ?></td>
+ <td width="78%" class="vtable">
+ <select name="count" class="formfld" id="count">
+ <?php for ($i = 1; $i <= MAX_COUNT; $i++): ?>
+ <option value="<?=$i;?>" <?php if ($i == $count) echo "selected=\"selected\""; ?>><?=$i;?></option>
+ <?php endfor; ?>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Ping"); ?>" />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" colspan="2">
+ <?php if ($do_ping) {
+ echo "<font face=\"terminal\" size=\"2\">";
+ echo "<strong>" . gettext("Ping output") . ":</strong><br />";
+ ?>
+ <script type="text/javascript">
+ //<![CDATA[
+ window.onload=function() {
+ document.getElementById("pingCaptured").wrap='off';
+ }
+ //]]>
+ </script>
+ <?php
+ echo "<textarea id=\"pingCaptured\" style=\"width:98%\" name=\"code\" rows=\"15\" cols=\"66\" readonly=\"readonly\">";
+ $ifscope = '';
+ $command = "/sbin/ping";
+ if ($ipproto == "ipv6") {
+ $command .= "6";
+ $ifaddr = is_ipaddr($sourceip) ? $sourceip : get_interface_ipv6($sourceip);
+ if (is_linklocal($ifaddr)) {
+ $ifscope = get_ll_scope($ifaddr);
}
- ?>
- <option value="<?=$sipvalue;?>" <?=$selected;?>>
- <?=htmlspecialchars($sipname);?>
- </option>
- <?php endforeach; ?>
- </select>
- </td>
-</tr>
-<tr>
- <td width="22%" valign="top" class="vncellreq"><?= gettext("Count"); ?></td>
- <td width="78%" class="vtable">
- <select name="count" class="formfld" id="count">
- <?php for ($i = 1; $i <= MAX_COUNT; $i++): ?>
- <option value="<?=$i;?>" <?php if ($i == $count) echo "selected=\"selected\""; ?>><?=$i;?></option>
- <?php endfor; ?>
- </select>
- </td>
-</tr>
-<tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Ping"); ?>" />
- </td>
-</tr>
-<tr>
- <td valign="top" colspan="2">
- <?php if ($do_ping) {
- echo "<font face=\"terminal\" size=\"2\">";
- echo "<strong>" . gettext("Ping output") . ":</strong><br />";
-?>
- <script type="text/javascript">
- //<![CDATA[
- window.onload=function() {
- document.getElementById("pingCaptured").wrap='off';
- }
- //]]>
- </script>
-<?php
- echo "<textarea id=\"pingCaptured\" style=\"width:98%\" name=\"code\" rows=\"15\" cols=\"66\" readonly=\"readonly\">";
- $ifscope = '';
- $command = "/sbin/ping";
- if ($ipproto == "ipv6") {
- $command .= "6";
- $ifaddr = is_ipaddr($sourceip) ? $sourceip : get_interface_ipv6($sourceip);
- if (is_linklocal($ifaddr)) {
- $ifscope = get_ll_scope($ifaddr);
+ } else {
+ $ifaddr = is_ipaddr($sourceip) ? $sourceip : get_interface_ip($sourceip);
}
- } else {
- $ifaddr = is_ipaddr($sourceip) ? $sourceip : get_interface_ip($sourceip);
- }
- if ($ifaddr && (is_ipaddr($host) || is_hostname($host))) {
- $srcip = "-S" . escapeshellarg($ifaddr);
- if (is_linklocal($host) && !strstr($host, "%") && !empty($ifscope)) {
- $host .= "%{$ifscope}";
+ if ($ifaddr && (is_ipaddr($host) || is_hostname($host))) {
+ $srcip = "-S" . escapeshellarg($ifaddr);
+ if (is_linklocal($host) && !strstr($host, "%") && !empty($ifscope)) {
+ $host .= "%{$ifscope}";
+ }
}
- }
- $cmd = "{$command} {$srcip} -c" . escapeshellarg($count) . " " . escapeshellarg($host);
- //echo "Ping command: {$cmd}\n";
- system($cmd);
- echo('</textarea>&nbsp;</font>');
- }
- ?>
- </td>
-</tr>
-<tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">&nbsp;</td>
-</tr>
+ $cmd = "{$command} {$srcip} -c" . escapeshellarg($count) . " " . escapeshellarg($host);
+ //echo "Ping command: {$cmd}\n";
+ system($cmd);
+ echo('</textarea>&nbsp;</font>');
+ }
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">&nbsp;</td>
+ </tr>
</table>
</form>
</td></tr>
diff --git a/usr/local/www/diag_pkglogs.php b/usr/local/www/diag_pkglogs.php
index 5a64227..6575c48 100755
--- a/usr/local/www/diag_pkglogs.php
+++ b/usr/local/www/diag_pkglogs.php
@@ -85,7 +85,7 @@ if (!$apkg) { // If we aren't looking for a specific package, locate the first p
}
}
-$pgtitle = array(gettext("Status"),gettext("Package logs"));
+$pgtitle = array(gettext("Status"), gettext("Package logs"));
include("head.inc");
?>
@@ -109,9 +109,9 @@ include("head.inc");
}
if ($apkg == $package['name']) {
$curtab = $logtab;
- $tab_array[] = array(sprintf(gettext("%s"),$logtab), true, "diag_pkglogs.php?pkg=".$package['name']);
+ $tab_array[] = array(sprintf(gettext("%s"), $logtab), true, "diag_pkglogs.php?pkg=".$package['name']);
} else {
- $tab_array[] = array(sprintf(gettext("%s"),$logtab), false, "diag_pkglogs.php?pkg=".$package['name']);
+ $tab_array[] = array(sprintf(gettext("%s"), $logtab), false, "diag_pkglogs.php?pkg=".$package['name']);
}
}
}
@@ -125,7 +125,7 @@ include("head.inc");
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" class="listtopic">
- <?php printf(gettext('Last %1$s %2$s log entries'),$nentries,$curtab); ?>
+ <?php printf(gettext('Last %1$s %2$s log entries'), $nentries, $curtab); ?>
</td>
</tr>
<?php
diff --git a/usr/local/www/diag_routes.php b/usr/local/www/diag_routes.php
index 7204560..ff2fe8d 100644
--- a/usr/local/www/diag_routes.php
+++ b/usr/local/www/diag_routes.php
@@ -71,7 +71,7 @@ if (isset($_REQUEST['isAjax'])) {
exit;
}
-$pgtitle = array(gettext("Diagnostics"),gettext("Routing tables"));
+$pgtitle = array(gettext("Diagnostics"), gettext("Routing tables"));
$shortcut_section = "routing";
include('head.inc');
diff --git a/usr/local/www/diag_smart.php b/usr/local/www/diag_smart.php
index 0c9a057..1cc9161 100644
--- a/usr/local/www/diag_smart.php
+++ b/usr/local/www/diag_smart.php
@@ -69,8 +69,7 @@ pre {
include("fbegin.inc");
// Highlights the words "PASSED", "FAILED", and "WARNING".
-function add_colors($string)
-{
+function add_colors($string) {
// To add words keep arrays matched by numbers
$patterns[0] = '/PASSED/';
$patterns[1] = '/FAILED/';
@@ -84,8 +83,7 @@ function add_colors($string)
}
// Edits smartd.conf file, adds or removes email for failed disk reporting
-function update_email($email)
-{
+function update_email($email) {
// Did they pass an email?
if (!empty($email)) {
// Put it in the smartd.conf file
@@ -96,8 +94,7 @@ function update_email($email)
}
}
-function smartmonctl($action)
-{
+function smartmonctl($action) {
global $start_script;
shell_exec($start_script . escapeshellarg($action));
}
diff --git a/usr/local/www/diag_sockets.php b/usr/local/www/diag_sockets.php
index 1c960bd..cdcfeb7 100644
--- a/usr/local/www/diag_sockets.php
+++ b/usr/local/www/diag_sockets.php
@@ -42,7 +42,7 @@
include('guiconfig.inc');
-$pgtitle = array(gettext("Diagnostics"),gettext("Sockets"));
+$pgtitle = array(gettext("Diagnostics"), gettext("Sockets"));
include('head.inc');
diff --git a/usr/local/www/diag_states_summary.php b/usr/local/www/diag_states_summary.php
index 5133a2f..3b31df9 100644
--- a/usr/local/www/diag_states_summary.php
+++ b/usr/local/www/diag_states_summary.php
@@ -188,7 +188,7 @@ function print_summary_table($label, $iparr, $sort = TRUE) { ?>
<?php
}
-$pgtitle = array(gettext("Diagnostics"),gettext("State Table Summary"));
+$pgtitle = array(gettext("Diagnostics"), gettext("State Table Summary"));
require_once("guiconfig.inc");
include("head.inc");
echo "<body>";
diff --git a/usr/local/www/diag_system_activity.php b/usr/local/www/diag_system_activity.php
index 4426184..58c5345 100644
--- a/usr/local/www/diag_system_activity.php
+++ b/usr/local/www/diag_system_activity.php
@@ -59,7 +59,7 @@ include("head.inc");
<script type="text/javascript">
//<![CDATA[
function getcpuactivity() {
- scroll(0,0);
+ scroll(0, 0);
var url = "/diag_system_activity.php";
var pars = 'getactivity=yes';
jQuery.ajax(
diff --git a/usr/local/www/diag_system_pftop.php b/usr/local/www/diag_system_pftop.php
index c959e00..5c15e6f 100644
--- a/usr/local/www/diag_system_pftop.php
+++ b/usr/local/www/diag_system_pftop.php
@@ -125,7 +125,7 @@ if ($_REQUEST['sorttype'] && in_array($_REQUEST['sorttype'], $sorttypes) &&
print_input_errors($input_errors);
}
?>
- <div id="mainarea" style="padding-bottom: 0px;">
+ <div id="mainarea" style="padding-bottom: 0px;">
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="diag system pftop">
<tr>
<td class="list">
@@ -200,7 +200,7 @@ if ($_REQUEST['sorttype'] && in_array($_REQUEST['sorttype'], $sorttypes) &&
//<![CDATA[
jQuery("#viewtype").change(function() {
var selected = jQuery("#viewtype option:selected");
- switch(selected.val()) {
+ switch (selected.val()) {
case "queue":
case "label":
case "rules":
diff --git a/usr/local/www/diag_testport.php b/usr/local/www/diag_testport.php
index 7054a95..fbc448a 100644
--- a/usr/local/www/diag_testport.php
+++ b/usr/local/www/diag_testport.php
@@ -57,7 +57,7 @@ if ($_POST || $_REQUEST['host']) {
/* input validation */
$reqdfields = explode(" ", "host port");
- $reqdfieldsn = array(gettext("Host"),gettext("Port"));
+ $reqdfieldsn = array(gettext("Host"), gettext("Port"));
do_input_validation($_REQUEST, $reqdfields, $reqdfieldsn, $input_errors);
if (!is_ipaddr($_REQUEST['host']) && !is_hostname($_REQUEST['host'])) {
@@ -179,108 +179,108 @@ include("head.inc"); ?>
</td>
</tr>
<tr>
- <td valign="top" colspan="2">
- <?php if ($do_testport) {
- echo "<font face=\"terminal\" size=\"2\">";
- echo "<strong>" . gettext("Port Test Results") . ":</strong><br />";
- ?>
- <script type="text/javascript">
- //<![CDATA[
- window.onload=function() {
- document.getElementById("testportCaptured").wrap='off';
- }
- //]]>
- </script>
- <?php
- echo "<textarea id=\"testportCaptured\" style=\"width:98%\" name=\"code\" rows=\"15\" cols=\"66\" readonly=\"readonly\">";
- $result = "";
- $nc_base_cmd = "/usr/bin/nc";
- $nc_args = "-w " . escapeshellarg($timeout);
- if (!$showtext) {
- $nc_args .= " -z ";
- }
- if (!empty($srcport)) {
- $nc_args .= " -p " . escapeshellarg($srcport) . " ";
- }
-
- /* Attempt to determine the interface address, if possible. Else try both. */
- if (is_ipaddrv4($host)) {
- $ifaddr = ($sourceip == "any") ? "" : get_interface_ip($sourceip);
- $nc_args .= " -4";
- } elseif (is_ipaddrv6($host)) {
- if ($sourceip == "any") {
- $ifaddr = "";
- } else if (is_linklocal($sourceip)) {
- $ifaddr = $sourceip;
- } else {
- $ifaddr = get_interface_ipv6($sourceip);
+ <td valign="top" colspan="2">
+ <?php if ($do_testport) {
+ echo "<font face=\"terminal\" size=\"2\">";
+ echo "<strong>" . gettext("Port Test Results") . ":</strong><br />";
+ ?>
+ <script type="text/javascript">
+ //<![CDATA[
+ window.onload=function() {
+ document.getElementById("testportCaptured").wrap='off';
}
- $nc_args .= " -6";
- } else {
- switch ($ipprotocol) {
- case "ipv4":
- $ifaddr = get_interface_ip($sourceip);
- $nc_ipproto = " -4";
- break;
- case "ipv6":
- $ifaddr = (is_linklocal($sourceip) ? $sourceip : get_interface_ipv6($sourceip));
- $nc_ipproto = " -6";
- break;
- case "any":
- $ifaddr = get_interface_ip($sourceip);
- $nc_ipproto = (!empty($ifaddr)) ? " -4" : "";
- if (empty($ifaddr)) {
- $ifaddr = (is_linklocal($sourceip) ? $sourceip : get_interface_ipv6($sourceip));
- $nc_ipproto = (!empty($ifaddr)) ? " -6" : "";
- }
- break;
+ //]]>
+ </script>
+ <?php
+ echo "<textarea id=\"testportCaptured\" style=\"width:98%\" name=\"code\" rows=\"15\" cols=\"66\" readonly=\"readonly\">";
+ $result = "";
+ $nc_base_cmd = "/usr/bin/nc";
+ $nc_args = "-w " . escapeshellarg($timeout);
+ if (!$showtext) {
+ $nc_args .= " -z ";
}
- /* Netcat doesn't like it if we try to connect using a certain type of IP without specifying the family. */
- if (!empty($ifaddr)) {
- $nc_args .= $nc_ipproto;
- } elseif ($sourceip == "any") {
+ if (!empty($srcport)) {
+ $nc_args .= " -p " . escapeshellarg($srcport) . " ";
+ }
+
+ /* Attempt to determine the interface address, if possible. Else try both. */
+ if (is_ipaddrv4($host)) {
+ $ifaddr = ($sourceip == "any") ? "" : get_interface_ip($sourceip);
+ $nc_args .= " -4";
+ } elseif (is_ipaddrv6($host)) {
+ if ($sourceip == "any") {
+ $ifaddr = "";
+ } else if (is_linklocal($sourceip)) {
+ $ifaddr = $sourceip;
+ } else {
+ $ifaddr = get_interface_ipv6($sourceip);
+ }
+ $nc_args .= " -6";
+ } else {
switch ($ipprotocol) {
case "ipv4":
+ $ifaddr = get_interface_ip($sourceip);
$nc_ipproto = " -4";
break;
case "ipv6":
+ $ifaddr = (is_linklocal($sourceip) ? $sourceip : get_interface_ipv6($sourceip));
$nc_ipproto = " -6";
break;
+ case "any":
+ $ifaddr = get_interface_ip($sourceip);
+ $nc_ipproto = (!empty($ifaddr)) ? " -4" : "";
+ if (empty($ifaddr)) {
+ $ifaddr = (is_linklocal($sourceip) ? $sourceip : get_interface_ipv6($sourceip));
+ $nc_ipproto = (!empty($ifaddr)) ? " -6" : "";
+ }
+ break;
+ }
+ /* Netcat doesn't like it if we try to connect using a certain type of IP without specifying the family. */
+ if (!empty($ifaddr)) {
+ $nc_args .= $nc_ipproto;
+ } elseif ($sourceip == "any") {
+ switch ($ipprotocol) {
+ case "ipv4":
+ $nc_ipproto = " -4";
+ break;
+ case "ipv6":
+ $nc_ipproto = " -6";
+ break;
+ }
+ $nc_args .= $nc_ipproto;
}
- $nc_args .= $nc_ipproto;
}
- }
- /* Only add on the interface IP if we managed to find one. */
- if (!empty($ifaddr)) {
- $nc_args .= " -s " . escapeshellarg($ifaddr) . " ";
- $scope = get_ll_scope($ifaddr);
- if (!empty($scope) && !strstr($host, "%")) {
- $host .= "%{$scope}";
+ /* Only add on the interface IP if we managed to find one. */
+ if (!empty($ifaddr)) {
+ $nc_args .= " -s " . escapeshellarg($ifaddr) . " ";
+ $scope = get_ll_scope($ifaddr);
+ if (!empty($scope) && !strstr($host, "%")) {
+ $host .= "%{$scope}";
+ }
}
- }
- $nc_cmd = "{$nc_base_cmd} {$nc_args} " . escapeshellarg($host) . " " . escapeshellarg($port) . " 2>&1";
- exec($nc_cmd, $result, $retval);
- //echo "NC CMD: {$nc_cmd}\n\n";
- if (empty($result)) {
- if ($showtext) {
- echo gettext("No output received, or connection failed. Try with \"Show Remote Text\" unchecked first.");
- } else {
- echo gettext("Connection failed (Refused/Timeout)");
- }
- } else {
- if (is_array($result)) {
- foreach ($result as $resline) {
- echo htmlspecialchars($resline) . "\n";
+ $nc_cmd = "{$nc_base_cmd} {$nc_args} " . escapeshellarg($host) . " " . escapeshellarg($port) . " 2>&1";
+ exec($nc_cmd, $result, $retval);
+ //echo "NC CMD: {$nc_cmd}\n\n";
+ if (empty($result)) {
+ if ($showtext) {
+ echo gettext("No output received, or connection failed. Try with \"Show Remote Text\" unchecked first.");
+ } else {
+ echo gettext("Connection failed (Refused/Timeout)");
}
} else {
- echo htmlspecialchars($result);
+ if (is_array($result)) {
+ foreach ($result as $resline) {
+ echo htmlspecialchars($resline) . "\n";
+ }
+ } else {
+ echo htmlspecialchars($result);
+ }
}
+ echo '</textarea>&nbsp;</font>' ;
}
- echo '</textarea>&nbsp;</font>' ;
- }
- ?>
- </td>
+ ?>
+ </td>
</tr>
</table>
</form>
diff --git a/usr/local/www/diag_traceroute.php b/usr/local/www/diag_traceroute.php
index e3a062b..d094d49 100644
--- a/usr/local/www/diag_traceroute.php
+++ b/usr/local/www/diag_traceroute.php
@@ -44,7 +44,7 @@
require("guiconfig.inc");
$allowautocomplete = true;
-$pgtitle = array(gettext("Diagnostics"),gettext("Traceroute"));
+$pgtitle = array(gettext("Diagnostics"), gettext("Traceroute"));
include("head.inc");
?>
@@ -61,7 +61,7 @@ if ($_POST || $_REQUEST['host']) {
/* input validation */
$reqdfields = explode(" ", "host ttl");
- $reqdfieldsn = array(gettext("Host"),gettext("ttl"));
+ $reqdfieldsn = array(gettext("Host"), gettext("ttl"));
do_input_validation($_REQUEST, $reqdfields, $reqdfieldsn, $input_errors);
if (($_REQUEST['ttl'] < 1) || ($_REQUEST['ttl'] > MAX_TTL)) {
@@ -96,121 +96,121 @@ if (!isset($do_traceroute)) {
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="diag_traceroute.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="diag traceroute">
-<tr>
- <td colspan="2" valign="top" class="listtopic"><?=gettext("Traceroute");?></td>
-</tr>
-<tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Host");?></td>
- <td width="78%" class="vtable">
- <?=$mandfldhtml;?><input name="host" type="text" class="formfld unknown" id="host" size="20" value="<?=htmlspecialchars($host);?>" />
- </td>
-</tr>
-<tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("IP Protocol"); ?></td>
- <td width="78%" class="vtable">
- <select name="ipproto" class="formselect">
- <option value="ipv4" <?php if ($ipproto == "ipv4") echo "selected=\"selected\"" ?>>IPv4</option>
- <option value="ipv6" <?php if ($ipproto == "ipv6") echo "selected=\"selected\"" ?>>IPv6</option>
- </select>
- </td>
-</tr>
-<tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Source Address"); ?></td>
- <td width="78%" class="vtable">
- <select name="sourceip" class="formselect">
- <option value="">Any</option>
- <?php $sourceips = get_possible_traffic_source_addresses(true);
- foreach ($sourceips as $sipvalue => $sipname):
- $selected = "";
- if (!link_interface_to_bridge($sipvalue) && ($sipvalue == $sourceip)) {
- $selected = "selected=\"selected\"";
- }
+ <tr>
+ <td colspan="2" valign="top" class="listtopic"><?=gettext("Traceroute");?></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Host");?></td>
+ <td width="78%" class="vtable">
+ <?=$mandfldhtml;?><input name="host" type="text" class="formfld unknown" id="host" size="20" value="<?=htmlspecialchars($host);?>" />
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("IP Protocol"); ?></td>
+ <td width="78%" class="vtable">
+ <select name="ipproto" class="formselect">
+ <option value="ipv4" <?php if ($ipproto == "ipv4") echo "selected=\"selected\"" ?>>IPv4</option>
+ <option value="ipv6" <?php if ($ipproto == "ipv6") echo "selected=\"selected\"" ?>>IPv6</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Source Address"); ?></td>
+ <td width="78%" class="vtable">
+ <select name="sourceip" class="formselect">
+ <option value="">Any</option>
+ <?php $sourceips = get_possible_traffic_source_addresses(true);
+ foreach ($sourceips as $sipvalue => $sipname):
+ $selected = "";
+ if (!link_interface_to_bridge($sipvalue) && ($sipvalue == $sourceip)) {
+ $selected = "selected=\"selected\"";
+ }
+ ?>
+ <option value="<?=$sipvalue;?>" <?=$selected;?>>
+ <?=htmlspecialchars($sipname);?>
+ </option>
+ <?php endforeach; ?>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Maximum number of hops");?></td>
+ <td width="78%" class="vtable">
+ <select name="ttl" class="formfld" id="ttl">
+ <?php for ($i = 1; $i <= MAX_TTL; $i++): ?>
+ <option value="<?=$i;?>" <?php if ($i == $ttl) echo "selected=\"selected\""; ?>><?=$i;?></option>
+ <?php endfor; ?>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Reverse Address Lookup");?></td>
+ <td width="78%" class="vtable">
+ <input name="resolve" type="checkbox"<?php echo (!isset($resolve) ? "" : " checked=\"checked\""); ?> />
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Use ICMP");?></td>
+ <td width="78%" class="vtable">
+ <input name="useicmp" type="checkbox"<?php if ($_REQUEST['useicmp']) echo " checked=\"checked\""; ?> />
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Traceroute");?>" />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" colspan="2">
+ <span class="vexpl">
+ <span class="red"><b><?=gettext("Note: ");?></b></span>
+ <?=gettext("Traceroute may take a while to complete. You may hit the Stop button on your browser at any time to see the progress of failed traceroutes.");?>
+ <br /><br />
+ <?=gettext("Using a source interface/IP address that does not match selected type (IPv4, IPv6) will result in an error or empty output.");?>
+ </span>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" colspan="2">
+ <?php
+ if ($do_traceroute) {
+ echo "<font face=\"terminal\" size=\"2\">\n";
+ echo "<strong>" . gettext("Traceroute output:") . "</strong><br />\n";
+ ob_end_flush();
?>
- <option value="<?=$sipvalue;?>" <?=$selected;?>>
- <?=htmlspecialchars($sipname);?>
- </option>
- <?php endforeach; ?>
- </select>
- </td>
-</tr>
-<tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Maximum number of hops");?></td>
- <td width="78%" class="vtable">
- <select name="ttl" class="formfld" id="ttl">
- <?php for ($i = 1; $i <= MAX_TTL; $i++): ?>
- <option value="<?=$i;?>" <?php if ($i == $ttl) echo "selected=\"selected\""; ?>><?=$i;?></option>
- <?php endfor; ?>
- </select>
- </td>
-</tr>
-<tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Reverse Address Lookup");?></td>
- <td width="78%" class="vtable">
- <input name="resolve" type="checkbox"<?php echo (!isset($resolve) ? "" : " checked=\"checked\""); ?> />
- </td>
-</tr>
-<tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Use ICMP");?></td>
- <td width="78%" class="vtable">
- <input name="useicmp" type="checkbox"<?php if ($_REQUEST['useicmp']) echo " checked=\"checked\""; ?> />
- </td>
-</tr>
-<tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Traceroute");?>" />
- </td>
-</tr>
-<tr>
- <td valign="top" colspan="2">
- <span class="vexpl">
- <span class="red"><b><?=gettext("Note: ");?></b></span>
- <?=gettext("Traceroute may take a while to complete. You may hit the Stop button on your browser at any time to see the progress of failed traceroutes.");?>
- <br /><br />
- <?=gettext("Using a source interface/IP address that does not match selected type (IPv4, IPv6) will result in an error or empty output.");?>
- </span>
- </td>
-</tr>
-<tr>
- <td valign="top" colspan="2">
-<?php
-if ($do_traceroute) {
- echo "<font face=\"terminal\" size=\"2\">\n";
- echo "<strong>" . gettext("Traceroute output:") . "</strong><br />\n";
- ob_end_flush();
-?>
- <script type="text/javascript">
- //<![CDATA[
- window.onload=function() {
- document.getElementById("tracerouteCaptured").wrap='off';
- }
- //]]>
- </script>
-<?php
- echo "<textarea id=\"tracerouteCaptured\" style=\"width:98%\" name=\"code\" rows=\"15\" cols=\"66\" readonly=\"readonly\">";
- $useicmp = isset($_REQUEST['useicmp']) ? "-I" : "";
- $n = isset($resolve) ? "" : "-n";
-
- $command = "/usr/sbin/traceroute";
- if ($ipproto == "ipv6") {
- $command .= "6";
- $ifaddr = is_ipaddr($sourceip) ? $sourceip : get_interface_ipv6($sourceip);
- } else {
- $ifaddr = is_ipaddr($sourceip) ? $sourceip : get_interface_ip($sourceip);
- }
-
- if ($ifaddr && (is_ipaddr($host) || is_hostname($host))) {
- $srcip = "-s " . escapeshellarg($ifaddr);
- }
-
- $cmd = "{$command} {$n} {$srcip} -w 2 {$useicmp} -m " . escapeshellarg($ttl) . " " . escapeshellarg($host);
-
- //echo "Traceroute command: {$cmd}\n";
- system($cmd);
- echo "</textarea>&nbsp;</font>";
-} ?>
- </td>
-</tr>
+ <script type="text/javascript">
+ //<![CDATA[
+ window.onload=function() {
+ document.getElementById("tracerouteCaptured").wrap='off';
+ }
+ //]]>
+ </script>
+ <?php
+ echo "<textarea id=\"tracerouteCaptured\" style=\"width:98%\" name=\"code\" rows=\"15\" cols=\"66\" readonly=\"readonly\">";
+ $useicmp = isset($_REQUEST['useicmp']) ? "-I" : "";
+ $n = isset($resolve) ? "" : "-n";
+
+ $command = "/usr/sbin/traceroute";
+ if ($ipproto == "ipv6") {
+ $command .= "6";
+ $ifaddr = is_ipaddr($sourceip) ? $sourceip : get_interface_ipv6($sourceip);
+ } else {
+ $ifaddr = is_ipaddr($sourceip) ? $sourceip : get_interface_ip($sourceip);
+ }
+
+ if ($ifaddr && (is_ipaddr($host) || is_hostname($host))) {
+ $srcip = "-s " . escapeshellarg($ifaddr);
+ }
+
+ $cmd = "{$command} {$n} {$srcip} -w 2 {$useicmp} -m " . escapeshellarg($ttl) . " " . escapeshellarg($host);
+
+ //echo "Traceroute command: {$cmd}\n";
+ system($cmd);
+ echo "</textarea>&nbsp;</font>";
+ } ?>
+ </td>
+ </tr>
</table>
</form>
<?php include("fend.inc"); ?>
OpenPOWER on IntegriCloud