diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2005-08-29 22:39:39 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2005-08-29 22:39:39 +0000 |
commit | 1824c2f6308dd8ef6b4077b0e58de666d56f927e (patch) | |
tree | 10dd284f95dd4fcba0b1cb7f79b8b5b770c284ec /include | |
parent | 0f03a734b17826783dba60a572371302755a2047 (diff) |
encode/decode URIs in 'pedantic' mode (issue #3923)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6441 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-rwxr-xr-x | include/asterisk/utils.h | 28 |
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); |