title: Python - socket.recvfrom() get entire IP/UDP packet?
body: <p>Is there a way to use <code>socket.recvfrom(buf)</code> to get all IP and UPD data?
  specifically, I want to know the udp header (source port, dest port, length, application data) as well as the ip specifics : what ip did it come from, what address was it sent to?</p>
  
  <p>Snippet:</p>
  
  <pre><code>addrinfo = socket.getaddrinfo(MULTICAST_ADDR, None)[0]
  sock = socket.socket(addrinfo[0], socket.SOCK_DGRAM)
  sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
  sock.bind(('', DEST_PORT))
  
  #Join Multicast grp.
  group = socket.inet_pton(addrinfo[0], addrinfo[4][0])
  mreq = group + struct.pack('@I', 0)
  sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_JOIN_GROUP, mreq)
  
  while True:
      udp_data,ip_sender = sock.recvfrom(4000)
      #Only returns udp data field and ip of sender
  </code></pre>
  
  <p>Im on windows, and using socket.SOCK_RAW hangs (?) Are there any work-arounds?</p>