LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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


Reply
  Search this Thread
Old 03-26-2007, 10:58 PM   #1
yiux
LQ Newbie
 
Registered: Jan 2007
Location: Mauritius
Distribution: Debian 4.0R0
Posts: 11

Rep: Reputation: 0
Getting information from Netfilter


I want to build a c program to enable me to interact with Netfilter directly without using iptables.

Is is possible to get details such as chains available, the rules set with their specific details (source, destination, protocol ...) by using a system call or any function.
 
Old 03-28-2007, 08:51 AM   #2
slzckboy
Member
 
Registered: May 2005
Location: uk - Reading
Distribution: slackware 14.2 kernel 4.19.43
Posts: 462

Rep: Reputation: 30
try this...

I havn't used it yet but It might suit your needs..

http://www.netfilter.org/projects/li...log/index.html
 
Old 03-28-2007, 12:02 PM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Since iptables is simply a userland application that interacts with the kernel, you should be able to locate the source code for iptables, and from that, divine what system calls it is using to manipulate the kernel and related data structures. There may even be a documented API for this, and I would guess it would be referenced somewhere with the iptables package.

--- rod.
 
Old 03-28-2007, 12:21 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Okay, I just did a little browsing, since this question piqued my interest somewhat. There is the document http://www.netfilter.org/documentati...OWTO.html#toc4 which describes what you are after, AFAICT.
--- rod.
 
Old 03-29-2007, 12:11 AM   #5
yiux
LQ Newbie
 
Registered: Jan 2007
Location: Mauritius
Distribution: Debian 4.0R0
Posts: 11

Original Poster
Rep: Reputation: 0
thx rod, this how to seems to suit my needs. I have had a look a it, and there are many things missing. It seems like module programming.

Well this will do to get started.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
netfilter and dmesg MarcusMoeller Linux - Networking 6 01-20-2007 02:51 AM
Hiding machine information and root information geletine Linux - Security 6 07-14-2006 07:57 AM
Netfilter and 2.6.16.2 krizzz Slackware 8 04-13-2006 10:17 PM
Netfilter / IPtables SWAT Linux - Newbie 3 11-11-2003 09:04 AM
IPCHAINS or NETFILTER? cottonmouth Linux - Networking 1 11-18-2002 03:54 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration