32#ifndef GENLIB_NET_URI_H
33#define GENLIB_NET_URI_H
40 #include <sys/param.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 ";/?:@&=+$,{}"
127 struct sockaddr_storage IPaddress;
141 enum pathType path_type;
216 #define print_uri(in) \
229 #define print_token(in) \
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:123
token text
Definition uri.h:125
unsigned short int port
Definition uri.h:131
Buffer used in parsing http messages, urls, etc. generally this simply holds a pointer into a larger ...
Definition uri.h:113
Represents a URI used in parse_uri and elsewhere.
Definition uri.h:138
Represents a list of URLs as in the "callback" header of SUBSCRIBE message in GENA....
Definition uri.h:152
char * URLs
Definition uri.h:156
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:627
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:221
struct TOKEN token
Buffer used in parsing http messages, urls, etc. generally this simply holds a pointer into a larger ...
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:139
int remove_dots(char *in, size_t size)
Removes ".", and ".." from a path.
Definition uri.c:559
int token_cmp(token *in1, token *in2)
Compares two tokens.
Definition uri.c:309
int resolve_hostport(hostport_type *hostport)
Resolves a hostport's host to an IP address, performing a DNS lookup if it isn't already a literal IP...
Definition uri.c:437
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:300
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:535
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:773
void free_URL_list(URL_list *list)
Frees the memory associated with a URL_list.
Definition uri.c:267