summaryrefslogtreecommitdiff
path: root/include/asterisk/srv.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asterisk/srv.h')
-rw-r--r--include/asterisk/srv.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/asterisk/srv.h b/include/asterisk/srv.h
index 567b40844..a3d2c7a6e 100644
--- a/include/asterisk/srv.h
+++ b/include/asterisk/srv.h
@@ -31,6 +31,25 @@
no provisions for retrying or failover between records.
*/
+/*!\brief An opaque type, for lookup usage */
+struct srv_context;
+
+/*!\brief Retrieve set of SRV lookups, in order
+ * \param[in] context A pointer in which to hold the result
+ * \param[in] service The service name to look up
+ * \param[out] host Result host
+ * \param[out] port Associated TCP portnum
+ * \retval -1 Query failed
+ * \retval 0 Result exists in host and port
+ * \retval 1 No more results
+ */
+extern int ast_srv_lookup(struct srv_context **context, const char *service, const char **host, unsigned short *port);
+
+/*!\brief Cleanup resources associated with ast_srv_lookup
+ * \param context Pointer passed into ast_srv_lookup
+ */
+void ast_srv_cleanup(struct srv_context **context);
+
/*! Lookup entry in SRV records Returns 1 if found, 0 if not found, -1 on hangup
Only do SRV record lookup if you get a domain without a port. If you get a port #, it's a DNS host name.
*/