> > 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?