Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/networking/arp.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/networking/arp.c
r2725 r3232 14 14 */ 15 15 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 16 34 #include "libbb.h" 17 35 #include "inet_common.h" … … 197 215 /* Get the hardware address to a specified interface name */ 198 216 static void arp_getdevhw(char *ifname, struct sockaddr *sa, 199 217 const struct hwtype *hwt) 200 218 { 201 219 struct ifreq ifr; … … 216 234 } 217 235 bb_error_msg("device '%s' has HW address %s '%s'", 218 219 236 ifname, xhw->name, 237 xhw->print((unsigned char *) &ifr.ifr_hwaddr.sa_data)); 220 238 } 221 239 } … … 328 346 static void 329 347 arp_disp(const char *name, char *ip, int type, int arp_flags, 330 348 char *hwa, char *mask, char *dev) 331 349 { 332 350 static const int arp_masks[] = { … … 411 429 * because fgets above reads limited amount of data */ 412 430 num = sscanf(line, "%s 0x%x 0x%x %s %s %s\n", 413 431 ip, &type, &flags, hwa, mask, dev); 414 432 if (num < 4) 415 433 break; … … 444 462 if (option_mask32 & ARP_OPT_v) 445 463 printf("Entries: %d\tSkipped: %d\tFound: %d\n", 446 464 entries, entries - shown, shown); 447 465 448 466 if (!shown) { … … 500 518 if (hw->alen <= 0) { 501 519 bb_error_msg_and_die("%s: %s without ARP support", 502 520 hw->name, "hardware type"); 503 521 } 504 522
Note:
See TracChangeset
for help on using the changeset viewer.