40 #include "VirtualDir.h"
43 #define MAX_INTERFACES 256
49 #define DEFAULT_MAXAGE 1800
51 #define DEFAULT_SOAP_CONTENT_LENGTH 16000
52 #define MAX_SOAP_CONTENT_LENGTH (size_t)32000
54 #define NUM_HANDLE 200
61 #define UPNP_TIMEOUT 30
83 #ifdef INCLUDE_DEVICE_APIS
98 int RegistrationState;
116 #ifdef INCLUDE_CLIENT_APIS
137 #define HandleLock() HandleWriteLock()
139 #define HandleWriteLock() \
141 UPNP_INFO, API, __FILE__, __LINE__, "Trying a write lock\n"); \
142 ithread_rwlock_wrlock(&GlobalHndRWLock); \
143 UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Write lock acquired\n");
145 #define HandleReadLock() \
147 UPNP_INFO, API, __FILE__, __LINE__, "Trying a read lock\n"); \
148 ithread_rwlock_rdlock(&GlobalHndRWLock); \
149 UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Read lock acquired\n");
151 #define HandleUnlock() \
152 UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Trying Unlock\n"); \
153 ithread_rwlock_unlock(&GlobalHndRWLock); \
154 UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Unlocked rwlock\n");
165 int *client_handle_out,
182 int *device_handle_out,
199 int *device_handle_out,
206 extern char gIF_IPV4[INET_ADDRSTRLEN];
208 extern char gIF_IPV6[INET6_ADDRSTRLEN];
247 char VarName[NAME_SIZE];
248 char NewVal[NAME_SIZE];
249 char DevType[NAME_SIZE];
250 char DevId[NAME_SIZE];
251 char ServiceType[NAME_SIZE];
252 char ServiceVer[NAME_SIZE];
259 struct DevDesc *Devdesc;
271 #define E_HTTP_SYNTAX -6
Upnp_FunPtr Callback
Definition: upnpapi.h:76
int UpnpClient_Handle
Returned when a control point application registers with UpnpRegisterClient.
Definition: upnp.h:429
int(* Upnp_FunPtr)(Upnp_EventType EventType, const void *Event, void *Cookie)
Definition: Callback.h:145
IXML_Document * DescDocument
Definition: upnpapi.h:100
size_t g_maxContentLength
Definition: upnpapi.c:196
char DescURL[LINE_SIZE]
Definition: upnpapi.h:85
Definition: service_table.h:71
Definition: TimerThread.h:68
unsigned gIF_IPV6_PREFIX_LENGTH
Definition: upnpapi.c:166
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:4148
Definition: upnpapi.h:242
IXML_NodeList * DeviceList
Definition: upnpapi.h:102
Upnp_Handle_Type GetHandleInfo(int Hnd, struct Handle_Info **HndInfo)
Get handle information.
Definition: upnpapi.c:4225
int gAllowLiteralHostRedirection
Definition: upnpapi.c:150
char LowerDescURL[LINE_SIZE]
Definition: upnpapi.h:88
int g_UpnpSdkEQMaxAge
Definition: upnpapi.c:212
Upnp_Handle_Type HType
Definition: upnpapi.h:74
LinkedList SsdpSearchList
Definition: upnpapi.h:120
Definition: VirtualDir.h:10
ThreadPool gSendThreadPool
Definition: upnpapi.c:132
IXML_NodeList * ServiceList
Definition: upnpapi.h:104
WebServerState bWebServerState
Definition: upnpapi.c:141
GenlibClientSubscription * ClientSubList
Definition: upnpapi.h:118
int PrintHandleInfo(UpnpClient_Handle Hnd)
Print handle info.
Definition: upnpapi.c:4261
char gIF_IPV6[INET6_ADDRSTRLEN]
Definition: upnpapi.c:163
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:4185
int MaxSubscriptionTimeOut
Definition: upnpapi.h:110
A thread pool similar to the thread pool in the UPnP SDK.
Definition: ThreadPool.h:216
unsigned short LOCAL_PORT_V6
Definition: upnpapi.c:182
TimerThread gTimerThread
Definition: upnpapi.c:129
int aliasInstalled
Definition: upnpapi.h:80
Definition: service_table.h:89
char gIF_IPV4_NETMASK[INET_ADDRSTRLEN]
Definition: upnpapi.c:159
void AutoAdvertise(void *input)
This function is a timer thread scheduled by UpnpSendAdvertisement to the send advetisement again...
Definition: upnpapi.c:4300
unsigned short LOCAL_PORT_V4
Definition: upnpapi.c:179
unsigned gIF_IPV6_ULA_GUA_PREFIX_LENGTH
Definition: upnpapi.c:173
void UpnpThreadDistribution(struct UpnpNonblockParam *Param)
Schedule async functions in threadpool.
Definition: upnpapi.c:4006
char gIF_NAME[LINE_SIZE]
Definition: upnpapi.c:153
char gIF_IPV4[INET_ADDRSTRLEN]
Definition: upnpapi.c:156
int UpnpDevice_Handle
Returned when a device application registers with UpnpRegisterRootDevice, UpnpRegisterRootDevice2, UpnpRegisterRootDevice3 or UpnpRegisterRootDevice4.
Definition: upnp.h:439
ithread_rwlock_t GlobalHndRWLock
Definition: upnpapi.c:120
void * gWebCallback_HostValidateCookie
Definition: upnpapi.c:147
Upnp_Handle_Type GetClientHandleInfo(int *client_handle_out, struct Handle_Info **HndInfo)
Get client handle info.
Definition: upnpapi.c:4128
service_table ServiceTable
Definition: upnpapi.h:106
Data structure representing a list of nodes.
Definition: ixml.h:202
virtualDirList * pVirtualDirList
Definition: upnpapi.c:112
unsigned gIF_INDEX
Definition: upnpapi.c:176
struct VirtualDirCallbacks virtualDirCallback
Definition: upnpapi.c:109
unsigned short LOCAL_PORT_V6_ULA_GUA
Definition: upnpapi.c:185
WebCallback_HostValidate gWebCallback_HostValidate
Definition: upnpapi.c:144
char * Cookie
Definition: upnpapi.h:78
int MaxSubscriptions
Definition: upnpapi.h:108
int DeviceAf
Definition: upnpapi.h:112
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:3653
int g_UpnpSdkEQMaxLen
Definition: upnpapi.c:202
Data structure representing the DOM Document.
Definition: ixml.h:159
ThreadPool gRecvThreadPool
Definition: upnpapi.c:135
Definition: VirtualDir.h:60
char Upnp_SID[44]
Holds the subscription identifier for a subscription between a client and a device.
Definition: upnp.h:448
char gIF_IPV6_ULA_GUA[INET6_ADDRSTRLEN]
Definition: upnpapi.c:170
ThreadPool gMiniServerThreadPool
Definition: upnpapi.c:138
char DescXML[LINE_SIZE]
Definition: upnpapi.h:90
Definition: GenlibClientSubscription.c:18
Definition: LinkedList.h:83