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

Add new methods to Map API #419

Merged
merged 2 commits into from Apr 6, 2024
Merged

Add new methods to Map API #419

merged 2 commits into from Apr 6, 2024

Conversation

geyslan
Copy link
Member

@geyslan geyslan commented Apr 5, 2024

This is a continuation of #411

See #411 (comment)

commit a769590

feat(map): make CalcMapValueSize a public helper

Signed-off-by: Geyslan Gregório <geyslan@gmail.com>

commit b9543a4

feat(map): Add GetNextKey and LookupAndDeleteElem

For BPFMapLow add the following wrapper methods:

GetNextKey() -> bpf_map_get_next_key()
LookupAndDeleteElem() -> bpf_map_lookup_and_delete_elem()
LookupAndDeleteElemFlags() -> bpf_map_lookup_and_delete_elem_flags()

In addition, introduce GetValueAndDeleteKey() and
GetValueAndDeleteKeyFlags() helper methods to BPFMapLow which return
a pre-allocated lookup value automatically.

For BPFMap add the following wrapper methods:

GetNextKey() -> bpf_map__get_next_key()
LookupAndDeleteElem() -> bpf_map__lookup_and_delete_elem()

As for BPFMapLow, introduce GetValueAndDeleteKey() and
GetValueAndDeleteKeyFlags() helper methods to BPFMap.

Signed-off-by: Tao Chen <chen.dylane@gmail.com>
Co-authored-by: Geyslan Gregório <geyslan@gmail.com>

hangrymuppet and others added 2 commits April 5, 2024 09:58
For BPFMapLow add the following wrapper methods:

GetNextKey() -> bpf_map_get_next_key()
LookupAndDeleteElem() -> bpf_map_lookup_and_delete_elem()
LookupAndDeleteElemFlags() -> bpf_map_lookup_and_delete_elem_flags()

In addition, introduce GetValueAndDeleteKey() and
GetValueAndDeleteKeyFlags() helper methods to BPFMapLow which return
a pre-allocated lookup value automatically.

For BPFMap add the following wrapper methods:

GetNextKey() -> bpf_map__get_next_key()
LookupAndDeleteElem() -> bpf_map__lookup_and_delete_elem()

As for BPFMapLow, introduce GetValueAndDeleteKey() and
GetValueAndDeleteKeyFlags() helper methods to BPFMap.

Signed-off-by: Tao Chen <chen.dylane@gmail.com>
Co-authored-by: Geyslan Gregório <geyslan@gmail.com>
Signed-off-by: Geyslan Gregório <geyslan@gmail.com>
@geyslan geyslan added the feature New feature or request label Apr 5, 2024
@geyslan geyslan self-assigned this Apr 5, 2024
@geyslan geyslan marked this pull request as ready for review April 5, 2024 13:05
@geyslan
Copy link
Member Author

geyslan commented Apr 5, 2024

@chentao-kernel would you mind reviewing this?

@chentao-kernel
Copy link
Contributor

@chentao-kernel would you mind reviewing this?

@geyslan Hi, geyslan, i reviewed this, LGTM.

@geyslan geyslan merged commit 7371781 into aquasecurity:main Apr 6, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants