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

Enum string API #372

Merged
merged 6 commits into from
Oct 26, 2023
Merged

Enum string API #372

merged 6 commits into from
Oct 26, 2023

Conversation

geyslan
Copy link
Member

@geyslan geyslan commented Aug 30, 2023

Context: #218

commit 9f3d56d (HEAD -> enum-string-api)

feat: introduce enum string api

This adds the Name() method to MapType, BPFAttachType and BPFProgType,
which relies on libbpf_bpf_map_type_str(), libbpf_bpf_attach_type_str()
and libbpf_bpf_prog_type_str() respectively.

commit eb4b613

chore(prog): add BPFAttachType string API

commit 424283a

chore: assign constants with C enum values

This avoids wrong values if changes happen.

commit cd3df8d

chore(prog): instantiate bpfProgTypeToString

This avoids the need to instantiate the map in every call to
BPFProgType.String().

commit bc215c4

chore(prog): deprecate BPFProgType.Value()

commit 5e4fbbb

fix(map): return unspecified for unknown type

@geyslan geyslan added feature New feature or request chore labels Aug 30, 2023
@geyslan geyslan self-assigned this Aug 30, 2023
@geyslan geyslan mentioned this pull request Aug 30, 2023
4 tasks
@geyslan geyslan requested a review from rafaeldtinoco August 31, 2023 23:18
This avoids the need to instantiate the map in every call to
BPFProgType.String().
This avoids wrong values if changes happen.
This adds the Name() method to MapType, BPFAttachType and BPFProgType,
which relies on libbpf_bpf_map_type_str(), libbpf_bpf_attach_type_str()
and libbpf_bpf_prog_type_str() respectively.
@geyslan geyslan merged commit eea4a28 into aquasecurity:main Oct 26, 2023
13 checks passed
@geyslan geyslan deleted the enum-string-api branch November 28, 2023 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant