summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibC/netinet
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@serenityos.org>2021-05-04 14:42:47 +0300
committerAndreas Kling <kling@serenityos.org>2021-05-05 21:16:17 +0200
commit78459b92d50ee24f4312ff050fa8b63f82d0df05 (patch)
tree30dbe18941e66df70a1a44676c05c7ad4a52fa4a /Userland/Libraries/LibC/netinet
parentb9c367e13b0e8eeec9cb085876b3306c24a9f2fd (diff)
downloadserenity-78459b92d50ee24f4312ff050fa8b63f82d0df05.zip
Kernel: Implement IP multicast support
An IP socket can now join a multicast group by using the IP_ADD_MEMBERSHIP sockopt, which will cause it to start receiving packets sent to the multicast address, even though this address does not belong to this host.
Diffstat (limited to 'Userland/Libraries/LibC/netinet')
-rw-r--r--Userland/Libraries/LibC/netinet/in.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Libraries/LibC/netinet/in.h b/Userland/Libraries/LibC/netinet/in.h
index f6617c8bed..7d7bc6c938 100644
--- a/Userland/Libraries/LibC/netinet/in.h
+++ b/Userland/Libraries/LibC/netinet/in.h
@@ -22,6 +22,9 @@ in_addr_t inet_addr(const char*);
#define IN_LOOPBACKNET 127
#define IP_TTL 2
+#define IP_MULTICAST_LOOP 3
+#define IP_ADD_MEMBERSHIP 4
+#define IP_DROP_MEMBERSHIP 5
#define IPPORT_RESERVED 1024
#define IPPORT_USERRESERVED 5000
@@ -39,6 +42,11 @@ struct sockaddr_in {
char sin_zero[8];
};
+struct ip_mreq {
+ struct in_addr imr_multiaddr;
+ struct in_addr imr_interface;
+};
+
struct in6_addr {
uint8_t s6_addr[16];
};