From 005e69aa843f9ef0d4ef74da4db573fb61358e20 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 1 Aug 2015 00:45:40 +0200 Subject: arping - multiple improvements plus code style fixes --- config/arping/arping.xml | 112 ++++++++++++++++++++++++----------------------- 1 file changed, 57 insertions(+), 55 deletions(-) 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 @@ - - + . - 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. - */ -/* ========================================================================== */ - ]]> - - Describe your package here - Describe your package requirements here - Currently there are no FAQ items provided. + + 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. +*/ +/* ====================================================================================== */ + ]]> + arping - 2.6.0.2 + 1.2 Diagnostics: ARPing - ARPing + Run ARPing yes true /usr/local/pkg/arping.inc - Arping - Host to arp ping + ARPing + The arping utility sends ARP and/or ICMP requests to the specified host and displays the replies.
Diagnostics
- + /pkg_edit.php?xml=arping.xml&id=0>
- - - arping Settings - - - - /usr/local/pkg/ - 077 https://packages.pfsense.org/packages/config/arping/arping.inc - Host IP or MAC - hostip - Enter the host IP or MAC address to ARP ping + IP, Hostname or MAC + pinghost + Enter the hostname, IP or MAC address to ARPing. + input + true + + + Count + count + This is the number of ARP pings to send. input + (Defaults to 3.) + + + Interface + interface + Use the specified interface. + interfaces_selection + loopback - + - arping_package_php_command(); + arping_package_php_command();
-- cgit v1.2.3 From afce0dd00ae818bf3a5a887bc9571d0fa1983318 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 1 Aug 2015 00:53:11 +0200 Subject: arping.inc - multiple improvements plus code style fixes --- config/arping/arping.inc | 37 ++++++++++++++++++++----------------- 1 file 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 @@
"; + $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 "arping {$arping_options} output:

"; + system("/usr/local/sbin/arping {$arping_options}"); + echo "{$button}"; + } else { + echo "
ERROR: Invalid input. Supplied address must be a valid hostname, IP or MAC address.
"; + echo "{$button}"; + } exit; } - -function arping_package_resync() { -} - -?> \ No newline at end of file +?> -- cgit v1.2.3 From ecf77b9acc94fb6393a799112cb4d8c3b46c53d5 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 1 Aug 2015 00:54:23 +0200 Subject: Bump arping package version --- pkg_config.10.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg_config.10.xml b/pkg_config.10.xml index 480d4fef..c1bdcfac 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -739,7 +739,7 @@ Broadcasts a who-has ARP packet on the network and prints answers. http://www.habets.pp.se/synscan/programs.php?prog=arping Services - 1.1 + 1.2 Stable 2.2 https://packages.pfsense.org/packages/config/arping/arping.xml -- cgit v1.2.3