-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow fetching rules and counters via bfcli #151
Comments
Some thoughts on this:
|
Tommy Unger is working on adding get-counters functionality as part of his ramp-up! |
I have a few noob questions here. I'm currently working on
Hope these questions even make sense. I'm only beginning to understand this (very cool) system! |
I think I've more or less resolved 2 above. I'm currently working on reading a value out of an existing map. I see Perhaps it: 1) only lives there transiently, 2) is never actually created, or 3) I need to enable some configuration to show these files. Currently puzzling on that, will report back if I get to the bottom of it. |
One issue I see with It would make more sense to start with a high-level command to fetch the whole ruleset (including the counters), i.e.:
A modified version of
Following the example above,
You're right, this new command should be supported specifically for
You would have to modify the arguments' parser, not the Bison parser to support subparser with argp. Currently,
I see you started working on this, and I'm changing the requirements and expectations on the fly, sorry about that :/
When creating a map, Regarding this task, it's better if |
UPDATE EDIT: I have since found I have a question about the marshaled data with which the daemon responds to the CLI. Is there a preference for returning a list of chains over, say, a cgen (or ctx for that matter)? Only asking because it seems the former will require writing new marshaling/unmarshaling code while it is already done for the latter. Thanks! |
I'm not quite there yet, but an issue I see coming for If I have that right, It might take extra work to marshal them into the daemon's response. Or perhaps |
That's right, it should help to serialise a whole list at once.
You're right. But that's fine by me, the chains are static, but the counters are dynamic. Then,
|
bpfilter daemon keeps a list of active rules and it also writes counters to BPF maps. Sure, we can access the rules/counters via bpftool - counter maps are named bf_cmap_XXX - but it is more convenient to use an API.
To do this, we need to implement the BF_REQ_GET_RULES and BF_REQ_GET_RULES APIs in bpfilter backend and fetch the results via bfcli.
bfcli API could look like (where chain/rule are optional):
Note
bfcli
would need to introduce subcommands asbfcli
is only used for setting rules now.The text was updated successfully, but these errors were encountered: