Good day, George,

On Thu, 2 May 2002, Glover George wrote:

> > > Is there anyway to do this.  I would like from a userspace 
> > program to 
> > > ask netfilter two different things.
> > > 
> > > 1).  What is the policy on a give chain.  I want to ask 
> > netfilter is 
> > > their Forward policy DROP or ACCEPT or whatever.  Can I do 
> > this from 
> > > userspace, and how.
> > 
> > iptables -L -n -x -v | grep '^Chain INPUT' | sed -e 
> > 's/.*policy //' -e 's/ .*//'
> >     repeat for the FORWARD and OUTPUT.
> >     Cheers,
> >     - Bill
> > 
> 
> Haha!!!  Yeah, but how do I do that from a c++ program and grab the
> output of that command?  Ideally, I was wondering if I could just
> include a .h file from netfilter and use a function call.  I take it
> there is no userspace api for netfilter?

        I would assume that since C++ is a superset of C that you could 
use system()?
        /me ducks. :-)
        Cheers,
        - Bill

---------------------------------------------------------------------------
        "Fear leads to anger. Anger leads to hate. Hate leads to using
Windows NT for mission-critical applications."  (What Yoda *meant* to
say)
        -- Devin L. Ganger
(Courtesy of James Wilkinson <[EMAIL PROTECTED]>)
--------------------------------------------------------------------------
William Stearns ([EMAIL PROTECTED]).  Mason, Buildkernel, named2hosts, 
and ipfwadm2ipchains are at:                        http://www.stearns.org
--------------------------------------------------------------------------



Reply via email to