Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/networking/arp.c


Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/networking/arp.c

    r2725 r3232  
    1414 */
    1515
     16//usage:#define arp_trivial_usage
     17//usage:     "\n[-vn]   [-H HWTYPE] [-i IF] -a [HOSTNAME]"
     18//usage:     "\n[-v]            [-i IF] -d HOSTNAME [pub]"
     19//usage:     "\n[-v]    [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [temp]"
     20//usage:     "\n[-v]    [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [netmask MASK] pub"
     21//usage:     "\n[-v]    [-H HWTYPE] [-i IF] -Ds HOSTNAME IFACE [netmask MASK] pub"
     22//usage:#define arp_full_usage "\n\n"
     23//usage:       "Manipulate ARP cache\n"
     24//usage:       "\n  -a      Display (all) hosts"
     25//usage:       "\n  -s      Set new ARP entry"
     26//usage:       "\n  -d      Delete a specified entry"
     27//usage:       "\n  -v      Verbose"
     28//usage:       "\n  -n      Don't resolve names"
     29//usage:       "\n  -i IF       Network interface"
     30//usage:       "\n  -D      Read <hwaddr> from given device"
     31//usage:       "\n  -A,-p AF    Protocol family"
     32//usage:       "\n  -H HWTYPE   Hardware address type"
     33
    1634#include "libbb.h"
    1735#include "inet_common.h"
     
    197215/* Get the hardware address to a specified interface name */
    198216static void arp_getdevhw(char *ifname, struct sockaddr *sa,
    199                          const struct hwtype *hwt)
     217                        const struct hwtype *hwt)
    200218{
    201219    struct ifreq ifr;
     
    216234        }
    217235        bb_error_msg("device '%s' has HW address %s '%s'",
    218                      ifname, xhw->name,
    219                      xhw->print((unsigned char *) &ifr.ifr_hwaddr.sa_data));
     236                    ifname, xhw->name,
     237                    xhw->print((unsigned char *) &ifr.ifr_hwaddr.sa_data));
    220238    }
    221239}
     
    328346static void
    329347arp_disp(const char *name, char *ip, int type, int arp_flags,
    330          char *hwa, char *mask, char *dev)
     348        char *hwa, char *mask, char *dev)
    331349{
    332350    static const int arp_masks[] = {
     
    411429         * because fgets above reads limited amount of data */
    412430        num = sscanf(line, "%s 0x%x 0x%x %s %s %s\n",
    413                      ip, &type, &flags, hwa, mask, dev);
     431                    ip, &type, &flags, hwa, mask, dev);
    414432        if (num < 4)
    415433            break;
     
    444462    if (option_mask32 & ARP_OPT_v)
    445463        printf("Entries: %d\tSkipped: %d\tFound: %d\n",
    446                entries, entries - shown, shown);
     464                entries, entries - shown, shown);
    447465
    448466    if (!shown) {
     
    500518    if (hw->alen <= 0) {
    501519        bb_error_msg_and_die("%s: %s without ARP support",
    502                              hw->name, "hardware type");
     520                hw->name, "hardware type");
    503521    }
    504522
Note: See TracChangeset for help on using the changeset viewer.