Modify and parse URIs. More...
#include <upnp.hpp>#include <uri.hpp>#include <UPnPsdk/uri.hpp>#include <UPnPsdk/synclog.hpp>#include <UPnPsdk/addrinfo.hpp>
Include dependency graph for uri.cpp:Go to the source code of this file.
Functions | |
| int | create_url_list (memptr *a_url_list, URL_list *a_out) |
| Function to parse the Callback header value in subscription requests. | |
| int | copy_URL_list (URL_list *in, URL_list *out) |
| Copies one URL_list into another. | |
| void | free_URL_list (URL_list *list) |
| Frees the memory associated with a URL_list. | |
| 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. | |
| int | token_string_casecmp (token *in1, const char *in2) |
| Compares buffer in the token object with the buffer in in2 case insensitive. | |
| int | token_cmp (token *in1, token *in2) |
| Compares two tokens. | |
| char * | resolve_rel_url (char *a_base_url, char *a_rel_url) |
| Resolves a relative url with a base url. | |
Scope restricted to file | |
| void | anonymous_namespace{uri.cpp}::copy_token (const token *in, const char *in_base, token *out, char *out_base) |
| Copy the offset and size from a token to another token. | |
Variables | |
| UPnPsdk_EXTERN unsigned | gIF_INDEX |
| Index/scope-id from the used network interface. | |
Modify and parse URIs.
Definition in file uri.cpp.
Function to parse the Callback header value in subscription requests.
Takes in a buffer containing serialized URLs delimited by '<' and '>'. The entire buffer is copied into dynamic memory and stored in the URL_list. Pointers to the individual urls within this buffer are allocated and stored in the URL_list. Only URLs with network addresses are considered (i.e. host:port or domain name). Because the function expects a serialized list with delimiters, even one url must be surrounded by '<' and '>'.
| [in] | a_url_list | Pointer to a buffer containing serialized URLs delimited by '<' and '>' ("<url><url>"). It is not necessary to terminate the string with zero ('\0') but can. |
| [out] | a_out | Pointer to the new URL list. |
Definition at line 89 of file uri.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:Copies one URL_list into another.
This includes dynamically allocating the out->URLs field (the full string), and the structures used to hold the parsedURLs. This memory MUST be freed by the caller through: free_URL_list(&out).
| [in] | in | Source URL list. |
| [out] | out | Destination URL list. |
Definition at line 180 of file uri.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void free_URL_list | ( | URL_list * | list | ) |
| void print_uri | ( | uri_type * | in | ) |
| void print_token | ( | token * | in | ) |
| int token_string_casecmp | ( | token * | in1, |
| const char * | in2 | ||
| ) |
Compares buffer in the token object with the buffer in in2 case insensitive.
| [in] | in1 | Token object whose buffer is to be compared. |
| [in] | in2 | String of characters to compare with. |
Definition at line 251 of file uri.cpp.
Here is the caller graph for this function:Compares two tokens.
| [in] | in1 | First token object whose buffer is to be compared. |
| [in] | in2 | Second token object used for the comparison. |
Definition at line 265 of file uri.cpp.
Here is the caller graph for this function:| char * resolve_rel_url | ( | char * | a_base_url, |
| char * | a_rel_url | ||
| ) |
Resolves a relative url with a base url.
The resolution of '..' is NOT implemented, but '.' is resolved.
| [in] | a_base_url | Base URL. |
| [in] | a_rel_url | Relative URL. |
Definition at line 275 of file uri.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| UPnPsdk_EXTERN unsigned gIF_INDEX |