is this documented?  :)

any code examples?


-Nigel


On Thu, 7 Mar 2002, Schmidt, James wrote:

> Just taking a stab at this...  Sorry if I'm not right, as I've just recently
> started hacking at netfilter myself.
> 
> ipt_entry is the struct for the new rule you're trying to add.  it's a beast
> of struct that you create based on the rule parameters that you parsed out
> of the command line.
> 
> If you want to get down into the guts of it, create your whole table first
> and call the proper setsockopt() to write the table to the kernel.  this
> would save you from having to make many calls to iptables.  I think there's
> two that you would have to call, one to replace the existing kernel table,
> another to write the counters for the table.  Looking deeply into the
> iptables-restore code might give you some clues.
> 
> James
> 
> 
> 
> -----Original Message-----
> From: Nigel Kukard [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 07, 2002 2:39 AM
> To: Netfilter Development List
> Subject: inserting an entry into a table
> 
> 
> Hi,
> 
> ok, i've tried this out myself for 2 weeks now... i would like to
> insert very simple rules into an chain like this...
> 
> iptables -A a_test_chain -s ..... -d ..... -j RETURN
> 
> i've written a small C program which creates the chains, but how
> to add an entry is getting to me, i first tried   do_command, but
> for some very strange reason it segfaults, i've been having very
> many problems with malloc & strdup... unsure why though, if you use
> them alot in this program they segfault... anyway.
> 
> i was thinking of using  iptc_append_entry, and was wondering what
> the second argument (ipt_entry) means and how to give it a correct
> value.
> 
> is there any easier way to do this? (i want to create about 10,000
> rules... don't ask why, and yes the server is powerfull enough)  :)
> 
> 
> Regards
> 
> 

-- 
Nigel Kukard   (General Manager)
Lando Technologies Africa (Pty) Ltd
[EMAIL PROTECTED]   www.lando.co.za
Tel: 083 399 5822  Fax: 086 1100036
3 Parc Du Cap, Bellville, Cape Town
National Internet Service Provider

=====================================================================

Disclaimer
----------
The contents of this message and any attachments are intended 
solely for the addressee's use and may be legally privileged and/or 
confidential information. This message may not be retained, 
distributed, copied or used if you are not he addressee of this 
message. If this message was sent to you in error, please notify 
the sender immediately by reply e-mail and then destroy the message 
and any copies thereof.

Opinions, conclusions and other information in this message may be 
personal to the sender and is not that of Lando Technologies Africa 
or any of it's subsideries, associated companies or principals and 
is therefore not endorsed by any of the Lando groups of companies. 
Due to e-maill communication being insecure, Lando groups of 
companies do not guarantee confidentiality, security, accuracy or  
performance of the e-mail. Any liability for viruses is excluded 
to the fullest extent.


Reply via email to