libUPnP 22.2.1
ssdp_ctrlpt.c File Reference
#include "Callback.h"
#include "LinkedList.h"
#include "TimerThread.h"
#include "UpnpDiscovery.h"
#include "UpnpString.h"
#include "config.h"
#include "ithread.h"
#include "membuffer.h"
#include "upnp.h"
#include "upnpdebug.h"
#include "upnpdebug_internal.h"
#include "upnputil.h"
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <poll.h>
#include "SSDPResultData.h"
#include "SSDPResultDataCallback.h"
#include "ThreadPool.h"
#include "UpnpInet.h"
#include "httpparser.h"
#include "ssdplib.h"
#include "statcodes.h"
#include "upnpapi.h"
#include <stdio.h>
#include "posix_overwrites.h"
Include dependency graph for ssdp_ctrlpt.c:

Data Structures

struct  SearchResultJob
struct  search_cb

Macros

#define _poll(fds, nfds, timeout)

Typedefs

typedef struct search_cb SearchCallback

Functions

static void free_search_result (void *arg)
static void send_search_result (void *arg)
 Sends a callback to the control point application with a SEARCH result, unless the search ended or the client unregistered after the result was queued.
static int CreateClientRequestPacket (char *RqstBuf, size_t RqstBufSize, int Mx, char *SearchTarget, int AddressFamily)
 Creates a HTTP search request packet depending on the input parameter.
static void searchExpired (void *arg)
SSDP Control Point Functions
void ssdp_wait_search_callbacks (int handle, int searchId)
 Waits until no search result callback of the given search is running. Returns at once when called from such a callback. The caller must not hold the handle lock.
void ssdp_handle_ctrlpt_msg (http_message_t *hmsg, struct sockaddr_storage *dest_addr, int timeout)
 This function handles the ssdp messages from the devices. These messages includes the search replies, advertisement of device coming alive and bye byes.
int SearchByTarget (int Hnd, int Mx, char *St, void *Cookie)
 Creates and send the search request for a specific URL.

Variables

static ithread_mutex_t gSearchCbMutex = PTHREAD_MUTEX_INITIALIZER
static ithread_cond_t gSearchCbCond = PTHREAD_COND_INITIALIZER
static SearchCallback * gSearchCbs = NULL