Re: how does it pass in the rule sets

2014-04-21 Thread Andrey V. Elsukov
On 19.04.2014 11:45, bycn82 wrote:
 Hi,
 can someone help to explain how does the user land command `ipfw` pass
 the rule set into the hook function in the kernel? I assume that it must
 be hardcoded in somewhere, but I did not find it yet.

ipfw(8) uses raw socket and setsockopt(2)/getsockopt(2) functions to
interact with kernel. In particular, do_cmd() function from ipfw2.c does it.

-- 
WBR, Andrey V. Elsukov
___
freebsd-ipfw@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ipfw
To unsubscribe, send any mail to freebsd-ipfw-unsubscr...@freebsd.org


Re: how does it pass in the rule sets

2014-04-21 Thread bycn82

On 4/21/14 22:34, Andrey V. Elsukov wrote:

On 19.04.2014 11:45, bycn82 wrote:

Hi,
can someone help to explain how does the user land command `ipfw` pass
the rule set into the hook function in the kernel? I assume that it must
be hardcoded in somewhere, but I did not find it yet.

ipfw(8) uses raw socket and setsockopt(2)/getsockopt(2) functions to
interact with kernel. In particular, do_cmd() function from ipfw2.c does it.


Thanks very much,
Actually I saw the source already, the ipfw_ctl() method. I would like 
to call it as an event handler
But why it will triggered?  where are the code to register this method 
as listener?

Sorry for using Java terminologies ;)

___
freebsd-ipfw@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ipfw
To unsubscribe, send any mail to freebsd-ipfw-unsubscr...@freebsd.org


how does it pass in the rule sets

2014-04-19 Thread bycn82

Hi,
can someone help to explain how does the user land command `ipfw` pass 
the rule set into the hook function in the kernel? I assume that it must 
be hardcoded in somewhere, but I did not find it yet.


Best Regards
Bycn82
___
freebsd-ipfw@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ipfw
To unsubscribe, send any mail to freebsd-ipfw-unsubscr...@freebsd.org