Discarding Packets from LAN programatically

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

Discarding Packets from LAN programatically

Post by suezkhan »

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
Qadri-409
Battalion Havaldaar Major
Posts: 286
Joined: Sun May 09, 2004 4:16 pm
Location: Peshawar
Contact:

Post by Qadri-409 »

M Shahzad Qadri
blackdaemon
Naik
Posts: 53
Joined: Wed Jan 04, 2006 3:51 pm
Location: Quetta, Pakistan
Contact:

Post by blackdaemon »

salam:

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:

http://www.linuxjournal.com/article/7184

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!
Post Reply