1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:34:57 +00:00

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.
This commit is contained in:
Sergey Bugaev 2021-05-04 14:42:47 +03:00 committed by Andreas Kling
parent b9c367e13b
commit 78459b92d5
5 changed files with 77 additions and 7 deletions

View file

@ -525,6 +525,9 @@ enum {
#define IPPROTO_UDP 17
#define IP_TTL 2
#define IP_MULTICAST_LOOP 3
#define IP_ADD_MEMBERSHIP 4
#define IP_DROP_MEMBERSHIP 5
struct ucred {
pid_t pid;
@ -548,6 +551,7 @@ struct sockaddr_un {
struct in_addr {
uint32_t s_addr;
};
typedef uint32_t in_addr_t;
struct sockaddr_in {
int16_t sin_family;
@ -556,6 +560,15 @@ struct sockaddr_in {
char sin_zero[8];
};
struct ip_mreq {
struct in_addr imr_multiaddr;
struct in_addr imr_interface;
};
#define INADDR_ANY ((in_addr_t)0)
#define INADDR_NONE ((in_addr_t)-1)
#define INADDR_LOOPBACK 0x7f000001
typedef u32 __u32;
typedef u16 __u16;
typedef u8 __u8;