aboutsummaryrefslogtreecommitdiffstats
path: root/config/arping/arping.inc
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-08-03 09:07:15 -0300
committerRenato Botelho <renato@netgate.com>2015-08-03 09:07:15 -0300
commita4ebb57930ccfd79993cf2e2949fde97eb760a3d (patch)
tree09a32ad944b24398d7aa0dbada5b4bcf2d675cc1 /config/arping/arping.inc
parente2957d644dabb146de90c19c710d9420a30d6778 (diff)
parentecf77b9acc94fb6393a799112cb4d8c3b46c53d5 (diff)
downloadpfsense-packages-a4ebb57930ccfd79993cf2e2949fde97eb760a3d.tar.gz
pfsense-packages-a4ebb57930ccfd79993cf2e2949fde97eb760a3d.tar.bz2
pfsense-packages-a4ebb57930ccfd79993cf2e2949fde97eb760a3d.zip
Merge pull request #920 from doktornotor/patch-9
Diffstat (limited to 'config/arping/arping.inc')
-rw-r--r--config/arping/arping.inc37
1 files changed, 20 insertions, 17 deletions
diff --git a/config/arping/arping.inc b/config/arping/arping.inc
index 0054adf0..996fddf3 100644
--- a/config/arping/arping.inc
+++ b/config/arping/arping.inc
@@ -1,9 +1,9 @@
<?php
-/* $Id$ */
/*
arping.inc
+ part of pfSense (https://www.pfSense.org/)
Copyright (C) 2006 Scott Ullrich
- part of pfSense
+ Copyright (C) 2009-2015 ESF, LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -28,22 +28,25 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-function arping_deinstall() {
-}
-
-function arping_package_reinstall() {
-}
-
function arping_package_php_command() {
require_once("util.inc");
- if (is_ipaddr($_POST['hostip']) || is_hostname($_POST['hostip']) || is_macaddr($_POST['hostip']))
- system("arping -c3 " . escapeshellarg($_POST['hostip']));
- else
- echo "Invalid input. Supplied address must be a valid IP or MAC address.";
+
+ $button = "<br /><br /><input class=\"formbtn\" type=\"button\" value=\"Back to ARPing\" onclick=\"history.back()\" />";
+ $int_count = (is_numeric($_POST['count']) ? (abs(intval($_POST['count']))) : 3);
+ $arping_options = " -v -c {$int_count}";
+ if (!empty($_POST['interface'])) {
+ $iface = convert_friendly_interface_to_real_interface_name($_POST['interface']);
+ $arping_options .= " -i {$iface}";
+ }
+ if (is_ipaddr($_POST['pinghost']) || is_hostname($_POST['pinghost']) || is_macaddr($_POST['pinghost'])) {
+ $arping_options .= " " . $_POST['pinghost'];
+ echo "<strong>arping {$arping_options} output:</strong><br /><br />";
+ system("/usr/local/sbin/arping {$arping_options}");
+ echo "{$button}";
+ } else {
+ echo "<div class=\"errmsg\">ERROR: Invalid input. Supplied address must be a valid hostname, IP or MAC address.</div>";
+ echo "{$button}";
+ }
exit;
}
-
-function arping_package_resync() {
-}
-
-?> \ No newline at end of file
+?>