45#include "VirtualDir.h"
48#define MAX_INTERFACES 256
50#define DEFAULT_INTERFACE 1
56#define DEFAULT_MAXAGE 1800
58#define DEFAULT_SOAP_CONTENT_LENGTH 16000
59#define MAX_SOAP_CONTENT_LENGTH (size_t)32000
68#define UPNP_TIMEOUT 30
70typedef enum {HND_INVALID=-1,HND_CLIENT,HND_DEVICE} Upnp_Handle_Type;
85#ifdef INCLUDE_DEVICE_APIS
100 int RegistrationState;
118#ifdef INCLUDE_CLIENT_APIS
140#define HandleLock() HandleWriteLock()
143#define HandleWriteLock() \
144 UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Trying a write lock\n"); \
145 ithread_rwlock_wrlock(&GlobalHndRWLock); \
146 UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Write lock acquired\n");
149#define HandleReadLock() \
150 UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Trying a read lock\n"); \
151 ithread_rwlock_rdlock(&GlobalHndRWLock); \
152 UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Read lock acquired\n");
155#define HandleUnlock() \
156 UpnpPrintf(UPNP_INFO, API,__FILE__, __LINE__, "Trying Unlock\n"); \
157 ithread_rwlock_unlock(&GlobalHndRWLock); \
158 UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Unlocked rwlock\n");
170 int *client_handle_out,
187 int *device_handle_out,
204 int *device_handle_out,
213extern char gIF_IPV4[INET_ADDRSTRLEN];
214extern char gIF_IPV6[INET6_ADDRSTRLEN];
254 char VarName[NAME_SIZE];
255 char NewVal[NAME_SIZE];
256 char DevType[NAME_SIZE];
257 char DevId[NAME_SIZE];
258 char ServiceType[NAME_SIZE];
259 char ServiceVer[NAME_SIZE];
266 struct DevDesc *Devdesc;
280#define E_HTTP_SYNTAX -6
int(* Upnp_FunPtr)(Upnp_EventType EventType, const void *Event, void *Cookie)
Definition: Callback.h:145
char Upnp_SID[44]
Holds the subscription identifier for a subscription between a client and a device.
Definition: upnp.h:445
struct VirtualDirCallbacks virtualDirCallback
Definition: upnpapi.c:98
void UpnpThreadDistribution(struct UpnpNonblockParam *Param)
Schedule async functions in threadpool.
Definition: upnpapi.c:3691
ThreadPool gSendThreadPool
Definition: upnpapi.c:122
char gIF_IPV6_ULA_GUA[INET6_ADDRSTRLEN]
Definition: upnpapi.c:143
ThreadPool gRecvThreadPool
Definition: upnpapi.c:125
int getlocalhostname(char *out, size_t out_len)
Get local IP address.
Definition: upnpapi.c:3953
int PrintHandleInfo(UpnpClient_Handle Hnd)
Print handle info.
Definition: upnpapi.c:3927
Upnp_Handle_Type GetDeviceHandleInfoForPath(const char *path, int AddressFamily, int *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:3863
size_t g_maxContentLength
Definition: upnpapi.c:163
int UpnpClient_Handle
Returned when a control point application registers with UpnpRegisterClient.
Definition: upnp.h:426
virtualDirList * pVirtualDirList
Definition: upnpapi.c:101
int g_UpnpSdkEQMaxLen
Definition: upnpapi.c:169
int UpnpGetIfInfo(const char *IfName)
Retrieve interface information and keep it in global variables. If NULL, we'll find the first suitabl...
Definition: upnpapi.c:3304
unsigned short LOCAL_PORT_V6
Definition: upnpapi.c:152
unsigned short LOCAL_PORT_V4
Definition: upnpapi.c:149
ithread_rwlock_t GlobalHndRWLock
Definition: upnpapi.c:109
int UpnpDevice_Handle
Returned when a device application registers with UpnpRegisterRootDevice, UpnpRegisterRootDevice2,...
Definition: upnp.h:436
Upnp_Handle_Type GetDeviceHandleInfo(UpnpDevice_Handle start, int AddressFamily, int *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:3827
void AutoAdvertise(void *input)
This function is a timer thread scheduled by UpnpSendAdvertisement to the send advetisement again.
Definition: upnpapi.c:4113
char gIF_IPV4[INET_ADDRSTRLEN]
Definition: upnpapi.c:137
TimerThread gTimerThread
Definition: upnpapi.c:119
char gIF_NAME[LINE_SIZE]
Definition: upnpapi.c:134
unsigned gIF_INDEX
Definition: upnpapi.c:146
ThreadPool gMiniServerThreadPool
Definition: upnpapi.c:128
int g_UpnpSdkEQMaxAge
Definition: upnpapi.c:179
char gIF_IPV6[INET6_ADDRSTRLEN]
Definition: upnpapi.c:140
Upnp_Handle_Type GetHandleInfo(int Hnd, struct Handle_Info **HndInfo)
Get handle information.
Definition: upnpapi.c:3900
Upnp_Handle_Type GetClientHandleInfo(int *client_handle_out, struct Handle_Info **HndInfo)
Get client handle info.
Definition: upnpapi.c:3805
WebServerState bWebServerState
Definition: upnpapi.c:131
Upnp_Handle_Type HType
Definition: upnpapi.h:76
IXML_NodeList * ServiceList
Definition: upnpapi.h:106
int aliasInstalled
Definition: upnpapi.h:82
char DescXML[LINE_SIZE]
Definition: upnpapi.h:92
GenlibClientSubscription * ClientSubList
Definition: upnpapi.h:120
service_table ServiceTable
Definition: upnpapi.h:108
char LowerDescURL[LINE_SIZE]
Definition: upnpapi.h:90
char DescURL[LINE_SIZE]
Definition: upnpapi.h:87
IXML_Document * DescDocument
Definition: upnpapi.h:102
char * Cookie
Definition: upnpapi.h:80
Upnp_FunPtr Callback
Definition: upnpapi.h:78
int MaxSubscriptionTimeOut
Definition: upnpapi.h:112
int MaxSubscriptions
Definition: upnpapi.h:110
LinkedList SsdpSearchList
Definition: upnpapi.h:122
IXML_NodeList * DeviceList
Definition: upnpapi.h:104
int DeviceAf
Definition: upnpapi.h:114
Definition: LinkedList.h:84
Definition: service_table.h:74
Definition: service_table.h:87
A thread pool similar to the thread pool in the UPnP SDK.
Definition: ThreadPool.h:213
Definition: TimerThread.h:68
Definition: upnpapi.h:250
Definition: VirtualDir.h:12
Data structure representing the DOM Document.
Definition: ixml.h:198
Data structure representing a list of nodes.
Definition: ixml.h:246
Definition: VirtualDir.h:62