English 中文(简体)
Detect WOL possibility
原标题:

I d like to detect if Wake On Lan is possible.

On my router (Tomato firmware) there is a table with info - when displays device "Active (In ARP)" - it s possible to turn this device by WOL (offline linux pc).

I wonder if it is achieved by router only function or I can do this in C# or C? Function SendArp can detect MAC adress and do "arping" but it is not what I would like to do.

问题回答

Your router can t detect if your computer (or any other network device) supports Wake-On-Lan. All your router can do is send out a WOL package and hoping that it will wake up.

If the calling device respects the packet and wakes up must be configured at the device itself and there exists nothing within the OSI layers 4 to 1 which can tell you if a device supports WOL.

If you like to send a WOL packet from your PC using C#, you find plenty examples by using your favourite search engine. Here is one example from Bart de Smet.

Update

The message "Active (In ARP)" doesn t mean that your router detected that it is possible to send a WOL packet. It just tells you that within the routers ARP cache currently is a matching entry for this IP or MAC address. Such a cache has every network device (also your pc). In Windows just open the command line and enter arp -a to see the cache of your windows machine. Here you ll get a list of the stored mac adresses for sending to an IP address. A black hat can try to manipulate this cache to redirect your ip communication. Further informations about this can be found at wikipedia.

So this message just tells you, that your router had recently an ip connection to this device. That s it. But it can t tell you if your device is currently able to handle a WOL packet (cause it is power connected or not).

You re probably best checking out http://msdn.microsoft.com/en-us/library/ff566341(VS.85).aspx

This will let you query boolean for power management and the device specific "wake enabled" state.

Given that it s WMI, you should be able to get to this remotely, but it does need a couple of registry keys set to expose the WMI class.

You get the info about whether a machine supports WOL from the BIOS.

If it is supported, make sure it s turned on. Many machines have the capability disabled by default.

To route WOL packets through the network you need to forward port 9 on the router to 255.255.255.255 (Brodcast-to-all) IP Address.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签