Re: [libipset] How to read packet counter of a single item?

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

 



Hi,

On Fri, 13 Oct 2023, U.Mutlu wrote:

> 1) Which libipset function can be used for getting
> the packet counter value of a single entry in the set/list?
> 
> Using the function ipset_parse_line(ips, line) I can issue most of the 
> ipset functions, but I need also a method for getting the packet counter 
> for just a single item only, ie. not the output of all items as "ipset 
> save" does. I need to do this in C/C++ (hence libipset in Linux), ie. 
> not in script.

There is no such functionality in ipset. You can test the existence of an 
element in a set or list/save all of them with all of the attached 
attributes.

> 2) man ipset says
> "test SETNAME TEST-ENTRY [ TEST-OPTIONS ]
>    Test whether an entry is in a set or not. Exit status number is zero if the
> tested entry is in the set and nonzero if it is missing from the set."
> 
> But the TEST-OPTIONS are not further described or documented.
> What test options are possible?

There's a single one in the case of list:set: to test the element before 
or after a reference one.

Best regards,
Jozsef
-- 
E-mail  : kadlec@xxxxxxxxxxxxxxxxx, kadlecsik.jozsef@xxxxxxxxx
PGP key : https://wigner.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics
          H-1525 Budapest 114, POB. 49, Hungary



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux