Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-13-2003, 09:59 AM
|
#1
|
|
LQ Newbie
Registered: Apr 2003
Posts: 17
Rep:
|
dropping packets ?
Hi Community,
following situation:
there is a gateway between my LAN and the Internet, and now the programming part starts. :-)
I want to write a packetsniffer sitting on my Gateway. (shouldn't be the problem). The sniffer should have the opportunity to filter out disliked packets compared with a small rulebase. Wrong dest-address or whatever ...
Does anyone of you knows a way to drop these packets out of a given stream, so they dont reach their acutal destinations ?
I have read about BPF and the IPtables headers, but i havent found usefull documents :-(
edit: i forgot to say ... the programm should run in the userspace. // prefered language is C
Thanks in advance,
h.d.
Last edited by jb_li; 04-13-2003 at 10:02 AM.
|
|
|
|
04-13-2003, 03:04 PM
|
#2
|
|
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,903
|
Why re-invent the wheel?
IPTables does a pretty good job,
all you need is to make a set of rules?
And if you really want to program your own
filter, don't start out trying to understand
IPTables, rather grab a TCP/IP programming
primer ;) and start from scratch.
Just my 2 cents.
Cheers,
TInk
|
|
|
|
04-13-2003, 04:13 PM
|
#3
|
|
LQ Newbie
Registered: Apr 2003
Posts: 17
Original Poster
Rep:
|
acutally my program should be a content-filter for http ... i don't think it is possible to set such rules with iptables.
i just want to run the sniffer, filtering the payload. This filter decide, whether there should be a full connection to the target host or not.
Maybe i can use iptables for dropping packets during the runtime ?!
If I would use just iptables doing this job, there is no dynamic effect. I dont have a real rulebase.
|
|
|
|
04-13-2003, 04:28 PM
|
#4
|
|
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,903
|
Now that sounds like a job for squid &
squid-guard or DanskGuardian :}
Cheers,
Tink
|
|
|
|
04-13-2003, 04:34 PM
|
#5
|
|
Moderator
Registered: May 2001
Posts: 24,827
|
Maybe you should give an example of the payload (or classification) you want to filter for before I offer Snort as another alternative.
|
|
|
|
04-13-2003, 05:37 PM
|
#6
|
|
LQ Newbie
Registered: Apr 2003
Posts: 17
Original Poster
Rep:
|
How does Squid or Snort drop these packets ...?
Actually i want to write my own filter... :-)
|
|
|
|
04-14-2003, 11:18 AM
|
#8
|
|
LQ Newbie
Registered: Apr 2003
Posts: 17
Original Poster
Rep:
|
Thank you .. I will try it tonight
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:39 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|