Does anyone have suggestions on how to port Donald Becker's ether-wake.c
from Linux (ftp://cesdis.gsfc.nasa.gov/pub/linux/misc/ether-wake.c)?
It's a little utility to send a Magic Packet to wake a machine (i.e.,
Wake on LAN).

I think the trick is being able to specify the ethernet address from
userland. ether-wake.c uses Linux's socket type SOCK_PACKET. What's an
equivalent way to do this with FreeBSD?

Matt


        /* Note: PF_INET, SOCK_DGRAM, IPPROTO_UDP would allow
SIOCGIFHWADDR to
           work as non-root, but we need SOCK_PACKET to specify the
Ethernet
           destination address. */
        if ((s = socket(AF_INET, SOCK_PACKET, SOCK_PACKET)) < 0) {
                if (errno == EPERM)
                        fprintf(stderr, "ether-wake must run as
root\n");
                else
                        perror("ether-wake: socket");
                if (! debug)
                        return 2;


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to