From owner-freebsd-hackers Tue Jan 4 11:36:21 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from boromir.vpop.net (dns1.vpop.net [206.117.147.2]) by hub.freebsd.org (Postfix) with ESMTP id 4221414D66 for ; Tue, 4 Jan 2000 11:36:19 -0800 (PST) (envelope-from mreimer@vpop.net) Received: from vpop.net (bilbo.vpop.net [216.160.82.65]) by boromir.vpop.net (8.9.1/8.9.1) with ESMTP id LAA11236 for ; Tue, 4 Jan 2000 11:36:18 -0800 (PST) Message-ID: <38724BC2.767E9055@vpop.net> Date: Tue, 04 Jan 2000 11:36:34 -0800 From: Matthew Reimer Organization: VPOP Technologies, Inc. X-Mailer: Mozilla 4.7 [en] (X11; I; FreeBSD 3.4-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Subject: Porting ether-wake.c from Linux Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message