Reengineered Object Oriented UPnP+ program code. More...
Classes | |
| class | CAddrinfo |
| Get information from the operating system about an internet address. More... | |
| class | CAuthority |
| Authority component of a URI reference. More... | |
| class | CComponent |
| Base class of a component. More... | |
| class | CFragment |
| Fragment component of a URI reference. More... | |
| class | CHost |
| Host subcomponent from an authority component of a URI reference. More... | |
| class | CNetadapter |
| Get information from local network adapters. More... | |
| class | CNetadapter_platform |
| Manage information from Unix like platforms about network adapters. More... | |
| class | CPath |
| Path component of a URI reference. More... | |
| class | CPort |
| Port subcomponent from an authority component of a URI reference. More... | |
| class | CPrepUriStr |
| Internal class to prepare the input URI string, Not publicly usable. More... | |
| class | CPthread_scoped_lock |
| Scoped POSIX thread mutex lock is valid for the current scope of the object. More... | |
| class | CQuery |
| Query component of a URI reference. More... | |
| class | CRootdevice |
| This will become a container object for the root device of a network node. More... | |
| class | CScheme |
| Scheme component of a URI. More... | |
| class | CSigpipe_scoped |
| Portable handle SIGPIPE on failed write to a remote closed network socket. More... | |
| class | CSocket |
| Manage all aspects of a network socket. More... | |
| class | CSocket_basic |
| Get information from a raw network socket file descriptor. More... | |
| class | CSocketErr |
| Class for portable handling of network socket errors. More... | |
| class | CStrIntMap |
| Table with C-strings mapped to an integer id. More... | |
| class | CUri |
| Representing a URI that can be modified with a relative reference. More... | |
| class | CUriRef |
| This is a URI reference. More... | |
| class | CUserinfo |
| Userinfo subcomponent from an authority component of a URI reference. More... | |
| struct | Document_meta |
| Mapping of file extension to content-type of document. More... | |
| class | INetadapter |
| Manage information from different platforms about network adapters. More... | |
| union | sockaddr_t |
| Helpful union of the different socket address structures. More... | |
| struct | SSockaddr |
| Trivial ::sockaddr structures enhanced with methods. More... | |
| struct | str_int_entry |
| String to integer map entry. More... | |
Typedefs | |
| using | PNetadapter_platform = std::shared_ptr< INetadapter > |
| Smart pointer to hold the injected pointer to the netadapter object for the current used platform. | |
Enumerations | |
| enum | Upnp_HttpMethod { UPNP_HTTPMETHOD_PUT , UPNP_HTTPMETHOD_DELETE , UPNP_HTTPMETHOD_GET , UPNP_HTTPMETHOD_HEAD , UPNP_HTTPMETHOD_POST } |
| Different HTTP methods. More... | |
| enum | http_method_t { HTTPMETHOD_PUT = UPNP_HTTPMETHOD_PUT , HTTPMETHOD_DELETE = UPNP_HTTPMETHOD_DELETE , HTTPMETHOD_GET = UPNP_HTTPMETHOD_GET , HTTPMETHOD_HEAD = UPNP_HTTPMETHOD_HEAD , HTTPMETHOD_POST = UPNP_HTTPMETHOD_POST , HTTPMETHOD_MPOST , HTTPMETHOD_SUBSCRIBE , HTTPMETHOD_UNSUBSCRIBE , HTTPMETHOD_NOTIFY , HTTPMETHOD_MSEARCH , HTTPMETHOD_UNKNOWN , SOAPMETHOD_POST , HTTPMETHOD_SIMPLEGET } |
| Method in a HTTP request. More... | |
Functions | |
| uint8_t | netmask_to_bitmask (const ::sockaddr_storage *a_netmask) |
| Get prefix bit number from a network address mask. | |
| void | bitmask_to_netmask (const ::sockaddr_storage *a_saddr, const unsigned int a_prefixlength, SSockaddr &a_saddrObj) |
| Get network address mask from address prefix bit number. | |
| UPnPsdk_VIS uint64_t | pthread_self () |
| Get pthread thread id as unsigned integer. | |
| int | to_port (std::string_view a_port_str, in_port_t *const a_port_num=nullptr) noexcept |
| Free function to check if a string represents a valid port number. | |
| void | split_addr_port (std::string_view a_addr_str, std::string &a_addr, std::string &a_serv) |
| Free function to split inet address and port(service) | |
| UPnPsdk_API::std::ostream & | operator<< (::std::ostream &os, SSockaddr &saddr) |
| output the netaddress | |
| UPnPsdk_VIS const std::string | errStr (int error) |
| Get error name string. | |
| UPnPsdk_VIS const std::string | errStrEx (const int error, const int success) |
| Get extended error name string. | |
| UPnPsdk_VIS void | remove_dot_segments (std::string &a_path) |
| Remove dot segments from a path. | |
| UPnPsdk_VIS void | decode_esc_chars (std::string &a_encoded) |
| Replaces http percent encoded characters with their character representation. | |
| UPnPsdk_VIS const Document_meta * | select_filetype (std::string_view a_extension) |
| Based on the extension, returns the content type and content subtype. | |
Variables | |
| UPnPsdk_EXTERN bool | g_dbug {false} |
| Switch to enable verbose (debug) output. | |
Reengineered Object Oriented UPnP+ program code.
cond
endcond
| struct UPnPsdk::Document_meta |
Mapping of file extension to content-type of document.
Definition at line 18 of file webserver.hpp.
| Class Members | ||
|---|---|---|
| string | extension | extension of a filename |
| string | type | file type |
| string | subtype | file subtype |
| struct UPnPsdk::str_int_entry |
String to integer map entry.
Definition at line 28 of file strintmap.hpp.
| Class Members | ||
|---|---|---|
| const char * | name | A value in string form. |
| int | id | Same value in integer form. |
| using UPnPsdk::PNetadapter_platform = typedef std::shared_ptr<INetadapter> |
Smart pointer to hold the injected pointer to the netadapter object for the current used platform.
Definition at line 120 of file netadapter_if.hpp.
Method in a HTTP request.
Definition at line 18 of file httpparser.hpp.
| uint64_t UPnPsdk::pthread_self | ( | ) |
Get pthread thread id as unsigned integer.
Actually ::pthread_self() returns pthread_t and not an integer thread id you can work with. The following helper function will get you that in a portable way across different POSIX systems.
Reference: How do I get a thread ID from an arbitrary pthread_t?
Definition at line 20 of file pthread.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| const std::string UPnPsdk::errStr | ( | int | error | ) |
Get error name string.
Search for the string name of an error number and return it.
| [in] | error | Error number |
Definition at line 86 of file upnptools.cpp.
| const std::string UPnPsdk::errStrEx | ( | const int | error, |
| const int | success | ||
| ) |
Get extended error name string.
Search for the string names of two error numbers, the wrong and the right one, and return an error message with a hint what is expected.
| [in] | error | Error number |
| [in] | success | Message number that should be given instead of the error |
Definition at line 103 of file upnptools.cpp.
| void UPnPsdk::decode_esc_chars | ( | std::string & | a_encoded | ) |
Replaces http percent encoded characters with their character representation.
For example: "%5BHello world%21%5D" becomes "[Hello world!]".
| std::invalid_argument | if an invalid encoded character is found. |
| [in,out] | a_encoded | String of characters to be modified. It is modified in place. |
Definition at line 133 of file uri.cpp.
Here is the caller graph for this function:| const Document_meta * UPnPsdk::select_filetype | ( | std::string_view | a_extension | ) |
Based on the extension, returns the content type and content subtype.
Example
pointer to a content type structure for a known file extensionnullptr if file extension was not known| [in] | a_extension | file extension |
Definition at line 101 of file webserver.cpp.
Here is the caller graph for this function:| UPnPsdk_API bool UPnPsdk::g_dbug {false} |
Switch to enable verbose (debug) output.
This flag is only modified by user intervention, e.g. on the command line or with an environment variable but never modified by the production code. Only Unit tests may toggle the switch under test.
Definition at line 26 of file global.hpp.