how to test run nfqnl_test.c

two shells :

Shell 1
1. sudo iptables -A OUTPUT -p icmp -j NFQUEUE --queue-num 0
# this create a queue and rediect icmp to this queue
2. ping www.cceye.com
# this create icmp traffic , note at this stage, all ICMP traffic are blocked, since no queue consumer process.

Shell 2
3, let the ping continue run, and in new shell, run nfqnl_test,

./nfqnl_test
opening library handle
unbinding existing nf_queue handler for AF_INET (if any)
binding nfnetlink_queue as nf_queue handler for AF_INET
binding this socket to queue ‘0’
setting copy_packet mode
pkt received
hw_protocol=0x0800 hook=3 id=1 outdev=3 payload_len=84
entering callback
pkt received
hw_protocol=0x0800 hook=3 id=2 outdev=3 payload_len=84
entering callback
pkt received
hw_protocol=0x0800 hook=3 id=3 outdev=3 payload_len=84
entering callback
pkt received
hw_protocol=0x0800 hook=3 id=4 outdev=3 payload_len=84
entering callback
pkt received
hw_protocol=0x0800 hook=3 id=5 outdev=3 payload_len=84
entering callback