Add IPv6 Support To chan_iax2

This patch adds IPv6 support to chan_iax2.  Yay!

(closes issue ASTERISK-22025)
Patches:
  iax2-ipv6-v5-reviewboard.diff by Michael L. Young (license 5026)

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

Merged revisions 400567 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Michael L. Young
2013-10-04 21:41:58 +00:00
parent 21902bf964
commit 2af53640c8
8 changed files with 839 additions and 676 deletions

View File

@@ -50,6 +50,18 @@ enum ast_transport {
AST_TRANSPORT_WSS = 1 << 4,
};
/*!
* \brief
* Isolate a 32-bit section of an IPv6 address
*
* An IPv6 address can be divided into 4 32-bit chunks. This gives
* easy access to one of these chunks.
*
* \param sin6 A pointer to a struct sockaddr_in6
* \param index Which 32-bit chunk to operate on. Must be in the range 0-3.
*/
#define V6_WORD(sin6, index) ((uint32_t *)&((sin6)->sin6_addr))[(index)]
/*!
* \brief Socket address structure.
*
@@ -399,6 +411,23 @@ int ast_sockaddr_parse(struct ast_sockaddr *addr, const char *str, int flags);
int ast_sockaddr_resolve(struct ast_sockaddr **addrs, const char *str,
int flags, int family);
/*!
* \brief
* Apply a netmask to an address and store the result in a separate structure.
*
* When dealing with IPv6 addresses, one cannot apply a netmask with a simple
* logical AND operation. Futhermore, the incoming address may be an IPv4
* address and needs to be mapped properly before attempting to apply a rule.
*
* \param addr The IP address to apply the mask to.
* \param netmask The netmask configured in the host access rule.
* \param result The resultant address after applying the netmask to the given address
* \retval 0 Successfully applied netmask
* \retval -1 Failed to apply netmask
*/
int ast_sockaddr_apply_netmask(const struct ast_sockaddr *addr, const struct ast_sockaddr *netmask,
struct ast_sockaddr *result);
/*!
* \since 1.8
*