libUPnP 1.14.19
Data Structures | Macros | Enumerations | Functions | Variables
ssdp_server.c File Reference
#include "config.h"
#include "ssdplib.h"
#include "ThreadPool.h"
#include "httpparser.h"
#include "httpreadwrite.h"
#include "membuffer.h"
#include "miniserver.h"
#include "sock.h"
#include "upnpapi.h"
#include <stdio.h>
#include "posix_overwrites.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.
 
static UPNP_INLINE int valid_ssdp_msg (http_message_t *hmsg)
 Does some quick checking of the ssdp msg.
 
static UPNP_INLINE int start_event_handler (void *Data)
 Parses the message and dispatches it to a handler which handles the ssdp request msg.
 
static void ssdp_event_handler_thread (void *the_data)
 This function is a thread that handles SSDP requests.
 
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.
 
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.
 
int unique_service_name (char *cmd, SsdpEvent *Evt)
 Fills the fields of the event structure like DeviceType, Device UDN and Service Type.
 
enum SsdpSearchType ssdp_request_type1 (char *cmd)
 This function figures out the type of the SSDP search in the 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

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