add multicast structures from RFC 3678 to netinet/in.h

and use _GNU_SOURCE || _BSD_SOURCE guards for all of the RFC 3678
namespace polluting things like glibc/uclibc does.
This commit is contained in:
Timo Teräs 2013-07-31 12:05:14 +03:00 committed by Rich Felker
parent 4f6658b969
commit 7c0ca4d361
1 changed files with 42 additions and 1 deletions

View File

@ -206,7 +206,7 @@ uint16_t ntohs(uint16_t);
#define IP_MULTICAST_ALL 49
#define IP_UNICAST_IF 50
#ifdef _GNU_SOURCE
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define MCAST_JOIN_GROUP 42
#define MCAST_BLOCK_SOURCE 43
#define MCAST_UNBLOCK_SOURCE 44
@ -251,6 +251,47 @@ struct ip_mreqn
int imr_ifindex;
};
struct ip_mreq_source {
struct in_addr imr_multiaddr;
struct in_addr imr_interface;
struct in_addr imr_sourceaddr;
};
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))
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
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))
#endif
struct in_pktinfo
{
int ipi_ifindex;