0
votes

I want to intercept network traffic from user space , so I have used libpcap API s to capture tcp/ip packets . Right now I am just capturing information about the packet header & payload in the registered callback . How can I use this callback to block traffic or drop a packet based on certain conditions ? Or is pcap mechanism is purely a capture mechanism ?

1

1 Answers

0
votes

You can't. As you said in your own question libpcap can only be used to inspect traffic passing through a network interface, it can't be used to affect this traffic in any way.