libUPnP 1.8.0
|
#include "config.h"
#include <sys/stat.h>
#include <assert.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <sys/param.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <netinet/in.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <unistd.h>
#include "upnpapi.h"
#include "httpreadwrite.h"
#include "membuffer.h"
#include "ssdplib.h"
#include "soaplib.h"
#include "ThreadPool.h"
#include "sysdep.h"
#include "uuid.h"
#include "gena.h"
#include "miniserver.h"
#include "service_table.h"
Functions | |
static int | WinsockInit (void) |
(Windows Only) Initializes the Windows Winsock library. | |
static int | UpnpInitMutexes (void) |
Initializes the global mutexes used by the UPnP SDK. | |
static int | UpnpInitThreadPools (void) |
Initializes the global threadm pools used by the UPnP SDK. | |
static int | UpnpInitPreamble (void) |
Performs the initial steps in initializing the UPnP SDK. | |
static int | UpnpInitStartServers (unsigned short DestPort) |
Finishes initializing the UPnP SDK. | |
int | UpnpInit (const char *HostIP, unsigned short DestPort) |
Initializes the Linux SDK for UPnP Devices (IPv4 only). | |
int | UpnpInit2 (const char *IfName, unsigned short DestPort) |
Initializes the Linux SDK for UPnP Devices (IPv4 or IPv6). | |
int | UpnpFinish (void) |
Terminates the Linux SDK for UPnP Devices. | |
unsigned short | UpnpGetServerPort (void) |
Returns the internal server IPv4 UPnP listening port. | |
unsigned short | UpnpGetServerPort6 (void) |
Returns the internal server IPv6 UPnP listening port. | |
const char * | UpnpGetServerIpAddress (void) |
Returns the local IPv4 listening ip address. | |
const char * | UpnpGetServerIp6Address (void) |
Returns the local IPv6 listening ip address. | |
int | UpnpRegisterRootDevice (const char *DescUrl, Upnp_FunPtr Fun, const void *Cookie, UpnpDevice_Handle *Hnd) |
Registers a device application with the UPnP Library. | |
static int | GetDescDocumentAndURL (Upnp_DescType descriptionType, char *description, unsigned int bufferLen, int config_baseURL, int AddressFamily, IXML_Document **xmlDoc, char *descURL) |
Fills the sockadr_in with miniserver information. | |
int | UpnpRegisterRootDevice2 (Upnp_DescType descriptionType, const char *description_const, size_t bufferLen, int config_baseURL, Upnp_FunPtr Fun, const void *Cookie, UpnpDevice_Handle *Hnd) |
Registers a device application with the UPnP Library. Similar to UpnpRegisterRootDevice, except that it also allows the description document to be specified as a file or a memory buffer. | |
int | UpnpRegisterRootDevice3 (const char *DescUrl, Upnp_FunPtr Fun, const void *Cookie, UpnpDevice_Handle *Hnd, const int AddressFamily) |
Registers a device application for a specific address family with the UPnP library. | |
int | UpnpUnRegisterRootDevice (UpnpDevice_Handle Hnd) |
Unregisters a root device registered with UpnpRegisterRootDevice or UpnpRegisterRootDevice2. | |
int | UpnpRegisterClient (Upnp_FunPtr Fun, const void *Cookie, UpnpClient_Handle *Hnd) |
Registers a control point application with the UPnP Library. | |
int | UpnpUnRegisterClient (UpnpClient_Handle Hnd) |
Unregisters a control point application, unsubscribing all active subscriptions. | |
int | UpnpSendAdvertisement (UpnpDevice_Handle Hnd, int Exp) |
Sends out the discovery announcements for all devices and services for a device. | |
int | UpnpSearchAsync (UpnpClient_Handle Hnd, int Mx, const char *Target_const, const void *Cookie_const) |
Searches for devices matching the given search target. | |
int | UpnpSetMaxSubscriptions (UpnpDevice_Handle Hnd, int MaxSubscriptions) |
Sets the maximum number of subscriptions accepted per service. | |
int | UpnpSetMaxSubscriptionTimeOut (UpnpDevice_Handle Hnd, int MaxSubscriptionTimeOut) |
Sets the maximum time-out accepted for a subscription request or renewal. | |
int | UpnpSubscribeAsync (UpnpClient_Handle Hnd, const char *EvtUrl_const, int TimeOut, Upnp_FunPtr Fun, const void *Cookie_const) |
Performs the same operation as UpnpSubscribe, but returns immediately and calls the registered callback function when the operation is complete. | |
int | UpnpSubscribe (UpnpClient_Handle Hnd, const char *EvtUrl_const, int *TimeOut, Upnp_SID SubsId) |
Registers a control point to receive event notifications from another device. | |
int | UpnpUnSubscribe (UpnpClient_Handle Hnd, const Upnp_SID SubsId) |
Removes the subscription of a control point from a service previously subscribed to using UpnpSubscribe or UpnpSubscribeAsync. | |
int | UpnpUnSubscribeAsync (UpnpClient_Handle Hnd, Upnp_SID SubsId, Upnp_FunPtr Fun, const void *Cookie_const) |
Removes a subscription of a control point from a service previously subscribed to using UpnpSubscribe or UpnpSubscribeAsync, generating a callback when the operation is complete. | |
int | UpnpRenewSubscription (UpnpClient_Handle Hnd, int *TimeOut, const Upnp_SID SubsId) |
Renews a subscription that is about to expire. | |
int | UpnpRenewSubscriptionAsync (UpnpClient_Handle Hnd, int TimeOut, Upnp_SID SubsId, Upnp_FunPtr Fun, const void *Cookie_const) |
Renews a subscription that is about to expire, generating a callback when the operation is complete. | |
int | UpnpNotify (UpnpDevice_Handle Hnd, const char *DevID_const, const char *ServName_const, const char **VarName_const, const char **NewVal_const, int cVariables) |
Sends out an event change notification to all control points subscribed to a particular service. | |
int | UpnpNotifyExt (UpnpDevice_Handle Hnd, const char *DevID_const, const char *ServName_const, IXML_Document *PropSet) |
Similar to UpnpNotify except that it takes a DOM document for the event rather than an array of strings. | |
int | UpnpAcceptSubscription (UpnpDevice_Handle Hnd, const char *DevID_const, const char *ServName_const, const char **VarName_const, const char **NewVal_const, int cVariables, const Upnp_SID SubsId) |
Accepts a subscription request and sends out the current state of the eventable variables for a service. | |
int | UpnpAcceptSubscriptionExt (UpnpDevice_Handle Hnd, const char *DevID_const, const char *ServName_const, IXML_Document *PropSet, const Upnp_SID SubsId) |
Similar to UpnpAcceptSubscription() except that it takes a DOM document for the variables to event rather than an array of strings. | |
int | UpnpSendAction (UpnpClient_Handle Hnd, const char *ActionURL_const, const char *ServiceType_const, const char *DevUDN_const, IXML_Document *Action, IXML_Document **RespNodePtr) |
Sends a message to change a state variable in a service. | |
int | UpnpSendActionEx (UpnpClient_Handle Hnd, const char *ActionURL_const, const char *ServiceType_const, const char *DevUDN_const, IXML_Document *Header, IXML_Document *Action, IXML_Document **RespNodePtr) |
Sends a message to change a state variable in a service. | |
int | UpnpSendActionAsync (UpnpClient_Handle Hnd, const char *ActionURL_const, const char *ServiceType_const, const char *DevUDN_const, IXML_Document *Act, Upnp_FunPtr Fun, const void *Cookie_const) |
Sends a message to change a state variable in a service, generating a callback when the operation is complete. | |
int | UpnpSendActionExAsync (UpnpClient_Handle Hnd, const char *ActionURL_const, const char *ServiceType_const, const char *DevUDN_const, IXML_Document *Header, IXML_Document *Act, Upnp_FunPtr Fun, const void *Cookie_const) |
Sends a message to change a state variable in a service, generating a callback when the operation is complete. | |
int | UpnpGetServiceVarStatusAsync (UpnpClient_Handle Hnd, const char *ActionURL_const, const char *VarName_const, Upnp_FunPtr Fun, const void *Cookie_const) |
Queries the state of a variable of a service, generating a callback when the operation is complete. | |
int | UpnpGetServiceVarStatus (UpnpClient_Handle Hnd, const char *ActionURL_const, const char *VarName_const, DOMString *StVar) |
Queries the state of a state variable of a service on another device. | |
int | UpnpOpenHttpPost (const char *url, void **handle, const char *contentType, int contentLength, int timeout) |
Makes an HTTP POST request message, opens a connection to the server and sends the POST request to the server if the connection to the server succeeds. | |
int | UpnpWriteHttpPost (void *handle, char *buf, unsigned int *size, int timeout) |
Sends a request to a server to copy the contents of a buffer to the URI specified in the UpnpOpenHttpPost call. | |
int | UpnpCloseHttpPost (void *handle, int *httpStatus, int timeout) |
Sends and receives any pending data, closes the connection with the server, and frees memory allocated during the UpnpOpenHttpPost call. | |
int | UpnpOpenHttpGet (const char *url_str, void **Handle, char **contentType, int *contentLength, int *httpStatus, int timeout) |
Gets a file specified in a URL. | |
int | UpnpOpenHttpGetProxy (const char *url_str, const char *proxy_str, void **Handle, char **contentType, int *contentLength, int *httpStatus, int timeout) |
Gets a file specified in a URL through the specified proxy. | |
int | UpnpOpenHttpGetEx (const char *url_str, void **Handle, char **contentType, int *contentLength, int *httpStatus, int lowRange, int highRange, int timeout) |
Gets specified number of bytes from a file specified in the URL. | |
int | UpnpCancelHttpGet (void *Handle) |
Set the cancel flag of the handle parameter. | |
int | UpnpCloseHttpGet (void *Handle) |
Closes the connection and frees memory that was allocated for the handle parameter. | |
int | UpnpReadHttpGet (void *Handle, char *buf, unsigned int *size, int timeout) |
Gets specified number of bytes from a file specified in a URL. | |
int | UpnpHttpGetProgress (void *Handle, unsigned int *length, unsigned int *total) |
Retrieve progress information of a http-get transfer. | |
int | UpnpDownloadUrlItem (const char *url, char **outBuf, char *contentType) |
Downloads a file specified in a URL. | |
int | UpnpDownloadXmlDoc (const char *url, IXML_Document **xmlDoc) |
Downloads an XML document specified in a URL. | |
int | UpnpGetIfInfo (const char *IfName) |
Retrieve interface information and keep it in global variables. If NULL, we'll find the first suitable interface for operation. | |
void | UpnpThreadDistribution (struct UpnpNonblockParam *Param) |
Schedule async functions in threadpool. | |
Upnp_FunPtr | GetCallBackFn (UpnpClient_Handle Hnd) |
Get callback function ptr from a handle. | |
int | GetFreeHandle () |
Get a free handle. | |
Upnp_Handle_Type | GetClientHandleInfo (UpnpClient_Handle *client_handle_out, struct Handle_Info **HndInfo) |
Get client handle info. | |
Upnp_Handle_Type | GetDeviceHandleInfo (const 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 spcified. | |
Upnp_Handle_Type | GetHandleInfo (UpnpClient_Handle Hnd, struct Handle_Info **HndInfo) |
Get handle information. | |
int | FreeHandle (int Upnp_Handle) |
Free handle. | |
int | PrintHandleInfo (UpnpClient_Handle Hnd) |
Print handle info. | |
int | getlocalhostname (char *out, const int out_len) |
Get local IP address. | |
void | AutoAdvertise (void *input) |
This function is a timer thread scheduled by UpnpSendAdvertisement to the send advetisement again. | |
int | UpnpAddVirtualDir (const char *newDirName) |
Adds a virtual directory mapping. | |
int | UpnpRemoveVirtualDir (const char *dirName) |
Removes a virtual directory mapping made with UpnpAddVirtualDir. | |
void | UpnpRemoveAllVirtualDirs (void) |
Removes all virtual directory mappings. | |
int | UpnpEnableWebserver (int enable) |
Enables or disables the webserver. | |
int | UpnpIsWebserverEnabled (void) |
Checks if the webserver is enabled or disabled. | |
int | UpnpVirtualDir_set_GetInfoCallback (VDCallback_GetInfo callback) |
Sets the get_info callback function to be used to access a virtual directory. | |
int | UpnpVirtualDir_set_OpenCallback (VDCallback_Open callback) |
Sets the open callback function to be used to access a virtual directory. | |
int | UpnpVirtualDir_set_ReadCallback (VDCallback_Read callback) |
Sets the read callback function to be used to access a virtual directory. | |
int | UpnpVirtualDir_set_WriteCallback (VDCallback_Write callback) |
Sets the write callback function to be used to access a virtual directory. | |
int | UpnpVirtualDir_set_SeekCallback (VDCallback_Seek callback) |
Sets the seek callback function to be used to access a virtual directory. | |
int | UpnpVirtualDir_set_CloseCallback (VDCallback_Close callback) |
Sets the close callback function to be used to access a virtual directory. | |
int | UpnpSetContentLength (UpnpClient_Handle Hnd, int contentLength) |
int | UpnpSetMaxContentLength (size_t contentLength) |
Sets the maximum content-length that the SDK will process on an incoming SOAP requests or responses. | |
Variables | |
struct VirtualDirCallbacks | virtualDirCallback |
virtualDirList * | pVirtualDirList |
ithread_mutex_t | GlobalClientSubscribeMutex |
ithread_rwlock_t | GlobalHndRWLock |
ithread_mutex_t | gUUIDMutex |
ithread_mutex_t | gSDKInitMutex = PTHREAD_MUTEX_INITIALIZER |
TimerThread | gTimerThread |
ThreadPool | gSendThreadPool |
ThreadPool | gRecvThreadPool |
ThreadPool | gMiniServerThreadPool |
WebServerState | bWebServerState = WEB_SERVER_DISABLED |
char | gIF_NAME [LINE_SIZE] = { '\0' } |
char | gIF_IPV4 [22] = { '\0' } |
char | gIF_IPV6 [65] = { '\0' } |
int | gIF_INDEX = -1 |
unsigned short | LOCAL_PORT_V4 |
unsigned short | LOCAL_PORT_V6 |
void * | HandleTable [NUM_HANDLE] |
membuffer | gDocumentRootDir |
size_t | g_maxContentLength = DEFAULT_SOAP_CONTENT_LENGTH |
int | UpnpSdkInit = 0 |
int | UpnpSdkClientRegistered = 0 |
int | UpnpSdkDeviceRegisteredV4 = 0 |
int | UpnpSdkDeviceregisteredV6 = 0 |
Upnp_SID | gUpnpSdkNLSuuid |
void AutoAdvertise | ( | void * | input | ) |
This function is a timer thread scheduled by UpnpSendAdvertisement to the send advetisement again.
[in] | input | Information provided to the thread. |
References free_upnp_timeout(), and UpnpSendAdvertisement().
Referenced by UpnpSendAdvertisement().
int FreeHandle | ( | int | Handle | ) |
Free handle.
[in] | Upnp_Handle | Handle index. |
References HandleTable, UPNP_E_INVALID_HANDLE, UPNP_E_SUCCESS, and UpnpPrintf().
Referenced by UpnpRegisterRootDevice(), UpnpRegisterRootDevice2(), UpnpRegisterRootDevice3(), UpnpUnRegisterClient(), and UpnpUnRegisterRootDevice().
Upnp_FunPtr GetCallBackFn | ( | UpnpClient_Handle | Hnd | ) |
Upnp_Handle_Type GetClientHandleInfo | ( | int * | client_handle_out, |
struct Handle_Info ** | HndInfo | ||
) |
Get client handle info.
[in] | client_handle_out | client handle pointer (key for the client handle structure). |
[out] | HndInfo | Client handle structure passed by this function. |
References GetHandleInfo().
Referenced by gena_process_notification_event(), and UpnpFinish().
static int GetDescDocumentAndURL | ( | Upnp_DescType | descriptionType, |
char * | description, | ||
unsigned int | bufferLen, | ||
int | config_baseURL, | ||
int | AddressFamily, | ||
IXML_Document ** | xmlDoc, | ||
char * | descURL | ||
) | [static] |
Fills the sockadr_in with miniserver information.
References UPNP_E_INVALID_PARAM, UPNP_E_SUCCESS, UPNP_E_URL_TOO_BIG, UpnpDownloadXmlDoc(), and UPNPREG_URL_DESC.
Referenced by UpnpRegisterRootDevice2().
Upnp_Handle_Type GetDeviceHandleInfo | ( | const int | AddressFamily, |
int * | device_handle_out, | ||
struct Handle_Info ** | HndInfo | ||
) |
Retrieves the device handle and information of the first device of the address family spcified.
[in] | AddressFamily | Address family. |
[out] | device_handle_out | Device handle pointer. |
[out] | HndInfo | Device handle structure passed by this function. |
References GetHandleInfo(), UpnpSdkDeviceRegisteredV4, and UpnpSdkDeviceregisteredV6.
Referenced by gena_process_subscription_renewal_request(), gena_process_subscription_request(), gena_process_unsubscribe_request(), and UpnpFinish().
int GetFreeHandle | ( | ) |
Get a free handle.
References HandleTable, and UPNP_E_OUTOF_HANDLE.
Referenced by UpnpRegisterClient(), UpnpRegisterRootDevice(), UpnpRegisterRootDevice2(), and UpnpRegisterRootDevice3().
Upnp_Handle_Type GetHandleInfo | ( | int | Hnd, |
struct Handle_Info ** | HndInfo | ||
) |
Get handle information.
Hnd | handle pointer (key for the client handle structure). |
HndInfo | handle structure passed by this function. |
References HandleTable, UPNP_E_INVALID_HANDLE, and UpnpPrintf().
Referenced by GenaAutoRenewSubscription(), genaInitNotify(), genaInitNotifyExt(), genaNotifyAll(), genaNotifyAllExt(), genaNotifyThread(), genaRenewSubscription(), genaSubscribe(), genaUnregisterClient(), genaUnregisterDevice(), genaUnSubscribe(), GetClientHandleInfo(), GetDeviceHandleInfo(), UpnpAcceptSubscription(), UpnpAcceptSubscriptionExt(), UpnpGetServiceVarStatus(), UpnpGetServiceVarStatusAsync(), UpnpNotify(), UpnpNotifyExt(), UpnpRenewSubscription(), UpnpRenewSubscriptionAsync(), UpnpSearchAsync(), UpnpSendAction(), UpnpSendActionAsync(), UpnpSendActionEx(), UpnpSendActionExAsync(), UpnpSendAdvertisement(), UpnpSetContentLength(), UpnpSetMaxSubscriptions(), UpnpSetMaxSubscriptionTimeOut(), UpnpSubscribe(), UpnpSubscribeAsync(), UpnpUnRegisterClient(), UpnpUnRegisterRootDevice(), UpnpUnSubscribe(), and UpnpUnSubscribeAsync().
int getlocalhostname | ( | char * | out, |
const int | out_len | ||
) |
Get local IP address.
Gets the ip address for the DEFAULT_INTERFACE interface which is up and not a loopback. Assumes at most MAX_INTERFACES interfaces
[out] | out | IP address of the interface. |
[in] | out_len | Length of the output buffer. |
References UPNP_E_INIT, UPNP_E_SUCCESS, and UpnpPrintf().
Referenced by UpnpInit().
int PrintHandleInfo | ( | UpnpClient_Handle | Hnd | ) |
Print handle info.
[in] | Hnd | Handle index. |
References Handle_Info::DescURL, HandleTable, Handle_Info::HType, UPNP_E_INVALID_HANDLE, UPNP_E_SUCCESS, and UpnpPrintf().
int UpnpGetIfInfo | ( | const char * | IfName | ) |
Retrieve interface information and keep it in global variables. If NULL, we'll find the first suitable interface for operation.
The interface must fulfill these requirements:
We'll retrieve the following information from the interface:
[in] | IfName | Interface name (can be NULL). |
References gIF_INDEX, gIF_IPV4, gIF_IPV6, gIF_NAME, UPNP_E_INIT, UPNP_E_INVALID_INTERFACE, UPNP_E_OUTOF_MEMORY, UPNP_E_SUCCESS, and UpnpPrintf().
Referenced by UpnpInit2().
static int UpnpInitMutexes | ( | void | ) | [static] |
Initializes the global mutexes used by the UPnP SDK.
References GlobalClientSubscribeMutex, GlobalHndRWLock, gUUIDMutex, UPNP_E_INIT_FAILED, and UPNP_E_SUCCESS.
Referenced by UpnpInitPreamble().
static int UpnpInitPreamble | ( | void | ) | [static] |
Performs the initial steps in initializing the UPnP SDK.
References genaCallback(), gUpnpSdkNLSuuid, HandleTable, SetGenaCallback(), SetSoapCallback(), TimerThreadInit(), UPNP_E_INIT_FAILED, UPNP_E_SUCCESS, UpnpFinish(), UpnpInitLog(), UpnpInitMutexes(), UpnpInitThreadPools(), UpnpPrintf(), and WinsockInit().
Referenced by UpnpInit(), and UpnpInit2().
static int UpnpInitStartServers | ( | unsigned short | DestPort | ) | [static] |
Finishes initializing the UPnP SDK.
[in] | DestPort | Local Port to listen for incoming connections. |
References LOCAL_PORT_V4, LOCAL_PORT_V6, StartMiniServer(), UPNP_E_SUCCESS, UpnpEnableWebserver(), UpnpFinish(), and UpnpPrintf().
Referenced by UpnpInit(), and UpnpInit2().
static int UpnpInitThreadPools | ( | void | ) | [static] |
Initializes the global threadm pools used by the UPnP SDK.
References UPNP_E_INIT_FAILED, UPNP_E_SUCCESS, UpnpFinish(), and UpnpSdkInit.
Referenced by UpnpInitPreamble().
void UpnpThreadDistribution | ( | struct UpnpNonblockParam * | Param | ) |
Schedule async functions in threadpool.
References DOMString, genaRenewSubscription(), genaSubscribe(), genaUnSubscribe(), UPNP_CONTROL_ACTION_COMPLETE, UPNP_CONTROL_GET_VAR_COMPLETE, UPNP_EVENT_RENEWAL_COMPLETE, UPNP_EVENT_SUBSCRIBE_COMPLETE, UPNP_EVENT_UNSUBSCRIBE_COMPLETE, UpnpActionComplete_delete(), UpnpActionComplete_new(), UpnpActionComplete_set_ActionRequest(), UpnpActionComplete_set_ActionResult(), UpnpActionComplete_set_ErrCode(), UpnpActionComplete_strcpy_CtrlUrl(), UpnpEventSubscribe_delete(), UpnpEventSubscribe_get_PublisherUrl(), UpnpEventSubscribe_get_SID(), UpnpEventSubscribe_new(), UpnpPrintf(), UpnpStateVarComplete_delete(), and UpnpStateVarComplete_new().
Referenced by UpnpGetServiceVarStatusAsync(), UpnpRenewSubscriptionAsync(), UpnpSendActionAsync(), UpnpSendActionExAsync(), UpnpSubscribeAsync(), and UpnpUnSubscribeAsync().
static int WinsockInit | ( | void | ) | [static] |
(Windows Only) Initializes the Windows Winsock library.
References UPNP_E_INIT_FAILED, and UPNP_E_SUCCESS.
Referenced by UpnpInitPreamble().
WebServerState bWebServerState = WEB_SERVER_DISABLED |
Flag to indicate the state of web server
Referenced by UpnpEnableWebserver(), and UpnpIsWebserverEnabled().
size_t g_maxContentLength = DEFAULT_SOAP_CONTENT_LENGTH |
Maximum content-length (in bytes) that the SDK will process on an incoming packet. Content-Length exceeding this size will be not processed and error 413 (HTTP Error Code) will be returned to the remote end point.
Referenced by UpnpSetContentLength(), and UpnpSetMaxContentLength().
a local dir which serves as webserver root
int gIF_INDEX = -1 |
Contains interface index. (extern'ed in upnp.h)
Referenced by parse_hostport(), and UpnpGetIfInfo().
char gIF_IPV4[22] = { '\0' } |
Static buffer to contain interface IPv4 address. (extern'ed in upnp.h)
Referenced by gena_subscribe(), UpnpGetIfInfo(), UpnpGetServerIpAddress(), and UpnpInit().
char gIF_IPV6[65] = { '\0' } |
Static buffer to contain interface IPv6 address. (extern'ed in upnp.h)
Referenced by gena_subscribe(), UpnpGetIfInfo(), and UpnpGetServerIp6Address().
char gIF_NAME[LINE_SIZE] = { '\0' } |
Static buffer to contain interface name. (extern'ed in upnp.h)
Referenced by UpnpGetIfInfo().
ithread_mutex_t GlobalClientSubscribeMutex |
Mutex to synchronize the subscription handling at the client side.
Referenced by UpnpFinish(), and UpnpInitMutexes().
ithread_rwlock_t GlobalHndRWLock |
rwlock to synchronize handles (root device or control point handle).
Referenced by UpnpFinish(), and UpnpInitMutexes().
Mini server thread pool.
Referenced by StartMiniServer().
Receive thread pool.
ithread_mutex_t gSDKInitMutex = PTHREAD_MUTEX_INITIALIZER |
Initialization mutex.
Referenced by UpnpInit(), and UpnpInit2().
Send thread pool.
Referenced by genaInitNotify(), genaInitNotifyExt(), genaNotifyAll(), genaNotifyAllExt(), and genaNotifyThread().
Global timer thread.
Referenced by free_client_subscription(), genaRenewSubscription(), and ScheduleGenaAutoRenew().
Global variable used in discovery notifications.
Referenced by UpnpInitPreamble().
ithread_mutex_t gUUIDMutex |
Mutex to synchronize the uuid creation process.
Referenced by UpnpFinish(), and UpnpInitMutexes().
void* HandleTable[NUM_HANDLE] |
UPnP device and control point handle table
Referenced by FreeHandle(), GetCallBackFn(), GetFreeHandle(), GetHandleInfo(), PrintHandleInfo(), UpnpInitPreamble(), UpnpRegisterClient(), UpnpRegisterRootDevice(), UpnpRegisterRootDevice2(), and UpnpRegisterRootDevice3().
unsigned short LOCAL_PORT_V4 |
local IPv4 port for the mini-server
Referenced by gena_subscribe(), UpnpGetServerPort(), UpnpInit(), and UpnpInitStartServers().
unsigned short LOCAL_PORT_V6 |
local IPv6 port for the mini-server
Referenced by gena_subscribe(), UpnpGetServerPort6(), and UpnpInitStartServers().
Pointer to the virtual directory list.
Referenced by UpnpAddVirtualDir(), UpnpRemoveAllVirtualDirs(), and UpnpRemoveVirtualDir().
int UpnpSdkClientRegistered = 0 |
Global variable to denote the state of Upnp SDK client registration. == 0 if unregistered, == 1 if registered.
Referenced by UpnpRegisterClient(), and UpnpUnRegisterClient().
int UpnpSdkDeviceRegisteredV4 = 0 |
Global variable to denote the state of Upnp SDK IPv4 device registration. == 0 if unregistered, == 1 if registered.
Referenced by GetDeviceHandleInfo(), UpnpRegisterRootDevice(), UpnpRegisterRootDevice2(), UpnpRegisterRootDevice3(), and UpnpUnRegisterRootDevice().
int UpnpSdkDeviceregisteredV6 = 0 |
Global variable to denote the state of Upnp SDK IPv6 device registration. == 0 if unregistered, == 1 if registered.
Referenced by GetDeviceHandleInfo(), UpnpRegisterRootDevice3(), and UpnpUnRegisterRootDevice().
int UpnpSdkInit = 0 |
Global variable to denote the state of Upnp SDK == 0 if uninitialized, == 1 if initialized.
Referenced by UpnpAcceptSubscription(), UpnpAcceptSubscriptionExt(), UpnpAddVirtualDir(), UpnpEnableWebserver(), UpnpFinish(), UpnpGetServerIp6Address(), UpnpGetServerIpAddress(), UpnpGetServerPort(), UpnpGetServerPort6(), UpnpGetServiceVarStatus(), UpnpGetServiceVarStatusAsync(), UpnpInit(), UpnpInit2(), UpnpInitThreadPools(), UpnpIsWebserverEnabled(), UpnpNotify(), UpnpNotifyExt(), UpnpRegisterClient(), UpnpRegisterRootDevice(), UpnpRegisterRootDevice2(), UpnpRegisterRootDevice3(), UpnpRemoveAllVirtualDirs(), UpnpRemoveVirtualDir(), UpnpRenewSubscription(), UpnpRenewSubscriptionAsync(), UpnpSearchAsync(), UpnpSendAction(), UpnpSendActionAsync(), UpnpSendActionEx(), UpnpSendActionExAsync(), UpnpSendAdvertisement(), UpnpSetContentLength(), UpnpSetMaxContentLength(), UpnpSetMaxSubscriptions(), UpnpSetMaxSubscriptionTimeOut(), UpnpSubscribe(), UpnpSubscribeAsync(), UpnpUnRegisterClient(), UpnpUnRegisterRootDevice(), UpnpUnSubscribe(), and UpnpUnSubscribeAsync().
This structure is for virtual directory callbacks
Referenced by UpnpVirtualDir_set_CloseCallback(), UpnpVirtualDir_set_GetInfoCallback(), UpnpVirtualDir_set_OpenCallback(), UpnpVirtualDir_set_ReadCallback(), UpnpVirtualDir_set_SeekCallback(), and UpnpVirtualDir_set_WriteCallback().