1** icmpecho
2reply every ping command.
3
4to try it:
51. make
62. sudo ./icmpecho
73. in another window, set ip of tun0 device.
8   sudo ifconfig tun0 192.168.0.1/24
9   or
10   sudo ifconfig tun0 10.0.0.1/24
114. ping 192.168.0.2
12   or
13   ping 192.168.0.3
14   or
15   ping 192.168.0.4
16   or
17   ping 192.168.0.254
18
19** rejectall
20reject all tcp connections.
21
22to try it:
231. make
242. sudo ./rejectall
253. in another window, set ip of tun0 device.
26   sudo ifconfig tun0 192.168.0.1/24
27   or
28   sudo ifconfig tun0 10.0.0.1/24
294. nc 192.168.0.2 1000
30   or
31   nc 192.168.0.3 1000
32   or
33   nc 192.168.0.3 4000
34
35** acceptall
36accept all tcp connections.
37
38to try it:
391. make
402. sudo ./acceptall
413. in another window, set ip of tun0 device.
42   sudo ifconfig tun0 192.168.0.1/24
43   or
44   sudo ifconfig tun0 10.0.0.1/24
454. nc 192.168.0.2 1000
46   or
47   nc 192.168.0.3 1000
48   or
49   nc 192.168.0.3 4000
50
51** discardall
52accept all tcp connections, and discard all incoming data.
53
54to try it:
551. make
562. sudo ./discardall
573. in another window, set ip of tun0 device.
58   sudo ifconfig tun0 192.168.0.1/24
59   or
60   sudo ifconfig tun0 10.0.0.1/24
614. nc 192.168.0.2 1000
62   or
63   nc 192.168.0.3 1000
64   or
65   nc 192.168.0.3 4000
66
67** connectmany
68connect to ip:port for many times concurrently.
69
70to try it:
711. make
722. sudo ./connectmany 192.168.0.1 2007 1000
733. in another window, set ip of tun0 device.
74   sudo ifconfig tun0 192.168.0.1/24
754. start a concurrent tcp server which listens port 2007
76   eg. muduo/examples/simple/echo
775. hit ENTER in 1st window, start connecting
78