SIP URI comparison fixes.

This initially was created to work around the issue of
using a string comparison instead of a binary comparison
for IP addresses. It evolved a bit when test cases were
created and it was discovered that comparison of URI
parameters was not working exactly as it should.

sip_uri_cmp() and its helpers have been moved to reqresp_parser.c
and a new test has been added.

(closes issue #17662)
Reported by: oej

Review: https://reviewboard.asterisk.org/r/792



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Michelson
2010-07-23 16:33:52 +00:00
parent 3ab0041118
commit d1ad460b3d
3 changed files with 514 additions and 287 deletions

View File

@@ -142,4 +142,27 @@ void sip_request_parser_unregister_tests(void);
*/
unsigned int parse_sip_options(const char *options, char *unsupported, size_t unsupported_len);
/*!
* \brief Compare two URIs as described in RFC 3261 Section 19.1.4
*
* \param input1 First URI
* \param input2 Second URI
* \retval 0 URIs match
* \retval nonzero URIs do not match or one or both is malformed
*/
int sip_uri_cmp(const char *input1, const char *input2);
/*!
* \brief initialize request and response parser data
*
* \retval 0 Success
* \retval -1 Failure
*/
int sip_reqresp_parser_init(void);
/*!
* \brief Free resources used by request and response parser
*/
void sip_reqresp_parser_exit(void);
#endif