一、主要特色
- 使用cmake重构了ping工具的源码工程,能够直接编译出最简单的ping工具。
- 目前工程结构比较清晰明了,易于阅读源码
二、主要目的
- 查看ping工具里面是如何绑定自身的特定端口进行通信的,内在原理是如何
- 想要通过模仿内在指定端口转发的功能,改写modbus的通讯库
三、转发试验
rk@localhost:~/pengzhikang$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.1.177 netmask 255.255.255.0 broadcast 10.0.1.255
inet6 fe80::b4f5:91c6:5928:a878 prefixlen 64 scopeid 0x20<link>
ether 6e:e8:43:36:6e:7c txqueuelen 1000 (Ethernet)
RX packets 135757 bytes 125066586 (125.0 MB)
RX errors 0 dropped 121 overruns 0 frame 0
TX packets 47791 bytes 4910035 (4.9 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 24
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 12396 bytes 3435542 (3.4 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12396 bytes 3435542 (3.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisi