ssdp_server.c File Reference
SSDP Library
`#include <sys/param.h>`
`#include "config.h"`
`#include "ssdplib.h"`
`#include "httpparser.h"`
`#include "httpreadwrite.h"`
`#include "membuffer.h"`
`#include "miniserver.h"`
`#include "sock.h"`
`#include "ThreadPool.h"`
`#include "upnpapi.h"`
`#include <stdio.h>`
Include dependency graph for ssdp_server.c:

## Data Structures

struct | SSDPSockArray

## Macros

#define | MAX_TIME_TOREAD 45

## Enumerations

enum | Listener { Idle, Stopping, Running }

## Functions

void | RequestHandler ()
static void | free_ssdp_event_handler_data (void *the_data)
| Frees the ssdp request. More...
static UPNP_INLINE int | valid_ssdp_msg (http_message_t *hmsg)
| Does some quick checking of the ssdp msg. More...
static UPNP_INLINE int | start_event_handler (void *Data)
| Parses the message and dispatches it to a handler which handles the ssdp request msg. More...
static void | ssdp_event_handler_thread (void *the_data)
| This function is a thread that handles SSDP requests. More...
static int | create_ssdp_sock_v4 (SOCKET *ssdpSock)
static int | create_ssdp_sock_reqv4 (SOCKET *ssdpReqSock)
| Creates the SSDP IPv4 socket to be used by the control point. More...
SSDP Server Functions
int | AdvertiseAndReply (int AdFlag, UpnpDevice_Handle Hnd, enum SsdpSearchType SearchType, struct sockaddr *DestAddr, char *DeviceType, char *DeviceUDN, char *ServiceType, int Exp)
| Sends SSDP advertisements, replies and shutdown messages. More...
int | unique_service_name (char *cmd, SsdpEvent *Evt)
| Fills the fields of the event structure like DeviceType, Device UDN and Service Type. More...
enum SsdpSearchType | ssdp_request_type1 (char *cmd)
| This function figures out the type of the SSDP search in the in the request. More...
int | ssdp_request_type (char *cmd, SsdpEvent *Evt)
| Starts filling the SSDP event structure based upon the request received. More...
void | readFromSSDPSocket (SOCKET socket)
| This function reads the data from the ssdp socket. More...
int | get_ssdp_sockets (MiniServerSockArray *out)
| Creates the IPv4 and IPv6 ssdp sockets required by the control point and device operation. More...

## Variables

SOCKET | gSsdpReqSocket4 = INVALID_SOCKET
static const char | SERVICELIST_STR [] = "serviceList"