Skip to content
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

generic: add support for dumping policy #981

Merged
merged 1 commit into from
Jul 31, 2022

Conversation

jacob-keller
Copy link
Contributor

Add basic support for dumping the policy data that the kernel can report
via CTRL_CMD_GETPOLICY.

The current implementation for parsing the mappings is a bit awkward since
it relies on a list comprehension to fill in the nla_map used.

This is done because the kernel presents some of the sections with nested
NLA where the attribute number is actually an index or a command opcode,
rather than using an extra attribute. Ideally, the nla or nlmsg classes
would be expanded to support this kind of nested substructure.

Eventually we probably want to extract the policy data into more useful
structures. In particular, converting the command opcodes and attribute ids
into human readable names would be ideal.

Add a very basic example which simply dumps and prints the policy data for
the nlctrl netlink family.

Signed-off-by: Jacob Keller [email protected]

Add basic support for dumping the policy data that the kernel can report
via CTRL_CMD_GETPOLICY.

The current implementation for parsing the mappings is a bit awkward since
it relies on a list comprehension to fill in the nla_map used.

This is done because the kernel presents some of the sections with nested
NLA where the attribute number is actually an index or a command opcode,
rather than using an extra attribute. Ideally, the nla or nlmsg classes
would be expanded to support this kind of nested substructure.

Eventually we probably want to extract the policy data into more useful
structures. In particular, converting the command opcodes and attribute ids
into human readable names would be ideal.

Add a very basic example which simply dumps and prints the policy data for
the nlctrl netlink family.

Signed-off-by: Jacob Keller <[email protected]>
svinota added a commit that referenced this pull request Jul 31, 2022
+ implementation
+ docs
+ tests

Bug-Url: #980
Bug-Url: #981
@svinota svinota mentioned this pull request Jul 31, 2022
@svinota svinota merged commit 57d18b3 into svinota:master Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants