Re: [nf-next] netfilter: acct: add support to accounters in nftables

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

 



On 12.01, Pablo Neira Ayuso wrote:
> On Mon, Jan 12, 2015 at 11:45:39AM +0000, Patrick McHardy wrote:
> > On 12.01, Pablo Neira Ayuso wrote:
> > > > +/**
> > > > + * struct nft_acct - nf_tables acct instance
> > > > + *
> > > > + * @list: table acct list node
> > > > + * @name: name of the acct
> > > > + * @pkts:  number of packets
> > > > + * @bytes:  number of bytes
> > > > + * use: number of rule references to this acct
> > > > + */
> > > > +struct nft_acct {
> > > > +	struct list_head	list;
> > > > +	char                    name[NFT_ACCT_MAXNAMELEN];
> > > 
> > > NFT_ACCT_MAXNAMELEN needs to be limited to 16 bytes, so we can easily
> > > use acct objects from mappings.
> > 
> > Not saying that we need more than 16 bytes, but we'd hopefully use
> > references instead of runtime resolved lookups in mappings :)
> 
> I just noticed Ana have to replace NFTA_ACCT_EXPR_NAME by
> NFTA_ACCT_EXPR_SREG to support mappings.
> 
> What's your idea behind the references? Use some unique id to identify
> the object instead of the name?

Similar to verdicts we'd include another data type which refers to
accounting objects. Those are resolved when the data is created and
we'd return them from the map lookup. Resolving can use the name,
just as we do for chains.

At runtime the map would either load the reference to a register and
pass it to the counter expression (might need a special register
similar to NFT_REG_VERDICT) or we just add a special type of the
counter expression that invokes the lookup itself.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux