Mirror of git://git.busybox.net/busybox with our patches on top
Source
/* vi: set sw=4 ts=4: */
/*
* arp.c - Manipulate the system ARP cache
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* Author: Fred N. van Kempen, <waltje at uwalt.nl.mugnet.org>
* Busybox port: Paul van Gool <pvangool at mimotech.com>
*
* modified for getopt32 by Arne Bernin <arne [at] alamut.de>
*/
//usage:#define arp_trivial_usage
//usage: "\n[-vn] [-H HWTYPE] [-i IF] -a [HOSTNAME]"
//usage: "\n[-v] [-i IF] -d HOSTNAME [pub]"
//usage: "\n[-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [temp]"
//usage: "\n[-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [netmask MASK] pub"
//usage: "\n[-v] [-H HWTYPE] [-i IF] -Ds HOSTNAME IFACE [netmask MASK] pub"
//usage:#define arp_full_usage "\n\n"
//usage: "Manipulate ARP cache\n"
//usage: "\n -a Display (all) hosts"
//usage: "\n -s Set new ARP entry"
//usage: "\n -d Delete a specified entry"
//usage: "\n -v Verbose"
//usage: "\n -n Don't resolve names"
//usage: "\n -i IF Network interface"
//usage: "\n -D Read <hwaddr> from given device"
//usage: "\n -A,-p AF Protocol family"
//usage: "\n -H HWTYPE Hardware address type"
enum {
ARP_OPT_A = (1 << 0),
ARP_OPT_p = (1 << 1),
ARP_OPT_H = (1 << 2),
ARP_OPT_t = (1 << 3),
ARP_OPT_i = (1 << 4),
ARP_OPT_a = (1 << 5),
ARP_OPT_d = (1 << 6),
ARP_OPT_n = (1 << 7), /* do not resolve addresses */
ARP_OPT_D = (1 << 8), /* HW-address is devicename */
ARP_OPT_s = (1 << 9),
ARP_OPT_v = (1 << 10) * DEBUG, /* debugging output flag */
};
enum {
sockfd = 3, /* active socket descriptor */