[net][sal] add socket set multicast group support and format code.
@@ -120,14 +120,28 @@ typedef uint16_t in_port_t;
#define TCP_KEEPINTVL 0x04 /* set pcb->keep_intvl - Use seconds for get/setsockopt */
#define TCP_KEEPCNT 0x05 /* set pcb->keep_cnt - Use number of probes sent for get/setsockopt */
-struct sockaddr {
+/*
+ * Options and types related to multicast membership
+ */
+#define IP_ADD_MEMBERSHIP 3
+#define IP_DROP_MEMBERSHIP 4
+
+typedef struct ip_mreq
+{
+ struct in_addr imr_multiaddr; /* IP multicast address of group */
+ struct in_addr imr_interface; /* local IP address of interface */
+} ip_mreq;
+
+struct sockaddr
+{
uint8_t sa_len;
sa_family_t sa_family;
char sa_data[14];
};
/* members are in network byte order */
-struct sockaddr_in {
+struct sockaddr_in
+{
uint8_t sin_len;
sa_family_t sin_family;
in_port_t sin_port;
@@ -136,7 +150,8 @@ struct sockaddr_in {
char sin_zero[SIN_ZERO_LEN];
};
-struct sockaddr_storage {
+struct sockaddr_storage
+{
uint8_t s2_len;
sa_family_t ss_family;
char s2_data1[2];
