Project

General

Profile

Feature #4038 » diag_arp.php.diff

Josh Finlay, 01/22/2015 12:20 AM

View differences:

diag_arp.php 2015-01-22 16:19:25.000000000 +1000
65 65
	return $new;
66 66
}
67 67

  
68
if (isset($_GET["clear"])) {
69
	if ($_GET["clear"] == "true") {
70
		$out = "";
71
		$ret = exec("/usr/sbin/arp -d -a", &$out, $arpTableRetVal);
72
	}
73
}
74

  
68 75
// Define path to AWK
69 76
$awk = "/usr/bin/awk";
70 77

  
......
304 311

  
305 312
// Load MAC-Manufacturer table
306 313
$mac_man = load_mac_manufacturer_table();
314

  
315
if (isset($_GET["clear"])) {
316
	if ($_GET["clear"] == "true") {
317
		if ($arpTableRetVal == 0) { print "<h3>ARP Table has been cleared!</h3>"; }
318
		else { print "<h3>Unable to clear ARP Table.</h3>"; }
319
	}
320
}
321
		
307 322
?>
308 323
<table width="100%" border="0" cellpadding="0" cellspacing="0">
309 324
	<tr>
......
341 356
	<tr>
342 357
		<td><br/><?= gettext("NOTE: Local IPv6 peers use") ?> <a href="diag_ndp.php"><?= gettext("NDP") ?></a> <?= gettext("instead of ARP") ?>.</td>
343 358
	</tr>
359
	<tr>
360
		<td style="text-align: right"><br /><input class="formbtn" type="button" id="pfArpTblClearBtn" value="Clear ARP Table" /></td>
361
	</tr>
344 362
</table>
345 363

  
346 364
<?php include("fend.inc"); ?>
347 365

  
348 366
<script type="text/javascript">
349 367
	jQuery('#loading').html('');
368
	jQuery("#pfArpTblClearBtn").click(function() {
369
		if (confirm('Are you sure you want to clear the ARP table?')) {
370
			window.location.href = "diag_arp.php?clear=true";
371
		}
372
	});
350 373
</script>
(2-2/2)