libUPnP  1.8.4
ssdp_ResultData.h
Go to the documentation of this file.
1 
2 #ifndef SSDP_RESULTDATA_H
3 #define SSDP_RESULTDATA_H
4 
17 /******************************************************************************/
18 
19 #ifdef TEMPLATE_GENERATE_SOURCE
20 #undef TEMPLATE_GENERATE_SOURCE
21 
22  #include "Discovery.h" /* for UpnpDiscovery */
23 
24 #define TEMPLATE_GENERATE_SOURCE
25 #else /* TEMPLATE_GENERATE_SOURCE */
26 
27  #include "Discovery.h" /* for UpnpDiscovery */
28 
29 #endif /* TEMPLATE_GENERATE_SOURCE */
30 
31 /******************************************************************************/
32 
33 #include "Callback.h" /* for Upnp_FunPtr */
34 
35 #define CLASS SSDPResultData
36 
37 #define EXPAND_CLASS_MEMBERS(CLASS) \
38  EXPAND_CLASS_MEMBER_OBJECT(CLASS, Param, UpnpDiscovery) \
39  EXPAND_CLASS_MEMBER_INT(CLASS, Cookie, void *) \
40  EXPAND_CLASS_MEMBER_INT(CLASS, CtrlptCallback, Upnp_FunPtr) \
41 
42 #include "TemplateInclude.h"
43 
45 void SSDPResultData_Callback(const SSDPResultData *p);
46 
47 /* @} SSDPlib */
48 
49 #endif /* SSDP_RESULTDATA_H */
50 
ixmlNode_getNodeName
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
DeviceShutdown
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
AdvertiseAndReply
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
ServiceReply
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
UPNP_DISCOVERY_SEARCH_RESULT
@ UPNP_DISCOVERY_SEARCH_RESULT
Definition: Callback.h:63
ssdpsearcharg
Definition: ssdplib.h:144
uri.h
Handle_Info
Definition: upnpapi.h:72
UPNP_TIMEOUT
Definition: upnp_timeout.h:45
UPNP_CONTROL_ACTION_REQUEST
@ UPNP_CONTROL_ACTION_REQUEST
Definition: Callback.h:25
ixmlPrintNode
EXPORT_SPEC char * ixmlPrintNode(IXML_Node *doc)
Renders a Node and all sub-elements into an XML text representation.
Definition: ixml.c:365
ixmlNode_getFirstChild
EXPORT_SPEC IXML_Node * ixmlNode_getFirstChild(IXML_Node *nodeptr)
Retrieves the first child Node of a Node.
Definition: node.c:307
SearchByTarget
int SearchByTarget(int Hnd, int Mx, char *St, void *Cookie)
Creates and send the search request for a specific URL.
Definition: ssdp_ctrlpt.c:545
GetHandleInfo
Upnp_Handle_Type GetHandleInfo(UpnpClient_Handle Hnd, struct Handle_Info **HndInfo)
Get handle information.
Definition: upnpapi.c:3855
SOAP_TIMEOUT
#define SOAP_TIMEOUT
Definition: soap_device.c:60
ixmlFreeDOMString
EXPORT_SPEC void ixmlFreeDOMString(char *buf)
Frees a DOMString.
ServiceAdvertisement
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
ListDelNode
void * ListDelNode(LinkedList *list, ListNode *dnode, int freeItem)
Removes a node from the list. The memory for the node is freed.
Definition: LinkedList.c:177
http_header_t::value
membuffer value
Definition: httpparser.h:174
handle_query_variable
static UPNP_INLINE void handle_query_variable(SOCKINFO *info, http_message_t *request, soap_devserv_t *soap_info, IXML_Node *req_node)
Handles the SOAP requests to querry the state variables. This functionality has been deprecated in th...
Definition: soap_device.c:291
http_message_t::status_code
int status_code
Definition: httpparser.h:188
upnpapi.h
ssdpsearchreply
Definition: ssdplib.h:136
free_routine
void(* free_routine)(void *arg)
Definition: ThreadPool.h:135
http_parser_t
Definition: httpparser.h:213
UPNP_CONTROL_GET_VAR_REQUEST
@ UPNP_CONTROL_GET_VAR_REQUEST
Definition: Callback.h:36
UPNP_E_INVALID_ACTION
#define UPNP_E_INVALID_ACTION
The SOAP action message is invalid.
Definition: upnp.h:182
UPNP_E_INVALID_PARAM
#define UPNP_E_INVALID_PARAM
One or more of the parameters passed to the function is not valid.
Definition: upnp.h:110
SOCKINFO::foreign_sockaddr
struct sockaddr_storage foreign_sockaddr
Definition: sock.h:64
unique_service_name
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
ixmlNode_getNodeValue
EXPORT_SPEC const char * ixmlNode_getNodeValue(IXML_Node *nodeptr)
Returns the value of the Node as a string.
Definition: node.c:253
gUpnpSdkNLSuuid
Upnp_SID gUpnpSdkNLSuuid
membuffer::buf
char * buf
Definition: membuffer.h:58
Upnp_FunPtr
int(* Upnp_FunPtr)(Upnp_EventType EventType, const void *Event, void *Cookie)
Definition: Callback.h:145
UPNP_E_OUTOF_SOCKET
#define UPNP_E_OUTOF_SOCKET
The SDK cannot create any more sockets.
Definition: upnp.h:287
UpnpCloseSocket
#define UpnpCloseSocket
Definition: UpnpInet.h:57
ServiceShutdown
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
PARSE_OK
@ PARSE_OK
Definition: httpparser.h:161
membuffer_insert
int membuffer_insert(membuffer *m, const void *buf, size_t buf_len, size_t index)
Allocates memory for the new data to be inserted. Does memory management by moving the data from the ...
Definition: membuffer.c:212
namecopy
void namecopy(char dest[NAME_SIZE], const char *src)
Copy no of bytes spcified by the NAME_SIZE constant, from the source buffer. Null terminate the desti...
Definition: util.c:53
Discovery.h
UpnpDiscovery object declararion.
GetDeviceHandleInfo
Upnp_Handle_Type GetDeviceHandleInfo(UpnpDevice_Handle start, int AddressFamily, UpnpDevice_Handle *device_handle_out, struct Handle_Info **HndInfo)
Retrieves the device handle and information of the first device of the address family specified....
Definition: upnpapi.c:3782
_IXML_Document
Data structure representing the DOM Document.
Definition: ixml.h:198
get_mpost_acton_hdrval
static int get_mpost_acton_hdrval(http_message_t *request, memptr *val)
Get the SOAPACTION header value for M-POST request.
Definition: soap_device.c:490
memptr_cmp
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
http_message_t::entity
memptr entity
Definition: httpparser.h:205
TPJobSetPriority
int TPJobSetPriority(ThreadPoolJob *job, ThreadPriority priority)
Sets the max threads for the thread pool attributes.
Definition: ThreadPool.c:1083
parsetools.h
memptr
Definition: membuffer.h:47
advertiseAndReplyThread
void advertiseAndReplyThread(void *data)
Wrapper function to reply the search request coming from the control point.
Definition: ssdp_device.c:67
memptr::length
size_t length
Definition: membuffer.h:51
ssdp_request_type1
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
ssdp_ResultData.h
SSDPResultData object declararion.
CreateClientRequestPacket
static int CreateClientRequestPacket(INOUT char *RqstBuf, IN size_t RqstBufSize, IN int Mx, IN char *SearchTarget, IN int AddressFamily)
Creates a HTTP search request packet depending on the input parameter.
Definition: ssdp_ctrlpt.c:355
ssdplib.h
http_message_t::uri
uri_type uri
Definition: httpparser.h:184
UPNP_DISCOVERY_SEARCH_TIMEOUT
@ UPNP_DISCOVERY_SEARCH_TIMEOUT
Definition: Callback.h:68
SsdpSearchType
SsdpSearchType
Definition: ssdplib.h:66
ActionRequest.h
UpnpActionRequest object declaration.
TimerThreadSchedule
int TimerThreadSchedule(TimerThread *timer, time_t timeout, TimeoutType type, ThreadPoolJob *job, Duration duration, int *id)
Schedules an event to run at a specified time.
Definition: TimerThread.c:245
UPNP_E_SUCCESS
#define UPNP_E_SUCCESS
The operation completed successfully.
Definition: upnp.h:97
membuffer_init
void membuffer_init(membuffer *m)
Wrapper to membuffer_initialize().
Definition: membuffer.c:152
UPNP_E_INVALID_ARGUMENT
#define UPNP_E_INVALID_ARGUMENT
One or more of the parameters passed to a function is invalid.
Definition: upnp.h:344
UPNP_INLINE
#define UPNP_INLINE
Declares an inline function.
Definition: UpnpGlobal.h:99
soap_devserv_t
Definition: soap_device.c:84
SendReply
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
membuffer
Definition: membuffer.h:56
httpparser.h
UPNP_E_INVALID_URL
#define UPNP_E_INVALID_URL
An URL passed into the function is invalid.
Definition: upnp.h:152
upnp.h
Callback.h
ssdpsearchexparg
Definition: ssdplib.h:152
send_action_response
static UPNP_INLINE void send_action_response(SOCKINFO *info, IXML_Document *action_resp, http_message_t *request)
Sends the SOAP action response.
Definition: soap_device.c:220
ixmlCloneDOMString
EXPORT_SPEC char * ixmlCloneDOMString(const char *src)
Clones an existing DOMString.
gTimerThread
TimerThread gTimerThread
Definition: upnpapi.c:119
UPNP_E_NOT_FOUND
#define UPNP_E_NOT_FOUND
The response to a SOAP request did not contain the required XML constructs.
Definition: upnp.h:370
membuffer_assign
int membuffer_assign(membuffer *m, const void *buf, size_t buf_len)
Allocate memory to membuffer *m and copy the contents of the in parameter const void *buf.
Definition: membuffer.c:170
ixmlDocument_free
EXPORT_SPEC void ixmlDocument_free(IXML_Document *doc)
Frees a Document object and all Nodes associated with it.
Definition: document.c:54
SSDP_SERROR
@ SSDP_SERROR
Definition: ssdplib.h:68
Handle_Info::Cookie
char * Cookie
Definition: upnpapi.h:78
membuffer_detach
char * membuffer_detach(membuffer *m)
Definition: membuffer.c:273
GetClientHandleInfo
Upnp_Handle_Type GetClientHandleInfo(UpnpClient_Handle *client_handle_out, struct Handle_Info **HndInfo)
Get client handle info.
Definition: upnpapi.c:3760
ThreadPool.h
INVALID_SOCKET
#define INVALID_SOCKET
Definition: UpnpInet.h:51
CreateServicePacket
static void CreateServicePacket(int msg_type, const char *nt, char *usn, char *location, int duration, char **packet, int AddressFamily, int PowerState, int SleepPeriod, int RegistrationState)
Creates a HTTP request packet. Depending on the input parameter, it either creates a service advertis...
Definition: ssdp_device.c:319
ListNext
ListNode * ListNext(LinkedList *list, ListNode *node)
Returns the next item in the list.
Definition: LinkedList.c:245
UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE
@ UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE
Definition: Callback.h:57
LISTNODE
Definition: LinkedList.h:61
ListHead
ListNode * ListHead(LinkedList *list)
Returns the head of the list.
Definition: LinkedList.c:219
SsdpEventStruct
Definition: ssdplib.h:107
SOCKET
int SOCKET
Definition: UpnpInet.h:48
send_var_query_response
static UPNP_INLINE void send_var_query_response(SOCKINFO *info, const char *var_value, http_message_t *hmsg)
Sends response of get var status.
Definition: soap_device.c:168
ListAddTail
ListNode * ListAddTail(LinkedList *list, void *item)
Adds a node to the tail of the list. Node gets added immediately before list.tail.
Definition: LinkedList.c:119
soap_device_callback
void soap_device_callback(http_parser_t *parser, http_message_t *request, SOCKINFO *info)
This is a callback called by minisever after receiving the request from the control point....
Definition: soap_device.c:701
THREADPOOLJOB
Definition: ThreadPool.h:164
HOSTPORT::text
token text
Definition: uri.h:128
_IXML_Node
Data structure common to all types of nodes.
Definition: ixml.h:173
check_soapaction_hdr
static int check_soapaction_hdr(http_message_t *request, soap_devserv_t *soap_info)
Check the header validity, and get the action name and the version of the service that the CP wants t...
Definition: soap_device.c:531
memptr::buf
char * buf
Definition: membuffer.h:49
membuffer.h
http_SendMessage
int http_SendMessage(SOCKINFO *info, int *TimeOut, const char *fmt,...)
Sends a message to the destination based on the format parameter.
Definition: httpreadwrite.c:437
membuffer::size_inc
size_t size_inc
Definition: membuffer.h:64
has_xml_content_type
int has_xml_content_type(http_message_t *hmsg)
Find the header from the HTTP message and match the header for xml data.
Definition: parsetools.c:48
DeviceReply
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
TRUE
#define TRUE
Definition: upnputil.h:63
http_message_t
Definition: httpparser.h:179
ixmlNode_getNamespaceURI
EXPORT_SPEC const char * ixmlNode_getNamespaceURI(IXML_Node *nodeptr)
Retrieves the namespace URI for a Node as a DOMString.
Definition: node.c:229
handle_invoke_action
static void handle_invoke_action(SOCKINFO *info, http_message_t *request, soap_devserv_t *soap_info, IXML_Node *req_node)
Handles the SOAP action request.
Definition: soap_device.c:352
UPNP_E_NETWORK_ERROR
#define UPNP_E_NETWORK_ERROR
A network error occurred.
Definition: upnp.h:237
send_error_response
static void send_error_response(IN SOCKINFO *info, IN int error_code, IN const char *err_msg, IN http_message_t *hmsg)
Sends SOAP error response.
Definition: soap_device.c:97
GetDeviceHandleInfoForPath
Upnp_Handle_Type GetDeviceHandleInfoForPath(const char *path, int AddressFamily, UpnpDevice_Handle *device_handle_out, struct Handle_Info **HndInfo, service_info **serv_info)
Retrieves the device handle and information of the first device of the address family specified,...
Definition: upnpapi.c:3818
ixmlNode_getLocalName
EXPORT_SPEC const char * ixmlNode_getLocalName(IXML_Node *nodeptr)
Retrieves the local name of a Node, if present.
Definition: node.c:132
URI
Represents a URI used in parse_uri and elsewhere.
Definition: uri.h:136
TPJobInit
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
http_header_t
Definition: httpparser.h:168
membuffer::length
size_t length
Definition: membuffer.h:60
extractIPv6address
static int extractIPv6address(char *url, char *address)
Definition: ssdp_device.c:263
ixmlNode_getNodeType
EXPORT_SPEC unsigned short ixmlNode_getNodeType(IXML_Node *nodeptr)
Retrieves the type of a Node. Note that not all possible return values are actually implemented.
Definition: node.c:287
gIF_IPV4
char gIF_IPV4[INET_ADDRSTRLEN]
Definition: upnpapi.c:137
UpnpPrintf
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
membuffer_append_str
int membuffer_append_str(membuffer *m, const char *c_str)
Invokes function to appends data from a constant string to the buffer.
Definition: membuffer.c:207
TPJobSetFreeFunction
int TPJobSetFreeFunction(ThreadPoolJob *job, free_routine func)
Sets the max threads for the thread pool attributes.
Definition: ThreadPool.c:1098
SOCKINFO
Definition: sock.h:60
http_message_t::is_request
int is_request
Definition: httpparser.h:197
DOMString
#define DOMString
The type of DOM strings.
Definition: ixml.h:59
membuffer_append
int membuffer_append(membuffer *m, const void *buf, size_t buf_len)
Invokes function to appends data from a constant buffer to the buffer.
Definition: membuffer.c:200
ssdp_handle_device_request
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
gIF_INDEX
unsigned gIF_INDEX
Definition: upnpapi.c:149
ThreadPoolAdd
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
miniserver.h
Handle_Info::Callback
Upnp_FunPtr Callback
Definition: upnpapi.h:76
http_MakeMessage
int http_MakeMessage(membuffer *buf, int http_major_version, int http_minor_version, const char *fmt,...)
Generate an HTTP message based on the format that is specified in the input parameters.
Definition: httpreadwrite.c:1470
isUrlV6UlaGua
static int isUrlV6UlaGua(char *descdocUrl)
Definition: ssdp_device.c:301
check_soap_request
static int check_soap_request(soap_devserv_t *soap_info, IN IXML_Document *xml_doc, IXML_Node **req_node)
Check validity of the SOAP request per UPnP specification.
Definition: soap_device.c:612
UPNP_DISCOVERY_ADVERTISEMENT_ALIVE
@ UPNP_DISCOVERY_ADVERTISEMENT_ALIVE
Definition: Callback.h:51
parse_uri
int parse_uri(const char *in, size_t max, uri_type *out)
Parses a uri as defined in http://www.ietf.org/rfc/rfc2396.txt (RFC explaining URIs).
Definition: uri.c:707
Handle_Info::SsdpSearchList
LinkedList SsdpSearchList
Definition: upnpapi.h:120
http_message_t::method
http_method_t method
Definition: httpparser.h:182
DeviceAdvertisement
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
TemplateInclude.h
Templates for include files of objects.
UPNP_E_INTERNAL_ERROR
#define UPNP_E_INTERNAL_ERROR
Generic error code for internal conditions not covered by other error codes.
Definition: upnp.h:376
REL_SEC
@ REL_SEC
Definition: TimerThread.h:55
UPNP_E_BAD_RESPONSE
#define UPNP_E_BAD_RESPONSE
The response received from the remote side of a connection is not correct for the protocol.
Definition: upnp.h:172
soaplib.h
ixmlParseBufferEx
EXPORT_SPEC int ixmlParseBufferEx(const char *buffer, IXML_Document **doc)
Parses an XML text buffer converting it into an IXML DOM representation.
Definition: ixml.c:428
UpnpInet.h
Provides a platform independent way to include TCP/IP types and functions.
membuffer_destroy
void membuffer_destroy(membuffer *m)
Free's memory allocated for membuffer* m.
Definition: membuffer.c:160
NewRequestHandler
static int NewRequestHandler(struct sockaddr *DestAddr, int NumPacket, char **RqPacket)
Works as a request handler which passes the HTTP request string to multicast channel.
Definition: ssdp_device.c:176
upnputil.h
gRecvThreadPool
ThreadPool gRecvThreadPool
Definition: upnpapi.c:125
sock.h
UPNP_E_SOCKET_WRITE
#define UPNP_E_SOCKET_WRITE
An error happened while writing to a socket.
Definition: upnp.h:247
ixmlNode_getNextSibling
EXPORT_SPEC IXML_Node * ixmlNode_getNextSibling(IXML_Node *nodeptr)
Retrieves the sibling Node immediately following this Node.
Definition: node.c:346
get_dev_service
static int get_dev_service(http_message_t *request, int AddressFamily, soap_devserv_t *soap_info)
Retrieve SOAP device/service information associated with request-URI, which includes the callback fun...
Definition: soap_device.c:442
ssdp_handle_ctrlpt_msg
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
send_search_result
static void send_search_result(IN void *data)
Sends a callback to the control point application with a SEARCH result.
Definition: ssdp_ctrlpt.c:68
SERVICE_INFO
Definition: service_table.h:74
UPNP_E_OUTOF_MEMORY
#define UPNP_E_OUTOF_MEMORY
Not enough resources are currently available to complete the operation.
Definition: upnp.h:126
UpnpString_get_Length
size_t UpnpString_get_Length(const UpnpString *p)
Returns the length of the string.
Definition: UpnpString.c:145
ssdp_request_type
int ssdp_request_type(char *cmd, SsdpEvent *Evt)
Starts filling the SSDP event structure based upon the request received.
Definition: ssdp_server.c:548