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 66 #define UPNP_TIMEOUT 30 68 typedef enum {HND_INVALID=-1,HND_CLIENT,HND_DEVICE} Upnp_Handle_Type;
83 #ifdef INCLUDE_DEVICE_APIS 98 int RegistrationState;
116 #ifdef INCLUDE_CLIENT_APIS 138 #define HandleLock() HandleWriteLock() 141 #define HandleWriteLock() \ 142 UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Trying a write lock\n"); \ 143 ithread_rwlock_wrlock(&GlobalHndRWLock); \ 144 UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Write lock acquired\n"); 147 #define HandleReadLock() \ 148 UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Trying a read lock\n"); \ 149 ithread_rwlock_rdlock(&GlobalHndRWLock); \ 150 UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Read lock acquired\n"); 153 #define HandleUnlock() \ 154 UpnpPrintf(UPNP_INFO, API,__FILE__, __LINE__, "Trying Unlock\n"); \ 155 ithread_rwlock_unlock(&GlobalHndRWLock); \ 156 UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Unlocked rwlock\n"); 168 int *client_handle_out,
181 int *device_handle_out,
187 extern char gIF_IPV4[INET_ADDRSTRLEN];
188 extern char gIF_IPV6[INET6_ADDRSTRLEN];
228 char VarName[NAME_SIZE];
229 char NewVal[NAME_SIZE];
230 char DevType[NAME_SIZE];
231 char DevId[NAME_SIZE];
232 char ServiceType[NAME_SIZE];
233 char ServiceVer[NAME_SIZE];
240 struct DevDesc *Devdesc;
254 #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:404
ClientSubscription * ClientSubList
Definition: upnpapi.h:118
IXML_Document * DescDocument
Definition: upnpapi.h:100
size_t g_maxContentLength
Definition: upnpapi.c:160
char DescURL[LINE_SIZE]
Definition: upnpapi.h:85
Definition: TimerThread.h:67
Definition: upnpapi.h:223
IXML_NodeList * DeviceList
Definition: upnpapi.h:102
Upnp_Handle_Type GetHandleInfo(int Hnd, struct Handle_Info **HndInfo)
Get handle information.
Definition: upnpapi.c:3821
int getlocalhostname(char *out, size_t out_len)
Get local IP address.
Definition: upnpapi.c:3874
char LowerDescURL[LINE_SIZE]
Definition: upnpapi.h:88
int g_UpnpSdkEQMaxAge
Definition: upnpapi.c:176
Upnp_Handle_Type HType
Definition: upnpapi.h:74
LinkedList SsdpSearchList
Definition: upnpapi.h:120
Definition: VirtualDir.h:11
ThreadPool gSendThreadPool
Definition: upnpapi.c:118
IXML_NodeList * ServiceList
Definition: upnpapi.h:104
WebServerState bWebServerState
Definition: upnpapi.c:127
int PrintHandleInfo(UpnpClient_Handle Hnd)
Print handle info.
Definition: upnpapi.c:3848
char gIF_IPV6[INET6_ADDRSTRLEN]
Definition: upnpapi.c:136
int MaxSubscriptionTimeOut
Definition: upnpapi.h:110
A thread pool similar to the thread pool in the UPnP SDK.
Definition: ThreadPool.h:212
int(* Upnp_FunPtr)(Upnp_EventType EventType, void *Event, void *Cookie)
Definition: upnp.h:930
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:3789
unsigned short LOCAL_PORT_V6
Definition: upnpapi.c:148
TimerThread gTimerThread
Definition: upnpapi.c:115
int aliasInstalled
Definition: upnpapi.h:80
Definition: service_table.h:86
void AutoAdvertise(void *input)
This function is a timer thread scheduled by UpnpSendAdvertisement to the send advetisement again...
Definition: upnpapi.c:4034
unsigned short LOCAL_PORT_V4
Definition: upnpapi.c:145
void UpnpThreadDistribution(struct UpnpNonblockParam *Param)
Schedule async functions in threadpool.
Definition: upnpapi.c:3641
char gIF_NAME[LINE_SIZE]
Definition: upnpapi.c:130
char gIF_IPV4[INET_ADDRSTRLEN]
Definition: upnpapi.c:133
ithread_rwlock_t GlobalHndRWLock
Definition: upnpapi.c:105
Upnp_Handle_Type GetClientHandleInfo(int *client_handle_out, struct Handle_Info **HndInfo)
Get client handle info.
Definition: upnpapi.c:3762
service_table ServiceTable
Definition: upnpapi.h:106
Data structure representing a list of nodes.
Definition: ixml.h:235
virtualDirList * pVirtualDirList
Definition: upnpapi.c:97
unsigned gIF_INDEX
Definition: upnpapi.c:142
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:3250
int g_UpnpSdkEQMaxLen
Definition: upnpapi.c:166
Data structure representing the DOM Document.
Definition: ixml.h:187
ThreadPool gRecvThreadPool
Definition: upnpapi.c:121
struct s_UpnpString UpnpString
Type of the string objects inside libupnp.
Definition: UpnpString.h:38
Definition: VirtualDir.h:61
char Upnp_SID[44]
Holds the subscription identifier for a subscription between a client and a device.
Definition: upnp.h:534
char gIF_IPV6_ULA_GUA[INET6_ADDRSTRLEN]
Definition: upnpapi.c:139
ThreadPool gMiniServerThreadPool
Definition: upnpapi.c:124
char DescXML[LINE_SIZE]
Definition: upnpapi.h:90
Definition: LinkedList.h:83