1 /*
2 * Copyright (C) 2017-2019 Alibaba Group Holding Limited
3 */
4 #if AOS_COMP_CLI
5 #include <string.h>
6 #include <aos/cli.h>
7 #include <lwip/netdb.h>
8 #include "lwip/opt.h"
9
10 static void lsfd_command(char *buffer, int32_t buf_len, int32_t argc, char **argv);
11
12 struct cli_command lsfd_cmd[] = {
13 { "lsfd", "lsfd app", lsfd_command},
14 };
lsfd_help_command(void)15 static void lsfd_help_command(void)
16 {
17 LWIP_DEBUGF( SOCKET_ALLOC_DEBUG, ("Usage: lsfd\n"));
18 LWIP_DEBUGF( SOCKET_ALLOC_DEBUG, ("Eample:\n"));
19 LWIP_DEBUGF( SOCKET_ALLOC_DEBUG, ("lsfd\n"));
20 }
21
lsfd_exec_command(void)22 static void lsfd_exec_command(void)
23 {
24 #if (SOCKET_ALLOC_DEBUG == LWIP_DBG_ON)
25 extern void print_sock_alloc_info(void);
26 print_sock_alloc_info();
27 #endif
28 }
29
lsfd_command(char * buffer,int32_t buf_len,int32_t argc,char ** argv)30 static void lsfd_command(char *buffer, int32_t buf_len, int32_t argc, char **argv)
31 {
32 if (argc == 1) {
33 lsfd_exec_command();
34 return;
35 }
36
37 lsfd_help_command();
38 }
39
lsfd_cli_register(void)40 int32_t lsfd_cli_register(void)
41 {
42 if (0 == aos_cli_register_commands(lsfd_cmd, 1)) {
43 return 0;
44 }
45
46 return -1;
47 }
48 #endif /* AOS_COMP_CLI */
49