Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Lwip
提交
ef6cc096
T
Third Party Lwip
项目概览
OpenHarmony
/
Third Party Lwip
8 个月 前同步成功
通知
5
Star
23
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Lwip
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ef6cc096
编写于
12月 02, 2021
作者:
M
maosiping
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
蓝牙网络代理
Signed-off-by:
N
maosiping
<
maosiping@huawei.com
>
上级
40d89b67
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
31 addition
and
29 deletion
+31
-29
src/api/sockets.c
src/api/sockets.c
+3
-3
src/core/distributed_net/distributed_net_core.c
src/core/distributed_net/distributed_net_core.c
+21
-19
src/core/distributed_net/udp_transmit.c
src/core/distributed_net/udp_transmit.c
+2
-2
src/include/lwip/distributed_net/distributed_net_core.h
src/include/lwip/distributed_net/distributed_net_core.h
+3
-3
src/include/lwip/distributed_net/udp_transmit.h
src/include/lwip/distributed_net/udp_transmit.h
+2
-2
未找到文件。
src/api/sockets.c
浏览文件 @
ef6cc096
...
...
@@ -1437,7 +1437,7 @@ lwip_send(int s, const void *data, size_t size, int flags)
if
(
NETCONNTYPE_GROUP
(
netconn_type
(
sock
->
conn
))
!=
NETCONN_TCP
)
{
#if (LWIP_UDP || LWIP_RAW)
done_socket
(
sock
);
#if LWIP_ENABLE_DISTRIBUTED_NET
#if LWIP_ENABLE_DISTRIBUTED_NET
&& LWIP_USE_GET_HOST_BY_NAME_EXTERNAL
return
lwip_sendto_internal
(
s
,
data
,
size
,
flags
,
NULL
,
0
);
#else
return
lwip_sendto
(
s
,
data
,
size
,
flags
,
NULL
,
0
);
...
...
@@ -1465,7 +1465,7 @@ lwip_send(int s, const void *data, size_t size, int flags)
ssize_t
lwip_sendmsg
(
int
s
,
const
struct
msghdr
*
msg
,
int
flags
)
{
#if LWIP_ENABLE_DISTRIBUTED_NET
#if LWIP_ENABLE_DISTRIBUTED_NET
&& LWIP_USE_GET_HOST_BY_NAME_EXTERNAL && LWIP_DISTRIBUTED_NET_ENABLE_SENDMSG
if
(
!
is_distributed_net_enabled
())
{
return
lwip_sendmsg_internal
(
s
,
msg
,
flags
);
}
...
...
@@ -1640,7 +1640,7 @@ ssize_t
lwip_sendto
(
int
s
,
const
void
*
data
,
size_t
size
,
int
flags
,
const
struct
sockaddr
*
to
,
socklen_t
tolen
)
{
#if LWIP_ENABLE_DISTRIBUTED_NET
#if LWIP_ENABLE_DISTRIBUTED_NET
&& LWIP_USE_GET_HOST_BY_NAME_EXTERNAL
if
(
!
is_distributed_net_enabled
())
{
return
lwip_sendto_internal
(
s
,
data
,
size
,
flags
,
to
,
tolen
);
}
...
...
src/core/distributed_net/distributed_net_core.c
浏览文件 @
ef6cc096
...
...
@@ -71,6 +71,25 @@ int distributed_net_connect(int sock, const struct sockaddr *addr, socklen_t add
return
0
;
}
int
distributed_net_close
(
int
sock
)
{
CHECK_PARA
(
SOCKET_TO_INDEX
(
sock
)
>=
0
&&
SOCKET_TO_INDEX
(
sock
)
<
NUM_SOCKETS
,
EBADF
);
reset_distributed_net_socket
(
sock
);
return
lwip_close_internal
(
sock
);
}
#if LWIP_USE_GET_HOST_BY_NAME_EXTERNAL
typedef
union
{
struct
sockaddr
sa
;
#if LWIP_IPV6
struct
sockaddr_in6
sin6
;
#endif
/* LWIP_IPV6 */
#if LWIP_IPV4
struct
sockaddr_in
sin
;
#endif
/* LWIP_IPV4 */
}
aligned_sockaddr
;
ssize_t
distributed_net_sendto
(
int
sock
,
const
void
*
buf
,
size_t
buf_len
,
int
flags
,
const
struct
sockaddr
*
addr
,
socklen_t
addr_len
)
{
...
...
@@ -112,6 +131,7 @@ ssize_t distributed_net_sendto(int sock, const void *buf, size_t buf_len, int fl
return
ret
>
0
?
UDP_PAYLOAD_LEN
(
ret
)
:
-
1
;
}
#if LWIP_DISTRIBUTED_NET_ENABLE_SENDMSG
ssize_t
distributed_net_sendmsg
(
int
sock
,
const
struct
msghdr
*
hdr
,
int
flags
)
{
CHECK_PARA
(
SOCKET_TO_INDEX
(
sock
)
>=
0
&&
SOCKET_TO_INDEX
(
sock
)
<
NUM_SOCKETS
,
EBADF
);
...
...
@@ -155,25 +175,7 @@ ssize_t distributed_net_sendmsg(int sock, const struct msghdr *hdr, int flags)
ssize_t
ret
=
udp_transmit_sendmsg
(
sock
,
hdr
);
return
ret
>
0
?
UDP_PAYLOAD_LEN
(
ret
)
:
-
1
;
}
int
distributed_net_close
(
int
sock
)
{
CHECK_PARA
(
SOCKET_TO_INDEX
(
sock
)
>=
0
&&
SOCKET_TO_INDEX
(
sock
)
<
NUM_SOCKETS
,
EBADF
);
reset_distributed_net_socket
(
sock
);
return
lwip_close_internal
(
sock
);
}
#if LWIP_USE_GET_HOST_BY_NAME_EXTERNAL
typedef
union
{
struct
sockaddr
sa
;
#if LWIP_IPV6
struct
sockaddr_in6
sin6
;
#endif
/* LWIP_IPV6 */
#if LWIP_IPV4
struct
sockaddr_in
sin
;
#endif
/* LWIP_IPV4 */
}
aligned_sockaddr
;
#endif
/* LWIP_DISTRIBUTED_NET_ENABLE_SENDMSG */
ssize_t
distributed_net_recvfrom
(
int
sock
,
void
*
buf
,
size_t
buf_len
,
int
flags
,
struct
sockaddr
*
from
,
socklen_t
*
from_len
)
...
...
src/core/distributed_net/udp_transmit.c
浏览文件 @
ef6cc096
...
...
@@ -29,7 +29,7 @@
#include "lwip/opt.h"
#if LWIP_ENABLE_DISTRIBUTED_NET
#if LWIP_ENABLE_DISTRIBUTED_NET
&& LWIP_USE_GET_HOST_BY_NAME_EXTERNAL
#include "lwip/distributed_net/udp_transmit.h"
...
...
@@ -131,4 +131,4 @@ ssize_t udp_transmit_sendmsg(int sock, const struct msghdr *hdr)
return
ret
;
}
#endif
/* LWIP_ENABLE_DISTRIBUTED_NET */
#endif
/* LWIP_ENABLE_DISTRIBUTED_NET
&& LWIP_USE_GET_HOST_BY_NAME_EXTERNAL
*/
src/include/lwip/distributed_net/distributed_net_core.h
浏览文件 @
ef6cc096
...
...
@@ -59,14 +59,14 @@ typedef struct tcp_connect_data {
int
distributed_net_connect
(
int
sock
,
const
struct
sockaddr
*
addr
,
socklen_t
addr_len
);
int
distributed_net_close
(
int
sock
);
#if LWIP_USE_GET_HOST_BY_NAME_EXTERNAL
ssize_t
distributed_net_sendto
(
int
sock
,
const
void
*
buf
,
size_t
buf_len
,
int
flags
,
const
struct
sockaddr
*
addr
,
socklen_t
addr_len
);
ssize_t
distributed_net_sendmsg
(
int
sock
,
const
struct
msghdr
*
hdr
,
int
flags
);
int
distributed_net_close
(
int
sock
);
#if LWIP_USE_GET_HOST_BY_NAME_EXTERNAL
ssize_t
distributed_net_recvfrom
(
int
sock
,
void
*
buf
,
size_t
buf_len
,
int
flags
,
struct
sockaddr
*
from
,
socklen_t
*
from_len
);
#endif
/* LWIP_USE_GET_HOST_BY_NAME_EXTERNAL */
...
...
src/include/lwip/distributed_net/udp_transmit.h
浏览文件 @
ef6cc096
...
...
@@ -32,7 +32,7 @@
#include "lwip/opt.h"
#if LWIP_ENABLE_DISTRIBUTED_NET
#if LWIP_ENABLE_DISTRIBUTED_NET
&& LWIP_USE_GET_HOST_BY_NAME_EXTERNAL
#include "lwip/distributed_net/distributed_net.h"
#include "lwip/sockets.h"
...
...
@@ -53,6 +53,6 @@ ssize_t udp_transmit_sendto(int sock, const void *buf, size_t buf_len, const str
ssize_t
udp_transmit_sendmsg
(
int
sock
,
const
struct
msghdr
*
hdr
);
#endif
/* LWIP_ENABLE_DISTRIBUTED_NET */
#endif
/* LWIP_ENABLE_DISTRIBUTED_NET
&& LWIP_USE_GET_HOST_BY_NAME_EXTERNAL
*/
#endif
/* LWIP_HDR_UDP_TRANSMIT_H */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录