1#if defined(COMPA_HAVE_CTRLPT_SSDP) || defined(COMPA_HAVE_DEVICE_SSDP)
3#ifndef COMPA_SSDP_COMMON_HPP
4#define COMPA_SSDP_COMMON_HPP
54#define BUFSIZE (size_t)2500
56#define SSDP_IP "239.255.255.250"
58#define SSDP_IPV6_LINKLOCAL "FF02::C"
60#define SSDP_IPV6_SITELOCAL "FF05::C"
66#define THREAD_LIMIT 50
68#define COMMAND_LEN 300
73#define NO_ERROR_FOUND 0
75#define E_REQUEST_INVALID -3
77#define E_RES_EXPIRED -4
81#define E_HTTP_SYNTEX -6
87#define RQST_TIMEOUT 20
163#ifdef UPNP_ENABLE_IPV6
int UpnpDevice_Handle
Returned when a device application registers with UpnpRegisterRootDevice(),UpnpRegisterRootDevice2(),...
Structure of an HTTP parser object.
int ssdp_request_type(char *cmd, SsdpEvent *Evt)
Starts filling the SSDP event structure based upon the request received.
int get_ssdp_sockets(MiniServerSockArray *out)
Creates the IPv4 and IPv6 ssdp sockets required by the control point and device operation.
SsdpSearchType ssdp_request_type1(char *cmd)
This function figures out the type of the SSDP search in the request.
int unique_service_name(char *cmd, SsdpEvent *Evt)
Fills the fields of the event structure like DeviceType, Device UDN and Service Type.
int readFromSSDPSocket(SOCKET socket)
This function reads the data from the ssdp socket.
Manage "Step 0: Addressing" of the UPnP+™ specification.
Provides sockets for all network communications.
struct sockaddr * DestAddr
Part of SSDP Event.
struct sockaddr_storage DestAddr
part of thread data
sockaddr_storage dest_addr
destination socket address
struct sockaddr_storage dest_addr
part of search reply
int MaxAge
Part of SSDP Event.
char UDN[LINE_SIZE]
Part of SSDP Event.
int Mx
Part of SSDP Event.
char Ext[LINE_SIZE]
Part of SSDP Event.
char HostAddr[LINE_SIZE]
Part of SSDP Event.
constexpr size_t ERROR_BUFFER_LEN
Size of the errorBuffer variable, passed to the strerror_r() function.
UpnpDevice_Handle handle
part of search reply
char ServiceType[LINE_SIZE]
Part of SSDP Event.
int Mx
part of thread data
int timeoutEventId
timeout event id
int ErrCode
Part of SSDP Event.
char DeviceType[LINE_SIZE]
Part of SSDP Event.
int(* ParserFun)(char *, SsdpEvent *)
Maybe a callback function?
int MaxAge
part of search reply
http_parser_t parser
parser
SOCKET gSsdpReqSocket6
If control point API is compiled in, this is the global IPv6 socket for it.
void(* SsdpFunPtr)(SsdpEvent *)
Maybe a callback function?
void * Cookie
part of thread data
char Os[LINE_SIZE]
Part of SSDP Event.
enum SsdpSearchType RequestType
Part of SSDP Event.
char Date[LINE_SIZE]
Part of SSDP Event.
char * Data
part of thread data
SsdpEvent event
part of search reply
SOCKET gSsdpReqSocket4
If control point API is compiled in, this is the global IPv4 socket for it.
void * Cookie
Part of SSDP Event.
char Location[LINE_SIZE]
Part of SSDP Event.
SsdpSearchType
Enumeration to define all different types of ssdp searches.
@ SSDP_SERROR
Unknown search command.
@ SSDP_DEVICEUDN
Part of SType.
@ SSDP_DEVICETYPE
Part of SType.
@ SSDP_ROOTDEVICE
Part of SType.
@ SSDP_SERVICE
Part of SType.
Structure to store the SSDP information.
SSDP search exp argument.