diff options
author | Mark Michelson <mmichelson@digium.com> | 2010-07-23 16:33:52 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2010-07-23 16:33:52 +0000 |
commit | d1ad460b3d02322a7cacb0b1f35ed86a78973344 (patch) | |
tree | 1e0879f4f888be3421d0133c9f2076c53bf41297 /channels/sip/include/reqresp_parser.h | |
parent | 3ab004111841f96bc845c8965ea5e5db6a9227d0 (diff) |
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
Diffstat (limited to 'channels/sip/include/reqresp_parser.h')
-rw-r--r-- | channels/sip/include/reqresp_parser.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/channels/sip/include/reqresp_parser.h b/channels/sip/include/reqresp_parser.h index d8631c982..2957151aa 100644 --- a/channels/sip/include/reqresp_parser.h +++ b/channels/sip/include/reqresp_parser.h @@ -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 |