X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuhttpd.git;a=blobdiff_plain;f=utils.h;h=ab00399b6654071a1e38e061e6c909839aaa2cb6;hp=4f74f5c096992919a31bcee228323f3ca7094108;hb=190ee6ac443d2ab65f62fffb3cb2b48a12e97ea5;hpb=30fff08a44094df9b775f2e4bf9f5abceb847415 diff --git a/utils.h b/utils.h index 4f74f5c..ab00399 100644 --- a/utils.h +++ b/utils.h @@ -29,6 +29,15 @@ #include #include +struct uh_addr { + uint8_t family; + uint16_t port; + union { + struct in_addr in; + struct in6_addr in6; + }; +}; + #define min(x, y) (((x) < (y)) ? (x) : (y)) #define max(x, y) (((x) > (y)) ? (x) : (y)) @@ -42,8 +51,11 @@ static inline void clearenv(void) { extern char **environ; - environ = NULL; + *environ = NULL; } + +time_t timegm (struct tm *tm); + #endif #ifdef __GNUC__ @@ -54,5 +66,9 @@ static inline void clearenv(void) int uh_urldecode(char *buf, int blen, const char *src, int slen); int uh_urlencode(char *buf, int blen, const char *src, int slen); -int uh_b64decode(char *buf, int blen, const unsigned char *src, int slen); +int uh_b64decode(char *buf, int blen, const void *src, int slen); +bool uh_path_match(const char *prefix, const char *url); +char *uh_split_header(char *str); +bool uh_addr_rfc1918(struct uh_addr *addr); + #endif