summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpquerna <pquerna@13f79535-47bb-0310-9956-ffa450edef68>2005-01-03 07:37:34 +0000
committerpquerna <pquerna@13f79535-47bb-0310-9956-ffa450edef68>2005-01-03 07:37:34 +0000
commit081e68ff5cfcb639f44107200103b05bcdafa000 (patch)
tree1856e44cf2418548c616e6b403d992e5dbda0da7
parent9a1c294540ef81b527085aab8a0d32be8b81692d (diff)
downloadlibapr-081e68ff5cfcb639f44107200103b05bcdafa000.tar.gz
Add arguments for Single Source Multicast Support as suggested by Colm
MacCarthaigh on dev@apr. SSM Support is not implemented, but I added it in the interest of making a single API that can be used in the future. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@123950 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--include/apr_network_io.h12
-rw-r--r--network_io/unix/multicast.c17
2 files changed, 22 insertions, 7 deletions
diff --git a/include/apr_network_io.h b/include/apr_network_io.h
index cf3679b23..8721fa166 100644
--- a/include/apr_network_io.h
+++ b/include/apr_network_io.h
@@ -758,10 +758,14 @@ APR_DECLARE_INHERIT_UNSET(socket);
* @param join The address of the multicast group to join
* @param iface Address of the interface to use. If NULL is passed, the
* default multicast interface will be used. (OS Dependent)
+ * @param ssm Single Source Multicast Address to accept transmissions from.
+ * @remark Single Source Multicast is not currently implemented, and you must
+ * pass NULL for the argument.
*/
APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock,
apr_sockaddr_t *join,
- apr_sockaddr_t *iface);
+ apr_sockaddr_t *iface,
+ apr_sockaddr_t *ssm);
/**
* Leave a Multicast Group. All arguments must be the same as
@@ -770,10 +774,14 @@ APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock,
* @param leave The address of the multicast group to leave
* @param iface Address of the interface to use. If NULL is passed, the
* default multicast interface will be used. (OS Dependent)
+ * @param ssm Single Source Multicast Address that transmissions came from.
+ * @remark Single Source Multicast is not currently implemented, and you must
+ * pass NULL for the argument.
*/
APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock,
apr_sockaddr_t *leave,
- apr_sockaddr_t *iface);
+ apr_sockaddr_t *iface,
+ apr_sockaddr_t *ssm);
/**
* Set the Multicast Time to Live (ttl) for a multicast transmission.
diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c
index ea4fe6487..08cd522cd 100644
--- a/network_io/unix/multicast.c
+++ b/network_io/unix/multicast.c
@@ -125,7 +125,8 @@ static int sock_is_ipv6(apr_socket_t* sock)
#endif
static apr_status_t do_mcast(int type, apr_socket_t *sock,
- apr_sockaddr_t *mcast, apr_sockaddr_t *iface)
+ apr_sockaddr_t *mcast, apr_sockaddr_t *iface,
+ apr_sockaddr_t *ssm)
{
struct ip_mreq mip4;
apr_status_t rv = APR_SUCCESS;
@@ -133,6 +134,10 @@ static apr_status_t do_mcast(int type, apr_socket_t *sock,
struct ipv6_mreq mip6;
#endif
+ /* We do not currently support Single Source Multicast. */
+ if (ssm != NULL)
+ return APR_ENOTIMPL;
+
rv = mcast_check_type(sock);
if (rv != APR_SUCCESS) {
@@ -223,10 +228,11 @@ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock,
APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock,
apr_sockaddr_t *join,
- apr_sockaddr_t *iface)
+ apr_sockaddr_t *iface,
+ apr_sockaddr_t *ssm)
{
#ifdef IP_ADD_MEMBERSHIP
- return do_mcast(IP_ADD_MEMBERSHIP, sock, join, iface);
+ return do_mcast(IP_ADD_MEMBERSHIP, sock, join, iface, ssm);
#else
return APR_ENOTIMPL;
#endif
@@ -234,10 +240,11 @@ APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock,
APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock,
apr_sockaddr_t *leave,
- apr_sockaddr_t *iface)
+ apr_sockaddr_t *iface,
+ apr_sockaddr_t *ssm)
{
#ifdef IP_DROP_MEMBERSHIP
- return do_mcast(IP_DROP_MEMBERSHIP, sock, leave, iface);
+ return do_mcast(IP_DROP_MEMBERSHIP, sock, leave, iface, ssm);
#else
return APR_ENOTIMPL;
#endif