Discarding Packets from LAN programatically

Discussion of programming on Linux, including shell scripting, perl, python, c/c++, mono, java. Whatever tickles your fancy.
Posts: 1
Joined: Wed Feb 15, 2006 12:07 pm
Location: Abbottabad

Discarding Packets from LAN programatically

Postby suezkhan » Wed Feb 15, 2006 12:15 pm

somebody plz let me know how i can stop or discard a packet over LAN using C. i mean is there any liberary or Header file which should i use in order to discard suppose SYN packets not to reach a specific application.
actually i am working on a firewall type application which would discard either TCP or othere packets on the basis of a policy. so is there any way out here to deal such situation..
God Bless You

Battalion Havaldaar Major
Posts: 286
Joined: Sun May 09, 2004 4:16 pm
Location: Peshawar

Postby Qadri-409 » Wed Feb 15, 2006 2:02 pm

M Shahzad Qadri

Posts: 53
Joined: Wed Jan 04, 2006 3:51 pm
Location: Quetta, Pakistan

Postby blackdaemon » Thu Feb 16, 2006 12:13 pm


work on netfilters library, its same library as used by iptables!. provides you all the functionalities with its hooks placed at all major nodes of the network stack. Kindly refer to following link:


yes ofcourse you'll need to write your module/driver for it, trustme its not as hard as it sounds especially after reading this >> www.tldp.org/LDP/lkmpg/2.4/lkmpg.pdf

Finally you'l get tremendous resources at www.kernelnewbies.org it really helped me out & im sure you'l benefit equally from it.
I think, therefore i am!

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest