Hi,
I'm creating a personal app for network filtering using C. I already know that you can log and analyze a downloaded packet's info using this code:
Code:
tcpPacket = recvfrom(raw_socket , buffer , 65536 , 0 , &serverAddress , &serverAddressSize);
but this requires that the tcp packet be downloaded first. What I need is that the filter will be acted out even before it is downloaded, let's say it examines the source IP and based on that, it either accepts or rejects it.
Note: Yes I am aware of iptables, but I do not want to use it because I want to learn how to do it using raw sockets.
Thanks