On 6/20/05, Triode <[EMAIL PROTECTED]> wrote:
> Seems to me that some of the issue could be down to this - the specific way
> the magic packet is encapsulated and forwarded on the
> local network. Does anyone have acess to the source for the magic packet?
Here's the code I'm using. It's based on Net::Wake from CPAN.
- Jacob
use IO::Socket::INET;
use strict;
my $mac_addr='00:0d:87:af:eb:05';
my $port = 9;
my $sock = new IO::Socket::INET(Proto=>'udp') || return undef;
my $ip_addr = inet_aton('255.255.255.255');
my $sock_addr = sockaddr_in($port, $ip_addr);
$mac_addr =~ s/://g;
my $packet = pack('C6H*', 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, $mac_addr x 16);
setsockopt($sock, SOL_SOCKET, SO_BROADCAST, 1);
send($sock, $packet, 0, $sock_addr);
close ($sock);
_______________________________________________
Discuss mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/discuss