aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-08-29 22:39:39 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-08-29 22:39:39 +0000
commite66e742eeba32501c1438835ea581dcf518bd4c4 (patch)
tree10dd284f95dd4fcba0b1cb7f79b8b5b770c284ec /include
parent558f8be1b81fd211756afb3f3814490bfc0763d7 (diff)
encode/decode URIs in 'pedantic' mode (issue #3923)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6441 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rwxr-xr-xinclude/asterisk/utils.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h
index 1d398fa10..83d9e2185 100755
--- a/include/asterisk/utils.h
+++ b/include/asterisk/utils.h
@@ -128,11 +128,37 @@ struct ast_hostent {
};
extern struct hostent *ast_gethostbyname(const char *host, struct ast_hostent *hp);
-/* ast_md5_hash: Produces MD5 hash based on input string */
+
+/* ast_md5_hash
+ \brief Produces MD5 hash based on input string */
extern void ast_md5_hash(char *output, char *input);
+
extern int ast_base64encode(char *dst, unsigned char *src, int srclen, int max);
extern int ast_base64decode(unsigned char *dst, char *src, int max);
+/*! ast_uri_encode
+ \brief Turn text string to URI-encoded %XX version
+ At this point, we're converting from ISO-8859-x (8-bit), not UTF8
+ as in the SIP protocol spec
+ If doreserved == 1 we will convert reserved characters also.
+ RFC 2396, section 2.4
+ outbuf needs to have more memory allocated than the instring
+ to have room for the expansion. Every char that is converted
+ is replaced by three ASCII characters.
+ \param string String to be converted
+ \param outbuf Resulting encoded string
+ \param buflen Size of output buffer
+ \param doreserved Convert reserved characters
+*/
+
+char *ast_uri_encode(char *string, char *outbuf, int buflen, int doreserved);
+
+/*! \brief Decode URI, URN, URL (overwrite string)
+ \param s String to be decoded
+ */
+void ast_uri_decode(char *s);
+
+
extern int test_for_thread_safety(void);
extern const char *ast_inet_ntoa(char *buf, int bufsiz, struct in_addr ia);