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/ether-wake.c

    r2725 r3232  
    5050 *
    5151 *  The author may be reached as becker@scyld, or C/O
    52  *   Scyld Computing Corporation
    53  *   914 Bay Ridge Road, Suite 220
    54  *   Annapolis MD 21403
     52 *  Scyld Computing Corporation
     53 *  914 Bay Ridge Road, Suite 220
     54 *  Annapolis MD 21403
    5555 *
    5656 *   Notes:
     
    6565*/
    6666
    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"
    6878#include <netpacket/packet.h>
    69 #include <net/ethernet.h>
    7079#include <netinet/ether.h>
    7180#include <linux/if.h>
    72 
    73 #include "libbb.h"
    7481
    7582/* Note: PF_INET, SOCK_DGRAM, IPPROTO_UDP would allow SIOCGIFHWADDR to
     
    107114 *    IP address string
    108115 *    MAC address string
    109 */
     116 */
    110117static void get_dest_addr(const char *hostid, struct ether_addr *eaddr)
    111118{
     
    232239            unsigned char *hwaddr = if_hwaddr.ifr_hwaddr.sa_data;
    233240            printf("The hardware address (SIOCGIFHWADDR) of %s is type %d  "
    234                    "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n\n", ifname,
    235                    if_hwaddr.ifr_hwaddr.sa_family, hwaddr[0], hwaddr[1],
    236                    hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5]);
     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]);
    237244        }
    238245# endif
Note: See TracChangeset for help on using the changeset viewer.