You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.0 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. * MiniSSDPd - SSDP daemon
  2. (c) Thomas Bernard
  3. http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
  4. https://github.com/miniupnp/miniupnp/
  5. MiniSSDPd is a daemon that :
  6. 1 - keeps track of all UPnP devices announcing themselves on the network.
  7. its database can be queried by local processes using a protocol based on
  8. a unix socket. That enables local processes to quickly discover UPnP devices
  9. without broadcasting SSDP message and waiting several seconds for a response.
  10. 2 - keeps a database of local UPnP devices hosted on the machine and
  11. answering SSDP searchs on their behalf. It enables to run several UPnP devices,
  12. like an IGD and a MediaServer, on the same machine.
  13. to build, use GNU Make.
  14. * protocol :
  15. Connect to the unix socket.
  16. Sent request, get response.
  17. close unix socket connection.
  18. * Request format :
  19. 1st byte : request type
  20. 0 - version
  21. 1 - type
  22. 2 - USN (unique id)
  23. 3 - everything
  24. 4 - submit service (see below)
  25. 5 - switch connection to notification mode
  26. n bytes : string length : 1 byte if < 128 else the upper bit indicate that
  27. one additional byte should be read, etc. (see codelength.h)
  28. n bytes = string
  29. Response format :
  30. request type 0 (version) :
  31. n bytes string length
  32. n bytes = version string
  33. request type 1 / 2 / 3 / 5 :
  34. 1st byte : number of services/devices, from 0 to 254.
  35. 255 is a special value, see below
  36. For each service/device :
  37. URL :
  38. n bytes string length
  39. n bytes = Location string
  40. ST:
  41. n bytes string length
  42. n bytes = type string
  43. USN:
  44. n bytes string length
  45. n bytes = identifier string
  46. if the 1st byte is 255, the format is as follows :
  47. 1st byte = 255
  48. 2nd byte = notification type (1=NEW, 2=UPDATE, 3=REMOVE)
  49. 3rd byte = number of services/devices, from 0 to 255.
  50. request type 4 = submit service
  51. 1st byte = 4
  52. (k,n) bytes : length and string "ST" (service type)
  53. (k,n) bytes : length and string "USN"
  54. (k,n) bytes : length and string "Server"
  55. (k,n) bytes : length and string "Location"
  56. No answer