1 /* 2 * Copyright (c) Huawei Technologies Co., Ltd. 2013-2015. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 * 3. The name of the author may not be used to endorse or promote 13 * products derived from this software without specific prior 14 * written permission. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 17 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 22 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * 28 * Description: shell cmds APIs declaration 29 * Author: none 30 * Create: 2013 31 */ 32 33 #ifndef LWIP_API_SHELL_H 34 #define LWIP_API_SHELL_H 35 36 #include "lwip/opt.h" 37 #include "lwip/netif.h" 38 #if defined (__cplusplus) && __cplusplus 39 extern "C" { 40 #endif 41 42 extern int tcpip_init_finish; 43 #ifndef PRINT_USE_CRLF 44 #define PRINT_USE_CRLF 1 45 #endif 46 47 #if PRINT_USE_CRLF 48 #define CRLF "\r\n" 49 #else 50 #define CRLF "\n" 51 #endif 52 53 /* help convert ptr to u32 array(if 64bit platfrom) */ 54 union los_ptr_args { 55 void *ptr; 56 u32_t args[2]; 57 }; 58 59 typedef void (*icmp_code_hander)(u8_t code, void *arg); 60 61 #ifdef CUSTOM_AT_COMMAND 62 typedef enum netstat_trans_type { 63 TCP_IP6, 64 TCP, 65 UDP_IP6, 66 UDP, 67 RAW, 68 PKT_RAW, 69 } netstat_trans_type; 70 #endif 71 72 u32_t lwip_ifconfig(int argc, const char **argv); 73 u32_t lwip_get_ipv4(char *localIp, unsigned char ipLen, unsigned char *ifname); 74 u32_t lwip_get_mac_addr(unsigned char *macAddr, unsigned int len, unsigned char *ifname); 75 76 u32_t lwip_ifstats(int argc, char **argv); 77 u32_t lwip_arp(int argc, char **argv); 78 u32_t at_lwip_arp(int argc, char **argv); 79 u32_t os_shell_netif_up(int argc, char **argv); 80 u32_t os_shell_netif_down(int argc, char **argv); 81 u32_t os_shell_ping(int argc, const char **argv); 82 #if LWIP_IPV6 83 u32_t os_shell_ping6(int argc, const char **argv); 84 u32_t os_shell_ipdebug(int argc, char **argv); 85 #endif 86 87 #if LWIP_RPL || LWIP_RIPPLE 88 u32_t os_shell_rpl(int argc, char **argv); 89 u32_t os_rte_debug(int argc, char **argv); 90 #endif 91 92 u32_t os_shell_tftp(int argc, char **argv); 93 #if LWIP_SNTP 94 u32_t os_shell_ntpdate(int argc, char **argv); 95 #endif 96 #if LWIP_DNS 97 #ifdef CUSTOM_AT_COMMAND 98 u32_t os_shell_show_dns(void); 99 #endif 100 u32_t os_shell_dns(int argc, const char **argv); 101 #endif /* LWIP_DNS */ 102 #if LWIP_IPV4 && LWIP_IGMP 103 u32_t os_shell_igmp(int argc, char **argv); 104 u32_t at_os_shell_igmp(int argc, char **argv); 105 #endif /* LWIP_IPV4 && LWIP_IGMP */ 106 #if (LWIP_IPV6 && (LWIP_IPV6_MLD || LWIP_IPV6_MLD_QUERIER)) 107 u32_t os_shell_mld6(int argc, char **argv); 108 #endif /* (LWIP_IPV6 && (LWIP_IPV6_MLD || LWIP_IPV6_MLD_QUERIER)) */ 109 #if LWIP_DHCP 110 u32_t os_shell_dhcp(int argc, const char **argv); 111 void dhcp_clients_info_show(struct netif *netif_p); 112 #if LWIP_DHCPS 113 u32_t os_shell_dhcps(int argc, const char **argv); 114 void dhcps_info_show(struct netif *netif); 115 #endif /* LWIP_DHCPS */ 116 #endif /* LWIP_DHCP */ 117 u32_t os_shell_netstat(int argc, char **argv); 118 119 void netstat_internal(void *ctx); 120 121 u32_t os_shell_mcast6(int argc, char **argv); 122 #if LWIP_RIPPLE 123 u32_t os_shell_l2test(int argc, char **argv); 124 #endif /* LWIP_RIPPLE */ 125 126 u32_t os_shell_netif(int argc, char **argv); 127 128 u32_t os_shell_display_version(int argc, char **argv); 129 130 #if defined (__cplusplus) && __cplusplus 131 } 132 #endif 133 134 #endif 135 136