From 6281771f37cb3a62ca2c9259e250805998e7f5cc Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 16 Jan 2007 11:37:05 +0000 Subject: * include/cygwin/in.h (struct ip_mreq_source): Define. (struct ip_msfilter): Define. (IP_MSFILTER_SIZE): Define. (struct in_pktinfo): Define. (struct group_req): Define. (struct group_source_req): Define. (struct group_filter): Define. (GROUP_FILTER_SIZE): Define. (INADDR_ALLRTRS_GROUP): Define. * include/cygwin/socket.h: Define protocol agnostic multicast options. --- winsup/cygwin/ChangeLog | 13 ++++++++ winsup/cygwin/include/cygwin/in.h | 56 ++++++++++++++++++++++++++++++++++- winsup/cygwin/include/cygwin/socket.h | 13 +++++++- 3 files changed, 80 insertions(+), 2 deletions(-) (limited to 'winsup') diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 965d23750..8748f55cd 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,16 @@ +2007-01-16 Corinna Vinschen + + * include/cygwin/in.h (struct ip_mreq_source): Define. + (struct ip_msfilter): Define. + (IP_MSFILTER_SIZE): Define. + (struct in_pktinfo): Define. + (struct group_req): Define. + (struct group_source_req): Define. + (struct group_filter): Define. + (GROUP_FILTER_SIZE): Define. + (INADDR_ALLRTRS_GROUP): Define. + * include/cygwin/socket.h: Define protocol agnostic multicast options. + 2007-01-15 Corinna Vinschen * CYGWIN_LICENSE: Fix web pages and contact information. diff --git a/winsup/cygwin/include/cygwin/in.h b/winsup/cygwin/include/cygwin/in.h index 619d47a30..0fd9e92c4 100644 --- a/winsup/cygwin/include/cygwin/in.h +++ b/winsup/cygwin/include/cygwin/in.h @@ -116,7 +116,7 @@ struct in_addr in_addr_t s_addr; }; -/* Request struct for multicast socket ops */ +/* Request struct for IPv4 multicast socket ops */ struct ip_mreq { @@ -124,6 +124,59 @@ struct ip_mreq struct in_addr imr_interface; /* local IP address of interface */ }; +struct ip_mreq_source +{ + struct in_addr imr_multiaddr; + struct in_addr imr_sourceaddr; + struct in_addr imr_interface; +}; + +struct ip_msfilter +{ + struct in_addr imsf_multiaddr; + struct in_addr imsf_interface; + uint32_t imsf_fmode; + uint32_t imsf_numsrc; + struct in_addr imsf_slist[1]; +}; + +#define IP_MSFILTER_SIZE(numsrc) (sizeof (struct ip_msfilter) \ + - sizeof (struct in_addr) \ + + (numsrc) * sizeof (struct in_addr)) + +struct in_pktinfo +{ + struct in_addr ipi_addr; + uint32_t ipi_ifindex; +}; + +/* Request struct for IP agnostic multicast socket ops */ + +struct group_req +{ + uint32_t gr_interface; + struct sockaddr_storage gr_group; +}; + +struct group_source_req +{ + uint32_t gsr_interface; + struct sockaddr_storage gsr_group; + struct sockaddr_storage gsr_source; +}; + +struct group_filter +{ + uint32_t gf_interface; + struct sockaddr_storage gf_group; + uint32_t gf_fmode; + uint32_t gf_numsrc; + struct sockaddr_storage gf_slist[1]; +}; + +#define GROUP_FILTER_SIZE(numsrc) (sizeof (struct group_filter) \ + - sizeof (struct sockaddr_storage) \ + + (numsrc) * sizeof (struct sockaddr_storage)) /* Structure describing an Internet (IP) socket address. */ #define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */ @@ -187,6 +240,7 @@ struct sockaddr_in /* Defines for Multicast INADDR */ #define INADDR_UNSPEC_GROUP 0xe0000000 /* 224.0.0.0 */ #define INADDR_ALLHOSTS_GROUP 0xe0000001 /* 224.0.0.1 */ +#define INADDR_ALLRTRS_GROUP 0xe0000002 /* 224.0.0.2 */ #define INADDR_MAX_LOCAL_GROUP 0xe00000ff /* 224.0.0.255 */ #define INET_ADDRSTRLEN 16 diff --git a/winsup/cygwin/include/cygwin/socket.h b/winsup/cygwin/include/cygwin/socket.h index 33aec8c63..0b64092ec 100644 --- a/winsup/cygwin/include/cygwin/socket.h +++ b/winsup/cygwin/include/cygwin/socket.h @@ -1,6 +1,6 @@ /* cygwin/socket.h - Copyright 1999, 2000, 2001, 2005 Red Hat, Inc. + Copyright 1999, 2000, 2001, 2005, 2006, 2007 Red Hat, Inc. This file is part of Cygwin. @@ -243,6 +243,17 @@ struct OLD_msghdr #define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP #define IPV6_PKTINFO 19 +/* IP agnostic options for use with getsockopt/setsockopt */ +#define MCAST_JOIN_GROUP 41 +#define MCAST_LEAVE_GROUP 42 +#define MCAST_BLOCK_SOURCE 43 +#define MCAST_UNBLOCK_SOURCE 44 +#define MCAST_JOIN_SOURCE_GROUP 45 +#define MCAST_LEAVE_SOURCE_GROUP 46 + +#define MCAST_EXCLUDE 0 +#define MCAST_INCLUDE 1 + /* Old WinSock1 values, needed internally */ #ifdef __INSIDE_CYGWIN__ #define _WS1_IP_OPTIONS 1 -- cgit v1.2.3