<html>
<head>
<base href="https://bugzilla.netfilter.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - counter flag proposal for sets and maps"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1185#c6">Comment # 6</a>
on <a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - counter flag proposal for sets and maps"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1185">bug 1185</a>
from <span class="vcard"><a class="email" href="mailto:pablo@netfilter.org" title="Pablo Neira Ayuso <pablo@netfilter.org>"> <span class="fn">Pablo Neira Ayuso</span></a>
</span></b>
<pre>(In reply to Karel Rericha from <a href="show_bug.cgi?id=1185#c5">comment #5</a>)
<span class="quote">> (In reply to Pablo Neira Ayuso from <a href="show_bug.cgi?id=1185#c4">comment #4</a>)
> > (In reply to Karel Rericha from <a href="show_bug.cgi?id=1185#c3">comment #3</a>)
> > > Actually on second thought I just want to know, how many times set or map
> > > element was hit.
> >
> > I see. So it would be a global counter for this set/map that updated if an
> > element lookup succeeds.
> >
> > Right?
>
> No, separate counter for each element. Definition could look like:
>
> table x {
> chain y {
> ...
> set s {
> type ipv4_addr . type ipv4_addr; flags counter;
> }
>
> map m {
> type inet_service : ipv4_addr; flags counter;
> }
> }
> }</span >
OK, we can do this via anonymous stateful objects, needs to be implemented.
We can also support it with maps like this, proposed syntax (please suggest any
better if you like):
map m {
type inet_service : ipv4_addr, counter;
}
Where the counter is an anonymous stateful object.
Semantics would be:
1) Look up for inet_service key.
2) If found, bump counter and then fetch ipv4_addr in the mapping.
Let me know.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>