summaryrefslogtreecommitdiff
path: root/channels/sip/include/reqresp_parser.h
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2010-07-23 16:33:52 +0000
committerMark Michelson <mmichelson@digium.com>2010-07-23 16:33:52 +0000
commitd1ad460b3d02322a7cacb0b1f35ed86a78973344 (patch)
tree1e0879f4f888be3421d0133c9f2076c53bf41297 /channels/sip/include/reqresp_parser.h
parent3ab004111841f96bc845c8965ea5e5db6a9227d0 (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.h23
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