Skip to content

Instantly share code, notes, and snippets.

@swilson
Created December 11, 2017 17:13
Show Gist options
  • Save swilson/294d5b553e2bd574bb4788712613f70b to your computer and use it in GitHub Desktop.
Save swilson/294d5b553e2bd574bb4788712613f70b to your computer and use it in GitHub Desktop.
Netgear RAIDar query
import sys, select, socket, time
bufferSize = 1024 # whatever you need
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind(('', 0))
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
sock_recv = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock_recv.bind(('', 22081))
data = bytearray([0x00, 0x00, 0x07, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xA4, 0xA1, 0xEF, 0xB8, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00])
while True:
s.sendto(data, ('<broadcast>', 22081))
message, address = s.recvfrom(1024)
print 'message (%s) from : %s' % ( str(message), address[0])
time.sleep(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment