OSDN Git Service

libbpf: Implement basic zip archive parsing support
authorDaniel Müller <deso@posteo.net>
Wed, 1 Mar 2023 21:23:06 +0000 (21:23 +0000)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 2 Mar 2023 00:05:34 +0000 (16:05 -0800)
commit1eebcb60633fd469ee27b0fbd7ee4f271feedeca
tree9f50282acac2b874e4ff5adba2d1ecef2e05cc8a
parentdb52b587c67f40e4bd6e8167f2334d4500617bdc
libbpf: Implement basic zip archive parsing support

This change implements support for reading zip archives, including
opening an archive, finding an entry based on its path and name in it,
and closing it.
The code was copied from https://github.com/iovisor/bcc/pull/4440, which
implements similar functionality for bcc. The author confirmed that he
is fine with this usage and the corresponding relicensing. I adjusted it
to adhere to libbpf coding standards.

Signed-off-by: Daniel Müller <deso@posteo.net>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Michał Gregorczyk <michalgr@meta.com>
Link: https://lore.kernel.org/bpf/20230301212308.1839139-2-deso@posteo.net
tools/lib/bpf/Build
tools/lib/bpf/zip.c [new file with mode: 0644]
tools/lib/bpf/zip.h [new file with mode: 0644]