Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
ba23a26f
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
1 年多 前同步成功
通知
461
Star
414
Fork
55
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos A
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
ba23a26f
编写于
8月 09, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 09, 2022
浏览文件
操作
浏览文件
下载
差异文件
!928 Fix : 内核告警清理
Merge pull request !928 from yinjiaming/fix
上级
6302c5f7
2dc24da8
变更
20
展开全部
隐藏空白更改
内联
并排
Showing
20 changed file
with
971 addition
and
1175 deletion
+971
-1175
compat/posix/src/time.c
compat/posix/src/time.c
+0
-1
drivers/block/disk/include/disk_pri.h
drivers/block/disk/include/disk_pri.h
+1
-1
fs/fat/os_adapt/fatfs.c
fs/fat/os_adapt/fatfs.c
+2
-1
fs/include/fs/fs_operation.h
fs/include/fs/fs_operation.h
+4
-3
fs/jffs2/src/vfs_jffs2.c
fs/jffs2/src/vfs_jffs2.c
+1
-3
fs/proc/os_adapt/fs_cache_proc.c
fs/proc/os_adapt/fs_cache_proc.c
+3
-2
fs/proc/src/proc_shellcmd.c
fs/proc/src/proc_shellcmd.c
+2
-2
fs/vfs/epoll/fs_epoll.c
fs/vfs/epoll/fs_epoll.c
+2
-2
fs/vfs/operation/fullpath.c
fs/vfs/operation/fullpath.c
+7
-11
fs/vfs/operation/vfs_other.c
fs/vfs/operation/vfs_other.c
+13
-14
fs/vfs/operation/vfs_utime.c
fs/vfs/operation/vfs_utime.c
+0
-1
fs/vfs/vfs_cmd/vfs_shellcmd.c
fs/vfs/vfs_cmd/vfs_shellcmd.c
+855
-1049
fs/vfs/vnode.c
fs/vfs/vnode.c
+6
-6
kernel/include/los_rwlock.h
kernel/include/los_rwlock.h
+2
-2
net/lwip-2.1/enhancement/include/lwip/fixme.h
net/lwip-2.1/enhancement/include/lwip/fixme.h
+1
-1
net/lwip-2.1/enhancement/src/api_shell.c
net/lwip-2.1/enhancement/src/api_shell.c
+64
-63
net/lwip-2.1/enhancement/src/dhcps.c
net/lwip-2.1/enhancement/src/dhcps.c
+3
-3
net/lwip-2.1/enhancement/src/fixme.c
net/lwip-2.1/enhancement/src/fixme.c
+1
-1
net/lwip-2.1/porting/src/driverif.c
net/lwip-2.1/porting/src/driverif.c
+4
-4
net/lwip-2.1/porting/src/sockets.c
net/lwip-2.1/porting/src/sockets.c
+0
-5
未找到文件。
compat/posix/src/time.c
浏览文件 @
ba23a26f
...
@@ -478,7 +478,6 @@ static int PthreadGetCputime(clockid_t clockID, struct timespec *ats)
...
@@ -478,7 +478,6 @@ static int PthreadGetCputime(clockid_t clockID, struct timespec *ats)
uint64_t
runtime
;
uint64_t
runtime
;
UINT32
intSave
;
UINT32
intSave
;
UINT32
tid
=
GetTidFromClockID
(
clockID
);
UINT32
tid
=
GetTidFromClockID
(
clockID
);
if
(
OS_TID_CHECK_INVALID
(
tid
))
{
if
(
OS_TID_CHECK_INVALID
(
tid
))
{
return
-
EINVAL
;
return
-
EINVAL
;
}
}
...
...
drivers/block/disk/include/disk_pri.h
浏览文件 @
ba23a26f
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
#ifdef __cplusplus
#ifdef __cplusplus
#if __cplusplus
#if __cplusplus
extern
"C"
{
extern
"C"
{
#endif
#endif
#endif
/* __cplusplus */
#endif
/* __cplusplus */
...
...
fs/fat/os_adapt/fatfs.c
浏览文件 @
ba23a26f
...
@@ -343,7 +343,8 @@ static FRESULT init_cluster(DIR_FILE *pdfp, DIR *dp_new, FATFS *fs, int type, co
...
@@ -343,7 +343,8 @@ static FRESULT init_cluster(DIR_FILE *pdfp, DIR *dp_new, FATFS *fs, int type, co
return
FR_OK
;
return
FR_OK
;
}
}
static
int
fatfs_create_obj
(
struct
Vnode
*
parent
,
const
char
*
name
,
int
mode
,
struct
Vnode
**
vpp
,
BYTE
type
,
const
char
*
target
)
static
int
fatfs_create_obj
(
struct
Vnode
*
parent
,
const
char
*
name
,
int
mode
,
struct
Vnode
**
vpp
,
BYTE
type
,
const
char
*
target
)
{
{
struct
Vnode
*
vp
=
NULL
;
struct
Vnode
*
vp
=
NULL
;
FATFS
*
fs
=
(
FATFS
*
)
parent
->
originMount
->
data
;
FATFS
*
fs
=
(
FATFS
*
)
parent
->
originMount
->
data
;
...
...
fs/include/fs/fs_operation.h
浏览文件 @
ba23a26f
/*
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-202
1
Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-202
2
Huawei Device Co., Ltd. All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without modification,
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* are permitted provided that the following conditions are met:
...
@@ -244,8 +244,9 @@ extern int chattr(const char *pathname, struct IATTR *attr);
...
@@ -244,8 +244,9 @@ extern int chattr(const char *pathname, struct IATTR *attr);
*
*
* @retval #0 On success.
* @retval #0 On success.
* @retval #-1 On failure with errno set.
* @retval #-1 On failure with errno set.
* @retval CONTINE_NUTTX_FCNTL doesn't support some cmds in VfsFcntl, needs to continue going through Nuttx vfs operation.</li>
* @retval CONTINE_NUTTX_FCNTL doesn't support some cmds in VfsFcntl, needs to continue going through
*
* Nuttx vfs operation.</li>
*
* @par Dependency:
* @par Dependency:
* <ul><li>fs.h</li></ul>
* <ul><li>fs.h</li></ul>
* @see None
* @see None
...
...
fs/jffs2/src/vfs_jffs2.c
浏览文件 @
ba23a26f
/*
/*
* Copyright (c) 2021-202
1
Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2021-202
2
Huawei Device Co., Ltd. All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without modification,
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* are permitted provided that the following conditions are met:
...
@@ -682,7 +682,6 @@ int VfsJffs2Rmdir(struct Vnode *parentVnode, struct Vnode *targetVnode, const ch
...
@@ -682,7 +682,6 @@ int VfsJffs2Rmdir(struct Vnode *parentVnode, struct Vnode *targetVnode, const ch
LOS_MuxLock
(
&
g_jffs2FsLock
,
(
uint32_t
)
JFFS2_WAITING_FOREVER
);
LOS_MuxLock
(
&
g_jffs2FsLock
,
(
uint32_t
)
JFFS2_WAITING_FOREVER
);
ret
=
jffs2_rmdir
(
parentInode
,
targetInode
,
(
const
unsigned
char
*
)
path
);
ret
=
jffs2_rmdir
(
parentInode
,
targetInode
,
(
const
unsigned
char
*
)
path
);
if
(
ret
==
0
)
{
if
(
ret
==
0
)
{
(
void
)
jffs2_iput
(
targetInode
);
(
void
)
jffs2_iput
(
targetInode
);
}
}
...
@@ -809,7 +808,6 @@ int VfsJffs2Unlink(struct Vnode *parentVnode, struct Vnode *targetVnode, const c
...
@@ -809,7 +808,6 @@ int VfsJffs2Unlink(struct Vnode *parentVnode, struct Vnode *targetVnode, const c
LOS_MuxLock
(
&
g_jffs2FsLock
,
(
uint32_t
)
JFFS2_WAITING_FOREVER
);
LOS_MuxLock
(
&
g_jffs2FsLock
,
(
uint32_t
)
JFFS2_WAITING_FOREVER
);
ret
=
jffs2_unlink
(
parentInode
,
targetInode
,
(
const
unsigned
char
*
)
path
);
ret
=
jffs2_unlink
(
parentInode
,
targetInode
,
(
const
unsigned
char
*
)
path
);
if
(
ret
==
0
)
{
if
(
ret
==
0
)
{
(
void
)
jffs2_iput
(
targetInode
);
(
void
)
jffs2_iput
(
targetInode
);
}
}
...
...
fs/proc/os_adapt/fs_cache_proc.c
浏览文件 @
ba23a26f
/*
/*
* Copyright (c) 2021-202
1
Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2021-202
2
Huawei Device Co., Ltd. All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without modification,
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* are permitted provided that the following conditions are met:
...
@@ -154,7 +154,8 @@ static int FsCacheInfoFill(struct SeqBuf *buf, void *arg)
...
@@ -154,7 +154,8 @@ static int FsCacheInfoFill(struct SeqBuf *buf, void *arg)
VnodeHold
();
VnodeHold
();
LosBufPrintf
(
buf
,
"
\n
=================================================================
\n
"
);
LosBufPrintf
(
buf
,
"
\n
=================================================================
\n
"
);
LosBufPrintf
(
buf
,
"VnodeAddr ParentAddr DataAddr VnodeOps Hash Ref Type Gid Uid Mode
\n
"
);
LosBufPrintf
(
buf
,
"VnodeAddr ParentAddr DataAddr VnodeOps Hash Ref Type Gid Uid Mode
\n
"
);
vnodeVirtual
=
VnodeListProcess
(
buf
,
GetVnodeVirtualList
());
vnodeVirtual
=
VnodeListProcess
(
buf
,
GetVnodeVirtualList
());
vnodeFree
=
VnodeListProcess
(
buf
,
GetVnodeFreeList
());
vnodeFree
=
VnodeListProcess
(
buf
,
GetVnodeFreeList
());
vnodeActive
=
VnodeListProcess
(
buf
,
GetVnodeActiveList
());
vnodeActive
=
VnodeListProcess
(
buf
,
GetVnodeActiveList
());
...
...
fs/proc/src/proc_shellcmd.c
浏览文件 @
ba23a26f
...
@@ -62,8 +62,8 @@ int OsShellCmdWriteProc(int argc, char **argv)
...
@@ -62,8 +62,8 @@ int OsShellCmdWriteProc(int argc, char **argv)
if
(
argc
==
WRITEPROC_ARGC
)
{
if
(
argc
==
WRITEPROC_ARGC
)
{
value
=
argv
[
0
];
value
=
argv
[
0
];
path
=
argv
[
2
];
path
=
argv
[
2
];
// 2: index of path
len
=
strlen
(
value
)
+
1
;
/* +1:add the \0 */
len
=
strlen
(
value
)
+
1
;
/* +
1:add the \0 */
if
(
strncmp
(
argv
[
1
],
">>"
,
strlen
(
">>"
))
==
0
)
{
if
(
strncmp
(
argv
[
1
],
">>"
,
strlen
(
">>"
))
==
0
)
{
if
((
realpath
(
path
,
realPath
)
==
NULL
)
||
(
strncmp
(
realPath
,
rootProcDir
,
strlen
(
rootProcDir
))
!=
0
))
{
if
((
realpath
(
path
,
realPath
)
==
NULL
)
||
(
strncmp
(
realPath
,
rootProcDir
,
strlen
(
rootProcDir
))
!=
0
))
{
PRINT_ERR
(
"No such file or directory
\n
"
);
PRINT_ERR
(
"No such file or directory
\n
"
);
...
...
fs/vfs/epoll/fs_epoll.c
浏览文件 @
ba23a26f
/*
/*
* Copyright (c) 2021-202
1
Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2021-202
2
Huawei Device Co., Ltd. All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without modification,
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* are permitted provided that the following conditions are met:
...
@@ -304,7 +304,7 @@ int epoll_wait(int epfd, FAR struct epoll_event *evs, int maxevents, int timeout
...
@@ -304,7 +304,7 @@ int epoll_wait(int epfd, FAR struct epoll_event *evs, int maxevents, int timeout
int
pollSize
;
int
pollSize
;
epHead
=
EpollGetDataBuff
(
epfd
);
epHead
=
EpollGetDataBuff
(
epfd
);
if
(
epHead
==
NULL
)
{
if
(
epHead
==
NULL
)
{
set_errno
(
EBADF
);
set_errno
(
EBADF
);
return
-
1
;
return
-
1
;
}
}
...
...
fs/vfs/operation/fullpath.c
浏览文件 @
ba23a26f
...
@@ -225,7 +225,6 @@ static char *vfs_normalize_fullpath(const char *directory, const char *filename,
...
@@ -225,7 +225,6 @@ static char *vfs_normalize_fullpath(const char *directory, const char *filename,
/* it's a absolute path, use it directly */
/* it's a absolute path, use it directly */
fullpath
=
strdup
(
filename
);
/* copy string */
fullpath
=
strdup
(
filename
);
/* copy string */
if
(
fullpath
==
NULL
)
{
if
(
fullpath
==
NULL
)
{
*
pathname
=
NULL
;
*
pathname
=
NULL
;
set_errno
(
ENOMEM
);
set_errno
(
ENOMEM
);
...
@@ -258,11 +257,10 @@ int vfs_normalize_path(const char *directory, const char *filename, char **pathn
...
@@ -258,11 +257,10 @@ int vfs_normalize_path(const char *directory, const char *filename, char **pathn
}
}
#ifdef VFS_USING_WORKDIR
#ifdef VFS_USING_WORKDIR
if
(
directory
==
NULL
)
if
(
directory
==
NULL
)
{
{
spin_lock_irqsave
(
&
curr
->
files
->
workdir_lock
,
lock_flags
);
spin_lock_irqsave
(
&
curr
->
files
->
workdir_lock
,
lock_flags
);
directory
=
curr
->
files
->
workdir
;
directory
=
curr
->
files
->
workdir
;
}
}
#else
#else
if
((
directory
==
NULL
)
&&
(
filename
[
0
]
!=
'/'
))
{
if
((
directory
==
NULL
)
&&
(
filename
[
0
]
!=
'/'
))
{
PRINT_ERR
(
"NO_WORKING_DIR
\n
"
);
PRINT_ERR
(
"NO_WORKING_DIR
\n
"
);
...
@@ -275,20 +273,18 @@ int vfs_normalize_path(const char *directory, const char *filename, char **pathn
...
@@ -275,20 +273,18 @@ int vfs_normalize_path(const char *directory, const char *filename, char **pathn
if
((
filename
[
0
]
!=
'/'
)
&&
(
strlen
(
directory
)
+
namelen
+
2
>
TEMP_PATH_MAX
))
{
if
((
filename
[
0
]
!=
'/'
)
&&
(
strlen
(
directory
)
+
namelen
+
2
>
TEMP_PATH_MAX
))
{
#ifdef VFS_USING_WORKDIR
#ifdef VFS_USING_WORKDIR
if
(
dir_flags
==
TRUE
)
if
(
dir_flags
==
TRUE
)
{
{
spin_unlock_irqrestore
(
&
curr
->
files
->
workdir_lock
,
lock_flags
);
spin_unlock_irqrestore
(
&
curr
->
files
->
workdir_lock
,
lock_flags
);
}
}
#endif
#endif
return
-
ENAMETOOLONG
;
return
-
ENAMETOOLONG
;
}
}
fullpath
=
vfs_normalize_fullpath
(
directory
,
filename
,
pathname
,
namelen
);
fullpath
=
vfs_normalize_fullpath
(
directory
,
filename
,
pathname
,
namelen
);
#ifdef VFS_USING_WORKDIR
#ifdef VFS_USING_WORKDIR
if
(
dir_flags
==
TRUE
)
if
(
dir_flags
==
TRUE
)
{
{
spin_unlock_irqrestore
(
&
curr
->
files
->
workdir_lock
,
lock_flags
);
spin_unlock_irqrestore
(
&
curr
->
files
->
workdir_lock
,
lock_flags
);
}
}
#endif
#endif
if
(
fullpath
==
NULL
)
{
if
(
fullpath
==
NULL
)
{
return
-
get_errno
();
return
-
get_errno
();
...
@@ -308,7 +304,7 @@ int vfs_normalize_path(const char *directory, const char *filename, char **pathn
...
@@ -308,7 +304,7 @@ int vfs_normalize_path(const char *directory, const char *filename, char **pathn
int
vfs_normalize_pathat
(
int
dirfd
,
const
char
*
filename
,
char
**
pathname
)
int
vfs_normalize_pathat
(
int
dirfd
,
const
char
*
filename
,
char
**
pathname
)
{
{
/* Get path by dirfd*/
/* Get path by dirfd
*/
char
*
relativeoldpath
=
NULL
;
char
*
relativeoldpath
=
NULL
;
char
*
fullpath
=
NULL
;
char
*
fullpath
=
NULL
;
int
ret
=
0
;
int
ret
=
0
;
...
...
fs/vfs/operation/vfs_other.c
浏览文件 @
ba23a26f
...
@@ -132,19 +132,19 @@ int VfsPermissionCheck(uint fuid, uint fgid, uint fileMode, int accMode)
...
@@ -132,19 +132,19 @@ int VfsPermissionCheck(uint fuid, uint fgid, uint fileMode, int accMode)
#ifdef VFS_USING_WORKDIR
#ifdef VFS_USING_WORKDIR
static
int
SetWorkDir
(
const
char
*
dir
,
size_t
len
)
static
int
SetWorkDir
(
const
char
*
dir
,
size_t
len
)
{
{
errno_t
ret
;
errno_t
ret
;
uint
lock_flags
;
uint
lock_flags
;
LosProcessCB
*
curr
=
OsCurrProcessGet
();
LosProcessCB
*
curr
=
OsCurrProcessGet
();
spin_lock_irqsave
(
&
curr
->
files
->
workdir_lock
,
lock_flags
);
spin_lock_irqsave
(
&
curr
->
files
->
workdir_lock
,
lock_flags
);
ret
=
strncpy_s
(
curr
->
files
->
workdir
,
PATH_MAX
,
dir
,
len
);
ret
=
strncpy_s
(
curr
->
files
->
workdir
,
PATH_MAX
,
dir
,
len
);
curr
->
files
->
workdir
[
PATH_MAX
-
1
]
=
'\0'
;
curr
->
files
->
workdir
[
PATH_MAX
-
1
]
=
'\0'
;
spin_unlock_irqrestore
(
&
curr
->
files
->
workdir_lock
,
lock_flags
);
spin_unlock_irqrestore
(
&
curr
->
files
->
workdir_lock
,
lock_flags
);
if
(
ret
!=
EOK
)
{
if
(
ret
!=
EOK
)
{
return
-
1
;
return
-
1
;
}
}
return
0
;
return
0
;
}
}
#endif
#endif
...
@@ -155,7 +155,6 @@ int chdir(const char *path)
...
@@ -155,7 +155,6 @@ int chdir(const char *path)
char
*
fullpath_bak
=
NULL
;
char
*
fullpath_bak
=
NULL
;
struct
stat
statBuff
;
struct
stat
statBuff
;
if
(
!
path
)
{
if
(
!
path
)
{
set_errno
(
EFAULT
);
set_errno
(
EFAULT
);
return
-
1
;
return
-
1
;
...
...
fs/vfs/operation/vfs_utime.c
浏览文件 @
ba23a26f
...
@@ -57,7 +57,6 @@ int utime(const char *path, const struct utimbuf *ptimes)
...
@@ -57,7 +57,6 @@ int utime(const char *path, const struct utimbuf *ptimes)
/* Sanity checks */
/* Sanity checks */
if
(
path
==
NULL
)
{
if
(
path
==
NULL
)
{
ret
=
-
EINVAL
;
ret
=
-
EINVAL
;
goto
errout
;
goto
errout
;
...
...
fs/vfs/vfs_cmd/vfs_shellcmd.c
浏览文件 @
ba23a26f
此差异已折叠。
点击以展开。
fs/vfs/vnode.c
浏览文件 @
ba23a26f
/*
/*
* Copyright (c) 2021-202
1
Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2021-202
2
Huawei Device Co., Ltd. All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without modification,
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* are permitted provided that the following conditions are met:
...
@@ -239,7 +239,7 @@ BOOL VnodeInUseIter(const struct Mount *mount)
...
@@ -239,7 +239,7 @@ BOOL VnodeInUseIter(const struct Mount *mount)
return
FALSE
;
return
FALSE
;
}
}
int
VnodeHold
()
int
VnodeHold
(
void
)
{
{
int
ret
=
LOS_MuxLock
(
&
g_vnodeMux
,
LOS_WAIT_FOREVER
);
int
ret
=
LOS_MuxLock
(
&
g_vnodeMux
,
LOS_WAIT_FOREVER
);
if
(
ret
!=
LOS_OK
)
{
if
(
ret
!=
LOS_OK
)
{
...
@@ -248,7 +248,7 @@ int VnodeHold()
...
@@ -248,7 +248,7 @@ int VnodeHold()
return
ret
;
return
ret
;
}
}
int
VnodeDrop
()
int
VnodeDrop
(
void
)
{
{
int
ret
=
LOS_MuxUnlock
(
&
g_vnodeMux
);
int
ret
=
LOS_MuxUnlock
(
&
g_vnodeMux
);
if
(
ret
!=
LOS_OK
)
{
if
(
ret
!=
LOS_OK
)
{
...
@@ -583,7 +583,7 @@ int VnodeCreate(struct Vnode *parent, const char *name, int mode, struct Vnode *
...
@@ -583,7 +583,7 @@ int VnodeCreate(struct Vnode *parent, const char *name, int mode, struct Vnode *
return
0
;
return
0
;
}
}
int
VnodeDevInit
()
int
VnodeDevInit
(
void
)
{
{
struct
Vnode
*
devNode
=
NULL
;
struct
Vnode
*
devNode
=
NULL
;
struct
Mount
*
devMount
=
NULL
;
struct
Mount
*
devMount
=
NULL
;
...
@@ -616,7 +616,7 @@ int VnodeGetattr(struct Vnode *vnode, struct stat *buf)
...
@@ -616,7 +616,7 @@ int VnodeGetattr(struct Vnode *vnode, struct stat *buf)
return
LOS_OK
;
return
LOS_OK
;
}
}
struct
Vnode
*
VnodeGetRoot
()
struct
Vnode
*
VnodeGetRoot
(
void
)
{
{
return
g_rootVnode
;
return
g_rootVnode
;
}
}
...
@@ -697,7 +697,7 @@ LIST_HEAD* GetVnodeActiveList()
...
@@ -697,7 +697,7 @@ LIST_HEAD* GetVnodeActiveList()
return
&
g_vnodeActiveList
;
return
&
g_vnodeActiveList
;
}
}
int
VnodeClearCache
()
int
VnodeClearCache
(
void
)
{
{
struct
Vnode
*
item
=
NULL
;
struct
Vnode
*
item
=
NULL
;
struct
Vnode
*
nextItem
=
NULL
;
struct
Vnode
*
nextItem
=
NULL
;
...
...
kernel/include/los_rwlock.h
浏览文件 @
ba23a26f
...
@@ -50,8 +50,8 @@ extern "C" {
...
@@ -50,8 +50,8 @@ extern "C" {
* Rwlock object.
* Rwlock object.
*/
*/
typedef
struct
OsRwlock
{
typedef
struct
OsRwlock
{
INT32
magic
:
24
;
/**< Magic number */
INT32
magic
:
24
;
/**< Magic number */
INT32
rwCount
:
8
;
/**< Times of locking the rwlock, rwCount > 0 when rwkick is read mode, rwCount < 0
INT32
rwCount
:
8
;
/**< Times of locking the rwlock, rwCount > 0 when rwkick is read mode, rwCount < 0
when the rwlock is write mode, rwCount = 0 when the lock is free. */
when the rwlock is write mode, rwCount = 0 when the lock is free. */
VOID
*
writeOwner
;
/**< The current write thread that is locking the rwlock */
VOID
*
writeOwner
;
/**< The current write thread that is locking the rwlock */
LOS_DL_LIST
readList
;
/**< Read waiting list */
LOS_DL_LIST
readList
;
/**< Read waiting list */
...
...
net/lwip-2.1/enhancement/include/lwip/fixme.h
浏览文件 @
ba23a26f
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
#define ip_addr_set_val(dest, src) do { \
#define ip_addr_set_val(dest, src) do { \
IP_SET_TYPE_VAL(*dest, IP_GET_TYPE(src)); \
IP_SET_TYPE_VAL(*dest, IP_GET_TYPE(src)); \
if(IP_IS_V6_VAL(*(src))) { \
if
(IP_IS_V6_VAL(*(src))) { \
ip6_addr_set(ip_2_ip6(dest), ip_2_ip6(src)); \
ip6_addr_set(ip_2_ip6(dest), ip_2_ip6(src)); \
} else { \
} else { \
ip4_addr_set(ip_2_ip4(dest), ip_2_ip4(src)); \
ip4_addr_set(ip_2_ip4(dest), ip_2_ip4(src)); \
...
...
net/lwip-2.1/enhancement/src/api_shell.c
浏览文件 @
ba23a26f
...
@@ -365,19 +365,19 @@ int print_netif(struct netif *netif, char *print_buf, unsigned int buf_len)
...
@@ -365,19 +365,19 @@ int print_netif(struct netif *netif, char *print_buf, unsigned int buf_len)
ret
=
snprintf_s
(
tmp
,
buf_len
,
(
buf_len
-
1
),
"
\t
RX packets:%u "
,
ret
=
snprintf_s
(
tmp
,
buf_len
,
(
buf_len
-
1
),
"
\t
RX packets:%u "
,
netif
->
mib2_counters
.
ifinucastpkts
+
netif
->
mib2_counters
.
ifinnucastpkts
);
netif
->
mib2_counters
.
ifinucastpkts
+
netif
->
mib2_counters
.
ifinnucastpkts
);
if
((
ret
<=
0
)
||
((
unsigned
int
)
ret
>=
buf_len
))
if
((
ret
<=
0
)
||
((
unsigned
int
)
ret
>=
buf_len
))
goto
out
;
goto
out
;
tmp
+=
ret
;
tmp
+=
ret
;
buf_len
-=
(
unsigned
int
)
ret
;
buf_len
-=
(
unsigned
int
)
ret
;
ret
=
snprintf_s
(
tmp
,
buf_len
,
(
buf_len
-
1
),
"errors:%u "
,
netif
->
mib2_counters
.
ifinerrors
);
ret
=
snprintf_s
(
tmp
,
buf_len
,
(
buf_len
-
1
),
"errors:%u "
,
netif
->
mib2_counters
.
ifinerrors
);
if
((
ret
<=
0
)
||
((
unsigned
int
)
ret
>=
buf_len
))
if
((
ret
<=
0
)
||
((
unsigned
int
)
ret
>=
buf_len
))
goto
out
;
goto
out
;
tmp
+=
ret
;
tmp
+=
ret
;
buf_len
-=
(
unsigned
int
)
ret
;
buf_len
-=
(
unsigned
int
)
ret
;
ret
=
snprintf_s
(
tmp
,
buf_len
,
(
buf_len
-
1
),
"dropped:%u "
,
netif
->
mib2_counters
.
ifindiscards
);
ret
=
snprintf_s
(
tmp
,
buf_len
,
(
buf_len
-
1
),
"dropped:%u "
,
netif
->
mib2_counters
.
ifindiscards
);
if
((
ret
<=
0
)
||
((
unsigned
int
)
ret
>=
buf_len
))
if
((
ret
<=
0
)
||
((
unsigned
int
)
ret
>=
buf_len
))
goto
out
;
goto
out
;
tmp
+=
ret
;
tmp
+=
ret
;
buf_len
-=
(
unsigned
int
)
ret
;
buf_len
-=
(
unsigned
int
)
ret
;
...
@@ -1031,12 +1031,12 @@ u32_t lwip_ifconfig(int argc, const char **argv)
...
@@ -1031,12 +1031,12 @@ u32_t lwip_ifconfig(int argc, const char **argv)
#if LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL
#if LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL
if
((
ifconfig_cmd
.
option
&
IFCONFIG_OPTION_SET_IP
)
&&
IP_IS_V4_VAL
((
ifconfig_cmd
.
ip_addr
)))
{
if
((
ifconfig_cmd
.
option
&
IFCONFIG_OPTION_SET_IP
)
&&
IP_IS_V4_VAL
((
ifconfig_cmd
.
ip_addr
)))
{
/* Create the semaphore for ip conflict detection. */
/* Create the semaphore for ip conflict detection. */
if
(
sys_sem_new
(
&
ip_conflict_detect
,
0
)
!=
ERR_OK
)
{
if
(
sys_sem_new
(
&
ip_conflict_detect
,
0
)
!=
ERR_OK
)
{
sys_sem_free
(
&
ifconfig_cmd
.
cb_completed
);
sys_sem_free
(
&
ifconfig_cmd
.
cb_completed
);
PRINTK
(
"ifconfig: internal error
\n
"
);
PRINTK
(
"ifconfig: internal error
\n
"
);
return
1
;
return
1
;
}
}
is_ip_conflict_signal
=
1
;
is_ip_conflict_signal
=
1
;
}
}
#endif
/* LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL */
#endif
/* LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL */
...
@@ -1057,8 +1057,8 @@ u32_t lwip_ifconfig(int argc, const char **argv)
...
@@ -1057,8 +1057,8 @@ u32_t lwip_ifconfig(int argc, const char **argv)
sys_sem_free
(
&
ifconfig_cmd
.
cb_completed
);
sys_sem_free
(
&
ifconfig_cmd
.
cb_completed
);
#if LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL
#if LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL
if
((
ifconfig_cmd
.
option
&
IFCONFIG_OPTION_SET_IP
)
&&
IP_IS_V4_VAL
((
ifconfig_cmd
.
ip_addr
)))
{
if
((
ifconfig_cmd
.
option
&
IFCONFIG_OPTION_SET_IP
)
&&
IP_IS_V4_VAL
((
ifconfig_cmd
.
ip_addr
)))
{
is_ip_conflict_signal
=
0
;
is_ip_conflict_signal
=
0
;
sys_sem_free
(
&
ip_conflict_detect
);
sys_sem_free
(
&
ip_conflict_detect
);
}
}
#endif
/* LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL */
#endif
/* LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL */
...
@@ -1076,37 +1076,37 @@ u32_t lwip_ifconfig(int argc, const char **argv)
...
@@ -1076,37 +1076,37 @@ u32_t lwip_ifconfig(int argc, const char **argv)
ifconfig_cmd
.
cb_print_buf
[
PRINT_BUF_LEN
-
1
]
=
'\0'
;
ifconfig_cmd
.
cb_print_buf
[
PRINT_BUF_LEN
-
1
]
=
'\0'
;
PRINTK
(
"%s"
,
ifconfig_cmd
.
cb_print_buf
);
PRINTK
(
"%s"
,
ifconfig_cmd
.
cb_print_buf
);
#if LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL
#if LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL
/* Pend 2 seconds for waiting the arp reply if the ip is already in use.*/
/* Pend 2 seconds for waiting the arp reply if the ip is already in use.
*/
if
((
ifconfig_cmd
.
option
&
IFCONFIG_OPTION_SET_IP
)
&&
IP_IS_V4_VAL
((
ifconfig_cmd
.
ip_addr
)))
{
if
((
ifconfig_cmd
.
option
&
IFCONFIG_OPTION_SET_IP
)
&&
IP_IS_V4_VAL
((
ifconfig_cmd
.
ip_addr
)))
{
err
=
(
err_t
)
sys_arch_sem_wait
(
&
ip_conflict_detect
,
DUP_ARP_DETECT_TIME
);
err
=
(
err_t
)
sys_arch_sem_wait
(
&
ip_conflict_detect
,
DUP_ARP_DETECT_TIME
);
is_ip_conflict_signal
=
0
;
is_ip_conflict_signal
=
0
;
sys_sem_free
(
&
ip_conflict_detect
);
sys_sem_free
(
&
ip_conflict_detect
);
if
(
err
<
0
)
{
if
(
err
<
0
)
{
/* The result neither conflict nor timeout. */
/* The result neither conflict nor timeout. */
PRINT_ERR
(
"ifconfig: internal error
\n
"
);
PRINT_ERR
(
"ifconfig: internal error
\n
"
);
sys_sem_free
(
&
ifconfig_cmd
.
cb_completed
);
sys_sem_free
(
&
ifconfig_cmd
.
cb_completed
);
return
1
;
return
1
;
}
else
if
(
err
<
DUP_ARP_DETECT_TIME
)
{
}
else
if
(
err
<
DUP_ARP_DETECT_TIME
)
{
/* Duplicate use of new ip, restore it to the old one. */
/* Duplicate use of new ip, restore it to the old one. */
PRINT_ERR
(
"ifconfig: ip conflict!
\n
"
);
PRINT_ERR
(
"ifconfig: ip conflict!
\n
"
);
ip_addr_set_ip4_u32_val
(
ifconfig_cmd
.
ip_addr
,
old_ip4addr
);
ip_addr_set_ip4_u32_val
(
ifconfig_cmd
.
ip_addr
,
old_ip4addr
);
ret
=
tcpip_callback
(
lwip_ifconfig_internal
,
&
ifconfig_cmd
);
ret
=
tcpip_callback
(
lwip_ifconfig_internal
,
&
ifconfig_cmd
);
if
(
ret
!=
ERR_OK
)
{
if
(
ret
!=
ERR_OK
)
{
sys_sem_free
(
&
ifconfig_cmd
.
cb_completed
);
sys_sem_free
(
&
ifconfig_cmd
.
cb_completed
);
PRINTK
(
"%s : tcpip_callback failed in line %d : errnu %d"
,
__FUNCTION__
,
__LINE__
,
ret
);
PRINTK
(
"%s : tcpip_callback failed in line %d : errnu %d"
,
__FUNCTION__
,
__LINE__
,
ret
);
return
1
;
return
1
;
}
(
void
)
sys_arch_sem_wait
(
&
ifconfig_cmd
.
cb_completed
,
0
);
sys_sem_free
(
&
ifconfig_cmd
.
cb_completed
);
ifconfig_cmd
.
cb_print_buf
[
PRINT_BUF_LEN
-
1
]
=
'\0'
;
PRINTK
(
"%s"
,
ifconfig_cmd
.
cb_print_buf
);
return
1
;
}
}
(
void
)
sys_arch_sem_wait
(
&
ifconfig_cmd
.
cb_completed
,
0
);
sys_sem_free
(
&
ifconfig_cmd
.
cb_completed
);
ifconfig_cmd
.
cb_print_buf
[
PRINT_BUF_LEN
-
1
]
=
'\0'
;
PRINTK
(
"%s"
,
ifconfig_cmd
.
cb_print_buf
);
return
1
;
}
}
}
#endif
/* LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL */
#endif
/* LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL */
#if LWIP_IPV6
#if LWIP_IPV6
if
((
ifconfig_cmd
.
option
&
IFCONFIG_OPTION_SET_IP
)
&&
IP_IS_V6_VAL
(
ifconfig_cmd
.
ip_addr
))
{
if
((
ifconfig_cmd
.
option
&
IFCONFIG_OPTION_SET_IP
)
&&
IP_IS_V6_VAL
(
ifconfig_cmd
.
ip_addr
))
{
/* Pend 2 seconds for waiting the arp reply if the ip is already in use.*/
/* Pend 2 seconds for waiting the arp reply if the ip is already in use.
*/
retval
=
sys_arch_sem_wait
(
&
dup_addr_detect
,
DUP_ARP_DETECT_TIME
);
retval
=
sys_arch_sem_wait
(
&
dup_addr_detect
,
DUP_ARP_DETECT_TIME
);
is_dup_detect_initialized
=
0
;
is_dup_detect_initialized
=
0
;
sys_sem_free
(
&
dup_addr_detect
);
sys_sem_free
(
&
dup_addr_detect
);
...
@@ -1191,7 +1191,6 @@ void lwip_arp_show_internal(struct netif *netif, char *printf_buf, unsigned int
...
@@ -1191,7 +1191,6 @@ void lwip_arp_show_internal(struct netif *netif, char *printf_buf, unsigned int
||
(
state
==
ETHARP_STATE_STATIC
)
||
(
state
==
ETHARP_STATE_STATIC
)
#endif
/* ETHARP_SUPPORT_STATIC_ENTRIES */
#endif
/* ETHARP_SUPPORT_STATIC_ENTRIES */
)
&&
arp_table
[
i
].
netif
)
{
)
&&
arp_table
[
i
].
netif
)
{
if
(
strcmp
(
netif_get_name
(
netif
),
netif_get_name
(
arp_table
[
i
].
netif
))
!=
0
)
{
if
(
strcmp
(
netif_get_name
(
netif
),
netif_get_name
(
arp_table
[
i
].
netif
))
!=
0
)
{
continue
;
continue
;
}
}
...
@@ -1305,7 +1304,7 @@ void lwip_arp_internal(void *arg)
...
@@ -1305,7 +1304,7 @@ void lwip_arp_internal(void *arg)
for
(
netif
=
netif_list
;
netif
!=
NULL
;
netif
=
netif
->
next
)
{
for
(
netif
=
netif_list
;
netif
!=
NULL
;
netif
=
netif
->
next
)
{
ret
=
etharp_delete_arp_entry
(
netif
,
&
ipaddr
);
ret
=
etharp_delete_arp_entry
(
netif
,
&
ipaddr
);
if
(
ret
==
ERR_OK
)
{
if
(
ret
==
ERR_OK
)
{
/*
only can del success one time
*/
/*
only can del success one time
*/
break
;
break
;
}
}
}
}
...
@@ -1387,7 +1386,7 @@ u32_t lwip_arp(int argc, const char **argv)
...
@@ -1387,7 +1386,7 @@ u32_t lwip_arp(int argc, const char **argv)
goto
arp_error
;
goto
arp_error
;
}
}
i
+=
2
;
i
+=
2
;
argc
-=
2
;
argc
-=
2
;
// 2: number of used parameters
}
else
if
(
strcmp
(
"-d"
,
argv
[
i
])
==
0
&&
(
argc
>
1
))
{
}
else
if
(
strcmp
(
"-d"
,
argv
[
i
])
==
0
&&
(
argc
>
1
))
{
/* arp delete */
/* arp delete */
arp_cmd
.
option
=
ARP_OPTION_DEL
;
arp_cmd
.
option
=
ARP_OPTION_DEL
;
...
@@ -1399,8 +1398,8 @@ u32_t lwip_arp(int argc, const char **argv)
...
@@ -1399,8 +1398,8 @@ u32_t lwip_arp(int argc, const char **argv)
}
}
i
+=
2
;
i
+=
2
;
argc
-=
2
;
argc
-=
2
;
// 2: number of used parameters
}
else
if
(
strcmp
(
"-s"
,
argv
[
i
])
==
0
&&
(
argc
>
2
))
{
}
else
if
(
strcmp
(
"-s"
,
argv
[
i
])
==
0
&&
(
argc
>
2
))
{
// 2: require more than 2 parameters
/* arp add */
/* arp add */
char
*
digit
=
NULL
;
char
*
digit
=
NULL
;
u32_t
macaddrlen
=
strlen
(
argv
[
i
+
2
])
+
1
;
u32_t
macaddrlen
=
strlen
(
argv
[
i
+
2
])
+
1
;
...
@@ -1418,7 +1417,7 @@ u32_t lwip_arp(int argc, const char **argv)
...
@@ -1418,7 +1417,7 @@ u32_t lwip_arp(int argc, const char **argv)
goto
arp_error
;
goto
arp_error
;
}
}
/*cannot add an arp entry of 127.*.*.* */
/*
cannot add an arp entry of 127.*.*.* */
if
((
arp_cmd
.
ipaddr
&
(
u32_t
)
0x0000007fUL
)
==
(
u32_t
)
0x0000007fUL
)
{
if
((
arp_cmd
.
ipaddr
&
(
u32_t
)
0x0000007fUL
)
==
(
u32_t
)
0x0000007fUL
)
{
PRINTK
(
"IP address is not correct!
\n
"
);
PRINTK
(
"IP address is not correct!
\n
"
);
goto
arp_error
;
goto
arp_error
;
...
@@ -1452,7 +1451,7 @@ u32_t lwip_arp(int argc, const char **argv)
...
@@ -1452,7 +1451,7 @@ u32_t lwip_arp(int argc, const char **argv)
}
}
i
+=
3
;
i
+=
3
;
argc
-=
3
;
argc
-=
3
;
// 3: number of used parameters
}
else
{
}
else
{
goto
arp_error
;
goto
arp_error
;
}
}
...
@@ -1727,7 +1726,7 @@ LWIP_STATIC int osPingFunc(u32_t destip, u32_t cnt, u32_t interval, u32_t data_l
...
@@ -1727,7 +1726,7 @@ LWIP_STATIC int osPingFunc(u32_t destip, u32_t cnt, u32_t interval, u32_t data_l
break
;
break
;
}
}
intrvl
-=
1000
;
intrvl
-=
1000
;
sys_msleep
(
1000
);
sys_msleep
(
1000
);
// 1000: delay 1 s
if
(
ping_kill
==
1
)
if
(
ping_kill
==
1
)
break
;
break
;
}
while
(
intrvl
>
0
);
}
while
(
intrvl
>
0
);
...
@@ -1819,7 +1818,7 @@ u32_t osShellPing(int argc, const char **argv)
...
@@ -1819,7 +1818,7 @@ u32_t osShellPing(int argc, const char **argv)
count
=
ret
;
count
=
ret
;
count_set
=
1
;
count_set
=
1
;
i
+=
2
;
i
+=
2
;
argc
-=
2
;
argc
-=
2
;
// 2: nuber of arguments that has been checked
}
else
if
(
strcmp
(
"-t"
,
argv
[
i
])
==
0
)
{
}
else
if
(
strcmp
(
"-t"
,
argv
[
i
])
==
0
)
{
count
=
0
;
/* ping forerver */
count
=
0
;
/* ping forerver */
count_set
=
1
;
count_set
=
1
;
...
@@ -1834,7 +1833,7 @@ u32_t osShellPing(int argc, const char **argv)
...
@@ -1834,7 +1833,7 @@ u32_t osShellPing(int argc, const char **argv)
interval
=
ret
;
interval
=
ret
;
i
+=
2
;
i
+=
2
;
argc
-=
2
;
argc
-=
2
;
// 2:number of arguments that has been checked
}
else
if
(
strcmp
(
"-l"
,
argv
[
i
])
==
0
&&
(
argc
>
1
))
{
}
else
if
(
strcmp
(
"-l"
,
argv
[
i
])
==
0
&&
(
argc
>
1
))
{
ret
=
atoi
(
argv
[
i
+
1
]);
ret
=
atoi
(
argv
[
i
+
1
]);
if
(
ret
<
0
||
ret
>
(
int
)(
LWIP_MAX_UDP_RAW_SEND_SIZE
-
sizeof
(
struct
icmp_echo_hdr
)))
{
if
(
ret
<
0
||
ret
>
(
int
)(
LWIP_MAX_UDP_RAW_SEND_SIZE
-
sizeof
(
struct
icmp_echo_hdr
)))
{
...
@@ -1844,7 +1843,7 @@ u32_t osShellPing(int argc, const char **argv)
...
@@ -1844,7 +1843,7 @@ u32_t osShellPing(int argc, const char **argv)
}
}
data_len
=
ret
;
data_len
=
ret
;
i
+=
2
;
i
+=
2
;
argc
-=
2
;
argc
-=
2
;
// 2: number of elements has been checked
}
else
if
(
strcmp
(
"-k"
,
argv
[
i
])
==
0
)
{
}
else
if
(
strcmp
(
"-k"
,
argv
[
i
])
==
0
)
{
if
(
ping_taskid
>
0
)
{
if
(
ping_taskid
>
0
)
{
ping_kill
=
1
;
/* stop the current ping task */
ping_kill
=
1
;
/* stop the current ping task */
...
@@ -1896,7 +1895,7 @@ u32_t osShellPing(int argc, const char **argv)
...
@@ -1896,7 +1895,7 @@ u32_t osShellPing(int argc, const char **argv)
stPingTask
.
auwArgs
[
0
]
=
dst_ipaddr
.
addr
;
/* network order */
stPingTask
.
auwArgs
[
0
]
=
dst_ipaddr
.
addr
;
/* network order */
stPingTask
.
auwArgs
[
1
]
=
count
;
stPingTask
.
auwArgs
[
1
]
=
count
;
stPingTask
.
auwArgs
[
2
]
=
interval
;
stPingTask
.
auwArgs
[
2
]
=
interval
;
stPingTask
.
auwArgs
[
3
]
=
data_len
;
stPingTask
.
auwArgs
[
3
]
=
data_len
;
// 3: index of data length
ret
=
LOS_TaskCreate
((
UINT32
*
)(
&
ping_taskid
),
&
stPingTask
);
ret
=
LOS_TaskCreate
((
UINT32
*
)(
&
ping_taskid
),
&
stPingTask
);
if
(
ret
!=
LOS_OK
)
{
if
(
ret
!=
LOS_OK
)
{
PRINTK
(
"ping_task create failed 0x%08x.
\n
"
,
ret
);
PRINTK
(
"ping_task create failed 0x%08x.
\n
"
,
ret
);
...
@@ -1923,7 +1922,7 @@ ping_error:
...
@@ -1923,7 +1922,7 @@ ping_error:
SHELLCMD_ENTRY
(
ping_shellcmd
,
CMD_TYPE_EX
,
"ping"
,
XARGS
,
(
CmdCallBackFunc
)
osShellPing
);
SHELLCMD_ENTRY
(
ping_shellcmd
,
CMD_TYPE_EX
,
"ping"
,
XARGS
,
(
CmdCallBackFunc
)
osShellPing
);
#endif
/* LOSCFG_SHELL */
#endif
/* LOSCFG_SHELL */
#else
/* LWIP_EXT_POLL_SUPPORT*/
#else
/* LWIP_EXT_POLL_SUPPORT
*/
u32_t
osShellPing
(
int
argc
,
const
char
**
argv
)
u32_t
osShellPing
(
int
argc
,
const
char
**
argv
)
{
{
...
@@ -2076,7 +2075,7 @@ FAILURE:
...
@@ -2076,7 +2075,7 @@ FAILURE:
SHELLCMD_ENTRY
(
ping_shellcmd
,
CMD_TYPE_EX
,
"ping"
,
XARGS
,
(
CmdCallBackFunc
)
osShellPing
);
SHELLCMD_ENTRY
(
ping_shellcmd
,
CMD_TYPE_EX
,
"ping"
,
XARGS
,
(
CmdCallBackFunc
)
osShellPing
);
#endif
/* LOSCFG_SHELL */
#endif
/* LOSCFG_SHELL */
#endif
/* LWIP_EXT_POLL_SUPPORT*/
#endif
/* LWIP_EXT_POLL_SUPPORT
*/
#if LWIP_IPV6
#if LWIP_IPV6
u32_t
osShellPing6
(
int
argc
,
const
char
**
argv
)
u32_t
osShellPing6
(
int
argc
,
const
char
**
argv
)
...
@@ -2311,6 +2310,7 @@ REDUCE_SELECT_TIME:
...
@@ -2311,6 +2310,7 @@ REDUCE_SELECT_TIME:
PRINTK
(
"--- %s ping statistics ---
\n
"
,
argv
[
ping6_params
.
host_index
]);
PRINTK
(
"--- %s ping statistics ---
\n
"
,
argv
[
ping6_params
.
host_index
]);
PRINTK
(
"%d packets transmitted, %d received, %.2f%% packet loss, time %dms
\n
"
,
PRINTK
(
"%d packets transmitted, %d received, %.2f%% packet loss, time %dms
\n
"
,
nsent
,
nrecieve
,
(
float
)(((
float
)(
nsent
-
nrecieve
))
*
((
float
)(
100
))
/
((
float
)(
nsent
))),
nsent
,
nrecieve
,
(
float
)(((
float
)(
nsent
-
nrecieve
))
*
((
float
)(
100
))
/
((
float
)(
nsent
))),
/* 1000: convert seconds to milliseconds, 1000000: convert nanoseconds to milliseconds */
((
last
.
tv_sec
-
first
.
tv_sec
)
*
1000
+
(
last
.
tv_nsec
-
first
.
tv_nsec
)
/
1000000
));
((
last
.
tv_sec
-
first
.
tv_sec
)
*
1000
+
(
last
.
tv_nsec
-
first
.
tv_nsec
)
/
1000000
));
if
(
nrecieve
)
{
if
(
nrecieve
)
{
/* Display rtt stats only if at least one packet is received */
/* Display rtt stats only if at least one packet is received */
...
@@ -2629,7 +2629,7 @@ usage:
...
@@ -2629,7 +2629,7 @@ usage:
SHELLCMD_ENTRY
(
ntpdate_shellcmd
,
CMD_TYPE_EX
,
"ntpdate"
,
XARGS
,
(
CmdCallBackFunc
)
osShellNtpdate
);
SHELLCMD_ENTRY
(
ntpdate_shellcmd
,
CMD_TYPE_EX
,
"ntpdate"
,
XARGS
,
(
CmdCallBackFunc
)
osShellNtpdate
);
#endif
/* LOSCFG_SHELL_CMD_DEBUG */
#endif
/* LOSCFG_SHELL_CMD_DEBUG */
#endif
/* LWIP_SNTP*/
#endif
/* LWIP_SNTP
*/
#if LWIP_DNS
#if LWIP_DNS
u32_t
osShellDns
(
int
argc
,
const
char
**
argv
)
u32_t
osShellDns
(
int
argc
,
const
char
**
argv
)
...
@@ -2866,7 +2866,7 @@ int netstat_tcp_recvq(struct tcp_pcb *tpcb)
...
@@ -2866,7 +2866,7 @@ int netstat_tcp_recvq(struct tcp_pcb *tpcb)
case
NETCONN_UDP_IPV6
:
case
NETCONN_UDP_IPV6
:
#endif
#endif
case
NETCONN_UDP
:
case
NETCONN_UDP
:
SYS_ARCH_GET
(((
unsigned
int
)
conn
->
recv_avail
/*+ conn->lrcv_left*/
),
retVal
);
SYS_ARCH_GET
(((
unsigned
int
)
conn
->
recv_avail
),
retVal
);
// + conn->lrcv_left
break
;
break
;
default:
default:
retVal
=
0
;
/* ur... very ugly, damn DHCP DNS and SNTP */
retVal
=
0
;
/* ur... very ugly, damn DHCP DNS and SNTP */
...
@@ -2922,7 +2922,7 @@ int netstat_udp_sendq6(struct udp_pcb *upcb)
...
@@ -2922,7 +2922,7 @@ int netstat_udp_sendq6(struct udp_pcb *upcb)
#else
#else
ret
=
netstat_get_udp_sendQLen6
(
upcb
,
neighbor_cache
[
idx
].
q
);
ret
=
netstat_get_udp_sendQLen6
(
upcb
,
neighbor_cache
[
idx
].
q
);
if
(
ret
>=
0
)
{
if
(
ret
>=
0
)
{
retLen
+=
ret
;
retLen
+=
ret
;
}
}
#endif
#endif
return
retLen
;
return
retLen
;
...
@@ -2966,10 +2966,10 @@ int netstat_udp_sendq(struct udp_pcb *upcb)
...
@@ -2966,10 +2966,10 @@ int netstat_udp_sendq(struct udp_pcb *upcb)
#else
#else
ret
=
netstat_get_udp_sendQLen
(
upcb
,
arp_table
[
arpidx
].
q
);
ret
=
netstat_get_udp_sendQLen
(
upcb
,
arp_table
[
arpidx
].
q
);
if
(
ret
>
0
)
{
if
(
ret
>
0
)
{
retLen
+=
ret
;
retLen
+=
ret
;
if
(
retLen
<=
0
)
{
// overflow, set rteLen = -1 to indicate
if
(
retLen
<=
0
)
{
// overflow, set rteLen = -1 to indicate
retLen
=
-
1
;
retLen
=
-
1
;
}
}
}
}
#endif
#endif
}
}
...
@@ -2992,7 +2992,7 @@ int netstat_netconn_recvq(const struct netconn *conn)
...
@@ -2992,7 +2992,7 @@ int netstat_netconn_recvq(const struct netconn *conn)
case
NETCONN_PKT_RAW
:
case
NETCONN_PKT_RAW
:
#endif
#endif
case
NETCONN_UDP
:
case
NETCONN_UDP
:
SYS_ARCH_GET
(((
unsigned
int
)
conn
->
recv_avail
/*+ conn->lrcv_left*/
),
retVal
);
SYS_ARCH_GET
(((
unsigned
int
)
conn
->
recv_avail
),
retVal
);
// + conn->lrcv_left
break
;
break
;
default:
default:
retVal
=
0
;
/* ur... very ugly, damn DHCP DNS and SNTP */
retVal
=
0
;
/* ur... very ugly, damn DHCP DNS and SNTP */
...
@@ -3271,10 +3271,10 @@ void netstat_internal(void *ctx)
...
@@ -3271,10 +3271,10 @@ void netstat_internal(void *ctx)
recvQlen
=
netstat_netconn_recvq
(
rpcb
->
recv_arg
);
recvQlen
=
netstat_netconn_recvq
(
rpcb
->
recv_arg
);
sendQlen
=
netstat_netconn_sendq
(
rpcb
->
recv_arg
);
sendQlen
=
netstat_netconn_sendq
(
rpcb
->
recv_arg
);
proto
=
rpcb
->
protocol
;
//
raw_proto;
proto
=
rpcb
->
protocol
;
//
raw_proto;
iRet
=
snprintf_s
((
char
*
)(
entry_buf
+
entry_buf_offset
),
entry_buf_len
,
entry_buf_len
-
1
,
iRet
=
snprintf_s
((
char
*
)(
entry_buf
+
entry_buf_offset
),
entry_buf_len
,
entry_buf_len
-
1
,
"%-8s%-12d%-12d%-20s%-20s%-16u%-16d
\n
"
,
"%-8s%-12d%-12d%-20s%-20s%-16u%-16d
\n
"
,
"raw"
,
recvQlen
,
sendQlen
,
local_ip_port
,
remote_ip_port
,
proto
,
/*rpcb->hdrincl*/
0
);
"raw"
,
recvQlen
,
sendQlen
,
local_ip_port
,
remote_ip_port
,
proto
,
0
);
// rpcb->hdrincl
if
((
iRet
<=
0
)
||
((
u32_t
)(
iRet
)
>=
entry_buf_len
))
{
if
((
iRet
<=
0
)
||
((
u32_t
)(
iRet
)
>=
entry_buf_len
))
{
goto
out
;
goto
out
;
}
}
...
@@ -3297,7 +3297,8 @@ void netstat_internal(void *ctx)
...
@@ -3297,7 +3297,8 @@ void netstat_internal(void *ctx)
sendQlen
=
netstat_netconn_sendq
(
rpcb
->
recv_arg
);
sendQlen
=
netstat_netconn_sendq
(
rpcb
->
recv_arg
);
for
(
netif
=
netif_list
;
netif
!=
NULL
;
netif
=
netif
->
next
)
{
for
(
netif
=
netif_list
;
netif
!=
NULL
;
netif
=
netif
->
next
)
{
if
(
netif_get_index
(
netif
)
/*netif->ifindex*/
==
rpcb
->
netif_idx
/*index*/
)
{
/* netif->ifindex and index */
if
(
netif_get_index
(
netif
)
==
rpcb
->
netif_idx
)
{
(
void
)
snprintf_s
((
char
*
)
netif_name
,
IFNAMSIZ
,
IFNAMSIZ
-
1
,
"%s"
,
netif_get_name
(
netif
));
(
void
)
snprintf_s
((
char
*
)
netif_name
,
IFNAMSIZ
,
IFNAMSIZ
-
1
,
"%s"
,
netif_get_name
(
netif
));
break
;
break
;
}
}
...
@@ -3307,7 +3308,7 @@ void netstat_internal(void *ctx)
...
@@ -3307,7 +3308,7 @@ void netstat_internal(void *ctx)
(
void
)
snprintf_s
((
char
*
)
netif_name
,
IFNAMSIZ
,
IFNAMSIZ
-
1
,
"%s"
,
"None"
);
(
void
)
snprintf_s
((
char
*
)
netif_name
,
IFNAMSIZ
,
IFNAMSIZ
-
1
,
"%s"
,
"None"
);
}
}
proto
=
rpcb
->
protocol
;
//
ntohs(rpcb->proto.eth_proto);
proto
=
rpcb
->
protocol
;
//
ntohs(rpcb->proto.eth_proto);
iRet
=
snprintf_s
((
char
*
)(
entry_buf
+
entry_buf_offset
),
entry_buf_len
,
entry_buf_len
-
1
,
iRet
=
snprintf_s
((
char
*
)(
entry_buf
+
entry_buf_offset
),
entry_buf_len
,
entry_buf_len
-
1
,
"%-12s%-12d%-12d%-16x%-12s
\n
"
,
"pkt-raw"
,
recvQlen
,
sendQlen
,
proto
,
netif_name
);
"%-12s%-12d%-12d%-16x%-12s
\n
"
,
"pkt-raw"
,
recvQlen
,
sendQlen
,
proto
,
netif_name
);
...
@@ -3884,4 +3885,4 @@ SHELLCMD_ENTRY(reboot_shellcmd, CMD_TYPE_EX, "reboot", XARGS, (CmdCallBackFunc)o
...
@@ -3884,4 +3885,4 @@ SHELLCMD_ENTRY(reboot_shellcmd, CMD_TYPE_EX, "reboot", XARGS, (CmdCallBackFunc)o
#endif
/* LOSCFG_SHELL_CMD_DEBUG */
#endif
/* LOSCFG_SHELL_CMD_DEBUG */
#endif
#endif
#endif //LWIP_ENABLE_LOS_SHELL_CMD
#endif //
LWIP_ENABLE_LOS_SHELL_CMD
net/lwip-2.1/enhancement/src/dhcps.c
浏览文件 @
ba23a26f
...
@@ -435,9 +435,9 @@ LWIP_STATIC void handle_discover(struct netif *netif, struct dhcps *dhcps,
...
@@ -435,9 +435,9 @@ LWIP_STATIC void handle_discover(struct netif *netif, struct dhcps *dhcps,
}
}
#else
#else
else
{
else
{
LWIP_DEBUGF
(
DHCP_DEBUG
|
LWIP_DBG_TRACE
,
LWIP_DEBUGF
(
DHCP_DEBUG
|
LWIP_DBG_TRACE
,
(
"handle_discover: sendto(OFFER, IP_ADDR_BROADCAST, DHCP_CLIENT_PORT)
\n
"
));
(
"handle_discover: sendto(OFFER, IP_ADDR_BROADCAST, DHCP_CLIENT_PORT)
\n
"
));
(
void
)
udp_sendto_if_src
(
dhcps
->
pcb
,
out_msg
,
IP_ADDR_BROADCAST
,
DHCP_CLIENT_PORT
,
netif
,
&
(
netif
->
ip_addr
));
(
void
)
udp_sendto_if_src
(
dhcps
->
pcb
,
out_msg
,
IP_ADDR_BROADCAST
,
DHCP_CLIENT_PORT
,
netif
,
&
(
netif
->
ip_addr
));
}
}
#endif
#endif
...
...
net/lwip-2.1/enhancement/src/fixme.c
浏览文件 @
ba23a26f
...
@@ -412,7 +412,7 @@ int ip6addr_aton(const char *cp, ip6_addr_t *addr)
...
@@ -412,7 +412,7 @@ int ip6addr_aton(const char *cp, ip6_addr_t *addr)
int
squash_pos
=
ipv6_blocks
;
int
squash_pos
=
ipv6_blocks
;
int
i
;
int
i
;
const
char
*
s
=
cp
;
const
char
*
s
=
cp
;
const
char
*
ss
=
cp
-
1
;
const
char
*
ss
=
cp
-
1
;
for
(;
;
s
++
)
{
for
(;
;
s
++
)
{
if
(
current_block_index
>=
ipv6_blocks
)
{
if
(
current_block_index
>=
ipv6_blocks
)
{
...
...
net/lwip-2.1/porting/src/driverif.c
浏览文件 @
ba23a26f
...
@@ -98,10 +98,10 @@ driverif_output(struct netif *netif, struct pbuf *p)
...
@@ -98,10 +98,10 @@ driverif_output(struct netif *netif, struct pbuf *p)
#if PF_PKT_SUPPORT
#if PF_PKT_SUPPORT
if
(
all_pkt_raw_pcbs
!=
NULL
)
{
if
(
all_pkt_raw_pcbs
!=
NULL
)
{
p
->
flags
=
(
u16_t
)(
p
->
flags
&
~
(
PBUF_FLAG_LLMCAST
|
PBUF_FLAG_LLBCAST
|
PBUF_FLAG_HOST
));
p
->
flags
=
(
u16_t
)(
p
->
flags
&
~
(
PBUF_FLAG_LLMCAST
|
PBUF_FLAG_LLBCAST
|
PBUF_FLAG_HOST
));
p
->
flags
|=
PBUF_FLAG_OUTGOING
;
p
->
flags
|=
PBUF_FLAG_OUTGOING
;
(
void
)
raw_pkt_input
(
p
,
netif
,
NULL
);
(
void
)
raw_pkt_input
(
p
,
netif
,
NULL
);
}
}
#endif
#endif
#if ETH_PAD_SIZE
#if ETH_PAD_SIZE
...
...
net/lwip-2.1/porting/src/sockets.c
浏览文件 @
ba23a26f
...
@@ -803,12 +803,10 @@ static u8_t lwip_ioctl_internal_SIOCSIFHWADDR(struct ifreq *ifr)
...
@@ -803,12 +803,10 @@ static u8_t lwip_ioctl_internal_SIOCSIFHWADDR(struct ifreq *ifr)
}
}
#endif
#endif
else
{
else
{
/* bring netif down to clear all Neighbor Cache Entry */
/* bring netif down to clear all Neighbor Cache Entry */
(
void
)
netif_set_down
(
netif
);
(
void
)
netif_set_down
(
netif
);
ret
=
netif_set_hwaddr
(
netif
,
(
const
unsigned
char
*
)
ifr
->
ifr_hwaddr
.
sa_data
,
netif
->
hwaddr_len
);
ret
=
netif_set_hwaddr
(
netif
,
(
const
unsigned
char
*
)
ifr
->
ifr_hwaddr
.
sa_data
,
netif
->
hwaddr_len
);
if
(
ret
!=
ERR_OK
)
{
if
(
ret
!=
ERR_OK
)
{
(
void
)
netif_set_up
(
netif
);
(
void
)
netif_set_up
(
netif
);
return
err_to_errno
(
ret
);
return
err_to_errno
(
ret
);
...
@@ -979,7 +977,6 @@ static u8_t lwip_ioctl_internal_SIOCGIFFLAGS(struct ifreq *ifr)
...
@@ -979,7 +977,6 @@ static u8_t lwip_ioctl_internal_SIOCGIFFLAGS(struct ifreq *ifr)
#endif
/* LWIP_IGMP || LWIP_IPV6_MLD */
#endif
/* LWIP_IGMP || LWIP_IPV6_MLD */
#if LWIP_DHCP
#if LWIP_DHCP
//if ((netif->flags & NETIF_FLAG_DHCP) != 0) {
if
(
dhcp_supplied_address
(
netif
))
{
if
(
dhcp_supplied_address
(
netif
))
{
ifr
->
ifr_flags
=
(
short
)((
unsigned
short
)
ifr
->
ifr_flags
|
IFF_DYNAMIC
);
ifr
->
ifr_flags
=
(
short
)((
unsigned
short
)
ifr
->
ifr_flags
|
IFF_DYNAMIC
);
}
else
{
}
else
{
...
@@ -1090,7 +1087,6 @@ static u8_t lwip_ioctl_internal_SIOCSIFNAME(struct ifreq *ifr)
...
@@ -1090,7 +1087,6 @@ static u8_t lwip_ioctl_internal_SIOCSIFNAME(struct ifreq *ifr)
#endif
#endif
netif
=
netif_find
(
ifr
->
ifr_name
);
netif
=
netif_find
(
ifr
->
ifr_name
);
if
(
netif
==
NULL
)
{
if
(
netif
==
NULL
)
{
return
ENODEV
;
return
ENODEV
;
}
else
if
(
netif
->
link_layer_type
==
LOOPBACK_IF
)
{
}
else
if
(
netif
->
link_layer_type
==
LOOPBACK_IF
)
{
...
@@ -1165,7 +1161,6 @@ static u8_t lwip_ioctl_internal_SIOCGIFMTU(struct ifreq *ifr)
...
@@ -1165,7 +1161,6 @@ static u8_t lwip_ioctl_internal_SIOCGIFMTU(struct ifreq *ifr)
/* get netif hw addr */
/* get netif hw addr */
netif
=
netif_find
(
ifr
->
ifr_name
);
netif
=
netif_find
(
ifr
->
ifr_name
);
if
(
netif
==
NULL
)
{
if
(
netif
==
NULL
)
{
return
ENODEV
;
return
ENODEV
;
}
else
{
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录