Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
RT-Thread
rt-thread
提交
838cdbe6
R
rt-thread
项目概览
RT-Thread
/
rt-thread
9 个月 前同步成功
通知
752
Star
8909
Fork
4735
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
838cdbe6
编写于
8月 30, 2014
作者:
H
hduffddybz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change code style
上级
5a7d40f8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
38 addition
and
42 deletion
+38
-42
components/net/lwip-head/src/arch/sys_arch.c
components/net/lwip-head/src/arch/sys_arch.c
+9
-16
components/net/lwip-head/src/lwipopts.h
components/net/lwip-head/src/lwipopts.h
+6
-5
components/net/lwip-head/src/netif/ethernetif.c
components/net/lwip-head/src/netif/ethernetif.c
+23
-21
未找到文件。
components/net/lwip-head/src/arch/sys_arch.c
浏览文件 @
838cdbe6
...
...
@@ -95,15 +95,16 @@ static void tcpip_init_done_callback(void *arg)
if
(
netif_default
==
RT_NULL
)
netif_set_default
(
ethif
->
netif
);
#ifdef LWIP_IPV6
ethif
->
netif
->
output_ip6
=
ethip6_output
;
netif_create_ip6_linklocal_address
(
ethif
->
netif
,
1
);
#ifdef LWIP_IPV6_AUTOCONFIG
ethif
->
netif
->
ip6_autoconfig_enabled
=
1
;
#endif
#ifdef LWIP_IPV6_MLD
ethif
->
netif
->
mld_mac_filter
=
NULL
;
#endif
ethif
->
netif
->
output_ip6
=
ethip6_output
;
netif_create_ip6_linklocal_address
(
ethif
->
netif
,
1
);
#ifdef LWIP_IPV6_AUTOCONFIG
ethif
->
netif
->
ip6_autoconfig_enabled
=
1
;
#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
;
...
...
components/net/lwip-head/src/lwipopts.h
浏览文件 @
838cdbe6
...
...
@@ -10,14 +10,15 @@
#define LWIP_NETCONN 1
#ifdef RT_LWIP_IPV6
#define LWIP_IPV6
1
#define LWIP_IPV6
1
//#define LWIP_IPV6_DHCP6 1
#define LWIP_ICMP6 1
#define LWIP_IPV6_NUM_ADDRESSES 3
#endif
#define LWIP_ICMP6 1
#define LWIP_IPV6_NUM_ADDRESSES 3
#ifdef RT_LWIP_IPV6_AUTOCONFIG
#define LWIP_IPV6_AUTOCONFIG 1
#define LWIP_IPV6_AUTOCONFIG 1
#endif
#endif
#ifdef RT_LWIP_IPV6_MLD
...
...
components/net/lwip-head/src/netif/ethernetif.c
浏览文件 @
838cdbe6
...
...
@@ -208,18 +208,18 @@ rt_err_t eth_device_init_with_flag(struct eth_device *dev, char *name, rt_uint8_
/* if tcp thread has been started up, we add this netif to the system */
if
(
rt_thread_find
(
"tcpip"
)
!=
RT_NULL
)
{
struct
ip_addr
ipaddr
,
netmask
,
gw
;
struct
ip_addr
ipaddr
,
netmask
,
gw
;
#if !LWIP_DHCP
IP4_ADDR
(
&
ipaddr
,
RT_LWIP_IPADDR0
,
RT_LWIP_IPADDR1
,
RT_LWIP_IPADDR2
,
RT_LWIP_IPADDR3
);
IP4_ADDR
(
&
ipaddr
,
RT_LWIP_IPADDR0
,
RT_LWIP_IPADDR1
,
RT_LWIP_IPADDR2
,
RT_LWIP_IPADDR3
);
IP4_ADDR
(
&
gw
,
RT_LWIP_GWADDR0
,
RT_LWIP_GWADDR1
,
RT_LWIP_GWADDR2
,
RT_LWIP_GWADDR3
);
IP4_ADDR
(
&
netmask
,
RT_LWIP_MSKADDR0
,
RT_LWIP_MSKADDR1
,
RT_LWIP_MSKADDR2
,
RT_LWIP_MSKADDR3
);
#else
IP4_ADDR
(
&
ipaddr
,
0
,
0
,
0
,
0
);
IP4_ADDR
(
&
gw
,
0
,
0
,
0
,
0
);
IP4_ADDR
(
&
netmask
,
0
,
0
,
0
,
0
);
IP4_ADDR
(
&
ipaddr
,
0
,
0
,
0
,
0
);
IP4_ADDR
(
&
gw
,
0
,
0
,
0
,
0
);
IP4_ADDR
(
&
netmask
,
0
,
0
,
0
,
0
);
#endif
netifapi_netif_add
(
netif
,
&
ipaddr
,
&
netmask
,
&
gw
,
dev
,
eth_netif_device_init
,
tcpip_input
);
netifapi_netif_add
(
netif
,
&
ipaddr
,
&
netmask
,
&
gw
,
dev
,
eth_netif_device_init
,
tcpip_input
);
}
return
RT_EOK
;
...
...
@@ -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,12 +516,12 @@ 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
)));
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
"
);
netif
=
netif
->
next
;
#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
;
}
#if LWIP_DNS
...
...
@@ -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
strcpy
(
local_ip_str
,
ip6addr_ntoa
((
ip6_addr_t
*
)
&
(
pcb
->
local_ip
)));
#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
strcpy
(
local_ip_str
,
ipaddr_ntoa
(
&
(
pcb
->
local_ip
)));
#ifndef LWIP_IPV6
strcpy
(
local_ip_str
,
ipaddr_ntoa
(
&
(
pcb
->
local_ip
)));
strcpy
(
remote_ip_str
,
ipaddr_ntoa
(
&
(
pcb
->
remote_ip
)));
#else
strcpy
(
local_ip_str
,
ip6addr_ntoa
((
ip6_addr_t
*
)
&
(
pcb
->
local_ip
)));
#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
++
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录