README
1 * MiniSSDPd - SSDP daemon
2
3(c) Thomas Bernard
4http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
5https://github.com/miniupnp/miniupnp/
6
7MiniSSDPd is a daemon that :
81 - keeps track of all UPnP devices announcing themselves on the network.
9its database can be queried by local processes using a protocol based on
10a unix socket. That enables local processes to quickly discover UPnP devices
11without broadcasting SSDP message and waiting several seconds for a response.
122 - keeps a database of local UPnP devices hosted on the machine and
13answering SSDP searchs on their behalf. It enables to run several UPnP devices,
14like an IGD and a MediaServer, on the same machine.
15
16to build, use GNU Make.
17
18
19* protocol :
20
21Connect to the unix socket.
22Sent request, get response.
23close unix socket connection.
24
25* Request format :
261st byte : request type
27 0 - version
28 1 - type
29 2 - USN (unique id)
30 3 - everything
31 4 - submit service (see below)
32 5 - switch connection to notification mode
33n bytes : string length : 1 byte if < 128 else the upper bit indicate that
34one additional byte should be read, etc. (see codelength.h)
35n bytes = string
36
37Response format :
38
39request type 0 (version) :
40n bytes string length
41n bytes = version string
42
43request type 1 / 2 / 3 / 5 :
441st byte : number of services/devices, from 0 to 254.
45 255 is a special value, see below
46For each service/device :
47URL :
48 n bytes string length
49 n bytes = Location string
50ST:
51 n bytes string length
52 n bytes = type string
53USN:
54 n bytes string length
55 n bytes = identifier string
56
57if the 1st byte is 255, the format is as follows :
581st byte = 255
592nd byte = notification type (1=NEW, 2=UPDATE, 3=REMOVE)
603rd byte = number of services/devices, from 0 to 255.
61
62
63request type 4 = submit service
641st byte = 4
65(k,n) bytes : length and string "ST" (service type)
66(k,n) bytes : length and string "USN"
67(k,n) bytes : length and string "Server"
68(k,n) bytes : length and string "Location"
69No answer
70
71
README.fr
1protocole :
2
3connection à la socket unix.
4envoie d'une requete, retour d'une reponse.
5fermeture de la connexion.
6
7format de requete :
81 octet : type de la requete
9 0 - version
10 1 - type
11 2 - USN (id unique)
12 3 - tout
13n octets longueur de la chaine : 1 octet si < 128 sinon le bit haut
14indique s'il existe un octet suplementaire, etc...
15n octets = chaine
16
17format reponse :
181 octet : nombre de reponses (de 0 à 254)
19pour chaque rep :
20URL :
21 n octets longueur de la chaine
22 n octets = chaine Location
23ST:
24 n octets longueur de la chaine
25 n octets = chaine type
26USN:
27 n octets longueur de la chaine
28 n octets = chaine identifiant
29
30si le 1er octet est 255, alors le format est le suivant :
311 octet : 255
321 octet : type de notification
33 1 = NOTIF_NEW, 2 = NOTIF_NEW, 3 = NOTIF_REMOVE
341 octet : nombre de reponses (0 à 255)
35puis comme ci dessus pour chaque réponse
36
37
38
39* Type de requete 4 = submit service
401 octet = 4
41(k,n) octets : longueur et chaine "ST" (service type)
42(k,n) octets : longueur et chaine "USN"
43(k,n) octets : longueur et chaine "Server"
44(k,n) octets : longueur et chaine "Location"
45Pas de reponse
46
47* Type de requete 5 = mode notification
48Reste connecté et reçoit au fur et à mesure les nouvelles connections
49réponses au format normal
50