Skip to content

Commit 86cb113

Browse files
committed
modify test code
1 parent 70b1c5f commit 86cb113

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

README.md

100644100755
Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,18 @@ userspace netstack basic freebsd
99
默认的ARCH为x86_64,需要修改可以更改lib/machine_include/machine
1010

1111
运行方法:
12-
example/helloworld -i eth0
12+
./example/helloworld -i ens38
1313

14-
eth0为本机的物理接口名
14+
ens38为本机的物理接口名
15+
16+
接口要设置为混杂模式,ifconfig ens38 promisc
17+
18+
配置文件在config.ini,可以修改接口ip等参数
19+
20+
测试代码在example/main.c,已完成UDP,TCP,socket,select测试
21+
22+
23+
默认测试方法:直接通过浏览器访问配置文件的ip地址
24+
25+
测试环境:ubuntu18.4
1526

16-
测试代码在example/main.c

uinet/config.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ port_list=0
3939
# Port config section
4040
# Correspond to dpdk.port_list's index: port0, port1...
4141
[port0]
42-
addr=192.168.208.128
42+
addr=192.168.63.139
4343
netmask=255.255.255.0
44-
broadcast=192.168.208.255
45-
gateway=192.168.208.2
44+
broadcast=192.168.63.255
45+
gateway=192.168.63.2
4646
mac=00:11:22:33:44:55
4747

4848
# lcore list used to handle this port

uinet/example/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ int main(int argc, char * argv[])
15001500

15011501
#endif
15021502

1503-
#if 1 /*af_unix tcp*/
1503+
#if 0 /*af_unix tcp*/
15041504
sleep(2);
15051505
pthread_create(&pid, NULL,unix_tcp_server_test, NULL);
15061506

@@ -1536,7 +1536,7 @@ int main(int argc, char * argv[])
15361536
usp_pthread_create("ipv6_udp_client",&pid, NULL,ipv6_udp_client_test, NULL);
15371537
#endif
15381538

1539-
#if 0
1539+
#if 1
15401540
sleep(2);
15411541
usp_pthread_create("tcp_web",&pid, NULL,tcp_web_test, NULL);
15421542
#endif

0 commit comments

Comments
 (0)