Merge pull request #1687 from chenyong111/master

[net][sal] add socket set multicast group support.
This commit is contained in:
朱天龙 (Armink) 2018-08-02 17:46:38 +08:00 committed by GitHub
commit ba1aedd1a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 64 additions and 49 deletions

View File

@ -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];