Go to the documentation of this file.
65 int maxFreeListLength;
85 int maxFreeListLength);
EXPORT_SPEC const char * ixmlNode_getNodeName(IXML_Node *nodeptr)
Returns the name of the Node, depending on what type of Node it is, in a read-only string.
Definition: node.c:122
SOCKET ssdpReqSock6
Definition: miniserver.h:70
Definition: miniserver.h:45
static UPNP_INLINE int start_event_handler(void *Data)
Parses the message and dispatches it to a handler which handles the ssdp request msg.
Definition: ssdp_server.c:628
int DeviceShutdown(char *DevType, int RootDev, char *Udn, char *Location, int Duration, int AddressFamily, int PowerState, int SleepPeriod, int RegistrationState)
Creates a HTTP device shutdown request packet and send it to the multicast channel through RequestHan...
Definition: ssdp_device.c:834
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.
Definition: ssdp_server.c:92
int ServiceReply(struct sockaddr *DestAddr, char *ServType, char *Udn, char *Location, int Duration, int PowerState, int SleepPeriod, int RegistrationState)
Creates the advertisement packet based on the input parameter, and send it to the multicast channel.
Definition: ssdp_device.c:757
http_method_t request_method
Definition: httpparser.h:186
EXPORT_SPEC void ixmlNodeList_free(IXML_NodeList *nList)
Frees a NodeList object.
Definition: nodeList.c:143
#define UPNP_E_SOCKET_BIND
The SDK had a problem binding a socket to a network interface.
Definition: upnp.h:267
int membuffer_set_size(membuffer *m, size_t new_length)
Increases or decreases buffer cap so that at least 'new_length' bytes can be stored.
Definition: membuffer.c:104
EXPORT_SPEC IXML_Node * ixmlNode_getFirstChild(IXML_Node *nodeptr)
Retrieves the first child Node of a Node.
Definition: node.c:307
Upnp_Handle_Type GetHandleInfo(UpnpClient_Handle Hnd, struct Handle_Info **HndInfo)
Get handle information.
Definition: upnpapi.c:3855
int ServiceAdvertisement(char *Udn, char *ServType, char *Location, int Duration, int AddressFamily, int PowerState, int SleepPeriod, int RegistrationState)
Creates the advertisement packet based on the input parameter, and send it to the multicast channel.
Definition: ssdp_device.c:706
char LowerDescURL[LINE_SIZE]
Definition: upnpapi.h:88
int FreeListDestroy(FreeList *free_list)
Releases the resources stored with the free list.
Definition: FreeList.c:92
int get_ssdp_sockets(MiniServerSockArray *out)
Creates the IPv4 and IPv6 ssdp sockets required by the control point and device operation.
Definition: ssdp_server.c:1165
SOCKET ssdpSock4
Definition: miniserver.h:53
Definition: httpparser.h:213
int unique_service_name(char *cmd, SsdpEvent *Evt)
Fills the fields of the event structure like DeviceType, Device UDN and Service Type.
Definition: ssdp_server.c:447
EXPORT_SPEC const char * ixmlNode_getNodeValue(IXML_Node *nodeptr)
Returns the value of the Node as a string.
Definition: node.c:253
char * buf
Definition: membuffer.h:58
#define UPNP_E_OUTOF_SOCKET
The SDK cannot create any more sockets.
Definition: upnp.h:287
#define UpnpCloseSocket
Definition: UpnpInet.h:57
int ServiceShutdown(char *Udn, char *ServType, char *Location, int Duration, int AddressFamily, int PowerState, int SleepPeriod, int RegistrationState)
Creates a HTTP service shutdown request packet and sends it to the multicast channel through RequestH...
Definition: ssdp_device.c:783
int memptr_cmp(memptr *m, const char *s)
Compares characters of strings passed for number of bytes. If equal for the number of bytes,...
Definition: membuffer.c:63
Definition: ssdplib.h:158
int TPJobSetPriority(ThreadPoolJob *job, ThreadPriority priority)
Sets the max threads for the thread pool attributes.
Definition: ThreadPool.c:1083
Definition: membuffer.h:47
enum SsdpSearchType ssdp_request_type1(char *cmd)
This function figures out the type of the SSDP search in the in the request.
Definition: ssdp_server.c:533
uri_type uri
Definition: httpparser.h:184
SsdpSearchType
Definition: ssdplib.h:66
static int create_ssdp_sock_reqv4(SOCKET *ssdpReqSock)
Creates the SSDP IPv4 socket to be used by the control point.
Definition: ssdp_server.c:895
#define UPNP_E_SUCCESS
The operation completed successfully.
Definition: upnp.h:97
#define UPNP_INLINE
Declares an inline function.
Definition: UpnpGlobal.h:99
static int create_ssdp_sock_v4(SOCKET *ssdpSock)
Definition: ssdp_server.c:782
int SendReply(struct sockaddr *DestAddr, char *DevType, int RootDev, char *Udn, char *Location, int Duration, int ByType, int PowerState, int SleepPeriod, int RegistrationState)
Creates the reply packet based on the input parameter, and send it to the client addesss given in its...
Definition: ssdp_device.c:579
int DeviceAf
Definition: upnpapi.h:112
char gIF_IPV6[INET6_ADDRSTRLEN]
Definition: upnpapi.c:143
SOCKET ssdpReqSock4
Definition: miniserver.h:67
#define UPNP_E_SOCKET_ERROR
Generic socket error code for conditions not covered by other error codes.
Definition: upnp.h:311
int sock_make_no_blocking(SOCKET sock)
Make socket non-blocking.
Definition: sock.c:294
@ SSDP_SERROR
Definition: ssdplib.h:68
#define INVALID_SOCKET
Definition: UpnpInet.h:51
parse_status_t
Definition: httpparser.h:151
void * FreeListAlloc(FreeList *free_list)
Allocates chunk of set size.
Definition: FreeList.c:51
Definition: ssdplib.h:107
int SOCKET
Definition: UpnpInet.h:48
Definition: ThreadPool.h:164
SOCKET ssdpSock
Definition: ssdp_server.c:82
EXPORT_SPEC IXML_Node * ixmlNodeList_item(IXML_NodeList *nList, unsigned long index)
Retrieves a Node from a NodeList specified by a numerical index.
Definition: nodeList.c:54
Data structure common to all types of nodes.
Definition: ixml.h:173
#define UPNP_E_INVALID_HANDLE
The handle passed to a function is not a recognized as a valid handle.
Definition: upnp.h:102
struct FREELISTNODE FreeListNode
int DeviceReply(struct sockaddr *DestAddr, char *DevType, int RootDev, char *Udn, char *Location, int Duration, int PowerState, int SleepPeriod, int RegistrationState)
Creates the reply packet based on the input parameter, and send it to the client address given in its...
Definition: ssdp_device.c:643
#define TRUE
Definition: upnputil.h:63
Definition: httpparser.h:179
#define UPNP_E_NETWORK_ERROR
A network error occurred.
Definition: upnp.h:237
int valid_ssdp_notify_hack
Definition: httpparser.h:220
int TPJobInit(ThreadPoolJob *job, start_routine func, void *arg)
Initializes thread pool job. Sets the priority to default defined in ThreadPool.h....
Definition: ThreadPool.c:1071
Definition: FreeList.h:53
size_t length
Definition: membuffer.h:60
static void ssdp_event_handler_thread(void *the_data)
This function is a thread that handles SSDP requests.
Definition: ssdp_server.c:669
char gIF_IPV4[INET_ADDRSTRLEN]
Definition: upnpapi.c:137
SOCKET ssdpSock6
Definition: miniserver.h:55
void UpnpPrintf(Upnp_LogLevel DLevel, Dbg_Module Module, const char *DbgFileName, int DbgLineNo, const char *FmtStr,...)
Prints the debug statement either on the standard output or log file along with the information from ...
Definition: upnpdebug.c:127
int UpnpDevice_Handle
Returned when a device application registers with UpnpRegisterRootDevice, UpnpRegisterRootDevice2,...
Definition: upnp.h:436
IXML_NodeList * DeviceList
Definition: upnpapi.h:102
int TPJobSetFreeFunction(ThreadPoolJob *job, free_routine func)
Sets the max threads for the thread pool attributes.
Definition: ThreadPool.c:1098
membuffer msg
Definition: httpparser.h:208
Definition: FreeList.h:62
SOCKET ssdpSock6UlaGua
Definition: miniserver.h:57
Data structure representing a list of nodes.
Definition: ixml.h:246
#define DOMString
The type of DOM strings.
Definition: ixml.h:59
static UPNP_INLINE int valid_ssdp_msg(http_message_t *hmsg)
Does some quick checking of the ssdp msg.
Definition: ssdp_server.c:584
int FreeListInit(FreeList *free_list, size_t elementSize, int maxFreeListLength)
Initializes Free List.
Definition: FreeList.c:37
void ssdp_handle_device_request(http_message_t *hmsg, struct sockaddr_storage *dest_addr)
Handles the search request. It does the sanity checks of the request and then schedules a thread to s...
Definition: ssdp_device.c:80
unsigned gIF_INDEX
Definition: upnpapi.c:149
int ThreadPoolAdd(ThreadPool *tp, ThreadPoolJob *job, int *jobId)
Adds a job to the thread pool. Job will be run as soon as possible.
Definition: ThreadPool.c:816
int FreeListFree(FreeList *free_list, void *element)
Returns an item to the Free List.
Definition: FreeList.c:71
@ PARSE_FAILURE
Definition: httpparser.h:159
static void free_ssdp_event_handler_data(void *the_data)
Frees the ssdp request.
Definition: ssdp_server.c:564
int ssdpReqSock
Definition: ssdp_server.c:85
http_method_t method
Definition: httpparser.h:182
int DeviceAdvertisement(char *DevType, int RootDev, char *Udn, char *Location, int Duration, int AddressFamily, int PowerState, int SleepPeriod, int RegistrationState)
Creates the device advertisement request based on the input parameter, and send it to the multicast c...
Definition: ssdp_device.c:495
Definition: ssdp_server.c:80
char DescURL[LINE_SIZE]
Definition: upnpapi.h:85
@ PARSE_SUCCESS
Definition: httpparser.h:153
#define NO_ERROR_FOUND
Definition: ssdplib.h:97
Data structure representing an Element node.
Definition: ixml.h:216
char gIF_IPV6_ULA_GUA[INET6_ADDRSTRLEN]
Definition: upnpapi.c:146
ThreadPool gRecvThreadPool
Definition: upnpapi.c:125
EXPORT_SPEC IXML_Node * ixmlNode_getNextSibling(IXML_Node *nodeptr)
Retrieves the sibling Node immediately following this Node.
Definition: node.c:346
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,...
Definition: ssdp_ctrlpt.c:78
void readFromSSDPSocket(SOCKET socket)
This function reads the data from the ssdp socket.
Definition: ssdp_server.c:694
EXPORT_SPEC IXML_NodeList * ixmlElement_getElementsByTagName(IXML_Element *element, const char *tagName)
Returns a NodeList of all descendant Elements with a given tag name, in the order in which they are e...
int ssdp_request_type(char *cmd, SsdpEvent *Evt)
Starts filling the SSDP event structure based upon the request received.
Definition: ssdp_server.c:548