1 /* 2 * Copyright (C) 2017-2020 Alibaba Group Holding Limited 3 */ 4 #if AOS_COMP_CLI 5 #include "stdbool.h" 6 #include "lwip/opt.h" 7 #include "lwip/apps/ifconfig.h" 8 #include <lwip/def.h> 9 #include <lwip/netdb.h> 10 #include <lwip/sockets.h> 11 #include "aos/cli.h" 12 ifconfig_help(void)13void ifconfig_help(void) 14 { 15 aos_cli_printf("Usage: ifconfig\n"); 16 aos_cli_printf("Example:\n"); 17 aos_cli_printf("ifconfig Display net interface config information\n"); 18 aos_cli_printf("ifconfig status Display net interface config information\n"); 19 } 20 ifconfig_cmd(int argc,char ** argv)21void ifconfig_cmd(int argc, char **argv ) 22 { 23 if ( argc < 1 ) { 24 aos_cli_printf("Invalid command\n"); 25 ifconfig_help(); 26 return; 27 } 28 29 if((argc == 2) && (strcmp(argv[1], "-h") == 0)) { 30 ifconfig_help(); 31 } 32 else { 33 ifconfig(argc - 1, &argv[1]); 34 } 35 } 36 37 /* reg args: fun, cmd, description*/ 38 ALIOS_CLI_CMD_REGISTER(ifconfig_cmd, ifconfig, Ifconfig command) 39 #endif /* AOS_COMP_CLI */ 40