32 #ifndef GENLIB_NET_URI_H
33 #define GENLIB_NET_URI_H
40 #include <sys/param.h>
51 #include <sys/types.h>
55 #if !defined(UPNP_USE_MSVCPP) && !defined(UPNP_USE_BCBPP)
57 #include "inet_pton.h"
64 #define strncasecmp strnicmp
73 #define MARK "-_.!~*'()"
76 #define RESERVED ";/?:@&=+$,{}"
78 #define HTTP_SUCCESS 1
121 struct sockaddr_storage IPaddress;
130 enum pathType path_type;
204 #define print_uri(in) do {} while (0)
215 #define print_token(in) do {} while (0)
Defines constants that for some reason are not defined on some systems.
Provides a platform independent way to include TCP/IP types and functions.
Represents a host port: e.g. "127.127.0.1:80" text is a token pointing to the full string representat...
Definition: uri.h:117
token text
Definition: uri.h:119
Buffer used in parsinghttp messages, urls, etc. generally this simply holds a pointer into a larger a...
Definition: uri.h:108
Represents a URI used in parse_uri and elsewhere.
Definition: uri.h:127
Represents a list of URLs as in the "callback" header of SUBSCRIBE message in GENA....
Definition: uri.h:140
char * URLs
Definition: uri.h:144
int parse_token(char *in, token *out, int max_size)
struct URL_LIST URL_list
Represents a list of URLs as in the "callback" header of SUBSCRIBE message in GENA....
int copy_URL_list(URL_list *in, URL_list *out)
Copies one URL_list into another.
Definition: uri.c:206
struct TOKEN token
Buffer used in parsinghttp messages, urls, etc. generally this simply holds a pointer into a larger a...
int replace_escaped(char *in, size_t index, size_t *max)
Replaces an escaped sequence with its unescaped version as in http://www.ietf.org/rfc/rfc2396....
Definition: uri.c:128
int remove_dots(char *in, size_t size)
Removes ".", and ".." from a path.
Definition: uri.c:511
int token_cmp(token *in1, token *in2)
Compares two tokens.
Definition: uri.c:292
char * resolve_rel_url(char *base_url, char *rel_url)
resolves a relative url with a base url returning a NEW (dynamically allocated with malloc) full url.
Definition: uri.c:579
struct HOSTPORT hostport_type
Represents a host port: e.g. "127.127.0.1:80" text is a token pointing to the full string representat...
int token_string_casecmp(token *in1, const char *in2)
Compares buffer in the token object with the buffer in in2.
Definition: uri.c:283
struct URI uri_type
Represents a URI used in parse_uri and elsewhere.
int remove_escaped_chars(char *in, size_t *size)
Removes http escaped characters such as: "%20" and replaces them with their character representation....
Definition: uri.c:487
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 parse_uri(const char *in, size_t max, uri_type *out)
Parses a uri as defined in http://www.ietf.org/rfc/rfc2396.txt (RFC explaining URIs).
Definition: uri.c:725
void free_URL_list(URL_list *list)
Frees the memory associated with a URL_list.
Definition: uri.c:250