X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=networking%2Farping.c;h=a4421edcba01570a952bdfdd54590276266c2c49;hb=a38f9faa9fa230eb3753381c4f626acf029379fb;hp=71690cf30de7acfc9e8fd99cfd76ec9e390c4425;hpb=b22bbfffec182997827b0a71eeb93ddafbde602c;p=oweals%2Fbusybox.git diff --git a/networking/arping.c b/networking/arping.c index 71690cf30..a4421edcb 100644 --- a/networking/arping.c +++ b/networking/arping.c @@ -1,13 +1,27 @@ /* vi: set sw=4 ts=4: */ /* - * arping.c - Ping hosts by ARP requests/replies + * Licensed under GPLv2 or later, see file LICENSE in this source tree. * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. - * - * Author: Alexey Kuznetsov + * Author: Alexey Kuznetsov * Busybox port: Nick Fedchik */ +//usage:#define arping_trivial_usage +//usage: "[-fqbDUA] [-c CNT] [-w TIMEOUT] [-I IFACE] [-s SRC_IP] DST_IP" +//usage:#define arping_full_usage "\n\n" +//usage: "Send ARP requests/replies\n" +//usage: "\n -f Quit on first ARP reply" +//usage: "\n -q Quiet" +//usage: "\n -b Keep broadcasting, don't go unicast" +//usage: "\n -D Duplicated address detection mode" +//usage: "\n -U Unsolicited ARP mode, update your neighbors" +//usage: "\n -A ARP answer mode, update your neighbors" +//usage: "\n -c N Stop after sending N ARP requests" +//usage: "\n -w TIMEOUT Time to wait for ARP reply, seconds" +//usage: "\n -I IFACE Interface to use (default eth0)" +//usage: "\n -s SRC_IP Sender IP address" +//usage: "\n DST_IP Target IP address" + #include #include #include @@ -45,7 +59,7 @@ struct globals { unsigned received; unsigned brd_recv; unsigned req_recv; -}; +} FIX_ALIASING; #define G (*(struct globals*)&bb_common_bufsiz1) #define src (G.src ) #define dst (G.dst ) @@ -237,7 +251,7 @@ static bool recv_pack(unsigned char *buf, int len, struct sockaddr_ll *FROM) } else { printf(" UNSOLICITED?\n"); } - fflush(stdout); + fflush_all(); } received++; if (FROM->sll_pkttype != PACKET_HOST)