aboutsummaryrefslogtreecommitdiffstats
path: root/config/arping
diff options
context:
space:
mode:
Diffstat (limited to 'config/arping')
-rw-r--r--config/arping/arping.inc37
-rw-r--r--config/arping/arping.xml112
2 files changed, 77 insertions, 72 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
+?>
diff --git a/config/arping/arping.xml b/config/arping/arping.xml
index c8ab9931..08389b2f 100644
--- a/config/arping/arping.xml
+++ b/config/arping/arping.xml
@@ -2,83 +2,85 @@
<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
- <copyright>
- <![CDATA[
+ <copyright>
+ <![CDATA[
/* $Id$ */
-/* ========================================================================== */
+/* ====================================================================================== */
/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
+ arping.xml
+ part of pfSense (https://www.pfSense.org/)
+ Copyright (C) 2009-2015 ESF, LLC
+ All rights reserved.
+*/
+/* ====================================================================================== */
/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+/* ====================================================================================== */
+ ]]>
+ </copyright>
<name>arping</name>
- <version>2.6.0.2</version>
+ <version>1.2</version>
<title>Diagnostics: ARPing</title>
- <savetext>ARPing</savetext>
+ <savetext>Run ARPing</savetext>
<preoutput>yes</preoutput>
<donotsave>true</donotsave>
<include_file>/usr/local/pkg/arping.inc</include_file>
<menu>
- <name>Arping</name>
- <tooltiptext>Host to arp ping</tooltiptext>
+ <name>ARPing</name>
+ <tooltiptext>The arping utility sends ARP and/or ICMP requests to the specified host and displays the replies.</tooltiptext>
<section>Diagnostics</section>
- <url><![CDATA[/pkg_edit.php?xml=arping.xml&id=0]]></url>
+ <url>/pkg_edit.php?xml=arping.xml&amp;id=0></url>
</menu>
- <tabs>
- <tab>
- <text>arping Settings</text>
- <url><![CDATA[/pkg_edit.php?xml=arping.xml&id=0]]></url>
- <active/>
- </tab>
- </tabs>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
<item>https://packages.pfsense.org/packages/config/arping/arping.inc</item>
</additional_files_needed>
<fields>
<field>
- <fielddescr>Host IP or MAC</fielddescr>
- <fieldname>hostip</fieldname>
- <description>Enter the host IP or MAC address to ARP ping</description>
+ <fielddescr>IP, Hostname or MAC</fielddescr>
+ <fieldname>pinghost</fieldname>
+ <description>Enter the hostname, IP or MAC address to ARPing.</description>
+ <type>input</type>
+ <required>true</required>
+ </field>
+ <field>
+ <fielddescr>Count</fielddescr>
+ <fieldname>count</fieldname>
+ <description>This is the number of ARP pings to send.</description>
<type>input</type>
+ <typehint>(Defaults to 3.)</typehint>
+ </field>
+ <field>
+ <fielddescr>Interface</fielddescr>
+ <fieldname>interface</fieldname>
+ <description>Use the specified interface.</description>
+ <type>interfaces_selection</type>
+ <hideinterfaceregex>loopback</hideinterfaceregex>
</field>
- </fields>
+ </fields>
<custom_add_php_command>
- arping_package_php_command();
+ arping_package_php_command();
</custom_add_php_command>
</packagegui>