change code style

This commit is contained in:
hduffddybz 2014-08-30 11:04:13 +08:00
parent 5a7d40f80e
commit 838cdbe660
3 changed files with 38 additions and 42 deletions

View File

@ -97,13 +97,14 @@ static void tcpip_init_done_callback(void *arg)
#ifdef LWIP_IPV6
ethif->netif->output_ip6 = ethip6_output;
netif_create_ip6_linklocal_address(ethif->netif, 1);
#ifdef LWIP_IPV6_AUTOCONFIG
#ifdef LWIP_IPV6_AUTOCONFIG
ethif->netif->ip6_autoconfig_enabled = 1;
#endif
#ifdef LWIP_IPV6_MLD
ethif->netif->mld_mac_filter = NULL;
#endif
#endif
#ifdef LWIP_IPV6_MLD
ethif->netif->mld_mac_filter = NULL;
#endif
#endif
#if LWIP_DHCP
if (ethif->flags & NETIF_FLAG_DHCP)
{
@ -175,14 +176,6 @@ int lwip_system_init(void)
netifapi_netif_set_addr(netif_default, &ipaddr, &netmask, &gw);
}
#endif
/*#if LWIP_IPV6 && LWIP_IPV6_MLD
ip6_addr_t ip6addr_group;
IP6_ADDR(&ip6addr_group, 0, 0xfe, 0x80, 0x00, 0x00);
IP6_ADDR(&ip6addr_group, 0, 0x00, 0x00, 0x00, 0x00);
IP6_ADDR(&ip6addr_group, 0, 0x00, 0x00, 0x00, 0x00);
IP6_ADDR(&ip6addr_group, 0, 0x00, 0x00, 0x00, 0x01);
netif_mld_mac_filter_fn(netif_default, &ip6addr_group, 0);
#endif*/
rt_kprintf("lwIP-%d.%d.%d initialized!\n", LWIP_VERSION_MAJOR, LWIP_VERSION_MINOR, LWIP_VERSION_REVISION);
return 0;

View File

@ -14,12 +14,13 @@
//#define LWIP_IPV6_DHCP6 1
#define LWIP_ICMP6 1
#define LWIP_IPV6_NUM_ADDRESSES 3
#endif
#ifdef RT_LWIP_IPV6_AUTOCONFIG
#define LWIP_IPV6_AUTOCONFIG 1
#endif
#endif
#ifdef RT_LWIP_IPV6_MLD
#define LWIP_IPV6_MLD 1
#endif

View File

@ -437,6 +437,7 @@ void set_if(char* netif_name, char* ip_addr, char* gw_addr, char* nm_addr)
}
FINSH_FUNCTION_EXPORT(set_if, set network interface address);
#if LWIP_IPV6
void set_if6(char* netif_name, char* ip6_addr)
{
struct netif* netif = netif_list;
@ -467,6 +468,7 @@ void set_if6(char* netif_name, char* ip6_addr)
}
}
FINSH_FUNCTION_EXPORT(set_if6, set ipv6 local address)
#endif
#if LWIP_DNS
#include <lwip/dns.h>
@ -514,11 +516,11 @@ void list_if(void)
rt_kprintf("ip address: %s\n", ipaddr_ntoa(&(netif->ip_addr)));
rt_kprintf("gw address: %s\n", ipaddr_ntoa(&(netif->gw)));
rt_kprintf("net mask : %s\n", ipaddr_ntoa(&(netif->netmask)));
#if LWIP_IPV6
rt_kprintf("link-local address: %s\n", ip6addr_ntoa(&(netif->ip6_addr[0])));
rt_kprintf("ipv6[1] address: %s\n", ip6addr_ntoa(&(netif->ip6_addr[1])));
rt_kprintf("\r\n");
#endif
netif = netif->next;
}
@ -558,13 +560,13 @@ void list_tcps(void)
rt_kprintf("Active PCB states:\n");
for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next)
{
#ifndef LWIP_IPV6
#ifndef LWIP_IPV6
strcpy(local_ip_str, ipaddr_ntoa(&(pcb->local_ip)));
strcpy(remote_ip_str, ipaddr_ntoa(&(pcb->remote_ip)));
#else
#else
strcpy(local_ip_str, ip6addr_ntoa((ip6_addr_t *)&(pcb->local_ip)));
strcpy(remote_ip_str, ip6addr_ntoa((ip6_addr_t *)&(pcb->remote_ip)));
#endif
#endif
rt_kprintf("#%d %s:%d <==> %s:%d snd_nxt 0x%08X rcv_nxt 0x%08X ",
num++,
local_ip_str,
@ -588,13 +590,13 @@ void list_tcps(void)
num = 0;
for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next)
{
#ifndef LWIP_IPV6
#ifndef LWIP_IPV6
strcpy(local_ip_str, ipaddr_ntoa(&(pcb->local_ip)));
strcpy(remote_ip_str, ipaddr_ntoa(&(pcb->remote_ip)));
#else
#else
strcpy(local_ip_str, ip6addr_ntoa((ip6_addr_t *)&(pcb->local_ip)));
strcpy(remote_ip_str, ip6addr_ntoa((ip6_addr_t *)&(pcb->remote_ip)));
#endif
#endif
rt_kprintf("#%d %s:%d <==> %s:%d snd_nxt 0x%08X rcv_nxt 0x%08X ",
num++,