Manage "Step 1: Discovery" of the UPnP+™ specification with SSDP. More...
#include <miniserver.hpp>
Include dependency graph for ssdp_common.hpp:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| struct | SsdpEvent |
| Structure to store the SSDP information. More... | |
| struct | ThreadData |
| thread data. More... | |
| struct | SsdpSearchReply |
| SSDP search reply. More... | |
| struct | SsdpSearchExpArg |
| SSDP search exp argument. More... | |
| struct | ssdp_thread_data |
| SSDP thread data. More... | |
Macros | |
| #define | RQST_TIMEOUT 20 |
| timeout | |
SSDP constants. | |
| #define | BUFSIZE (size_t)2500 |
| constant | |
| #define | SSDP_IP "239.255.255.250" |
| constant | |
| #define | SSDP_IPV6_LINKLOCAL "FF02::C" |
| constant | |
| #define | SSDP_IPV6_SITELOCAL "FF05::C" |
| constant | |
| #define | SSDP_PORT 1900 |
| constant | |
| #define | SSDP_PORT_STR "1900" |
| constant | |
| #define | NUM_TRY 3 |
| constant | |
| #define | THREAD_LIMIT 50 |
| constant | |
| #define | COMMAND_LEN 300 |
| constant | |
SSDP Error codes. | |
| #define | NO_ERROR_FOUND 0 |
| error code | |
| #define | E_REQUEST_INVALID -3 |
| error code | |
| #define | E_RES_EXPIRED -4 |
| error code | |
| #define | E_MEM_ALLOC -5 |
| error code | |
| #define | E_HTTP_SYNTEX -6 |
| error code | |
| #define | E_SOCKET -7 |
| error code | |
Typedefs | |
| typedef void(* | SsdpFunPtr) (SsdpEvent *) |
| Maybe a callback function? | |
| typedef int(* | ParserFun) (char *, SsdpEvent *) |
| Maybe a callback function? | |
Enumerations | |
| enum | SsdpSearchType { SSDP_SERROR = -1 , SSDP_ALL , SSDP_ROOTDEVICE , SSDP_DEVICEUDN , SSDP_DEVICETYPE , SSDP_SERVICE } |
| Enumeration to define all different types of ssdp searches. More... | |
Functions | |
| int | unique_service_name (char *cmd, SsdpEvent *Evt) |
| Fills the fields of the event structure like DeviceType, Device UDN and Service Type. | |
| SsdpSearchType | ssdp_request_type1 (char *cmd) |
| This function figures out the type of the SSDP search in the request. | |
| int | ssdp_request_type (char *cmd, SsdpEvent *Evt) |
| Starts filling the SSDP event structure based upon the request received. | |
| int | readFromSSDPSocket (SOCKET socket) |
| This function reads the data from the ssdp socket. | |
| int | get_ssdp_sockets (MiniServerSockArray *out) |
| Creates the IPv4 and IPv6 ssdp sockets required by the control point and device operation. | |
Variables | |
| constexpr size_t | ERROR_BUFFER_LEN {256} |
| Size of the errorBuffer variable, passed to the strerror_r() function. | |
| SOCKET | gSsdpReqSocket4 |
| If control point API is compiled in, this is the global IPv4 socket for it. | |
| SOCKET | gSsdpReqSocket6 |
| If control point API is compiled in, this is the global IPv6 socket for it. | |
Manage "Step 1: Discovery" of the UPnP+™ specification with SSDP.
Definition in file ssdp_common.hpp.
| struct SsdpEvent |
Structure to store the SSDP information.
Definition at line 102 of file ssdp_common.hpp.
| Class Members | ||
|---|---|---|
| enum SsdpSearchType | RequestType | Part of SSDP Event. |
| int | ErrCode | Part of SSDP Event. |
| int | MaxAge | Part of SSDP Event. |
| int | Mx | Part of SSDP Event. |
| char | UDN[LINE_SIZE] | Part of SSDP Event. |
| char | DeviceType[LINE_SIZE] | Part of SSDP Event. |
| char | ServiceType[LINE_SIZE] | Part of SSDP Event. |
| char | Location[LINE_SIZE] | Part of SSDP Event. |
| char | HostAddr[LINE_SIZE] | Part of SSDP Event. |
| char | Os[LINE_SIZE] | Part of SSDP Event. |
| char | Ext[LINE_SIZE] | Part of SSDP Event. |
| char | Date[LINE_SIZE] | Part of SSDP Event. |
| struct sockaddr * | DestAddr | Part of SSDP Event. |
| void * | Cookie | Part of SSDP Event. |
| struct ThreadData |
thread data.
Definition at line 127 of file ssdp_common.hpp.
| Class Members | ||
|---|---|---|
| int | Mx | part of thread data |
| void * | Cookie | part of thread data |
| char * | Data | part of thread data |
| struct sockaddr_storage | DestAddr | part of thread data |
| struct SsdpSearchReply |
SSDP search reply.
Definition at line 138 of file ssdp_common.hpp.
Collaboration diagram for SsdpSearchReply:| Class Members | ||
|---|---|---|
| int | MaxAge | part of search reply |
| UpnpDevice_Handle | handle | part of search reply |
| struct sockaddr_storage | dest_addr | part of search reply |
| SsdpEvent | event | part of search reply |
| struct SsdpSearchExpArg |
SSDP search exp argument.
Definition at line 149 of file ssdp_common.hpp.
| Class Members | ||
|---|---|---|
| int | handle | handle |
| int | timeoutEventId | timeout event id |
| struct ssdp_thread_data |
SSDP thread data.
Definition at line 155 of file ssdp_common.hpp.
Collaboration diagram for ssdp_thread_data:| Class Members | ||
|---|---|---|
| http_parser_t | parser | parser |
| sockaddr_storage | dest_addr | destination socket address |
| #define BUFSIZE (size_t)2500 |
constant
Definition at line 54 of file ssdp_common.hpp.
| #define SSDP_IP "239.255.255.250" |
constant
Definition at line 56 of file ssdp_common.hpp.
| #define SSDP_IPV6_LINKLOCAL "FF02::C" |
constant
Definition at line 58 of file ssdp_common.hpp.
| #define SSDP_IPV6_SITELOCAL "FF05::C" |
constant
Definition at line 60 of file ssdp_common.hpp.
| #define SSDP_PORT 1900 |
constant
Definition at line 62 of file ssdp_common.hpp.
| #define SSDP_PORT_STR "1900" |
constant
Definition at line 64 of file ssdp_common.hpp.
| #define NUM_TRY 3 |
constant
Definition at line 66 of file ssdp_common.hpp.
| #define THREAD_LIMIT 50 |
constant
Definition at line 68 of file ssdp_common.hpp.
| #define COMMAND_LEN 300 |
constant
Definition at line 70 of file ssdp_common.hpp.
| #define NO_ERROR_FOUND 0 |
error code
Definition at line 75 of file ssdp_common.hpp.
| #define E_REQUEST_INVALID -3 |
error code
Definition at line 77 of file ssdp_common.hpp.
| #define E_RES_EXPIRED -4 |
error code
Definition at line 79 of file ssdp_common.hpp.
| #define E_MEM_ALLOC -5 |
error code
Definition at line 81 of file ssdp_common.hpp.
| #define E_HTTP_SYNTEX -6 |
error code
Definition at line 83 of file ssdp_common.hpp.
| #define E_SOCKET -7 |
error code
Definition at line 85 of file ssdp_common.hpp.
| #define RQST_TIMEOUT 20 |
timeout
Definition at line 89 of file ssdp_common.hpp.
| typedef void(* SsdpFunPtr) (SsdpEvent *) |
Maybe a callback function?
Definition at line 124 of file ssdp_common.hpp.
| typedef int(* ParserFun) (char *, SsdpEvent *) |
Maybe a callback function?
Definition at line 170 of file ssdp_common.hpp.
| enum SsdpSearchType |
Enumeration to define all different types of ssdp searches.
| Enumerator | |
|---|---|
| SSDP_SERROR | Unknown search command. |
| SSDP_ALL | Part of SType. |
| SSDP_ROOTDEVICE | Part of SType. |
| SSDP_DEVICEUDN | Part of SType. |
| SSDP_DEVICETYPE | Part of SType. |
| SSDP_SERVICE | Part of SType. |
Definition at line 92 of file ssdp_common.hpp.
|
inlineconstexpr |
Size of the errorBuffer variable, passed to the strerror_r() function.
Definition at line 49 of file ssdp_common.hpp.
|
inline |
If control point API is compiled in, this is the global IPv4 socket for it.
Definition at line 164 of file ssdp_common.hpp.
|
inline |
If control point API is compiled in, this is the global IPv6 socket for it.
Definition at line 167 of file ssdp_common.hpp.