I am writing code for finding source address of packets, so that i discard them if the ipaddress is not a valid one. For this, i think i have to make a raw socket and continuously sniff the network. Now, if any packet arrives, how to catch the packet and retrieves information from its header.
Please help me with a proper solution.
Thanks in advance.:)