mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "Timo Teräs" <timo.teras@iki.fi>
To: musl@lists.openwall.com
Cc: "Timo Teräs" <timo.teras@iki.fi>
Subject: [PATCH] add multicast structures from RFC 3678 to netinet/in.h
Date: Thu,  1 Aug 2013 08:23:13 +0300	[thread overview]
Message-ID: <1375334593-1978-1-git-send-email-timo.teras@iki.fi> (raw)

and use _GNU_SOURCE || _BSD_SOURCE guards for all of the RFC 3678
namespace polluting things like glibc/uclibc does.
---

 include/netinet/in.h | 43 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)

diff --git a/include/netinet/in.h b/include/netinet/in.h
index d886fc2..b7a8a7a 100644
--- a/include/netinet/in.h
+++ b/include/netinet/in.h
@@ -204,7 +204,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
@@ -249,6 +249,47 @@ struct ip_mreqn
 	int imr_ifindex;
 };
 
+struct ip_mreq_source {
+	uint32_t imr_multiaddr;
+	uint32_t imr_interface;
+	uint32_t imr_sourceaddr;
+};
+
+struct ip_msfilter {
+	uint32_t imsf_multiaddr;
+	uint32_t imsf_interface;
+	uint32_t imsf_fmode;
+	uint32_t imsf_numsrc;
+	uint32_t imsf_slist[1];
+};
+#define IP_MSFILTER_SIZE(numsrc) \
+	(sizeof(struct ip_msfilter) - sizeof(uint32_t) \
+	+ (numsrc) * sizeof(uint32_t))
+
+#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;
-- 
1.8.3.3



                 reply	other threads:[~2013-08-01  5:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1375334593-1978-1-git-send-email-timo.teras@iki.fi \
    --to=timo.teras@iki.fi \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).