upnpapi.h File Reference
`#include "client_table.h"`
`#include "upnp.h"`
`#include "VirtualDir.h"`
Include dependency graph for upnpapi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

struct | Handle_Info
struct | UpnpNonblockParam

## Macros

#define | MAX_INTERFACES 256
#define | DEFAULT_INTERFACE 1
#define | DEV_LIMIT 200
#define | DEFAULT_MX 5
#define | DEFAULT_MAXAGE 1800
#define | DEFAULT_SOAP_CONTENT_LENGTH 16000
#define | MAX_SOAP_CONTENT_LENGTH (size_t)32000
#define | NUM_HANDLE 200
#define | UPNP_TIMEOUT 30
#define | HandleLock() HandleWriteLock()
#define | HandleWriteLock()
#define | HandleReadLock()
#define | HandleUnlock()
#define | E_HTTP_SYNTAX -6

## Enumerations

enum | Upnp_Handle_Type { HND_INVALID =-1, HND_CLIENT, HND_DEVICE }
enum | UpnpFunName { SUBSCRIBE, UNSUBSCRIBE, DK_NOTIFY, QUERY, ACTION, STATUS, DEVDESCRIPTION, SERVDESCRIPTION, MINI, RENEW }
enum | WebServerState { WEB_SERVER_DISABLED, WEB_SERVER_ENABLED }

## Functions

Upnp_Handle_Type | GetHandleInfo (int Hnd, struct Handle_Info **HndInfo)
| Get handle information. More...
Upnp_Handle_Type | GetClientHandleInfo (int *client_handle_out, struct Handle_Info **HndInfo)
| Get client handle info. More...
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. More...
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. More...
void | UpnpThreadDistribution (struct UpnpNonblockParam *Param)
| Schedule async functions in threadpool. More...
void | AutoAdvertise (void *input)
| This function is a timer thread scheduled by UpnpSendAdvertisement to the send advetisement again. More...
int | getlocalhostname (char *out, size_t out_len)
| Get local IP address. More...
int | PrintHandleInfo (UpnpClient_Handle Hnd)
| Print handle info. More...

## Variables

size_t | g_maxContentLength
int | g_UpnpSdkEQMaxLen
int | g_UpnpSdkEQMaxAge
ithread_rwlock_t | GlobalHndRWLock
char | gIF_NAME [LINE_SIZE]
char | gIF_IPV4 [INET_ADDRSTRLEN]
char | gIF_IPV6 [INET6_ADDRSTRLEN]
char | gIF_IPV6_ULA_GUA [INET6_ADDRSTRLEN]
unsigned | gIF_INDEX
unsigned short | LOCAL_PORT_V4
unsigned short | LOCAL_PORT_V6
Upnp_SID | gUpnpSdkNLSuuid
TimerThread | gTimerThread
ThreadPool | gRecvThreadPool
ThreadPool | gSendThreadPool
ThreadPool | gMiniServerThreadPool
virtualDirList * | pVirtualDirList
struct VirtualDirCallbacks | virtualDirCallback
WebServerState | bWebServerState

## Macro Definition Documentation

## HandleReadLock

#define HandleReadLock | ( |  | ) |

Value:
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Trying a read lock\n"); \
ithread_rwlock_rdlock(&GlobalHndRWLock); \
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Read lock acquired\n");
UpnpPrintf
void UpnpPrintf(Upnp_LogLevel DLevel, Dbg_Module Module, const char *DbgFileName, int DbgLineNo, const char *FmtStr,...)
Prints the debug statement either on the standard output or log file along with the information from ...
Definition: upnpdebug.c:126
GlobalHndRWLock
ithread_rwlock_t GlobalHndRWLock
Definition: upnpapi.c:109

## HandleUnlock

#define HandleUnlock | ( |  | ) |

Value:
UpnpPrintf(UPNP_INFO, API,__FILE__, __LINE__, "Trying Unlock\n"); \
ithread_rwlock_unlock(&GlobalHndRWLock); \
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Unlocked rwlock\n");
UpnpPrintf
void UpnpPrintf(Upnp_LogLevel DLevel, Dbg_Module Module, const char *DbgFileName, int DbgLineNo, const char *FmtStr,...)
Prints the debug statement either on the standard output or log file along with the information from ...
Definition: upnpdebug.c:126
GlobalHndRWLock
ithread_rwlock_t GlobalHndRWLock
Definition: upnpapi.c:109

## HandleWriteLock

#define HandleWriteLock | ( |  | ) |

Value:
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Trying a write lock\n"); \
ithread_rwlock_wrlock(&GlobalHndRWLock); \
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Write lock acquired\n");
UpnpPrintf
void UpnpPrintf(Upnp_LogLevel DLevel, Dbg_Module Module, const char *DbgFileName, int DbgLineNo, const char *FmtStr,...)
Prints the debug statement either on the standard output or log file along with the information from ...
Definition: upnpdebug.c:126
GlobalHndRWLock
ithread_rwlock_t GlobalHndRWLock
Definition: upnpapi.c:109

## Variable Documentation

## gUpnpSdkNLSuuid

Upnp_SID gUpnpSdkNLSuuid

NLS uuid.