Jump to content
Sign in to follow this  
GtaSpider

Mutlicast Datagram

Recommended Posts

GtaSpider

Hi there,

I try to find a Mediabox (B1080 PX-3) in my local network. There is a program (called "Pop-Center") which can easily find the MAC and the IP Address of the Box by sending two strings via UDP on IP 221.1.1.1 at port 5555. Then it tooks some seconds and then the mediabox send its MAC address back to the Pop-Center. On Wireshark it looks like this (In the Attachement is the full Wireshark file):

post-11687-0-20320000-1305211661_thumb.j

Now i tried to do the same, when i take a look at Wireshark, exactly the same happens. UDP -> two String on 225.1.1.1 -> some secs -> Mediabox send the MAC. But I dont receive anything in my AutoIt script. It seems like, that IBM using a similar method to find their Boxes in the LAN. I found this URL, but I can't translate it completly in AutoIt.

http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/index.jsp?topic=/rzab6/x1multicast.htm

Here is what i got sofar:

;this are the two strings
$b01 = Binary("0x5365617263685f47726f75703a300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
$b02 = Binary("0x506f705f5365727665723a3139322e3136382e302e32000000000000000000000000000000000000000000000000000000000000000000000000000000000000")

;strings -> console
ConsoleWrite(BinaryToString($b01))
ConsoleWrite(@CRLF)
ConsoleWrite(BinaryToString($b02))
ConsoleWrite(@CRLF)


UDPStartup()
OnAutoItExitRegister("cleanup")
;Connecting to 225.1.1.1:5555
$hUPDopen = UDPOpen("225.1.1.1", 5555)
If @error Then Exit MsgBox(16, "", "")

;Bind a socket on my ip (192.168.0.2)
;im not sure if i need this!
$hUPDbind = UDPBind(@IPAddress1, 5555)
If @error Then Exit MsgBox(16, "", "")
;sending the two strings
ConsoleWrite("Send: " & UDPSend($hUPDopen, $b01) & "/" & BinaryLen($b01) & @CRLF)
ConsoleWrite("Send: " & UDPSend($hUPDopen, $b02) & "/" & BinaryLen($b02) & @CRLF)

While 1
    ;wait for recv... endless...
    $data = UDPRecv($hUPDopen, 50)
    If @error Then ConsoleWrite("Err: " & @error & @CRLF)
    $data &= UDPRecv($hUPDbind, 50)
    If @error Then ConsoleWrite("Err2: " & @error & @CRLF)
    If $data <> "" Then MsgBox(0, "", $data)
    Sleep(200)
WEnd



Func cleanup()
    UDPCloseSocket($hUPDopen)
    UDPCloseSocket($hUPDbind)
    UDPShutdown()
EndFunc   ;==>Cleanup

Any Ideas? Thank you for reading :unsure:

Greetz,

Spider

w01.zip


www.AutoIt.de - Moderator of theĀ German AutoIt Froum

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.