summaryrefslogtreecommitdiff
path: root/include/asterisk/acl.h
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2010-07-08 22:08:07 +0000
committerMark Michelson <mmichelson@digium.com>2010-07-08 22:08:07 +0000
commitcd4ebd336f6fdd1fe5d2ad57f06654a9678d88d4 (patch)
treec05335b563c3f7cb9a3edbf3e101d8e1b80e0be4 /include/asterisk/acl.h
parent816f26c16ce6cf03cf97b7d0e7af64837283e79d (diff)
Add IPv6 to Asterisk.
This adds a generic API for accommodating IPv6 and IPv4 addresses within Asterisk. While many files have been updated to make use of the API, chan_sip and the RTP code are the files which actually support IPv6 addresses at the time of this commit. The way has been paved for easier upgrading for other files in the near future, though. Big thanks go to Simon Perrault, Marc Blanchet, and Jean-Philippe Dionne for their hard work on this. (closes issue #17565) Reported by: russell Patches: asteriskv6-test-report.pdf uploaded by russell (license 2) Review: https://reviewboard.asterisk.org/r/743 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@274783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/acl.h')
-rw-r--r--include/asterisk/acl.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/include/asterisk/acl.h b/include/asterisk/acl.h
index c8916a68a..2c4f62051 100644
--- a/include/asterisk/acl.h
+++ b/include/asterisk/acl.h
@@ -29,6 +29,7 @@ extern "C" {
#endif
#include "asterisk/network.h"
+#include "asterisk/netsock2.h"
#include "asterisk/io.h"
#define AST_SENSE_DENY 0
@@ -124,12 +125,12 @@ int ast_apply_ha(struct ast_ha *ha, struct sockaddr_in *sin);
* of getting an entire hostent structure, you instead are given
* only the IP address inserted into a sockaddr_in structure.
*
- * \param[out] sin The IP address is written into sin->sin_addr
+ * \param[out] addr The IP address is written into sin->sin_addr
* \param value The hostname to look up
* \retval 0 Success
* \retval -1 Failure
*/
-int ast_get_ip(struct sockaddr_in *sin, const char *value);
+int ast_get_ip(struct ast_sockaddr *addr, const char *value);
/*!
* \brief Get the IP address given a hostname and optional service
@@ -141,14 +142,17 @@ int ast_get_ip(struct sockaddr_in *sin, const char *value);
* an SRV lookup will be done for "_sip._udp.example.com". If service is NULL,
* then this function acts exactly like a call to ast_get_ip.
*
- * \param[out] sin The IP address is written into sin->sin_addr
+ * \param addr The IP address found. The address family is used as an input parameter to
+ * filter the returned adresses. if it is 0, both IPv4 and IPv6 addresses
+ * can be returned.
+ *
* \param value The hostname to look up
* \param service A specific service provided by the host. A NULL service results
* in an A-record lookup instead of an SRV lookup
* \retval 0 Success
* \retval -1 Failure
*/
-int ast_get_ip_or_srv(struct sockaddr_in *sin, const char *value, const char *service);
+int ast_get_ip_or_srv(struct ast_sockaddr *addr, const char *value, const char *service);
/*!
* \brief Get our local IP address when contacting a remote host
@@ -164,7 +168,7 @@ int ast_get_ip_or_srv(struct sockaddr_in *sin, const char *value, const char *se
* \retval -1 Failure
* \retval 0 Success
*/
-int ast_ouraddrfor(struct in_addr *them, struct in_addr *us);
+int ast_ouraddrfor(const struct ast_sockaddr *them, struct ast_sockaddr *us);
/*!
* \brief Find an IP address associated with a specific interface
@@ -219,7 +223,7 @@ struct ast_ha *ast_duplicate_ha_list(struct ast_ha *original);
* \retval 0 Success
* \retval -1 Failure
*/
-int ast_find_ourip(struct in_addr *ourip, struct sockaddr_in bindaddr);
+int ast_find_ourip(struct ast_sockaddr *ourip, const struct ast_sockaddr *bindaddr);
/*!
* \brief Convert a string to the appropriate COS value