cservice.h File Reference

#include <cybergarage/typedef.h>
#include <cybergarage/xml/cxml.h>
#include <cybergarage/util/ctime.h>
#include <cybergarage/util/clist.h>
#include <cybergarage/util/cstring.h>
#include <cybergarage/util/cmutex.h>
#include <cybergarage/net/curl.h>
#include <cybergarage/upnp/caction.h>
#include <cybergarage/upnp/cstatevariable.h>
#include <cybergarage/upnp/ssdp/cssdp_server.h>
#include <cybergarage/upnp/event/csubscriber.h>

Data Structures

struct  _CgUpnpService

Defines

#define CG_UPNP_SERVICE_ELEM_NAME   "service"
#define CG_UPNP_SERVICELIST_ELEM_NAME   "serviceList"
#define CG_UPNP_SERVICE_TYPE   "serviceType"
#define CG_UPNP_SERVICE_ID   "serviceId"
#define CG_UPNP_SERVICE_SCPDURL   "SCPDURL"
#define CG_UPNP_SERVICE_CONTROL_URL   "controlURL"
#define CG_UPNP_SERVICE_EVENT_SUB_URL   "eventSubURL"
#define CG_UPNP_SERVICE_EVENT_KEY_INVALID   0
#define cg_upnp_service_next(service)   (CgUpnpService *)cg_list_next((CgList *)service)
#define cg_upnp_service_isservicenode(node)   cg_xml_node_isname(node, CG_UPNP_SERVICE_ELEM_NAME)
#define cg_upnp_service_getscpdnode(service)   cg_xml_nodelist_gets(service->scpdNodeList)
#define cg_upnp_service_setservicenode(service, node)   (service->serviceNode = node)
#define cg_upnp_service_getservicenode(service)   (service->serviceNode)
#define cg_upnp_service_getdevicenode(service)   cg_xml_node_getparentnode(cg_xml_node_getparentnode(service->serviceNode))
#define cg_upnp_service_isparsed(service)   (service->parsed)
#define cg_upnp_service_setservicetype(service, value)   cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_TYPE, value)
#define cg_upnp_service_getservicetype(service)   cg_xml_node_getchildnodevalue(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_TYPE)
#define cg_upnp_service_setserviceid(service, value)   cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_ID, value)
#define cg_upnp_service_getserviceid(service)   cg_xml_node_getchildnodevalue(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_ID)
#define cg_upnp_service_setscpdurl(service, value)   cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_SCPDURL, value)
#define cg_upnp_service_getscpdurl(service)   cg_xml_node_getchildnodevalue(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_SCPDURL)
#define cg_upnp_service_setcontrolurl(service, value)   cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_CONTROL_URL, value)
#define cg_upnp_service_getcontrolurl(service)   cg_xml_node_getchildnodevalue(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_CONTROL_URL)
#define cg_upnp_service_seteventsuburl(service, value)   cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_EVENT_SUB_URL, value)
#define cg_upnp_service_geteventsuburl(service)   cg_xml_node_getchildnodevalue(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_EVENT_SUB_URL)
#define cg_upnp_service_hasactionbyname(service, name)   ((cg_upnp_service_getactionbyname(service,name) != NULL) ? TRUE : FALSE)
#define cg_upnp_service_hasstatevariablebyname(service, name)   ((cg_upnp_service_getstatevariablebyname(service,name) != NULL) ? TRUE : FALSE)
#define cg_upnp_service_setdevice(service, dev)   (service->parentDevice = dev)
#define cg_upnp_service_getdevice(service)   ((CgUpnpDevice *)service->parentDevice)
#define cg_upnp_service_getrootdevice(service)   cg_upnp_device_getrootdevice((CgUpnpDevice *)service->parentDevice)
#define cg_upnp_service_getsubscribers(service)   cg_upnp_subscriberlist_gets(service->subscriberList)
#define cg_upnp_service_getnsubscribers(service)   cg_upnp_subscriberlist_size(service->subscriberList)
#define cg_upnp_service_lock(service)   cg_mutex_lock(service->mutex)
#define cg_upnp_service_unlock(service)   cg_mutex_unlock(service->mutex)
#define cg_upnp_service_setsubscriptionsid(service, value)   cg_string_setvalue(service->subscriptionSid, value)
#define cg_upnp_service_getsubscriptionsid(service)   cg_string_getvalue(service->subscriptionSid)
#define cg_upnp_service_issubscribed(service)   ((0 < cg_string_length(service->subscriptionSid)) ? TRUE : FALSE)
#define cg_upnp_service_clearsubscriptionsid(service)   cg_string_setvalue(service->subscriptionSid, "")
#define cg_upnp_service_setsubscriptiontimeout(service, value)   (service->subscriptionTimeout = value)
#define cg_upnp_service_getsubscriptiontimeout(service)   (service->subscriptionTimeout)
#define cg_upnp_service_setuserdata(service, value)   (service->userData = value)
#define cg_upnp_service_getuserdata(service)   (service->userData)
#define cg_upnp_service_seteventkey(service, value)   (service->eventKey = value)
#define cg_upnp_service_geteventkey(service)   (service->eventKey)
#define cg_upnp_service_setsubscriptiontimestamp(service, value)   (service->subscriptionTimestamp = value)
#define cg_upnp_service_getsubscriptiontimestamp(service)   (service->subscriptionTimestamp)
#define cg_upnp_service_getsubscriptionexpiration(service)   (service->subscriptionTimestamp + service->subscriptionTimeout - CG_UPNP_SUBSCRIPTION_DELAY)
#define cg_upnp_servicelist_clear(serviceList)   cg_list_clear((CgList *)serviceList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_service_delete)
#define cg_upnp_servicelist_size(serviceList)   cg_list_size((CgList *)serviceList)
#define cg_upnp_servicelist_gets(serviceList)   (CgUpnpService *)cg_list_next((CgList *)serviceList)
#define cg_upnp_servicelist_add(serviceList, service)   cg_list_add((CgList *)serviceList, (CgList *)service)

Typedefs

typedef _CgUpnpService CgUpnpService
typedef _CgUpnpService CgUpnpServiceList

Functions

CgUpnpServicecg_upnp_service_new ()
void cg_upnp_service_delete (CgUpnpService *service)
void cg_upnp_service_clear (CgUpnpService *service)
BOOL cg_upnp_service_parsedescription (CgUpnpService *service, char *description, int descriptionLen)
BOOL cg_upnp_service_parsedescriptionurl (CgUpnpService *service, CgNetURL *url)
char * cg_upnp_service_getdescription (CgUpnpService *service, CgString *descStr)
char * cg_upnp_servicetype_getidentifier (char *serviceType)
char * cg_upnp_servicetype_geturn (char *serviceType)
char * cg_upnp_servicetype_getservice (char *serviceType)
char * cg_upnp_servicetype_gettype (char *serviceType)
char * cg_upnp_servicetype_getschematype (char *serviceType)
char * cg_upnp_servicetype_getversion (char *serviceType)
BOOL cg_upnp_service_isscpdurl (CgUpnpService *service, char *url)
CgUpnpActionListcg_upnp_service_getactionlist (CgUpnpService *service)
CgUpnpActioncg_upnp_service_getactions (CgUpnpService *service)
CgUpnpActioncg_upnp_service_getactionbyname (CgUpnpService *service, char *name)
CgUpnpServiceStateTablecg_upnp_service_getservicestatetable (CgUpnpService *service)
CgUpnpStateVariablecg_upnp_service_getstatevariables (CgUpnpService *service)
CgUpnpStateVariablecg_upnp_service_getstatevariablebyname (CgUpnpService *service, char *name)
BOOL cg_upnp_service_announcefrom (CgUpnpService *service, char *bindAddr)
BOOL cg_upnp_service_byebyefrom (CgUpnpService *service, char *bindAddr)
void cg_upnp_service_setactionlistener (CgUpnpService *service, CG_UPNP_ACTION_LISTNER actionListener)
void cg_upnp_service_setquerylistener (CgUpnpService *service, CG_UPNP_STATEVARIABLE_LISTNER queryListener)
BOOL cg_upnp_service_addsubscriber (CgUpnpService *service, CgUpnpSubscriber *sub)
BOOL cg_upnp_service_removesubscriber (CgUpnpService *service, CgUpnpSubscriber *sub)
CgUpnpSubscribercg_upnp_service_getsubscriberbysid (CgUpnpService *service, char *sid)
char * cg_upnp_service_getnotifyservicetypent (CgUpnpService *service, char *buf, int bufSize)
char * cg_upnp_service_getnotifyservicetypeusn (CgUpnpService *service, char *buf, int bufSize)
BOOL cg_upnp_service_notify (CgUpnpService *service, CgUpnpStateVariable *statVar)
BOOL cg_upnp_service_notifyallstatevariables (CgUpnpService *service)
CgUpnpServiceListcg_upnp_servicelist_new ()
void cg_upnp_servicelist_delete (CgUpnpServiceList *serviceList)
void cg_upnp_service_ssdpmessagereceived (CgUpnpService *service, CgUpnpSSDPPacket *ssdpPkt)

Define Documentation

#define cg_upnp_service_clearsubscriptionsid ( service   )     cg_string_setvalue(service->subscriptionSid, "")

Clear (i.e. empty) the service's SID (subscription ID)

Parameters:
service The service in question

#define CG_UPNP_SERVICE_CONTROL_URL   "controlURL"

#define CG_UPNP_SERVICE_ELEM_NAME   "service"

#define CG_UPNP_SERVICE_EVENT_KEY_INVALID   0

#define CG_UPNP_SERVICE_EVENT_SUB_URL   "eventSubURL"

#define cg_upnp_service_getcontrolurl ( service   )     cg_xml_node_getchildnodevalue(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_CONTROL_URL)

Get the service's control URL

Parameters:
service The service in question
Returns:
char*

#define cg_upnp_service_getdevice ( service   )     ((CgUpnpDevice *)service->parentDevice)

Get the service's parent device

Parameters:
service The service in question
Returns:
CgUpnpDevice*

#define cg_upnp_service_getdevicenode ( service   )     cg_xml_node_getparentnode(cg_xml_node_getparentnode(service->serviceNode))

Get the parent device's XML node for the service

Parameters:
service The service in question

#define cg_upnp_service_geteventkey ( service   )     (service->eventKey)

Get the service's event key

Parameters:
service The service in question
Returns:
uint

#define cg_upnp_service_geteventsuburl ( service   )     cg_xml_node_getchildnodevalue(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_EVENT_SUB_URL)

Get the service's event subscription URL

Parameters:
service The service in question
Returns:
char*

#define cg_upnp_service_getnsubscribers ( service   )     cg_upnp_subscriberlist_size(service->subscriberList)

Get the number of subscribers for the service

Parameters:
service The service in question
Returns:
int

#define cg_upnp_service_getrootdevice ( service   )     cg_upnp_device_getrootdevice((CgUpnpDevice *)service->parentDevice)

Get the service's top-most root device

Parameters:
service The service in question
Returns:
CgUpnpDevice*

#define cg_upnp_service_getscpdnode ( service   )     cg_xml_nodelist_gets(service->scpdNodeList)

Get the service's SCPD node

Parameters:
service The service in question

#define cg_upnp_service_getscpdurl ( service   )     cg_xml_node_getchildnodevalue(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_SCPDURL)

Get the service's SCPD (service description) URL

Parameters:
service The service in question
Returns:
char*

#define cg_upnp_service_getserviceid ( service   )     cg_xml_node_getchildnodevalue(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_ID)

Get the service's service ID

Parameters:
service The service in question
Returns:
char*

#define cg_upnp_service_getservicenode ( service   )     (service->serviceNode)

Get the root XML node for the service

Parameters:
service The service in question

#define cg_upnp_service_getservicetype ( service   )     cg_xml_node_getchildnodevalue(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_TYPE)

Get the service's complete type string (ex. "urn:schemas-upnp-org:service:FooService:1")

Parameters:
service The service in question
Returns:
char*

#define cg_upnp_service_getsubscribers ( service   )     cg_upnp_subscriberlist_gets(service->subscriberList)

Get the first node in the service's list of event subscribers. Use as the starting point in iteration loops.

Parameters:
service The service in question

#define cg_upnp_service_getsubscriptionexpiration ( service   )     (service->subscriptionTimestamp + service->subscriptionTimeout - CG_UPNP_SUBSCRIPTION_DELAY)

Get the service's subscription expiration time

Parameters:
service The service in question
Returns:
CgSysTime

#define cg_upnp_service_getsubscriptionsid ( service   )     cg_string_getvalue(service->subscriptionSid)

Get the service's SID (subscription ID)

Parameters:
service The service in question
Returns:
char*

#define cg_upnp_service_getsubscriptiontimeout ( service   )     (service->subscriptionTimeout)

Get the service's subscription timeout (expiration) value

Parameters:
service The service in question
Returns:
long

#define cg_upnp_service_getsubscriptiontimestamp ( service   )     (service->subscriptionTimestamp)

Get the service's subscription time stamp

Parameters:
service The service in question
Returns:
CgSysTime

#define cg_upnp_service_getuserdata ( service   )     (service->userData)

Get the service's arbitrary user data pointer

Parameters:
service The service in question
Returns:
void*

#define cg_upnp_service_hasactionbyname ( service,
name   )     ((cg_upnp_service_getactionbyname(service,name) != NULL) ? TRUE : FALSE)

Check, whether a service has an action by the given name

Parameters:
service The service in question
name The name of the action

#define cg_upnp_service_hasstatevariablebyname ( service,
name   )     ((cg_upnp_service_getstatevariablebyname(service,name) != NULL) ? TRUE : FALSE)

Check, whether the service has the given state variable

Parameters:
service The service in question
name The name of the state variable
Returns:
TRUE if found; otherwise FALSE

#define CG_UPNP_SERVICE_ID   "serviceId"

#define cg_upnp_service_isparsed ( service   )     (service->parsed)

Get the service's parsing status (i.e. whether the service has been completely constructed). Useful mainly in optimized control point mode.

Parameters:
service The service in question

#define cg_upnp_service_isservicenode ( node   )     cg_xml_node_isname(node, CG_UPNP_SERVICE_ELEM_NAME)

Check, whether the given XML node is a service root node

Parameters:
node CgXmlNode*
Returns:
TRUE if the node is a service root node; otherwise FALSE

#define cg_upnp_service_issubscribed ( service   )     ((0 < cg_string_length(service->subscriptionSid)) ? TRUE : FALSE)

Check, whether the service has any subscribers

Parameters:
service The service in question
Returns:
TRUE if at least one subscriber is found; otherwise FALSE

#define cg_upnp_service_lock ( service   )     cg_mutex_lock(service->mutex)

Lock the service's mutex

Parameters:
service The service in question

#define cg_upnp_service_next ( service   )     (CgUpnpService *)cg_list_next((CgList *)service)

Get the next service in a service list. Use as an iterator.

Parameters:
service Current service

#define CG_UPNP_SERVICE_SCPDURL   "SCPDURL"

#define cg_upnp_service_setcontrolurl ( service,
value   )     cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_CONTROL_URL, value)

Set the service's control URL

Parameters:
service The service in question
value The control URL string

#define cg_upnp_service_setdevice ( service,
dev   )     (service->parentDevice = dev)

Set the service's parent device

Parameters:
service The service in question
dev The parent device

#define cg_upnp_service_seteventkey ( service,
value   )     (service->eventKey = value)

Set the service's event key (i.e. the sequential number used in events)

Parameters:
service The service in question
value The event key value (uint)

#define cg_upnp_service_seteventsuburl ( service,
value   )     cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_EVENT_SUB_URL, value)

Get the service's event subscription URL

Parameters:
service The service in question
value The event subscription URL string

#define cg_upnp_service_setscpdurl ( service,
value   )     cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_SCPDURL, value)

Set the service's SCPD (service description) URL

Parameters:
service The service in question
value The SCPD URL string

#define cg_upnp_service_setserviceid ( service,
value   )     cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_ID, value)

Set the service's service ID

Parameters:
service The service in question
value Service ID string

#define cg_upnp_service_setservicenode ( service,
node   )     (service->serviceNode = node)

Set the root XML node for the service

Parameters:
service The service in question
node The node to set

#define cg_upnp_service_setservicetype ( service,
value   )     cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_TYPE, value)

Set the service's complete type string (ex. "urn:schemas-upnp-org:service:FooService:1")

Parameters:
service The service in question
value The type string

#define cg_upnp_service_setsubscriptionsid ( service,
value   )     cg_string_setvalue(service->subscriptionSid, value)

Set the service's subscription's SID (subscription ID)

Parameters:
service The service in question
value The SID

#define cg_upnp_service_setsubscriptiontimeout ( service,
value   )     (service->subscriptionTimeout = value)

Set the service's subscription timeout (expiration) value

Parameters:
service The service in question
value The timeout value

#define cg_upnp_service_setsubscriptiontimestamp ( service,
value   )     (service->subscriptionTimestamp = value)

Set the service's subscription time stamp

Parameters:
service The service in question
value The time stamp

#define cg_upnp_service_setuserdata ( service,
value   )     (service->userData = value)

Set the service's arbitrary user data pointer

Parameters:
service The service in question
value The user data pointer

#define CG_UPNP_SERVICE_TYPE   "serviceType"

#define cg_upnp_service_unlock ( service   )     cg_mutex_unlock(service->mutex)

Unlock the service's mutex

Parameters:
service The service in question

#define cg_upnp_servicelist_add ( serviceList,
service   )     cg_list_add((CgList *)serviceList, (CgList *)service)

Add a service to a list of services

Parameters:
serviceList The list to add the service to
service The service to add to the list

#define cg_upnp_servicelist_clear ( serviceList   )     cg_list_clear((CgList *)serviceList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_service_delete)

Clear the contents of a list of services

Parameters:
serviceList The list of services to clear

#define CG_UPNP_SERVICELIST_ELEM_NAME   "serviceList"

#define cg_upnp_servicelist_gets ( serviceList   )     (CgUpnpService *)cg_list_next((CgList *)serviceList)

Get the first service in a list of services. Use as the starting point in iteration loops.

Parameters:
serviceList The service list

#define cg_upnp_servicelist_size ( serviceList   )     cg_list_size((CgList *)serviceList)

Get the number of services in a list of services

Parameters:
serviceList The list of services
Returns:
int


Typedef Documentation

typedef struct _CgUpnpService CgUpnpService

typedef struct _CgUpnpService CgUpnpServiceList


Function Documentation

BOOL cg_upnp_service_addsubscriber ( CgUpnpService service,
CgUpnpSubscriber sub 
)

Add a subscriber to the service

Parameters:
service The service in question
sub The subscriber

BOOL cg_upnp_service_announcefrom ( CgUpnpService service,
char *  bindAddr 
)

Send a service announcement (advertisement) from the given address

Parameters:
service The service to advertise
bindAddr The address to attach to the announcement

BOOL cg_upnp_service_byebyefrom ( CgUpnpService service,
char *  bindAddr 
)

Send a byebye announcement (i.e. a cancelling advertisement) from the given address

Parameters:
service The service to announce from
bindAddr The address to attach to the announcement

void cg_upnp_service_clear ( CgUpnpService service  ) 

Clear the contents of a UPnP service

Parameters:
service The service to clear

void cg_upnp_service_delete ( CgUpnpService service  ) 

Destroy a UPnP service

Parameters:
service The service to destroy

CgUpnpAction* cg_upnp_service_getactionbyname ( CgUpnpService service,
char *  name 
)

Get an action from the service by the action's name

Parameters:
service The service in question
name The name of the action to look for
Returns:
CgUpnpAction* or NULL

CgUpnpActionList* cg_upnp_service_getactionlist ( CgUpnpService service  ) 

Get the service's list of actions (head of list)

Parameters:
service The service in question

CgUpnpAction* cg_upnp_service_getactions ( CgUpnpService service  ) 

Get the first action in the service's list of actions. Use as the starting point in iteration loops.

Parameters:
service The service in question

char* cg_upnp_service_getdescription ( CgUpnpService service,
CgString descStr 
)

Get the service's description XML nodes as a string

Parameters:
service The service in question
descStr The description string

char* cg_upnp_service_getnotifyservicetypent ( CgUpnpService service,
char *  buf,
int  bufSize 
)

char* cg_upnp_service_getnotifyservicetypeusn ( CgUpnpService service,
char *  buf,
int  bufSize 
)

CgUpnpServiceStateTable* cg_upnp_service_getservicestatetable ( CgUpnpService service  ) 

Get the service's state table

Parameters:
service The service in question

CgUpnpStateVariable* cg_upnp_service_getstatevariablebyname ( CgUpnpService service,
char *  name 
)

Get a state variable from the service's state table by the variable's name

Parameters:
service The service in question
name the name of the variable
Returns:
CgUpnpStateVariable* or NULL

CgUpnpStateVariable* cg_upnp_service_getstatevariables ( CgUpnpService service  ) 

Get the first state variable in the service's state table. Use as the starting point in iteration loops.

Parameters:
service The service in question

CgUpnpSubscriber* cg_upnp_service_getsubscriberbysid ( CgUpnpService service,
char *  sid 
)

Find a subscriber from the service's list of subscribers by its SID (Subscription ID)

Parameters:
service The service in question
sid The SID

BOOL cg_upnp_service_isscpdurl ( CgUpnpService service,
char *  url 
)

Compare the service's SCPD URL and the given location

Parameters:
service The service in question
url The URL (location) to compare
Returns:
TRUE if location is found from URL; otherwise FALSE

CgUpnpService* cg_upnp_service_new (  ) 

Create a new UPnP service

BOOL cg_upnp_service_notify ( CgUpnpService service,
CgUpnpStateVariable statVar 
)

Send a notification of a service's changed state variable

Parameters:
service The service in question
statVar The changed state variable

BOOL cg_upnp_service_notifyallstatevariables ( CgUpnpService service  ) 

Send a notification message to all of the service's subscribers

Parameters:
service The service in question

BOOL cg_upnp_service_parsedescription ( CgUpnpService service,
char *  description,
int  descriptionLen 
)

Create the service's contents from the given XML document

Parameters:
service The service to create
description The XML document to parse
descriptionLen The length of the XML document

BOOL cg_upnp_service_parsedescriptionurl ( CgUpnpService service,
CgNetURL url 
)

Create the service's contents from the given URL. Gets the XML document from the URL and passes it again to cg_upnp_service_parsedescription

Parameters:
service The service to create
url The URL of the document to parse

BOOL cg_upnp_service_removesubscriber ( CgUpnpService service,
CgUpnpSubscriber sub 
)

Remove a subscriber from the service

Parameters:
service The service in question
sub The subscriber to remove

void cg_upnp_service_setactionlistener ( CgUpnpService service,
CG_UPNP_ACTION_LISTNER  actionListener 
)

Set an action listener to the service

Parameters:
service The service in question
actionListener A callback function of type CG_UPNP_ACTION_LISTNER

void cg_upnp_service_setquerylistener ( CgUpnpService service,
CG_UPNP_STATEVARIABLE_LISTNER  queryListener 
)

Set a query listener to the service

Parameters:
service The service in question
queryListener A callback function of type CG_UPNP_STATEVARIABLE_LISTNER

void cg_upnp_service_ssdpmessagereceived ( CgUpnpService service,
CgUpnpSSDPPacket ssdpPkt 
)

The service's handler function that deals with received SSDP messages.

Parameters:
service The service in question
ssdpPkt The received SSDP packet

void cg_upnp_servicelist_delete ( CgUpnpServiceList serviceList  ) 

Destroy a list of services

Parameters:
serviceList The list of services to destroy

CgUpnpServiceList* cg_upnp_servicelist_new (  ) 

Create a new list of services

char* cg_upnp_servicetype_getidentifier ( char *  serviceType  ) 

Get the identifier-part of a service type string (usually "urn")

Parameters:
serviceType A service type string (usually the result from cg_upnp_service_getservicetype)
Returns:
A newly-created char* if successful; otherwise NULL

char* cg_upnp_servicetype_getschematype ( char *  serviceType  ) 

Get the schema type part of a service type string (without last colon) (ex. "urn:schemas-upnp-org:service:ContentDirectory")

Parameters:
serviceType A service type string (usually the result from cg_upnp_service_getservicetype)
Returns:
A newly-created char* if successful; otherwise NULL

char* cg_upnp_servicetype_getservice ( char *  serviceType  ) 

Get the service part of a service type string (usually just "service")

Parameters:
serviceType A service type string (usually the result from cg_upnp_service_getservicetype)
Returns:
A newly-created char* if successful; otherwise NULL

char* cg_upnp_servicetype_gettype ( char *  serviceType  ) 

Get the type part of a service type string (ex. "ContentDirectory")

Parameters:
serviceType A service type string (usually the result from cg_upnp_service_getservicetype)
Returns:
A newly-created char* if successful; otherwise NULL

char* cg_upnp_servicetype_geturn ( char *  serviceType  ) 

Get the URN part of a service type string (usually "schemas-upnp-org")

Parameters:
serviceType A service type string (usually the result from cg_upnp_service_getservicetype)
Returns:
A newly-created char* if successful; otherwise NULL

char* cg_upnp_servicetype_getversion ( char *  serviceType  ) 

Get the version part of a service type string (ex. "1")

Parameters:
serviceType A service type string (usually the result from cg_upnp_service_getservicetype)
Returns:
A newly-created char* if successful; otherwise NULL


Generated on Tue Aug 8 14:56:29 2006 for CyberLinkC by  doxygen 1.4.7