[ C Code and Tool ] Wake On LAN

Heres a simple Wake-on-LAN application for use in system administration.

wol_c

As the name implies it causes a correctly set-up computer to boot up remotely when instructed to do so.
This happens when the application sends a repetition of six 0xFF followed by 16 repetitions of the Targets MAC ADDRESS, represented here as AA:BB:CC:DD:EE:FF, and as is displayed in the final created packet below. The highlighted section of six 0xFF’s is known as the Magic Packet.

wol_c2

This packet is sent over UDP to the broadcast address of 255.255.255.255.

To quote wikipedia: “Wake-on-LAN support is implemented on the motherboard of a computer and the network interface (firmware), and is consequently not dependent on the operating system running on the hardware.”.

The code makes use of the winsock sendto function which enables a packet to be sent to a port/host which is not connected.

[ MSDN ] sendto function
[ .ZIP / .EXE  ] Executable files
[ .ZIP ] Project Files
[ .TXT  ] C Source Files

Advertisements

~ by Rhys Mossom on March 15, 2014.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: