#include <cybergarage/upnp/cservice.h>
#include <cybergarage/upnp/cupnp.h>
#include <cybergarage/upnp/cupnp_function.h>
#include <cybergarage/upnp/cdevice.h>
#include <cybergarage/upnp/ssdp/cssdp.h>
#include <cybergarage/util/clog.h>
#include <cybergarage/util/cstring.h>
#include <cybergarage/net/curl.h>
#include <cybergarage/net/curi.h>
Functions |
| static void | cg_upnp_service_initchildnodes (CgUpnpService *service) |
| static void | cg_upnp_service_initactionlist (CgUpnpService *service) |
| static void | cg_upnp_service_initservicestatetable (CgUpnpService *service) |
| static CgNetURL * | cg_upnp_service_mangleurl (CgUpnpService *service, char *type) |
| CgUpnpService * | cg_upnp_service_new () |
| void | cg_upnp_service_delete (CgUpnpService *service) |
| void | cg_upnp_service_clear (CgUpnpService *service) |
| BOOL | cg_upnp_service_isscpdurl (CgUpnpService *service, char *url) |
| CgNetURL * | cg_upnp_service_geteventsuburl (CgUpnpService *service) |
| CgNetURL * | cg_upnp_service_getcontrolurl (CgUpnpService *service) |
| CgNetURL * | cg_upnp_service_getscpdurl (CgUpnpService *service) |
| BOOL | cg_upnp_service_parsedescription (CgUpnpService *service, char *desciption, 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) |
| 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_announcefrom (CgUpnpService *service, char *bindAddr) |
| BOOL | cg_upnp_service_byebyefrom (CgUpnpService *service, char *bindAddr) |
| CgUpnpAction * | cg_upnp_service_getactionbyname (CgUpnpService *service, char *name) |
| CgUpnpStateVariable * | cg_upnp_service_getstatevariablebyname (CgUpnpService *service, char *name) |
| void | cg_upnp_service_setactionlistener (CgUpnpService *service, CG_UPNP_ACTION_LISTNER actionListener) |
| void | cg_upnp_service_setquerylistener (CgUpnpService *service, CG_UPNP_STATEVARIABLE_LISTNER queryListener) |
| CgUpnpActionList * | cg_upnp_service_getactionlist (CgUpnpService *service) |
| CgUpnpAction * | cg_upnp_service_getactions (CgUpnpService *service) |
| CgUpnpServiceStateTable * | cg_upnp_service_getservicestatetable (CgUpnpService *service) |
| CgUpnpStateVariable * | cg_upnp_service_getstatevariables (CgUpnpService *service) |
| BOOL | cg_upnp_service_addsubscriber (CgUpnpService *service, CgUpnpSubscriber *sub) |
| BOOL | cg_upnp_service_removesubscriber (CgUpnpService *service, CgUpnpSubscriber *sub) |
| CgUpnpSubscriber * | cg_upnp_service_getsubscriberbysid (CgUpnpService *service, char *sid) |
Function Documentation
Add a subscriber to the service
- Parameters:
-
| service | The service in question |
| sub | The subscriber |
Send a service announcement (advertisement) from the given address
- Parameters:
-
| service | The service to advertise |
| bindAddr | The address to attach to the announcement |
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 |
Clear the contents of a UPnP service
- Parameters:
-
| service | The service to clear |
Destroy a UPnP service
- Parameters:
-
| service | The service to destroy |
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
Get the service's list of actions (head of list)
- Parameters:
-
| service | The service in question |
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 |
Get the service's control URL
- Parameters:
-
| service | The service in question |
- Returns:
- char*
Get the service's description XML nodes as a string
- Parameters:
-
| service | The service in question |
| descStr | The description string |
Get the service's event subscription URL
- Parameters:
-
| service | The service in question |
- Returns:
- char*
| char* cg_upnp_service_getnotifyservicetypent |
( |
CgUpnpService * |
service, |
|
|
char * |
buf, |
|
|
int |
bufSize |
|
) |
| |
| char* cg_upnp_service_getnotifyservicetypeusn |
( |
CgUpnpService * |
service, |
|
|
char * |
buf, |
|
|
int |
bufSize |
|
) |
| |
Get the service's SCPD (service description) URL
- Parameters:
-
| service | The service in question |
- Returns:
- CgNetURL Pointer to URL/URI structure
Get the service's state table
- Parameters:
-
| service | The service in question |
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
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 |
Find a subscriber from the service's list of subscribers by its SID (Subscription ID)
- Parameters:
-
| service | The service in question |
| sid | The SID |
| static void cg_upnp_service_initactionlist |
( |
CgUpnpService * |
service | ) |
[static] |
| static void cg_upnp_service_initchildnodes |
( |
CgUpnpService * |
service | ) |
[static] |
| static void cg_upnp_service_initservicestatetable |
( |
CgUpnpService * |
service | ) |
[static] |
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
Create a new UPnP service
| 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 |
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 |
Remove a subscriber from the service
- Parameters:
-
| service | The service in question |
| sub | The subscriber to remove |
Set an action listener to the service
- Parameters:
-
| service | The service in question |
| actionListener | A callback function of type CG_UPNP_ACTION_LISTNER |
Set a query listener to the service
- Parameters:
-
| service | The service in question |
| queryListener | A callback function of type CG_UPNP_STATEVARIABLE_LISTNER |
| char* cg_upnp_servicetype_getidentifier |
( |
char * |
serviceType | ) |
|
Get the identifier-part of a service type string (usually "urn")
- Parameters:
-
- 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:
-
- 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:
-
- 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:
-
- 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:
-
- 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:
-
- Returns:
- A newly-created char* if successful; otherwise NULL