0

So I am using XBMC (a media center program) that has an Android app with a feature that allows you to send Wake on LAN "magic packets" to computers you have XBMC installed on. While this would be a great feature for me if I had a dedicated media PC that auto-ran XBMC on startup, I use it instead on my normal desktop PC.

What I would like to do is see if I can write a little listener script that would run on my PC that would listen for those magic packets sent over port 9 and just start the XBMC application.

Some of my friends say that you cannot listen on this port. The Google searches on "port 9", "wake on lan", and "simple TCP/IP" I've performed remain inconclusive as to weather or not this is possible.

Russell C
  • 1
  • 4

2 Answers2

1

With Python and pcap (winpcap and pypcap http://code.google.com/p/pypcap/). Not very nice but works for me.

import os, pcap

pc = pcap.pcap()

pc.setfilter('udp port 9 and (udp[8:4] == 0xFFFFFFFF and udp[12:2] == 0xFFFF)')

for ts, pkt in pc:
    os.system(r'"C:\Program Files (x86)\XBMC\xbmc.exe"')
benny
  • 11
  • 1
  • Wow! I really like this! I'll want to do a little more research on pcap to see how this all works. If the basic functionality is there, I'd like to expand on it. – Russell C Nov 11 '11 at 14:39
0

You should be able to do this on a Windows PC. However your program will not run on a *Nix style system without having superuser, or using a privilege escalator program like jsvc.

Perception
  • 79,279
  • 19
  • 185
  • 195
  • Awesome! Do you have any references on this? I suppose I should have also stipulated that I am interested in knowing *how* to do this and not just if it is possible. – Russell C Oct 31 '11 at 19:00