Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
ba1aedd1
R
rt-thread
项目概览
BaiXuePrincess
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
未验证
提交
ba1aedd1
编写于
8月 02, 2018
作者:
armink_ztl
提交者:
GitHub
8月 02, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1687 from chenyong111/master
[net][sal] add socket set multicast group support.
上级
4af9f68a
dabf8efc
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
65 addition
and
50 deletion
+65
-50
components/net/sal_socket/include/sal_socket.h
components/net/sal_socket/include/sal_socket.h
+65
-50
未找到文件。
components/net/sal_socket/include/sal_socket.h
浏览文件 @
ba1aedd1
...
...
@@ -46,41 +46,41 @@ typedef uint16_t in_port_t;
#define SOCK_DGRAM 2
#define SOCK_RAW 3
#define SOCK_MAX (SOCK_RAW + 1)
#define SOCK_MAX
(SOCK_RAW + 1)
/*
* Option flags per-socket. These must match the SOF_ flags in ip.h (checked in init.c)
*/
#define SO_REUSEADDR 0x0004
/* Allow local address reuse */
#define SO_KEEPALIVE 0x0008
/* keep connections alive */
#define SO_BROADCAST 0x0020
/* permit to send and to receive broadcast messages (see IP_SOF_BROADCAST option) */
#define SO_REUSEADDR
0x0004
/* Allow local address reuse */
#define SO_KEEPALIVE
0x0008
/* keep connections alive */
#define SO_BROADCAST
0x0020
/* permit to send and to receive broadcast messages (see IP_SOF_BROADCAST option) */
/*
* Additional options, not kept in so_options.
*/
#define SO_DEBUG 0x0001
/* Unimplemented: turn on debugging info recording */
#define SO_ACCEPTCONN 0x0002
/* socket has had listen() */
#define SO_DONTROUTE 0x0010
/* Unimplemented: just use interface addresses */
#define SO_USELOOPBACK 0x0040
/* Unimplemented: bypass hardware when possible */
#define SO_LINGER 0x0080
/* linger on close if data present */
#define SO_DONTLINGER ((int)(~SO_LINGER))
#define SO_OOBINLINE 0x0100
/* Unimplemented: leave received OOB data in line */
#define SO_REUSEPORT 0x0200
/* Unimplemented: allow local address & port reuse */
#define SO_SNDBUF 0x1001
/* Unimplemented: send buffer size */
#define SO_RCVBUF 0x1002
/* receive buffer size */
#define SO_SNDLOWAT 0x1003
/* Unimplemented: send low-water mark */
#define SO_RCVLOWAT 0x1004
/* Unimplemented: receive low-water mark */
#define SO_SNDTIMEO 0x1005
/* send timeout */
#define SO_RCVTIMEO 0x1006
/* receive timeout */
#define SO_ERROR 0x1007
/* get error status and clear */
#define SO_TYPE 0x1008
/* get socket type */
#define SO_CONTIMEO 0x1009
/* Unimplemented: connect timeout */
#define SO_NO_CHECK 0x100a
/* don't create UDP checksum */
#define SO_DEBUG
0x0001
/* Unimplemented: turn on debugging info recording */
#define SO_ACCEPTCONN
0x0002
/* socket has had listen() */
#define SO_DONTROUTE
0x0010
/* Unimplemented: just use interface addresses */
#define SO_USELOOPBACK
0x0040
/* Unimplemented: bypass hardware when possible */
#define SO_LINGER
0x0080
/* linger on close if data present */
#define SO_DONTLINGER
((int)(~SO_LINGER))
#define SO_OOBINLINE
0x0100
/* Unimplemented: leave received OOB data in line */
#define SO_REUSEPORT
0x0200
/* Unimplemented: allow local address & port reuse */
#define SO_SNDBUF
0x1001
/* Unimplemented: send buffer size */
#define SO_RCVBUF
0x1002
/* receive buffer size */
#define SO_SNDLOWAT
0x1003
/* Unimplemented: send low-water mark */
#define SO_RCVLOWAT
0x1004
/* Unimplemented: receive low-water mark */
#define SO_SNDTIMEO
0x1005
/* send timeout */
#define SO_RCVTIMEO
0x1006
/* receive timeout */
#define SO_ERROR
0x1007
/* get error status and clear */
#define SO_TYPE
0x1008
/* get socket type */
#define SO_CONTIMEO
0x1009
/* Unimplemented: connect timeout */
#define SO_NO_CHECK
0x100a
/* don't create UDP checksum */
/*
* Level number for (get/set)sockopt() to apply to socket itself.
*/
#define SOL_SOCKET 0xfff
/* options for socket level */
#define SOL_SOCKET
0xfff
/* options for socket level */
#define AF_UNSPEC 0
#define AF_INET 2
...
...
@@ -105,44 +105,59 @@ typedef uint16_t in_port_t;
#define IPPROTO_RAW 255
/* Flags we can use with send and recv. */
#define MSG_PEEK 0x01
/* Peeks at an incoming message */
#define MSG_WAITALL 0x02
/* Unimplemented: Requests that the function block until the full amount of data requested can be returned */
#define MSG_OOB 0x04
/* Unimplemented: Requests out-of-band data. The significance and semantics of out-of-band data are protocol-specific */
#define MSG_DONTWAIT 0x08
/* Nonblocking i/o for this operation only */
#define MSG_MORE 0x10
/* Sender will send more */
#define MSG_PEEK
0x01
/* Peeks at an incoming message */
#define MSG_WAITALL
0x02
/* Unimplemented: Requests that the function block until the full amount of data requested can be returned */
#define MSG_OOB
0x04
/* Unimplemented: Requests out-of-band data. The significance and semantics of out-of-band data are protocol-specific */
#define MSG_DONTWAIT
0x08
/* Nonblocking i/o for this operation only */
#define MSG_MORE
0x10
/* Sender will send more */
/*
* Options for level IPPROTO_TCP
*/
#define TCP_NODELAY 0x01
/* don't delay send to coalesce packets */
#define TCP_KEEPALIVE 0x02
/* send KEEPALIVE probes when idle for pcb->keep_idle milliseconds */
#define TCP_KEEPIDLE 0x03
/* set pcb->keep_idle - Same as TCP_KEEPALIVE, but use seconds for get/setsockopt */
#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
{
uint8_t
sa_len
;
sa_family_t
sa_family
;
char
sa_data
[
14
];
#define TCP_NODELAY 0x01
/* don't delay send to coalesce packets */
#define TCP_KEEPALIVE 0x02
/* send KEEPALIVE probes when idle for pcb->keep_idle milliseconds */
#define TCP_KEEPIDLE 0x03
/* set pcb->keep_idle - Same as TCP_KEEPALIVE, but use seconds for get/setsockopt */
#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 */
/*
* 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
{
uint8_t
sin_len
;
sa_family_t
sin_family
;
in_port_t
sin_port
;
struct
in_addr
sin_addr
;
struct
sockaddr_in
{
uint8_t
sin_len
;
sa_family_t
sin_family
;
in_port_t
sin_port
;
struct
in_addr
sin_addr
;
#define SIN_ZERO_LEN 8
char
sin_zero
[
SIN_ZERO_LEN
];
char
sin_zero
[
SIN_ZERO_LEN
];
};
struct
sockaddr_storage
{
uint8_t
s2_len
;
sa_family_t
ss_family
;
char
s2_data1
[
2
];
uint32_t
s2_data2
[
3
];
struct
sockaddr_storage
{
uint8_t
s2_len
;
sa_family_t
ss_family
;
char
s2_data1
[
2
];
uint32_t
s2_data2
[
3
];
#if SAL_IPV6
u32_t
s2_data3
[
3
];
u32_t
s2_data3
[
3
];
#endif
/* SAL_IPV6 */
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录