yinshengkai
105fd2aac5
nsh: fix a buffer overflow in help
...
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-09 18:22:09 +08:00
fangxinyong
2234c3a2e6
nshlib: support list numeric user and group IDs
...
Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-08-09 15:06:09 +08:00
Zhe Weng
396ab2e931
nsh/alias: Fix compiler warning
...
Got use-after-free warning under GCC 12 with `-O3` option, and I found
that `nsh_strcat` may realloc `ptr`, then `cmdline` may point to invalid
memory.
Let `cmdline` point to the reallocated `ptr` may solve the problem.
Tested by `alias ll='ls -l'` and `ll /` on sim.
GCC output:
CC: binfmt_unloadmodule.c In function 'nsh_aliasexpand',
inlined from 'nsh_argument' at nsh_parse.c:1879:20:
nsh_parse.c:1196:23: error: pointer 'ptr' used after 'realloc' [-Werror=use-after-free]
1196 | ptr = cmdline + len;
| ~~~~~~~~^~~~~~~~~~~~~~~
In function 'nsh_strcat',
inlined from 'nsh_aliasexpand' at nsh_parse.c:1190:21,
inlined from 'nsh_argument' at nsh_parse.c:1879:20:
nsh_parse.c:1100:27: note: call to 'realloc' here
1100 | argument = (FAR char *)realloc(s1, allocsize);
| ^~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-08-01 08:13:23 -07:00
wanggang26
cb684097b8
nshlib: add print negative number support for echo command
...
Fix issue that "echo -1" will give "argument invalid" error
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-07-31 07:58:41 -07:00
wanggang26
f585d74b8c
nshlib: refine dd verify printing format
...
before:
infile sector 0
7f454c46010101000000000000000000
02002800010000007d13001834000000
8cbd2a00000400053400200004002800
now:
infile sector 0:
0000: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 .ELF............
0010: 02 00 28 00 01 00 00 00 7d 13 00 18 34 00 00 00 ..(.....}...4...
0020: 8c bd 2a 00 00 04 00 05 34 00 20 00 04 00 28 00 ..*.....4. ...(.
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-07-30 22:21:34 -07:00
wanggang26
9621aca73c
nshlib: add negative number logical judgement support for test and [ command
...
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-07-30 22:20:02 -07:00
wangjianyu3
fc8c425cc0
Fix dependents of nsh_foreach_direntry
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2023-07-28 21:51:50 -07:00
Xiang Xiao
8083b094c3
Kconfig: Simplify the conditional default statement
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-25 09:51:09 +08:00
chenrun1
046fe00b96
nsh_fscmd.c:fix "implicit declaration" warning.
...
Fix error: implicit declaration of function 'nsh_foreach_direntry' [-Werror=implicit-function-declaration] on file nsh_fscmds on some compiler versions.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-16 16:39:11 +08:00
chenrun1
415168dde6
nshlib: Add fdinfo to get information about the process associated fd
...
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-16 16:39:11 +08:00
Xiang Xiao
dab972b907
Remove the const cast from the initialization of boardioc_symtab_s::symtab
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-08 16:01:52 +03:00
chao an
4d79a5cbaf
add initial cmake build system
...
Co-authored-by: Daniel Agar <daniel@agar.ca>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-08 13:52:02 +08:00
Junbo Zheng
9de5a2550e
nshlib: add -h
option for ls command
...
config: ./tools/configure.sh sim:nsh
CONFIG_LIBC_FLOATINGPOINT=y
```
nsh> ls -l /dev
/dev:
crw-rw-rw- 0 console
crw-rw-rw- 0 gpio0
crw-rw-rw- 0 gpio1
crw-rw-rw- 0 gpio2
crw-rw-rw- 0 gpio3
crw-rw-rw- 0 loop
crw-rw-rw- 0 null
crw-rw-rw- 0 oneshot
brw-rw-rw- 1048576 ram0
brw-rw-rw- 1024 ram1
brw-rw-rw- 524288 ram2
crw-rw-rw- 0 zero
nsh> ls /lh /dev
nsh: ls: too many arguments
nsh> ls -lh /dev
/dev:
crw-rw-rw- 0 console
crw-rw-rw- 0 gpio0
crw-rw-rw- 0 gpio1
crw-rw-rw- 0 gpio2
crw-rw-rw- 0 gpio3
crw-rw-rw- 0 loop
crw-rw-rw- 0 null
crw-rw-rw- 0 oneshot
brw-rw-rw- 1.0M ram0
brw-rw-rw- 1.0K ram1
brw-rw-rw- 512.0K ram2
crw-rw-rw- 0 zero
```
config: ./tools/configure.sh ../vendor/sim/boards/miwear/configs/miwear -j16
```
nsh> ls -l /resource/misc/media
/resource/misc/media:
-rwxrwxr-x 384044 AlexaTimer.wav
-rwxrwxr-x 57001 AlexaReminder.mp3
-rwxrwxr-x 384132 AlexaAlarm.wav
-rw-rw-r-- 20733 Clank.mp3
-rw-rw-r-- 45183 NotificationXylophone.mp3
-rw-rw-r-- 27420 Robot.mp3
-rw-rw-r-- 21986 FadeIn.mp3
-rw-rw-r-- 42049 Flute.mp3
-rw-rw-r-- 362748 Latona-15s.mp3
drwxrwxr-x 4096 .
-rw-rw-r-- 47198 alarm_volume_adjust.mp3
-rw-rw-r-- 95338 Expect.mp3
drwxrwxr-x 4096 ..
-rw-rw-r-- 409435 Sunrise.mp3
-rw-rw-r-- 55841 Fresh.mp3
-rw-rw-r-- 36685 Bells-1s.mp3
-rw-rw-r-- 4432 camera_click.mp3
-rw-rw-r-- 469621 MiRemix.mp3
nsh>
nsh> ls -lh /resource/misc/media
/resource/misc/media:
-rwxrwxr-x 375.0K AlexaTimer.wav
-rwxrwxr-x 55.7K AlexaReminder.mp3
-rwxrwxr-x 375.1K AlexaAlarm.wav
-rw-rw-r-- 20.2K Clank.mp3
-rw-rw-r-- 44.1K NotificationXylophone.mp3
-rw-rw-r-- 26.8K Robot.mp3
-rw-rw-r-- 21.5K FadeIn.mp3
-rw-rw-r-- 41.1K Flute.mp3
-rw-rw-r-- 354.2K Latona-15s.mp3
drwxrwxr-x 4.0K .
-rw-rw-r-- 46.1K alarm_volume_adjust.mp3
-rw-rw-r-- 93.1K Expect.mp3
drwxrwxr-x 4.0K ..
-rw-rw-r-- 399.8K Sunrise.mp3
-rw-rw-r-- 54.5K Fresh.mp3
-rw-rw-r-- 35.8K Bells-1s.mp3
-rw-rw-r-- 4.3K camera_click.mp3
-rw-rw-r-- 458.6K MiRemix.mp3
```
Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2023-07-05 16:25:27 +08:00
Stuart Ianna
53e837e357
nshlib/dd: Increase the integer width for sector size in dd.
...
On some systems, using sector sizes larger than 65536 is needed for
profiling performance or testing.
2023-06-26 13:56:29 +08:00
raiden00pl
400951b7de
nsh_usbconsole.c: add support for NSH console over a composite device
2023-06-15 03:23:04 +08:00
chao an
ec63217b48
nshlib: disable nsh error print if NSH_DISABLE_ERROR_PRINT enabled
...
text data bss dec hex filename
398953 27088 4128 430169 69059 nuttx /* before */
389241 27072 4128 420441 66a59 nuttx /* after */
-9712 -16
Signed-off-by: chao an <anchao@xiaomi.com>
2023-06-12 13:37:27 +08:00
Petro Karashchenko
aed0e2873e
apps: fix style issues in code
...
Add missing FAR and CODE to pointers
Remove FAR for non-pointer variables
Remove extra spaces and align the parameters
Add do {} while(0) wrapper in macro
Use nitems to calculate number of elements in arrays
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-06-11 18:47:50 +08:00
chao an
e4cf94b509
nshlib/command: exclude usage to reduce data size
...
Test on sim/nsh (CONFIG_NSH_DISABLE_HELP=y):
text data bss dec hex filename
393746 26824 4000 424570 67a7a nuttx /* before */
391858 26440 4000 422298 6719a nuttx /* after */
-1888 -384
Signed-off-by: chao an <anchao@xiaomi.com>
2023-06-10 02:20:49 +08:00
simbit18
ca4ff01cf9
nshlib/Kconfig: Fix Kconfig style
...
Remove spaces from Kconfig file
2023-05-23 02:52:17 +08:00
Xiang Xiao
e81227f99d
Indent the define statement by two spaces
...
follow the code style convention
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-22 11:57:40 +02:00
Xiang Xiao
7032c72f2f
Indent the define statement by two spaces
...
follow the code style convention
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-21 07:39:53 +03:00
anjiahao
e68d5ffb98
support memdump can dump by seq number
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-05-21 00:08:48 +08:00
Takumi Ando
baf5509b59
nshlib: Add support for disabling echoback
...
If CONFIG_NSH_DISABLE_ECHOBACK is selected,
the NSH disables echoback prompt.
Signed-off-by: Takumi Ando <t-ando@advaly.co.jp>
2023-05-18 17:22:14 +08:00
chao an
28973a37b3
nshlib: fix memory leak found out by -fanalyzer
...
Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-16 22:43:21 -07:00
wangchen
cb292d0608
nshlib/netcmds:modify the description of setting MTU
...
modify the description of setting MTU
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-05-10 19:56:04 +08:00
Xiang Xiao
73701cd7cd
Replace all strncpy with strlcpy
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 21:35:16 +03:00
Xiang Xiao
7c37421266
Replace all sprintf with snprintf
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 21:35:16 +03:00
Xiang Xiao
134b8b538f
Replace all strcat with strlcat
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 21:35:16 +03:00
Xiang Xiao
bebae28bdd
nsh: Fix the typo error cmd_swtichboot -> cmd_switchboot
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-03 17:40:49 +03:00
wangchen
c2f75330f7
nshlib/netcmds:support to set MTU
...
Usage:ifconfig interfacename mtu ***
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-04-27 18:02:23 +08:00
chenrun1
cf54069487
nshlib/nsh_fscmds.c:Add whether or not to pass in empty arguments when rm -r
...
When rm -r is passed with no address specified, it will automatically recursively unlink all files under the root path ('/') until unlinking to the mounted folder causes the unlink to fail. In this change, rm -r without a specified path will prompt for missing arguments
2023-04-22 12:47:57 +08:00
Huang Qi
3a28933ca8
nshlib: Don't show passwd in telnet login
...
Current implementation is broken, in this patch ECHO is
disabled by termios.
This patch works with https://github.com/apache/nuttx/pull/8950
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-04-22 12:47:16 +08:00
Ville Juven
4ce809e7d4
nsh/nsh_parse: Fix handling of back-quotes
...
The logic that handles back-quotes was faulty, i.e. example command
set FOO `ls -l` would be split into two tokens as follows:
- set FOO `ls
- -l`
This results in nsh: `: no matching ` error, this fixes that issue.
2023-04-19 03:12:18 +08:00
Ville Juven
0914c20c0d
nsh/alias: Add support for alias arguments
...
This adds support for more complex alias handling, such as:
$ alias ls='ls -l'
Previously such an alias was not split into the command verb and the
argument correctly, instead the full alias string was handled as the
verb, which obviously fails.
This commit fixes this by expanding the alias, checking whether it has
arguments and if so, it merges the expanded alias + the old command line
together, resulting in a completely new command line.
Example (assuming the alias above has been created):
$ ls /bin
Results in a new command line: "ls -l /bin" which is then parsed and
executed.
2023-04-17 15:09:38 +09:00
Xiang Xiao
1d3e6510e6
nshlib: Add switchboot command
...
switchboot <image path>
Switch to the updated or specified boot system. This command depends on
hardware support CONFIG_BOARDCTL_SWITCH_BOOT. `<image path>` point to a
partion or file which contain the firmware to boot.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-07 13:44:49 +03:00
zhengjunbo1
f58c87e7ed
nshlib/README.md: add uptime command description
...
Signed-off-by: zhengjunbo1 <zhengjunbo1@xiaomi.com>
2023-04-04 12:19:15 -04:00
Xiang Xiao
49418d6de5
nshlib: Align the command table
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-04 13:53:28 +03:00
Xiang Xiao
4f7dd7be7c
nshlib: Add boot command
...
boot [<image path> [<header size>]]
Boot a new firmware image. This command depends on hardware support
CONFIG_BOARDCTL_BOOT_IMAGE. <image path> may point to a partion or file
which contain the firmware to boot. The optional, numeric argument
<header size> may be useful for skipping metadata information preprended
to the firmware image.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-04 13:53:28 +03:00
Masayuki Ishikawa
125cf7abe2
nshlib: Fix the ps command format
...
Summary:
- I noticed that the ps command shows the wrong format due to
recent changes on sigmask length from 32bits to 64bits
- This commit fixes this issue
Impact:
- None
Testing:
- Tested with sabre-6quad:smp on qemu-7.1
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-03-29 14:50:26 +03:00
Ville Juven
e20d2688ab
nsh/alias: Do not expand argument lists, only the command
...
A resulting word that is identified to be the command name word of a
simple command shall be examined to determine whether it is an unquoted,
valid alias name.
The keyword here being "a simple command", arguments are not subject to
expansion.
2023-03-23 22:10:19 +02:00
Ville Juven
ad18a50282
nsh/nsh_parse.c: Fix variable expansion inside double quotes
...
This also prevents expanding anything when inside single quotes, for
full POSIX compliance.
2023-03-23 22:10:19 +02:00
Ville Juven
f9dfb51001
nsh/nshlib: Add alias support for nsh
...
This adds support for string aliases into nsh. There are some nuances that
are not handled correctly yet:
- Reserved words can be overloaded, which is a clear POSIX violation
2023-03-23 22:10:19 +02:00
Ville Juven
bf40833d2e
nsh/nsh_parse.c: Add support for single ('') and double ("") quotes
...
The parser is modified to detect, handle and remove quotes from the
command string. Whatever is inside the quotes is treated as a string
literal. If no matching end quote is found, the terminal prints out
and error.
2023-03-23 22:10:19 +02:00
Xiang Xiao
86080a110e
apps: Remove the check of CONFIG_SERIAL_TERMIOS
...
If the code only change c_oflag, c_iflag and c_lflag, not c_cflag in termios.
Follow up the change from kernel: https://github.com/apache/nuttx/pull/8843
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-19 14:53:44 -06:00
yinshengkai
fb0ab1b4c6
nshlib: one-time output uname
...
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-03-17 12:10:00 -03:00
Ville Juven
5d9811a03d
nshlib/nsh_vars.c: Add missing stdio.h
...
nsh_vars.c: In function 'nsh_setvar':
nsh_vars.c:285:3: error: incompatible implicit declaration of built-in function 'sprintf' [-Werror]
285 | sprintf(pair, "%s=%s", name, value);
2023-03-17 11:59:37 -03:00
Huang Qi
ea4437fc76
termios: Fix wrong ECHO flag
...
Follow https://github.com/apache/nuttx/pull/8800
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-17 03:22:08 +01:00
Huang Qi
dbf7d34a2a
nsh: Fix a potential buffer overflow in cmd help
...
Follow https://github.com/apache/nuttx-apps/pull/1621 , fix issue of builtin command list.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-09 01:42:38 +08:00
Fotis Panagiotopoulos
dd2c3b3f6a
nsh: Added conditional include of netinit.
2023-03-09 01:41:10 +08:00
Gustavo Henrique Nihei
b61686b866
nshlib: Include missing "sched.h" header
...
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-06 18:52:31 +02:00
Huang Qi
12d31075eb
nsh: Fix a buffer overflow in help
...
Introduced by https://github.com/apache/nuttx-apps/pull/1610 ,
internal line buffer should have more bytes for tab before newline and '\0'.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-05 11:18:59 +02:00
Huang Qi
9bb730fb6b
nsh: Don't echo password during login
...
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-04 01:44:40 +08:00
Huang Qi
2e49d78400
nsh/login: FIx error prompt length
...
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-04 01:44:40 +08:00
Huang Qi
f1ba1a40ed
nsh: Improve performance of ps
by merge nsh_output
...
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-03 17:41:39 +09:00
Huang Qi
e957e1633c
nsh: Improve performance of help
by line buffer
...
This change reduce the usage of `printf`,
which will improve both CPU usage and IO performance.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-03 17:41:39 +09:00
yinshengkai
fa589ae622
nsh: fix nsh startup failure
...
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-03-01 21:26:01 +08:00
Xiang Xiao
a4f7129984
Fix nsh_builtin.c:91:22: error: 'SA_NOCLDWAIT' undeclared
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-26 19:02:28 +02:00
Xiang Xiao
359f66ad37
nshlib: Remove the remaining CONFIG_FILE_STREAM dependence
...
continue the change from https://github.com/apache/nuttx-apps/pull/1559
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-24 17:38:19 +08:00
Xiang Xiao
80feb2432d
nshlib: Shouldn't set TIOCSCTTY with STDOUT_FILENO directly
...
to handle the shell redirection correctly
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-24 17:38:19 +08:00
lilei19
41f60bd669
change strcpy to strlcpy
...
Change-Id: I8b9429a3c225a82842fce136bdb14b8b135066d3
Signed-off-by: lilei19 <lilei19@xiaomi.com>
2023-02-22 23:09:55 +08:00
Huang Qi
95f32fd018
nsh: Decouple with CONFIG_FILE_STREAM
...
Replace all fwrite/fread/fgets/... to write/read/...
Before:
```
text data bss dec hex filename
109827 601 6608 117036 1c92c nuttx/nuttx
```
After:
```
text data bss dec hex filename
108053 601 6608 115262 1c23e nuttx/nuttx
```
After with CONFIG_FILE_STREAM disabled:
```
text data bss dec hex filename
105667 601 6608 112876 1b8ec nuttx/nuttx
```
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-02-22 13:47:41 +08:00
Oreh
f63a3cac0e
Add NSH lomtd command (creates MTD loop device)
2023-02-19 19:55:52 +08:00
Nathan Hartman
8e77b79f78
Kconfig: Make indent consistent with TABS
2023-02-10 14:11:48 +08:00
Xiang Xiao
a29d9ea9da
fsutils/examples: Include unistd.h explicitly
...
to get the prototypes or macros are defined in it
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-05 08:46:59 +02:00
Gustavo Henrique Nihei
b0da60e498
apps: Use MIN/MAX definitions from "sys/param.h"
...
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-02-02 00:35:14 +02:00
Zhe Weng
93b4dc2692
ifconfig: Support ifconfig interface
and update arg limit
...
From comment in cmd_ifconfig, it seems that we support `ifconfig [interface]`, but actually not considering the interface param now. After this commit, we only print the information of interface specified in param, just like linux.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-02-01 11:12:24 +08:00
Fotis Panagiotopoulos
464607dc90
Fixed compiler warnings in dd.
2023-01-30 10:59:07 +08:00
Alan Carvalho de Assis
4ed5bec472
Enable TMPFS and NSH_QUOTE to get CONFIG_NSH_CMDPARMS working
2023-01-24 13:24:23 +01:00
dongjiuzhu1
542558f2c1
nshlib/script: avoid output unnecessary log when missing rc.sysinit file
...
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-12-31 00:40:00 +08:00
Zhe Weng
2ad05e3062
ifconfig: Support prefixlen/CIDR for IPv6
...
Linux:
ifconfig eth0 [inet6] add 2022::2/96
FreeBSD:
ifconfig eth0 inet6 2022::2/96
ifconfig eth0 inet6 2022::2 prefixlen 96
NuttX newly supported:
ifconfig eth0 inet6 [add] 2022::2/96
ifconfig eth0 inet6 [add] 2022::2 prefixlen 96
Ref:
https://man7.org/linux/man-pages/man8/ifconfig.8.html
https://www.freebsd.org/cgi/man.cgi?ifconfig
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2022-12-29 17:33:59 +08:00
Zhe Weng
8f10dde6ad
ifconfig: Allow hostip on first non-option place after inet/inet6
...
NuttX previous:
ifconfig eth0 10.0.0.1 [inet]
ifconfig eth0 2022::2 inet6
Try to be compatible with other systems:
Linux:
ifconfig eth0 [inet] 10.0.0.1
ifconfig eth0 [inet6] add 2022::2
FreeBSD:
ifconfig eth0 inet 10.0.0.1
ifconfig eth0 inet6 2022::2
NuttX newly supported:
ifconfig eth0 [inet] 10.0.0.1
ifconfig eth0 inet6 [add] 2022::2
Ref:
https://man7.org/linux/man-pages/man8/ifconfig.8.html
https://www.freebsd.org/cgi/man.cgi?ifconfig
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2022-12-29 17:33:59 +08:00
Xiang Xiao
d1e46c2d3e
compiler.h: Add _ between format|printf|syslog|scanf|strftime and like
...
align with other macro naming style
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-21 01:05:12 +02:00
huangjian
78020aec0d
nshlib:nsh login include nshlib/nshlib.h
...
Signed-off-by: huangjian <huangjian@xiaomi.com>
2022-12-20 23:39:36 +08:00
Xiang Xiao
cfc005a460
arp: Remove the unnecessary inclusion of nuttx/net/arp
...
and change the remain inclusion to netinet/arp.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-16 22:11:10 +02:00
Xiang Xiao
9884159346
nshlib: Add login skip, invalid name ignore and password challenge to telnet login
...
forget in the follow patches:
commit 6aef469c19
Author: huangjian <huangjian@xiaomi.com>
Date: Fri Nov 4 20:37:04 2022 +0800
nshlib:judge whether nsh login username is a valid input
Signed-off-by: huangjian <huangjian@xiaomi.com>
commit 88fff23d34
Author: huangjian <huangjian@xiaomi.com>
Date: Fri Nov 4 20:39:26 2022 +0800
nshlib:add platform skip login function
Signed-off-by: huangjian <huangjian@xiaomi.com>
commit 5a623cc9e3
Author: huangjian <huangjian@xiaomi.com>
Date: Fri Nov 4 20:35:07 2022 +0800
nshlib:add platform challenge function for nsh login
Signed-off-by: huangjian <huangjian@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-16 16:31:05 +02:00
zhanghongyu
c7e8ade590
arp: change arptable get struct from arp_entry_s to arpreq
...
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-12-14 21:19:37 +08:00
zhanghongyu
df3121213e
cmd_arp: add device input for arp interface
...
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-12-14 21:19:37 +08:00
huangjian
6aef469c19
nshlib:judge whether nsh login username is a valid input
...
Signed-off-by: huangjian <huangjian@xiaomi.com>
2022-12-04 19:24:57 +08:00
huangjian
88fff23d34
nshlib:add platform skip login function
...
Signed-off-by: huangjian <huangjian@xiaomi.com>
2022-12-04 19:24:57 +08:00
huangjian
5a623cc9e3
nshlib:add platform challenge function for nsh login
...
Signed-off-by: huangjian <huangjian@xiaomi.com>
2022-12-04 19:24:57 +08:00
anjiahao
14465b85c4
cmd_dd:support dd can do verify
...
After writing the file, compare the contents of the two files again
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-11-14 20:40:43 +08:00
anjiahao
c2f07a4d5a
dd:simplified cmd_dd code steps
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-11-14 20:40:43 +08:00
Xiang Xiao
36a0c924f7
netutils: Support telnetd in the kernel mode
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-07 15:24:08 +09:00
Xiang Xiao
12863fbd52
system/telnet: Fix the style warning
...
and remove the unused code
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-07 15:24:08 +09:00
Xiang Xiao
678415c6fa
Rename task_spawnattr_setstacksize to posix_spawnattr_setstacksize
...
follow up the kernel side change
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 09:51:08 +09:00
Xiang Xiao
757552e759
Fix nsh_fscmds.c:92:19: error: unused function 'ls_specialdir' [-Werror,-Wunused-function]
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 06:28:17 +01:00
Petro Karashchenko
ec1c5f9273
Revert "Revert "nshlib: fix possible out of bounds array access""
...
This reverts commit fe4b44e3ff
.
2022-10-24 01:13:27 +08:00
Petro Karashchenko
fe4b44e3ff
Revert "nshlib: fix possible out of bounds array access"
...
This reverts commit f6a86a578d
.
2022-10-23 08:29:01 +02:00
Petro Karashchenko
f6a86a578d
nshlib: fix possible out of bounds array access
...
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-23 11:45:52 +08:00
Xiang Xiao
0d2ef47192
nshlib: Rename CONFIG_SYSTEM_NSH_SYMTAB to CONFIG_NSH_SYMTAB
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 22:18:38 +02:00
Xiang Xiao
b659f0fbdf
Remove the unnecessary cast for main_t, NULL and argv
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 18:40:23 +02:00
Xiang Xiao
6944c5a0a1
nshlib: Fix warning reported by clang
...
nsh_telnetlogin.c:62:15: error: implicit conversion from 'int' to 'char' changes value from 255 to -1 [-Werror,-Wconstant-conversion]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:14:20 +02:00
Xiang Xiao
75455d3788
nshlib: Reuse nsh_session logic in nsh_telnetmain
...
to avoid the code duplication
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 09:41:43 -03:00
Xiang Xiao
8e460e7e19
nshlib: Move symbol table initialization from nsh_main to nsh_initialize
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 15:39:10 -04:00
Xiang Xiao
0d210c3227
nshlib: Move commoin initialization from console_main to nsh_initialize
...
to avoid the code duplication
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 15:39:10 -04:00
Xiang Xiao
964747dd36
nshlib: Call nsh_telnetstart in nsh_initialize to avoid the dupliation
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 15:39:10 -04:00
Xiang Xiao
cf70d8f95b
nshlib: Call nsh_sysinitscript in usb or alt console like normal one
...
forget in the pull request:
https://github.com/apache/incubator-nuttx-apps/pull/1142
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 15:39:10 -04:00
Xiang Xiao
893387b2c5
Fix the minor style issue
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 19:07:16 +02:00
Xiang Xiao
4941182cc6
Make.defs: Change "ifeq ($(XXX),y)" to "ifneq ($(XXX),)
...
to support the tristate option correctly and unify the usage
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 14:59:08 +02:00
Junbo Zheng
79e770b0c6
apps/nshlib: add the missing FAR macro for all source files
...
Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2022-09-22 14:22:13 +08:00