Re: [PATCH 3/8] conntrack: accept parameters from stdin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mikhail,

On Fri, Sep 25, 2020 at 02:49:14PM +0200, Mikhail Sennikovsky wrote:
> This commit allows accepting multiple sets of ct entry-related
> parameters on stdin.
> This is useful when one needs to add/update/delete a large
> set of ct entries with a single conntrack tool invocation.
> 
> Expected syntax is "conntrack [-I|-D|-U] [table] -".
> When invoked like that, conntrack expects ct entry parameters
> to be passed to the stdin, each line presenting a separate parameter
> set.

We have to follow a slightly different approach.

For the batch mode, we have to do similar to iptables, see
do_parse() there.

This parser will create a list of command objects, something like:

struct ct_cmd {
        struct list_head        list;
        ...
        /* attributes that result from parser that describe this command */
};

Once we have the list of commands, iterate over this list of commands
and send the netlink commands.

Thanks.



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux