I have written a small sample code to get you started. You can download it here. to compile the code: gcc code.c -lpcap
and then execute the output file as: sudo ./a.out
Here is a code which generates an ICMP packet, you should follow the structure given in this code. Compile and run the code as mentioned above.
and then execute the output file as: sudo ./a.out
Here is a code which generates an ICMP packet, you should follow the structure given in this code. Compile and run the code as mentioned above.