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 64 #define UPNP_TIMEOUT 30 66 typedef enum {HND_INVALID=-1,HND_CLIENT,HND_DEVICE} Upnp_Handle_Type;
81 #ifdef INCLUDE_DEVICE_APIS 96 int RegistrationState;
114 #ifdef INCLUDE_CLIENT_APIS 136 #define HandleLock() HandleWriteLock() 139 #define HandleWriteLock() \ 140 UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Trying a write lock"); \ 141 ithread_rwlock_wrlock(&GlobalHndRWLock); \ 142 UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Write lock acquired"); 145 #define HandleReadLock() \ 146 UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Trying a read lock"); \ 147 ithread_rwlock_rdlock(&GlobalHndRWLock); \ 148 UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Read lock acquired"); 151 #define HandleUnlock() \ 152 UpnpPrintf(UPNP_INFO, API,__FILE__, __LINE__, "Trying Unlock"); \ 153 ithread_rwlock_unlock(&GlobalHndRWLock); \ 154 UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Unlocked rwlock"); 166 int *client_handle_out,
179 int *device_handle_out,
185 extern char gIF_IPV4[INET_ADDRSTRLEN];
186 extern char gIF_IPV6[INET6_ADDRSTRLEN];
226 char VarName[NAME_SIZE];
227 char NewVal[NAME_SIZE];
228 char DevType[NAME_SIZE];
229 char DevId[NAME_SIZE];
230 char ServiceType[NAME_SIZE];
231 char ServiceVer[NAME_SIZE];
238 struct DevDesc *Devdesc;
252 #define E_HTTP_SYNTAX -6 Upnp_FunPtr Callback
Definition: upnpapi.h:74
int UpnpClient_Handle
Returned when a control point application registers with UpnpRegisterClient.
Definition: upnp.h:426
int(* Upnp_FunPtr)(Upnp_EventType EventType, const void *Event, void *Cookie)
Definition: Callback.h:145
IXML_Document * DescDocument
Definition: upnpapi.h:98
size_t g_maxContentLength
Definition: upnpapi.c:164
char DescURL[LINE_SIZE]
Definition: upnpapi.h:83
Definition: TimerThread.h:67
Definition: upnpapi.h:221
IXML_NodeList * DeviceList
Definition: upnpapi.h:100
Upnp_Handle_Type GetHandleInfo(int Hnd, struct Handle_Info **HndInfo)
Get handle information.
Definition: upnpapi.c:3883
int getlocalhostname(char *out, size_t out_len)
Get local IP address.
Definition: upnpapi.c:3936
char LowerDescURL[LINE_SIZE]
Definition: upnpapi.h:86
Upnp_Handle_Type HType
Definition: upnpapi.h:72
LinkedList SsdpSearchList
Definition: upnpapi.h:118
Definition: VirtualDir.h:11
ThreadPool gSendThreadPool
Definition: upnpapi.c:122
IXML_NodeList * ServiceList
Definition: upnpapi.h:102
WebServerState bWebServerState
Definition: upnpapi.c:131
GenlibClientSubscription * ClientSubList
Definition: upnpapi.h:116
int PrintHandleInfo(UpnpClient_Handle Hnd)
Print handle info.
Definition: upnpapi.c:3910
char gIF_IPV6[INET6_ADDRSTRLEN]
Definition: upnpapi.c:140
int MaxSubscriptionTimeOut
Definition: upnpapi.h:108
A thread pool similar to the thread pool in the UPnP SDK.
Definition: ThreadPool.h:212
Upnp_Handle_Type GetDeviceHandleInfo(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...
Definition: upnpapi.c:3851
unsigned short LOCAL_PORT_V6
Definition: upnpapi.c:152
TimerThread gTimerThread
Definition: upnpapi.c:119
int aliasInstalled
Definition: upnpapi.h:78
Definition: service_table.h:80
void AutoAdvertise(void *input)
This function is a timer thread scheduled by UpnpSendAdvertisement to the send advetisement again...
Definition: upnpapi.c:4096
unsigned short LOCAL_PORT_V4
Definition: upnpapi.c:149
void UpnpThreadDistribution(struct UpnpNonblockParam *Param)
Schedule async functions in threadpool.
Definition: upnpapi.c:3710
char gIF_NAME[LINE_SIZE]
Definition: upnpapi.c:134
char gIF_IPV4[INET_ADDRSTRLEN]
Definition: upnpapi.c:137
ithread_rwlock_t GlobalHndRWLock
Definition: upnpapi.c:109
Upnp_Handle_Type GetClientHandleInfo(int *client_handle_out, struct Handle_Info **HndInfo)
Get client handle info.
Definition: upnpapi.c:3824
service_table ServiceTable
Definition: upnpapi.h:104
Data structure representing a list of nodes.
Definition: ixml.h:245
virtualDirList * pVirtualDirList
Definition: upnpapi.c:101
unsigned gIF_INDEX
Definition: upnpapi.c:146
char * Cookie
Definition: upnpapi.h:76
int MaxSubscriptions
Definition: upnpapi.h:106
int DeviceAf
Definition: upnpapi.h:110
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:3319
Data structure representing the DOM Document.
Definition: ixml.h:197
ThreadPool gRecvThreadPool
Definition: upnpapi.c:125
Definition: VirtualDir.h:61
char Upnp_SID[44]
Holds the subscription identifier for a subscription between a client and a device.
Definition: upnp.h:445
char gIF_IPV6_ULA_GUA[INET6_ADDRSTRLEN]
Definition: upnpapi.c:143
ThreadPool gMiniServerThreadPool
Definition: upnpapi.c:128
char DescXML[LINE_SIZE]
Definition: upnpapi.h:88
Definition: LinkedList.h:83