Skip to contentSkip to conversation

maintaining per rule counters

DISCUSSION [email protected] 2 participants 2 messages Apr 10, 2003 – Apr 13, 2003 netfilter

lore
Share & tools
lore
#0 lore raw

Hi I'm afraid I can't subscribe to the mailing list at present?

Anyway I have a fairly simple requirement to maintain per rule packet & byte counts that are timestamped and sent to userspace every 1ms (packet clocked).

My question is where is the best place to store the 1ms of counters. Can I create a target module and put the data in the *targinfo I.E. is targinfo global to the target module or per rule. The ideal would be if it was dynamically allocated per rule and was just big enough for my counters+timestamp. What determines the size?

cheers,
Pádraig.

#1 lore raw
Quoted 9 lines · On Thu, Apr 10, 2003 at 04:02:42PM +0100, [email protected] wrote:

Hi I'm afraid I can't subscribe to the mailing list at present?

Anyway I have a fairly simple requirement to maintain per rule packet & byte counts that are timestamped and sent to userspace every 1ms (packet clocked).

My question is where is the best place to store the 1ms of counters. Can I create a target module and put the data in the *targinfo I.E. is targinfo global to the target module or per rule.

it is per rule. if you want something global, you need to dynamically allocate some private memory at module load time (or rule load time).

Quoted 3 lines

The ideal would be if it was dynamically allocated per rule and was just big enough for my counters+timestamp. What determines the size?

it is not dynamically allocated per rule, but once allocated per rule in which it is used.

Quoted 2 lines

cheers,
Pádraig.

Signature · 5 lines
- Harald Welte <[email protected]>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie