From: Jesper Dangaard Brouer <hawk@diku.dk>
To: James Nurmi <jdnurmi@qwe.cc>
Cc: Netfilter Developers <netfilter-devel@vger.kernel.org>
Subject: Re: IPTables API (redux)
Date: Tue, 14 Dec 2010 15:41:12 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.64.1012141534090.9787@ask.diku.dk> (raw)
In-Reply-To: <AANLkTinphM_EPoFVWm63qXEpvFZzUuMjrOVyMx7S-ArW@mail.gmail.com>
On Sat, 11 Dec 2010, James Nurmi wrote:
> I realize this has come up a few times, but I'd like to
> programmatically be able to query and modify IPTables rules, without
> shelling out.
>
> After digging, it would seem theres been some discussion around this
> issue, but I was unable to find any resolution.
I have created a Perl CPAN module named IPTables::libiptc, for doing
iptables manipulation directly from Perl.
The only problem with this Perl module is I have not had time to update it
to use the newer libiptc API introduced (by Jan) in 1.4.3. Thus, its only
compatible below version 1.4.3.
> For curiosities sake, I did a bit of reverse engineering and
> discovered that the functionality I'm interested in appears to be
> handled through set/getsockopt and requires a large amount of handling
> for both COMPAT and not COMPAT kernel compilations, leading to
> structures potentially being packed differently on the way in then on
> the way out, so a "trivial" implementation was just out as far as I
> could tell.
You should use the libiptc for parsing the "blob".
Cheers,
Jesper Brouer
--
-------------------------------------------------------------------
MSc. Master of Computer Science
Dept. of Computer Science, University of Copenhagen
Author of http://www.adsl-optimizer.dk
-------------------------------------------------------------------
prev parent reply other threads:[~2010-12-14 14:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-11 23:42 IPTables API (redux) James Nurmi
2010-12-12 4:17 ` Jan Engelhardt
2010-12-14 14:41 ` Jesper Dangaard Brouer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.1012141534090.9787@ask.diku.dk \
--to=hawk@diku.dk \
--cc=jdnurmi@qwe.cc \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).