Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/networking/ether-wake.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/ether-wake.c
r2725 r3232 50 50 * 51 51 * The author may be reached as becker@scyld, or C/O 52 * 53 * 54 * 52 * Scyld Computing Corporation 53 * 914 Bay Ridge Road, Suite 220 54 * Annapolis MD 21403 55 55 * 56 56 * Notes: … … 65 65 */ 66 66 67 67 //usage:#define ether_wake_trivial_usage 68 //usage: "[-b] [-i iface] [-p aa:bb:cc:dd[:ee:ff]] MAC" 69 //usage:#define ether_wake_full_usage "\n\n" 70 //usage: "Send a magic packet to wake up sleeping machines.\n" 71 //usage: "MAC must be a station address (00:11:22:33:44:55) or\n" 72 //usage: "a hostname with a known 'ethers' entry.\n" 73 //usage: "\n -b Send wake-up packet to the broadcast address" 74 //usage: "\n -i iface Interface to use (default eth0)" 75 //usage: "\n -p pass Append four or six byte password PW to the packet" 76 77 #include "libbb.h" 68 78 #include <netpacket/packet.h> 69 #include <net/ethernet.h>70 79 #include <netinet/ether.h> 71 80 #include <linux/if.h> 72 73 #include "libbb.h"74 81 75 82 /* Note: PF_INET, SOCK_DGRAM, IPPROTO_UDP would allow SIOCGIFHWADDR to … … 107 114 * IP address string 108 115 * MAC address string 109 */116 */ 110 117 static void get_dest_addr(const char *hostid, struct ether_addr *eaddr) 111 118 { … … 232 239 unsigned char *hwaddr = if_hwaddr.ifr_hwaddr.sa_data; 233 240 printf("The hardware address (SIOCGIFHWADDR) of %s is type %d " 234 235 236 241 "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n\n", ifname, 242 if_hwaddr.ifr_hwaddr.sa_family, hwaddr[0], hwaddr[1], 243 hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5]); 237 244 } 238 245 # endif
Note:
See TracChangeset
for help on using the changeset viewer.