diff options
author | stilez <stilez@users.noreply.github.com> | 2016-05-31 06:22:02 +0100 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2016-06-22 11:17:26 -0400 |
commit | 17e3a05af3428372c20a83cbc36b2ce884d3f5e7 (patch) | |
tree | e157532d10f9a7a54bbebe9480958f9c6d217893 /src | |
parent | 74d0b334b0136b54e64bb12d93328894905293e7 (diff) | |
download | pfsense-17e3a05af3428372c20a83cbc36b2ce884d3f5e7.zip pfsense-17e3a05af3428372c20a83cbc36b2ce884d3f5e7.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.
(cherry picked from commit 6ea0d41e3c094a0977e7f0d022ec74276280b8ff)
Diffstat (limited to 'src')
-rw-r--r-- | src/usr/local/www/diag_arp.php | 25 |
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> |