1#ifndef COMPA_GENLIB_NET_URI_HPP
2#define COMPA_GENLIB_NET_URI_HPP
51#define strncasecmp strnicmp
61enum struct uriType { Absolute, Relative };
64enum struct pathType { ABS_PATH, REL_PATH, OPAQUE_PART };
167#if defined(DEBUG) || defined(DOXYGEN_RUN)
173#define print_uri(in) \
178#if defined(DEBUG) || defined(DOXYGEN_RUN)
185#define print_token(in) \
token fragment
Member variable.
UPnPsdk_VIS int parse_uri(const char *in, size_t max, uri_type *out)
Parses a uri as defined in RFC 2396 (explaining URIs).
int parse_token(char *in, token *out, int max_size)
token scheme
Member variable.
char * URLs
Dynamic memory for all urls, delimited by <>
hostport_type hostport
Member variable.
uri_type * parsedURLs
parsed URLs
size_t size
Size of the buffer.
UPnPsdk_VIS int replace_escaped(char *in, size_t index, size_t *max)
Replaces one single escaped character within a string with its unescaped version.
compa::uriType type
Member variable.
UPnPsdk_VIS char * resolve_rel_url(char *base_url, char *rel_url)
Resolves a relative url with a base url.
UPnPsdk_VIS int remove_escaped_chars(char *in, size_t *size)
Removes http escaped characters such as: "%20" and replaces them with their character representation.
UPnPsdk_VIS int token_cmp(token *in1, token *in2)
Compares two tokens.
token pathquery
Member variable.
sockaddr_storage IPaddress
Network socket address.
UPnPsdk_VIS int token_string_casecmp(token *in1, const char *in2)
Compares buffer in the token object with the buffer in in2 case insensitive.
UPnPsdk_VIS void free_URL_list(URL_list *list)
Frees the memory associated with a URL_list.
constexpr int HTTP_SUCCESS
Yet another success code.
UPnPsdk_VIS int copy_URL_list(URL_list *in, URL_list *out)
Copies one URL_list into another.
UPnPsdk_VIS int remove_dots(char *buf, size_t size)
Removes ".", and ".." from a path.
void print_uri(uri_type *in)
Function useful in debugging for printing a parsed uri.
void print_token(token *in)
Function useful in debugging for printing a token.
compa::pathType path_type
Member variable.
token text
Pointing to the full host:port string representation.
Represents a list of URLs as in the "callback" header of SUBSCRIBE message in GENA.
Represents a URI used in parse_uri and elsewhere.
Buffer used in parsinghttp messages, urls, etc. Generally this simply holds a pointer into a larger a...
Represents a host port, e.g. "127.127.0.1:80".
Refactored pupnp program code that is compatible to the original pupnp code.
pathType
Type of the "path" part of the URI.
Macros to support visibility of external symbols.
#define UPnPsdk_VIS
Prefix to export symbol for external use.