|
a/libupnpp/upnpplib.hxx |
|
b/libupnpp/upnpplib.hxx |
|
... |
|
... |
40 |
* initialized.
|
40 |
* initialized.
|
41 |
* @return 0 for failure.
|
41 |
* @return 0 for failure.
|
42 |
*/
|
42 |
*/
|
43 |
static LibUPnP* getLibUPnP(bool server = false);
|
43 |
static LibUPnP* getLibUPnP(bool server = false);
|
44 |
|
44 |
|
45 |
int setupWebServer(const std::string& description);
|
|
|
46 |
|
|
|
47 |
/** Set log file name and activate logging.
|
45 |
/** Set log file name and activate logging.
|
48 |
*
|
46 |
*
|
49 |
* @param fn file name to use. Use empty string to turn logging off
|
47 |
* @param fn file name to use. Use empty string to turn logging off
|
50 |
*/
|
48 |
*/
|
51 |
bool setLogFileName(const std::string& fn);
|
49 |
enum LogLevel {LogLevelNone, LogLevelError, LogLevelDebug};
|
|
|
50 |
bool setLogFileName(const std::string& fn, LogLevel level = LogLevelError);
|
|
|
51 |
bool setLogLevel(LogLevel level);
|
52 |
|
52 |
|
53 |
/** Set max library buffer size for reading content from servers. */
|
53 |
/** Set max library buffer size for reading content from servers. */
|
54 |
void setMaxContentLength(int bytes);
|
54 |
void setMaxContentLength(int bytes);
|
55 |
|
55 |
|
56 |
/** Check state after initialization */
|
56 |
/** Check state after initialization */
|
|
... |
|
... |
63 |
int getInitError() const
|
63 |
int getInitError() const
|
64 |
{
|
64 |
{
|
65 |
return m_init_error;
|
65 |
return m_init_error;
|
66 |
}
|
66 |
}
|
67 |
|
67 |
|
68 |
/** Specify function to be called on given UPnP event. This will happen
|
|
|
69 |
* in the libupnp thread context.
|
|
|
70 |
*/
|
|
|
71 |
void registerHandler(Upnp_EventType et, Upnp_FunPtr handler, void *cookie);
|
|
|
72 |
|
|
|
73 |
/** Build a unique persistent UUID for a root device. This uses a hash
|
68 |
/** Build a unique persistent UUID for a root device. This uses a hash
|
74 |
of the input name (e.g.: friendlyName), and the host Ethernet address */
|
69 |
of the input name (e.g.: friendlyName), and the host Ethernet address */
|
75 |
static std::string makeDevUUID(const std::string& name);
|
70 |
static std::string makeDevUUID(const std::string& name);
|
76 |
|
71 |
|
77 |
/** Translate integer error code (UPNP_E_XXX) to string */
|
72 |
/** Translate libupnp integer error code (UPNP_E_XXX) to string */
|
78 |
static std::string errAsString(const std::string& who, int code);
|
73 |
static std::string errAsString(const std::string& who, int code);
|
79 |
|
74 |
|
|
|
75 |
/////////////////////////////////////////////////////////////////////////////
|
|
|
76 |
/* The methods which follow are normally for use by the
|
|
|
77 |
* intermediate layers in libupnpp, such as the base device class
|
|
|
78 |
* or the server directory, end-user code should not need them in
|
|
|
79 |
* general.
|
|
|
80 |
*/
|
|
|
81 |
|
|
|
82 |
/** Specify function to be called on given UPnP event. This will happen
|
|
|
83 |
* in the libupnp thread context.
|
|
|
84 |
*/
|
|
|
85 |
void registerHandler(Upnp_EventType et, Upnp_FunPtr handler, void *cookie);
|
|
|
86 |
|
|
|
87 |
/** Translate libupnp event type as string */
|
80 |
static std::string evTypeAsString(Upnp_EventType);
|
88 |
static std::string evTypeAsString(Upnp_EventType);
|
81 |
|
89 |
|
82 |
|
90 |
int setupWebServer(const std::string& description);
|
83 |
|
91 |
|
84 |
UpnpClient_Handle getclh()
|
92 |
UpnpClient_Handle getclh()
|
85 |
{
|
93 |
{
|
86 |
return m_clh;
|
94 |
return m_clh;
|
87 |
}
|
95 |
}
|