Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos M
提交
aed47981
K
Kernel Liteos M
项目概览
OpenHarmony
/
Kernel Liteos M
12 个月 前同步成功
通知
20
Star
28
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos M
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
aed47981
编写于
10月 21, 2021
作者:
O
openharmony_ci
提交者:
Gitee
10月 21, 2021
浏览文件
操作
浏览文件
下载
差异文件
!360 m核ioctl支持SIOCGIFBRDADDR选项
Merge pull request !360 from 刘建东/master
上级
fe68a93d
33ee4929
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
82 addition
and
3 deletion
+82
-3
components/net/lwip-2.1/BUILD.gn
components/net/lwip-2.1/BUILD.gn
+2
-0
components/net/lwip-2.1/porting/include/arch/cc.h
components/net/lwip-2.1/porting/include/arch/cc.h
+0
-1
components/net/lwip-2.1/porting/src/sockets_porting.c
components/net/lwip-2.1/porting/src/sockets_porting.c
+80
-2
未找到文件。
components/net/lwip-2.1/BUILD.gn
浏览文件 @
aed47981
...
@@ -44,6 +44,8 @@ static_library("lwip") {
...
@@ -44,6 +44,8 @@ static_library("lwip") {
sources = LWIP_PORTING_FILES + LWIPNOAPPSFILES
sources = LWIP_PORTING_FILES + LWIPNOAPPSFILES
sources -= [ "$LWIPDIR/api/sockets.c" ]
configs += [ ":lwip_depends" ]
configs += [ ":lwip_depends" ]
deps = [ "//kernel/liteos_m/kal/posix" ]
deps = [ "//kernel/liteos_m/kal/posix" ]
...
...
components/net/lwip-2.1/porting/include/arch/cc.h
浏览文件 @
aed47981
...
@@ -105,6 +105,5 @@ extern void LwipLogPrintf(const char *fmt, ...);
...
@@ -105,6 +105,5 @@ extern void LwipLogPrintf(const char *fmt, ...);
#define init_waitqueue_head(...)
#define init_waitqueue_head(...)
#define poll_check_waiters(...)
#define poll_check_waiters(...)
#define IOCTL_CMD_CASE_HANDLER()
#endif
/* _LWIP_PORTING_CC_H_ */
#endif
/* _LWIP_PORTING_CC_H_ */
components/net/lwip-2.1/porting/src/sockets_porting.c
浏览文件 @
aed47981
...
@@ -29,8 +29,9 @@
...
@@ -29,8 +29,9 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
*/
#include "lwip/sockets.h"
#include "lwip/priv/tcpip_priv.h"
#include "lwip/priv/sockets_priv.h"
#include "lwip/priv/sockets_priv.h"
#include <lwip/sockets.h>
#if !LWIP_COMPAT_SOCKETS
#if !LWIP_COMPAT_SOCKETS
#if LWIP_SOCKET
#if LWIP_SOCKET
...
@@ -185,4 +186,81 @@ unsigned int if_nametoindex(const char *ifname)
...
@@ -185,4 +186,81 @@ unsigned int if_nametoindex(const char *ifname)
}
}
#endif
#endif
#endif
/* !LWIP_COMPAT_SOCKETS */
#endif
/* !LWIP_COMPAT_SOCKETS */
\ No newline at end of file
#define IOCTL_CMD_CASE_HANDLER() do { \
err_t
err
;
\
struct
lwip_ioctl_apimsg
msg
;
\
msg
.
sock
=
sock
;
\
msg
.
cmd
=
cmd
;
\
msg
.
argp
=
argp
;
\
\
err
=
tcpip_api_call
(
lwip_do_ioctl_impl
,
&
msg
.
call
);
\
if
(
err
!=
ENOSYS
)
{
\
sock_set_errno
(
sock
,
err
);
\
done_socket
(
sock
);
\
return
-
(
err
!=
ERR_OK
);
\
}
\
}
while
(
0
)
struct
lwip_ioctl_apimsg
{
struct
tcpip_api_call_data
call
;
struct
lwip_sock
*
sock
;
long
cmd
;
void
*
argp
;
};
static
err_t
lwip_do_ioctl_impl
(
struct
tcpip_api_call_data
*
call
);
#include "../api/sockets.c"
static
u8_t
lwip_ioctl_internal_SIOCGIFBRDADDR
(
struct
ifreq
*
ifr
)
{
struct
netif
*
netif
=
NULL
;
struct
sockaddr_in
*
sock_in
=
NULL
;
/* get netif subnet broadcast addr */
netif
=
netif_find
(
ifr
->
ifr_name
);
if
(
netif
==
NULL
)
{
return
ENODEV
;
}
if
(
ip4_addr_isany_val
(
*
(
ip_2_ip4
(
&
netif
->
netmask
))))
{
return
ENXIO
;
}
sock_in
=
(
struct
sockaddr_in
*
)
&
ifr
->
ifr_addr
;
sock_in
->
sin_family
=
AF_INET
;
sock_in
->
sin_addr
.
s_addr
=
(
ip_2_ip4
(
&
((
netif
)
->
ip_addr
))
->
addr
|
~
(
ip_2_ip4
(
&
netif
->
netmask
)
->
addr
));
return
0
;
}
static
u8_t
lwip_ioctl_impl
(
const
struct
lwip_sock
*
sock
,
long
cmd
,
void
*
argp
)
{
u8_t
err
=
0
;
struct
ifreq
*
ifr
=
(
struct
ifreq
*
)
argp
;
bool
is_ipv6
=
0
;
/* allow it only on IPv6 sockets... */
is_ipv6
=
NETCONNTYPE_ISIPV6
((
unsigned
int
)(
sock
->
conn
->
type
));
switch
((
u32_t
)
cmd
)
{
case
SIOCGIFBRDADDR
:
if
(
is_ipv6
!=
0
)
{
err
=
EINVAL
;
}
else
{
err
=
lwip_ioctl_internal_SIOCGIFBRDADDR
(
ifr
);
}
break
;
default:
err
=
ENOSYS
;
LWIP_DEBUGF
(
SOCKETS_DEBUG
,
(
"lwip_ioctl(UNIMPL: 0x%lx)
\n
"
,
cmd
));
break
;
}
return
err
;
}
static
err_t
lwip_do_ioctl_impl
(
struct
tcpip_api_call_data
*
call
)
{
struct
lwip_ioctl_apimsg
*
msg
=
(
struct
lwip_ioctl_apimsg
*
)(
void
*
)
call
;
return
lwip_ioctl_impl
(
msg
->
sock
,
msg
->
cmd
,
msg
->
argp
);
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录