Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Redeom
Kernel Liteos A
提交
9b25a48d
K
Kernel Liteos A
项目概览
Redeom
/
Kernel Liteos A
与 Fork 源项目一致
Fork自
OpenHarmony / Kernel Liteos A
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos A
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
9b25a48d
编写于
9月 07, 2020
作者:
C
c00546070
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Description: fix indentations
Reviewed-by: jianghan
上级
ff52e24f
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
409 addition
and
409 deletion
+409
-409
net/lwip-2.1/enhancement/src/api_shell.c
net/lwip-2.1/enhancement/src/api_shell.c
+409
-409
未找到文件。
net/lwip-2.1/enhancement/src/api_shell.c
浏览文件 @
9b25a48d
...
@@ -225,14 +225,14 @@ int netstat_netconn_sendq(struct netconn *conn);
...
@@ -225,14 +225,14 @@ int netstat_netconn_sendq(struct netconn *conn);
} \
} \
}
}
#define ERR_IFCONFIG_STRING_PUT(ret, str)
do
\
#define ERR_IFCONFIG_STRING_PUT(ret, str)
\
{
\
do {
\
(ret) = snprintf_s(ifconfig_cmd->cb_print_buf + ifconfig_cmd->print_len, \
(ret) = snprintf_s(ifconfig_cmd->cb_print_buf + ifconfig_cmd->print_len, \
PRINT_BUF_LEN - ifconfig_cmd->print_len, \
PRINT_BUF_LEN - ifconfig_cmd->print_len, \
((PRINT_BUF_LEN - ifconfig_cmd->print_len) - 1), (str)); \
((PRINT_BUF_LEN - ifconfig_cmd->print_len) - 1), (str)); \
if (((ret) > 0) && ((unsigned int)(ret) < (PRINT_BUF_LEN - ifconfig_cmd->print_len))) \
if (((ret) > 0) && ((unsigned int)(ret) < (PRINT_BUF_LEN - ifconfig_cmd->print_len))) \
ifconfig_cmd->print_len += (unsigned int)(ret); \
ifconfig_cmd->print_len += (unsigned int)(ret); \
} while(0)
} while (0) \
#define LWIP_MSECS_TO_SECS(time_in_msecs) (time_in_msecs / 1000)
#define LWIP_MSECS_TO_SECS(time_in_msecs) (time_in_msecs / 1000)
struct
ifconfig_option
{
struct
ifconfig_option
{
...
@@ -2026,7 +2026,7 @@ DO_SELECT:
...
@@ -2026,7 +2026,7 @@ DO_SELECT:
}
}
/* Accessing ip header and icmp header */
/* Accessing ip header and icmp header */
iphdr_resp
=
(
struct
ip_hdr
*
)(
pbuf_resp
->
payload
);
iphdr_resp
=
(
struct
ip_hdr
*
)(
pbuf_resp
->
payload
);
ip_hlen
=
(
s16_t
)(
IPH_HL
(
iphdr_resp
)
*
4
);
ip_hlen
=
(
s16_t
)(
IPH_HL
(
iphdr_resp
)
*
4
);
if
(
pbuf_header
(
pbuf_resp
,
(
s16_t
)(
-
ip_hlen
)))
{
if
(
pbuf_header
(
pbuf_resp
,
(
s16_t
)(
-
ip_hlen
)))
{
/* this failure will never happen, but failure handle is written just to be in safe side */
/* this failure will never happen, but failure handle is written just to be in safe side */
...
@@ -2389,11 +2389,11 @@ LWIP_STATIC int create_ping6_socket(u8_t type, const void *param)
...
@@ -2389,11 +2389,11 @@ LWIP_STATIC int create_ping6_socket(u8_t type, const void *param)
}
}
/*
/*
Function to parse the command line args for ping6 shell utility
*
Function to parse the command line args for ping6 shell utility
@return:
*
@return:
Success: ERR_OK
*
Success: ERR_OK
Failure: -1
*
Failure: -1
*/
*/
LWIP_STATIC
int
parse_args_ping6
(
int
argc
,
const
char
**
argv
,
ping6_args_t
*
ping6_params
)
LWIP_STATIC
int
parse_args_ping6
(
int
argc
,
const
char
**
argv
,
ping6_args_t
*
ping6_params
)
{
{
int
pingcount
;
int
pingcount
;
...
@@ -3619,7 +3619,7 @@ u32_t osTcpserver(int argc, const char **argv)
...
@@ -3619,7 +3619,7 @@ u32_t osTcpserver(int argc, const char **argv)
return
LOS_NOK
;
return
LOS_NOK
;
}
}
reuse
=
1
;
reuse
=
1
;
if
(
setsockopt
(
sockfd
,
SOL_SOCKET
,
SO_REUSEADDR
,
(
const
char
*
)
&
reuse
,
sizeof
(
reuse
))
!=
0
)
{
if
(
setsockopt
(
sockfd
,
SOL_SOCKET
,
SO_REUSEADDR
,
(
const
char
*
)
&
reuse
,
sizeof
(
reuse
))
!=
0
)
{
(
void
)
closesocket
(
sockfd
);
(
void
)
closesocket
(
sockfd
);
PRINTK
(
"set SO_REUSEADDR failed
\n
"
);
PRINTK
(
"set SO_REUSEADDR failed
\n
"
);
return
LOS_NOK
;
return
LOS_NOK
;
...
@@ -3630,7 +3630,7 @@ u32_t osTcpserver(int argc, const char **argv)
...
@@ -3630,7 +3630,7 @@ u32_t osTcpserver(int argc, const char **argv)
seraddr
.
sin_addr
.
s_addr
=
htonl
(
INADDR_ANY
);
seraddr
.
sin_addr
.
s_addr
=
htonl
(
INADDR_ANY
);
seraddr
.
sin_port
=
htons
(
port
);
seraddr
.
sin_port
=
htons
(
port
);
ret
=
bind
(
sockfd
,
(
struct
sockaddr
*
)
&
seraddr
,
sizeof
(
seraddr
));
ret
=
bind
(
sockfd
,
(
struct
sockaddr
*
)
&
seraddr
,
sizeof
(
seraddr
));
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
PRINTK
(
"bind ip and port failed"
);
PRINTK
(
"bind ip and port failed"
);
(
void
)
closesocket
(
sockfd
);
(
void
)
closesocket
(
sockfd
);
...
@@ -3646,11 +3646,11 @@ u32_t osTcpserver(int argc, const char **argv)
...
@@ -3646,11 +3646,11 @@ u32_t osTcpserver(int argc, const char **argv)
while
(
1
)
{
while
(
1
)
{
PRINTK
(
"waiting for accept
\n
"
);
PRINTK
(
"waiting for accept
\n
"
);
(
void
)
memset_s
(
&
cliaddr
,
sizeof
(
struct
sockaddr_in
),
0
,
sizeof
(
struct
sockaddr_in
));
(
void
)
memset_s
(
&
cliaddr
,
sizeof
(
struct
sockaddr_in
),
0
,
sizeof
(
struct
sockaddr_in
));
ret
=
(
int
)
accept
(
sockfd
,
(
struct
sockaddr
*
)
&
cliaddr
,
&
cliaddr_size
);
ret
=
(
int
)
accept
(
sockfd
,
(
struct
sockaddr
*
)
&
cliaddr
,
&
cliaddr_size
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
(
void
)
closesocket
(
sockfd
);
(
void
)
closesocket
(
sockfd
);
PRINTK
(
"Accept failed, %d
\n
"
,
ret
);
PRINTK
(
"Accept failed, %d
\n
"
,
ret
);
break
;
break
;
}
}
tcp_access
(
ret
);
tcp_access
(
ret
);
}
}
...
@@ -3683,7 +3683,7 @@ void udpserver(int argc, const char **argv)
...
@@ -3683,7 +3683,7 @@ void udpserver(int argc, const char **argv)
/* Port 0 not supported , negative values not supported , max port limit is 65535 */
/* Port 0 not supported , negative values not supported , max port limit is 65535 */
if
(
iPortVal
<=
0
||
iPortVal
>
65535
)
{
if
(
iPortVal
<=
0
||
iPortVal
>
65535
)
{
PRINTK
(
"
\n
Usage: Invalid Port
\n
"
);
PRINTK
(
"
\n
Usage: Invalid Port
\n
"
);
return
;
return
;
}
}
port
=
(
uint16_t
)
iPortVal
;
port
=
(
uint16_t
)
iPortVal
;
...
@@ -3701,14 +3701,14 @@ void udpserver(int argc, const char **argv)
...
@@ -3701,14 +3701,14 @@ void udpserver(int argc, const char **argv)
seraddr
.
sin_family
=
AF_INET
;
seraddr
.
sin_family
=
AF_INET
;
seraddr
.
sin_addr
.
s_addr
=
htonl
(
INADDR_ANY
);
seraddr
.
sin_addr
.
s_addr
=
htonl
(
INADDR_ANY
);
seraddr
.
sin_port
=
htons
(
port
);
seraddr
.
sin_port
=
htons
(
port
);
ret
=
lwip_bind
(
sockfd
,
(
struct
sockaddr
*
)
&
seraddr
,
sizeof
(
seraddr
));
ret
=
lwip_bind
(
sockfd
,
(
struct
sockaddr
*
)
&
seraddr
,
sizeof
(
seraddr
));
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
PRINTK
(
"bind ip and port failed:%d
\n
"
,
errno
);
PRINTK
(
"bind ip and port failed:%d
\n
"
,
errno
);
(
void
)
closesocket
(
sockfd
);
(
void
)
closesocket
(
sockfd
);
return
;
return
;
}
}
while
(
1
)
{
while
(
1
)
{
ret
=
recvfrom
(
sockfd
,
msg
,
MAX_SIZE
-
1
,
0
,
(
struct
sockaddr
*
)
&
cliaddr
,
(
socklen_t
*
)
&
fromlen
);
ret
=
recvfrom
(
sockfd
,
msg
,
MAX_SIZE
-
1
,
0
,
(
struct
sockaddr
*
)
&
cliaddr
,
(
socklen_t
*
)
&
fromlen
);
if
(
ret
>=
0
)
{
if
(
ret
>=
0
)
{
n
=
strlen
(
msg
);
n
=
strlen
(
msg
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录