I want to capture packets wh开发者_C百科oes has a special target ip, then forward these packets by UDP. Does Ruby can do this ? thanks
Packet, you mean? If you want see packets in userspace, not kernel-level then you can use several ways.
- libpcap: libpcap is packet capture library used in tcpdump/wireshark
- libipq: iptables packet queueing library. http://rubyipq.rubyforge.org/ for libipq, there is also ruby binding but it doesn't seems to be in activated. Actually libipq is deprecated by libnetfilter_queue
You can make ruby binding of libnetfilter_queue.
精彩评论