summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/diag_arp.php
diff options
context:
space:
mode:
authorstilez <stilez@users.noreply.github.com>2016-05-31 06:22:02 +0100
committerstilez <stilez@users.noreply.github.com>2016-05-31 06:22:02 +0100
commit6ea0d41e3c094a0977e7f0d022ec74276280b8ff (patch)
treef55ae4d2f3ebbf21145fd7a3239d00dbd5ea0445 /src/usr/local/www/diag_arp.php
parente5026472d7b24d8ef1d31412f323d90e4949545c (diff)
downloadpfsense-6ea0d41e3c094a0977e7f0d022ec74276280b8ff.zip
pfsense-6ea0d41e3c094a0977e7f0d022ec74276280b8ff.tar.gz
Add "delete entry" for ARP table
Useful function in some circumstances - seems no reason not to have it. Uses IP rather than hostname since not all ARP entries have hostnames. Probably should also have "delete all" but not done that.
Diffstat (limited to 'src/usr/local/www/diag_arp.php')
-rw-r--r--src/usr/local/www/diag_arp.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/usr/local/www/diag_arp.php b/src/usr/local/www/diag_arp.php
index 69bc740..f7bdff4 100644
--- a/src/usr/local/www/diag_arp.php
+++ b/src/usr/local/www/diag_arp.php
@@ -68,6 +68,23 @@
require("guiconfig.inc");
+// delete arp entry
+if (isset($_GET['deleteentry'])) {
+ $ip = $_GET['deleteentry'];
+ if (is_ipaddrv4($ip)) {
+ $ret = mwexec("arp -d " . $_GET['deleteentry'], true);
+ } else {
+ $ret = 1;
+ }
+ if ($ret) {
+ $savemsg = sprintf(gettext("%s is not a valid IPv4 address or could not be deleted."), $ip);
+ $savemsgtype = 'alert-warning';
+ } else {
+ $savemsg = sprintf(gettext("The ARP cache entry for %s has been deleted."), $ip);
+ $savemsgtype = 'success';
+ }
+}
+
function leasecmp($a, $b) {
return strcmp($a[$_GET['order']], $b[$_GET['order']]);
}
@@ -286,6 +303,10 @@ function _getHostName($mac, $ip) {
$pgtitle = array(gettext("Diagnostics"), gettext("ARP Table"));
include("head.inc");
+// Handle save msg if defined
+if ($savemsg) {
+ print_info_box(htmlentities($savemsg), $savemsgtype);
+}
?>
<!-- On modern hardware the table will load so fast you may never see this! -->
@@ -346,6 +367,7 @@ $mac_man = load_mac_manufacturer_table();
<th><?= gettext("IP address")?></th>
<th><?= gettext("MAC address")?></th>
<th><?= gettext("Hostname")?></th>
+ <th data-sortable="false"><?=gettext("Actions")?></th>
</tr>
</thead>
<tbody>
@@ -367,6 +389,9 @@ $mac_man = load_mac_manufacturer_table();
?>
</td>
<td><?=trim(str_replace("Z_ ", "", $entry['dnsresolve']))?></td>
+ <td>
+ <a class="fa fa-trash" title="<?=gettext('Delete arp cache entry')?>" href="diag_arp.php?deleteentry=<?=$entry['ip']?>"></a>
+ </td>
</tr>
<?php endforeach?>
</tbody>
OpenPOWER on IntegriCloud