1
0
mirror of https://github.com/systemd/systemd synced 2024-07-01 07:34:28 +00:00

basic/dlfcn-util: deobfuscate macro definitions

When looking at how dlopen for various libs is implemented, I found that the
macros hide too much. I find it much easier to see what is going on if 'extern'
and '= NULL' are written explicitly. After all, we don't hide those for other
definitions, e.g. our style guide says that static variables should be
initialized with '= NULL'. With that change, it's much more obvious what is
a variable declaration and what is a variable initialization.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2024-05-21 14:10:26 +02:00
parent 726fc7ae69
commit 5c672e90a6
31 changed files with 619 additions and 621 deletions

View File

@ -31,20 +31,20 @@
#if HAVE_LZ4
static void *lz4_dl = NULL;
static DLSYM_FUNCTION(LZ4F_compressBegin);
static DLSYM_FUNCTION(LZ4F_compressBound);
static DLSYM_FUNCTION(LZ4F_compressEnd);
static DLSYM_FUNCTION(LZ4F_compressUpdate);
static DLSYM_FUNCTION(LZ4F_createCompressionContext);
static DLSYM_FUNCTION(LZ4F_createDecompressionContext);
static DLSYM_FUNCTION(LZ4F_decompress);
static DLSYM_FUNCTION(LZ4F_freeCompressionContext);
static DLSYM_FUNCTION(LZ4F_freeDecompressionContext);
static DLSYM_FUNCTION(LZ4F_isError);
DLSYM_FUNCTION(LZ4_compress_default);
DLSYM_FUNCTION(LZ4_decompress_safe);
DLSYM_FUNCTION(LZ4_decompress_safe_partial);
DLSYM_FUNCTION(LZ4_versionNumber);
static DLSYM_PROTOTYPE(LZ4F_compressBegin) = NULL;
static DLSYM_PROTOTYPE(LZ4F_compressBound) = NULL;
static DLSYM_PROTOTYPE(LZ4F_compressEnd) = NULL;
static DLSYM_PROTOTYPE(LZ4F_compressUpdate) = NULL;
static DLSYM_PROTOTYPE(LZ4F_createCompressionContext) = NULL;
static DLSYM_PROTOTYPE(LZ4F_createDecompressionContext) = NULL;
static DLSYM_PROTOTYPE(LZ4F_decompress) = NULL;
static DLSYM_PROTOTYPE(LZ4F_freeCompressionContext) = NULL;
static DLSYM_PROTOTYPE(LZ4F_freeDecompressionContext) = NULL;
static DLSYM_PROTOTYPE(LZ4F_isError) = NULL;
DLSYM_PROTOTYPE(LZ4_compress_default) = NULL;
DLSYM_PROTOTYPE(LZ4_decompress_safe) = NULL;
DLSYM_PROTOTYPE(LZ4_decompress_safe_partial) = NULL;
DLSYM_PROTOTYPE(LZ4_versionNumber) = NULL;
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(LZ4F_compressionContext_t, sym_LZ4F_freeCompressionContext, NULL);
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(LZ4F_decompressionContext_t, sym_LZ4F_freeDecompressionContext, NULL);
@ -53,22 +53,22 @@ DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(LZ4F_decompressionContext_t, sym_LZ4F_freeDecom
#if HAVE_ZSTD
static void *zstd_dl = NULL;
static DLSYM_FUNCTION(ZSTD_CCtx_setParameter);
static DLSYM_FUNCTION(ZSTD_compress);
static DLSYM_FUNCTION(ZSTD_compressStream2);
static DLSYM_FUNCTION(ZSTD_createCCtx);
static DLSYM_FUNCTION(ZSTD_createDCtx);
static DLSYM_FUNCTION(ZSTD_CStreamInSize);
static DLSYM_FUNCTION(ZSTD_CStreamOutSize);
static DLSYM_FUNCTION(ZSTD_decompressStream);
static DLSYM_FUNCTION(ZSTD_DStreamInSize);
static DLSYM_FUNCTION(ZSTD_DStreamOutSize);
static DLSYM_FUNCTION(ZSTD_freeCCtx);
static DLSYM_FUNCTION(ZSTD_freeDCtx);
static DLSYM_FUNCTION(ZSTD_getErrorCode);
static DLSYM_FUNCTION(ZSTD_getErrorName);
static DLSYM_FUNCTION(ZSTD_getFrameContentSize);
static DLSYM_FUNCTION(ZSTD_isError);
static DLSYM_PROTOTYPE(ZSTD_CCtx_setParameter) = NULL;
static DLSYM_PROTOTYPE(ZSTD_compress) = NULL;
static DLSYM_PROTOTYPE(ZSTD_compressStream2) = NULL;
static DLSYM_PROTOTYPE(ZSTD_createCCtx) = NULL;
static DLSYM_PROTOTYPE(ZSTD_createDCtx) = NULL;
static DLSYM_PROTOTYPE(ZSTD_CStreamInSize) = NULL;
static DLSYM_PROTOTYPE(ZSTD_CStreamOutSize) = NULL;
static DLSYM_PROTOTYPE(ZSTD_decompressStream) = NULL;
static DLSYM_PROTOTYPE(ZSTD_DStreamInSize) = NULL;
static DLSYM_PROTOTYPE(ZSTD_DStreamOutSize) = NULL;
static DLSYM_PROTOTYPE(ZSTD_freeCCtx) = NULL;
static DLSYM_PROTOTYPE(ZSTD_freeDCtx) = NULL;
static DLSYM_PROTOTYPE(ZSTD_getErrorCode) = NULL;
static DLSYM_PROTOTYPE(ZSTD_getErrorName) = NULL;
static DLSYM_PROTOTYPE(ZSTD_getFrameContentSize) = NULL;
static DLSYM_PROTOTYPE(ZSTD_isError) = NULL;
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(ZSTD_CCtx*, sym_ZSTD_freeCCtx, NULL);
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(ZSTD_DCtx*, sym_ZSTD_freeDCtx, NULL);
@ -88,11 +88,11 @@ static int zstd_ret_to_errno(size_t ret) {
#if HAVE_XZ
static void *lzma_dl = NULL;
static DLSYM_FUNCTION(lzma_code);
static DLSYM_FUNCTION(lzma_easy_encoder);
static DLSYM_FUNCTION(lzma_end);
static DLSYM_FUNCTION(lzma_stream_buffer_encode);
static DLSYM_FUNCTION(lzma_stream_decoder);
static DLSYM_PROTOTYPE(lzma_code) = NULL;
static DLSYM_PROTOTYPE(lzma_easy_encoder) = NULL;
static DLSYM_PROTOTYPE(lzma_end) = NULL;
static DLSYM_PROTOTYPE(lzma_stream_buffer_encode) = NULL;
static DLSYM_PROTOTYPE(lzma_stream_decoder) = NULL;
/* We can't just do _cleanup_(sym_lzma_end) because a compiler bug makes
* this fail with:

View File

@ -71,10 +71,10 @@ int decompress_stream_lz4(int fdf, int fdt, uint64_t max_size);
int decompress_stream_zstd(int fdf, int fdt, uint64_t max_size);
#if HAVE_LZ4
DLSYM_PROTOTYPE(LZ4_compress_default);
DLSYM_PROTOTYPE(LZ4_decompress_safe);
DLSYM_PROTOTYPE(LZ4_decompress_safe_partial);
DLSYM_PROTOTYPE(LZ4_versionNumber);
extern DLSYM_PROTOTYPE(LZ4_compress_default);
extern DLSYM_PROTOTYPE(LZ4_decompress_safe);
extern DLSYM_PROTOTYPE(LZ4_decompress_safe_partial);
extern DLSYM_PROTOTYPE(LZ4_versionNumber);
int dlopen_lz4(void);
#endif

View File

@ -25,10 +25,8 @@ int dlopen_many_sym_or_warn_sentinel(void **dlp, const char *filename, int log_l
#define dlopen_many_sym_or_warn(dlp, filename, log_level, ...) \
dlopen_many_sym_or_warn_sentinel(dlp, filename, log_level, __VA_ARGS__, NULL)
#define DLSYM_PROTOTYPE(symbol) \
extern typeof(symbol)* sym_##symbol
#define DLSYM_FUNCTION(symbol) \
typeof(symbol)* sym_##symbol = NULL
#define DLSYM_PROTOTYPE(symbol) \
typeof(symbol)* sym_##symbol
/* Macro useful for putting together variable/symbol name pairs when calling dlsym_many_or_warn(). Assumes
* that each library symbol to resolve will be placed in a variable with the "sym_" prefix, i.e. a symbol

View File

@ -7,38 +7,38 @@
static void *gcrypt_dl = NULL;
static DLSYM_FUNCTION(gcry_control);
static DLSYM_FUNCTION(gcry_check_version);
DLSYM_FUNCTION(gcry_md_close);
DLSYM_FUNCTION(gcry_md_copy);
DLSYM_FUNCTION(gcry_md_ctl);
DLSYM_FUNCTION(gcry_md_get_algo_dlen);
DLSYM_FUNCTION(gcry_md_open);
DLSYM_FUNCTION(gcry_md_read);
DLSYM_FUNCTION(gcry_md_reset);
DLSYM_FUNCTION(gcry_md_setkey);
DLSYM_FUNCTION(gcry_md_write);
DLSYM_FUNCTION(gcry_mpi_add);
DLSYM_FUNCTION(gcry_mpi_add_ui);
DLSYM_FUNCTION(gcry_mpi_cmp);
DLSYM_FUNCTION(gcry_mpi_cmp_ui);
DLSYM_FUNCTION(gcry_mpi_get_nbits);
DLSYM_FUNCTION(gcry_mpi_invm);
DLSYM_FUNCTION(gcry_mpi_mod);
DLSYM_FUNCTION(gcry_mpi_mul);
DLSYM_FUNCTION(gcry_mpi_mulm);
DLSYM_FUNCTION(gcry_mpi_new);
DLSYM_FUNCTION(gcry_mpi_powm);
DLSYM_FUNCTION(gcry_mpi_print);
DLSYM_FUNCTION(gcry_mpi_release);
DLSYM_FUNCTION(gcry_mpi_scan);
DLSYM_FUNCTION(gcry_mpi_set_ui);
DLSYM_FUNCTION(gcry_mpi_sub);
DLSYM_FUNCTION(gcry_mpi_subm);
DLSYM_FUNCTION(gcry_mpi_sub_ui);
DLSYM_FUNCTION(gcry_prime_check);
DLSYM_FUNCTION(gcry_randomize);
DLSYM_FUNCTION(gcry_strerror);
static DLSYM_PROTOTYPE(gcry_control) = NULL;
static DLSYM_PROTOTYPE(gcry_check_version) = NULL;
DLSYM_PROTOTYPE(gcry_md_close) = NULL;
DLSYM_PROTOTYPE(gcry_md_copy) = NULL;
DLSYM_PROTOTYPE(gcry_md_ctl) = NULL;
DLSYM_PROTOTYPE(gcry_md_get_algo_dlen) = NULL;
DLSYM_PROTOTYPE(gcry_md_open) = NULL;
DLSYM_PROTOTYPE(gcry_md_read) = NULL;
DLSYM_PROTOTYPE(gcry_md_reset) = NULL;
DLSYM_PROTOTYPE(gcry_md_setkey) = NULL;
DLSYM_PROTOTYPE(gcry_md_write) = NULL;
DLSYM_PROTOTYPE(gcry_mpi_add) = NULL;
DLSYM_PROTOTYPE(gcry_mpi_add_ui) = NULL;
DLSYM_PROTOTYPE(gcry_mpi_cmp) = NULL;
DLSYM_PROTOTYPE(gcry_mpi_cmp_ui) = NULL;
DLSYM_PROTOTYPE(gcry_mpi_get_nbits) = NULL;
DLSYM_PROTOTYPE(gcry_mpi_invm) = NULL;
DLSYM_PROTOTYPE(gcry_mpi_mod) = NULL;
DLSYM_PROTOTYPE(gcry_mpi_mul) = NULL;
DLSYM_PROTOTYPE(gcry_mpi_mulm) = NULL;
DLSYM_PROTOTYPE(gcry_mpi_new) = NULL;
DLSYM_PROTOTYPE(gcry_mpi_powm) = NULL;
DLSYM_PROTOTYPE(gcry_mpi_print) = NULL;
DLSYM_PROTOTYPE(gcry_mpi_release) = NULL;
DLSYM_PROTOTYPE(gcry_mpi_scan) = NULL;
DLSYM_PROTOTYPE(gcry_mpi_set_ui) = NULL;
DLSYM_PROTOTYPE(gcry_mpi_sub) = NULL;
DLSYM_PROTOTYPE(gcry_mpi_subm) = NULL;
DLSYM_PROTOTYPE(gcry_mpi_sub_ui) = NULL;
DLSYM_PROTOTYPE(gcry_prime_check) = NULL;
DLSYM_PROTOTYPE(gcry_randomize) = NULL;
DLSYM_PROTOTYPE(gcry_strerror) = NULL;
static int dlopen_gcrypt(void) {
ELF_NOTE_DLOPEN("gcrypt",

View File

@ -12,36 +12,36 @@
#include "dlfcn-util.h"
#include "macro.h"
DLSYM_PROTOTYPE(gcry_md_close);
DLSYM_PROTOTYPE(gcry_md_copy);
DLSYM_PROTOTYPE(gcry_md_ctl);
DLSYM_PROTOTYPE(gcry_md_get_algo_dlen);
DLSYM_PROTOTYPE(gcry_md_open);
DLSYM_PROTOTYPE(gcry_md_read);
DLSYM_PROTOTYPE(gcry_md_reset);
DLSYM_PROTOTYPE(gcry_md_setkey);
DLSYM_PROTOTYPE(gcry_md_write);
DLSYM_PROTOTYPE(gcry_mpi_add);
DLSYM_PROTOTYPE(gcry_mpi_add_ui);
DLSYM_PROTOTYPE(gcry_mpi_cmp);
DLSYM_PROTOTYPE(gcry_mpi_cmp_ui);
DLSYM_PROTOTYPE(gcry_mpi_get_nbits);
DLSYM_PROTOTYPE(gcry_mpi_invm);
DLSYM_PROTOTYPE(gcry_mpi_mod);
DLSYM_PROTOTYPE(gcry_mpi_mul);
DLSYM_PROTOTYPE(gcry_mpi_mulm);
DLSYM_PROTOTYPE(gcry_mpi_new);
DLSYM_PROTOTYPE(gcry_mpi_powm);
DLSYM_PROTOTYPE(gcry_mpi_print);
DLSYM_PROTOTYPE(gcry_mpi_release);
DLSYM_PROTOTYPE(gcry_mpi_scan);
DLSYM_PROTOTYPE(gcry_mpi_set_ui);
DLSYM_PROTOTYPE(gcry_mpi_sub);
DLSYM_PROTOTYPE(gcry_mpi_subm);
DLSYM_PROTOTYPE(gcry_mpi_sub_ui);
DLSYM_PROTOTYPE(gcry_prime_check);
DLSYM_PROTOTYPE(gcry_randomize);
DLSYM_PROTOTYPE(gcry_strerror);
extern DLSYM_PROTOTYPE(gcry_md_close);
extern DLSYM_PROTOTYPE(gcry_md_copy);
extern DLSYM_PROTOTYPE(gcry_md_ctl);
extern DLSYM_PROTOTYPE(gcry_md_get_algo_dlen);
extern DLSYM_PROTOTYPE(gcry_md_open);
extern DLSYM_PROTOTYPE(gcry_md_read);
extern DLSYM_PROTOTYPE(gcry_md_reset);
extern DLSYM_PROTOTYPE(gcry_md_setkey);
extern DLSYM_PROTOTYPE(gcry_md_write);
extern DLSYM_PROTOTYPE(gcry_mpi_add);
extern DLSYM_PROTOTYPE(gcry_mpi_add_ui);
extern DLSYM_PROTOTYPE(gcry_mpi_cmp);
extern DLSYM_PROTOTYPE(gcry_mpi_cmp_ui);
extern DLSYM_PROTOTYPE(gcry_mpi_get_nbits);
extern DLSYM_PROTOTYPE(gcry_mpi_invm);
extern DLSYM_PROTOTYPE(gcry_mpi_mod);
extern DLSYM_PROTOTYPE(gcry_mpi_mul);
extern DLSYM_PROTOTYPE(gcry_mpi_mulm);
extern DLSYM_PROTOTYPE(gcry_mpi_new);
extern DLSYM_PROTOTYPE(gcry_mpi_powm);
extern DLSYM_PROTOTYPE(gcry_mpi_print);
extern DLSYM_PROTOTYPE(gcry_mpi_release);
extern DLSYM_PROTOTYPE(gcry_mpi_scan);
extern DLSYM_PROTOTYPE(gcry_mpi_set_ui);
extern DLSYM_PROTOTYPE(gcry_mpi_sub);
extern DLSYM_PROTOTYPE(gcry_mpi_subm);
extern DLSYM_PROTOTYPE(gcry_mpi_sub_ui);
extern DLSYM_PROTOTYPE(gcry_prime_check);
extern DLSYM_PROTOTYPE(gcry_randomize);
extern DLSYM_PROTOTYPE(gcry_strerror);
int initialize_libgcrypt(bool secmem);

View File

@ -9,11 +9,11 @@
#if HAVE_XKBCOMMON
static void *xkbcommon_dl = NULL;
DLSYM_FUNCTION(xkb_context_new);
DLSYM_FUNCTION(xkb_context_unref);
DLSYM_FUNCTION(xkb_context_set_log_fn);
DLSYM_FUNCTION(xkb_keymap_new_from_names);
DLSYM_FUNCTION(xkb_keymap_unref);
DLSYM_PROTOTYPE(xkb_context_new) = NULL;
DLSYM_PROTOTYPE(xkb_context_unref) = NULL;
DLSYM_PROTOTYPE(xkb_context_set_log_fn) = NULL;
DLSYM_PROTOTYPE(xkb_keymap_new_from_names) = NULL;
DLSYM_PROTOTYPE(xkb_keymap_unref) = NULL;
static int dlopen_xkbcommon(void) {
ELF_NOTE_DLOPEN("xkbcommon",

View File

@ -6,11 +6,11 @@
#if HAVE_XKBCOMMON
#include <xkbcommon/xkbcommon.h>
DLSYM_PROTOTYPE(xkb_context_new);
DLSYM_PROTOTYPE(xkb_context_unref);
DLSYM_PROTOTYPE(xkb_context_set_log_fn);
DLSYM_PROTOTYPE(xkb_keymap_new_from_names);
DLSYM_PROTOTYPE(xkb_keymap_unref);
extern DLSYM_PROTOTYPE(xkb_context_new);
extern DLSYM_PROTOTYPE(xkb_context_unref);
extern DLSYM_PROTOTYPE(xkb_context_set_log_fn);
extern DLSYM_PROTOTYPE(xkb_keymap_new_from_names);
extern DLSYM_PROTOTYPE(xkb_keymap_unref);
int verify_xkb_rmlvo(const char *model, const char *layout, const char *variant, const char *options);

View File

@ -18,36 +18,36 @@
#define MODERN_LIBBPF 0
#endif
DLSYM_FUNCTION(bpf_link__destroy);
DLSYM_FUNCTION(bpf_link__fd);
DLSYM_FUNCTION(bpf_link__open);
DLSYM_FUNCTION(bpf_link__pin);
DLSYM_FUNCTION(bpf_map__fd);
DLSYM_FUNCTION(bpf_map__name);
DLSYM_FUNCTION(bpf_map__set_inner_map_fd);
DLSYM_FUNCTION(bpf_map__set_max_entries);
DLSYM_FUNCTION(bpf_map__set_pin_path);
DLSYM_FUNCTION(bpf_map_delete_elem);
DLSYM_FUNCTION(bpf_map_get_fd_by_id);
DLSYM_FUNCTION(bpf_map_lookup_elem);
DLSYM_FUNCTION(bpf_map_update_elem);
DLSYM_FUNCTION(bpf_object__attach_skeleton);
DLSYM_FUNCTION(bpf_object__destroy_skeleton);
DLSYM_FUNCTION(bpf_object__detach_skeleton);
DLSYM_FUNCTION(bpf_object__load_skeleton);
DLSYM_FUNCTION(bpf_object__name);
DLSYM_FUNCTION(bpf_object__open_skeleton);
DLSYM_FUNCTION(bpf_object__pin_maps);
DLSYM_FUNCTION(bpf_program__attach);
DLSYM_FUNCTION(bpf_program__attach_cgroup);
DLSYM_FUNCTION(bpf_program__attach_lsm);
DLSYM_FUNCTION(bpf_program__name);
DLSYM_FUNCTION(libbpf_get_error);
DLSYM_FUNCTION(libbpf_set_print);
DLSYM_FUNCTION(ring_buffer__epoll_fd);
DLSYM_FUNCTION(ring_buffer__free);
DLSYM_FUNCTION(ring_buffer__new);
DLSYM_FUNCTION(ring_buffer__poll);
DLSYM_PROTOTYPE(bpf_link__destroy) = NULL;
DLSYM_PROTOTYPE(bpf_link__fd) = NULL;
DLSYM_PROTOTYPE(bpf_link__open) = NULL;
DLSYM_PROTOTYPE(bpf_link__pin) = NULL;
DLSYM_PROTOTYPE(bpf_map__fd) = NULL;
DLSYM_PROTOTYPE(bpf_map__name) = NULL;
DLSYM_PROTOTYPE(bpf_map__set_inner_map_fd) = NULL;
DLSYM_PROTOTYPE(bpf_map__set_max_entries) = NULL;
DLSYM_PROTOTYPE(bpf_map__set_pin_path) = NULL;
DLSYM_PROTOTYPE(bpf_map_delete_elem) = NULL;
DLSYM_PROTOTYPE(bpf_map_get_fd_by_id) = NULL;
DLSYM_PROTOTYPE(bpf_map_lookup_elem) = NULL;
DLSYM_PROTOTYPE(bpf_map_update_elem) = NULL;
DLSYM_PROTOTYPE(bpf_object__attach_skeleton) = NULL;
DLSYM_PROTOTYPE(bpf_object__destroy_skeleton) = NULL;
DLSYM_PROTOTYPE(bpf_object__detach_skeleton) = NULL;
DLSYM_PROTOTYPE(bpf_object__load_skeleton) = NULL;
DLSYM_PROTOTYPE(bpf_object__name) = NULL;
DLSYM_PROTOTYPE(bpf_object__open_skeleton) = NULL;
DLSYM_PROTOTYPE(bpf_object__pin_maps) = NULL;
DLSYM_PROTOTYPE(bpf_program__attach) = NULL;
DLSYM_PROTOTYPE(bpf_program__attach_cgroup) = NULL;
DLSYM_PROTOTYPE(bpf_program__attach_lsm) = NULL;
DLSYM_PROTOTYPE(bpf_program__name) = NULL;
DLSYM_PROTOTYPE(libbpf_get_error) = NULL;
DLSYM_PROTOTYPE(libbpf_set_print) = NULL;
DLSYM_PROTOTYPE(ring_buffer__epoll_fd) = NULL;
DLSYM_PROTOTYPE(ring_buffer__free) = NULL;
DLSYM_PROTOTYPE(ring_buffer__new) = NULL;
DLSYM_PROTOTYPE(ring_buffer__poll) = NULL;
/* new symbols available from libbpf 0.7.0 */
int (*sym_bpf_map_create)(enum bpf_map_type, const char *, __u32, __u32, __u32, const struct bpf_map_create_opts *);

View File

@ -9,37 +9,37 @@
#include "bpf-compat.h"
#include "dlfcn-util.h"
DLSYM_PROTOTYPE(bpf_link__destroy);
DLSYM_PROTOTYPE(bpf_link__fd);
DLSYM_PROTOTYPE(bpf_link__open);
DLSYM_PROTOTYPE(bpf_link__pin);
DLSYM_PROTOTYPE(bpf_map__fd);
DLSYM_PROTOTYPE(bpf_map__name);
DLSYM_PROTOTYPE(bpf_map__set_inner_map_fd);
DLSYM_PROTOTYPE(bpf_map__set_max_entries);
DLSYM_PROTOTYPE(bpf_map__set_pin_path);
DLSYM_PROTOTYPE(bpf_map_delete_elem);
DLSYM_PROTOTYPE(bpf_map_get_fd_by_id);
DLSYM_PROTOTYPE(bpf_map_lookup_elem);
DLSYM_PROTOTYPE(bpf_map_update_elem);
extern DLSYM_PROTOTYPE(bpf_link__destroy);
extern DLSYM_PROTOTYPE(bpf_link__fd);
extern DLSYM_PROTOTYPE(bpf_link__open);
extern DLSYM_PROTOTYPE(bpf_link__pin);
extern DLSYM_PROTOTYPE(bpf_map__fd);
extern DLSYM_PROTOTYPE(bpf_map__name);
extern DLSYM_PROTOTYPE(bpf_map__set_inner_map_fd);
extern DLSYM_PROTOTYPE(bpf_map__set_max_entries);
extern DLSYM_PROTOTYPE(bpf_map__set_pin_path);
extern DLSYM_PROTOTYPE(bpf_map_delete_elem);
extern DLSYM_PROTOTYPE(bpf_map_get_fd_by_id);
extern DLSYM_PROTOTYPE(bpf_map_lookup_elem);
extern DLSYM_PROTOTYPE(bpf_map_update_elem);
/* The *_skeleton APIs are autogenerated by bpftool, the targets can be found
* in ./build/src/core/bpf/socket_bind/socket-bind.skel.h */
DLSYM_PROTOTYPE(bpf_object__attach_skeleton);
DLSYM_PROTOTYPE(bpf_object__destroy_skeleton);
DLSYM_PROTOTYPE(bpf_object__detach_skeleton);
DLSYM_PROTOTYPE(bpf_object__load_skeleton);
DLSYM_PROTOTYPE(bpf_object__name);
DLSYM_PROTOTYPE(bpf_object__open_skeleton);
DLSYM_PROTOTYPE(bpf_object__pin_maps);
DLSYM_PROTOTYPE(bpf_program__attach);
DLSYM_PROTOTYPE(bpf_program__attach_cgroup);
DLSYM_PROTOTYPE(bpf_program__attach_lsm);
DLSYM_PROTOTYPE(bpf_program__name);
DLSYM_PROTOTYPE(libbpf_set_print);
DLSYM_PROTOTYPE(ring_buffer__epoll_fd);
DLSYM_PROTOTYPE(ring_buffer__free);
DLSYM_PROTOTYPE(ring_buffer__new);
DLSYM_PROTOTYPE(ring_buffer__poll);
extern DLSYM_PROTOTYPE(bpf_object__attach_skeleton);
extern DLSYM_PROTOTYPE(bpf_object__destroy_skeleton);
extern DLSYM_PROTOTYPE(bpf_object__detach_skeleton);
extern DLSYM_PROTOTYPE(bpf_object__load_skeleton);
extern DLSYM_PROTOTYPE(bpf_object__name);
extern DLSYM_PROTOTYPE(bpf_object__open_skeleton);
extern DLSYM_PROTOTYPE(bpf_object__pin_maps);
extern DLSYM_PROTOTYPE(bpf_program__attach);
extern DLSYM_PROTOTYPE(bpf_program__attach_cgroup);
extern DLSYM_PROTOTYPE(bpf_program__attach_lsm);
extern DLSYM_PROTOTYPE(bpf_program__name);
extern DLSYM_PROTOTYPE(libbpf_set_print);
extern DLSYM_PROTOTYPE(ring_buffer__epoll_fd);
extern DLSYM_PROTOTYPE(ring_buffer__free);
extern DLSYM_PROTOTYPE(ring_buffer__new);
extern DLSYM_PROTOTYPE(ring_buffer__poll);
/* libbpf sometimes returns error codes that make sense only in the kernel, like 524 for EOPNOTSUPP. Use
* this helper instead of libbpf_get_error() to ensure some of the known ones are translated into errnos

View File

@ -9,62 +9,62 @@
#if HAVE_LIBCRYPTSETUP
static void *cryptsetup_dl = NULL;
DLSYM_FUNCTION(crypt_activate_by_passphrase);
DLSYM_PROTOTYPE(crypt_activate_by_passphrase) = NULL;
#if HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY
DLSYM_FUNCTION(crypt_activate_by_signed_key);
DLSYM_PROTOTYPE(crypt_activate_by_signed_key) = NULL;
#endif
DLSYM_FUNCTION(crypt_activate_by_volume_key);
DLSYM_FUNCTION(crypt_deactivate_by_name);
DLSYM_FUNCTION(crypt_format);
DLSYM_FUNCTION(crypt_free);
DLSYM_FUNCTION(crypt_get_cipher);
DLSYM_FUNCTION(crypt_get_cipher_mode);
DLSYM_FUNCTION(crypt_get_data_offset);
DLSYM_FUNCTION(crypt_get_device_name);
DLSYM_FUNCTION(crypt_get_dir);
DLSYM_FUNCTION(crypt_get_type);
DLSYM_FUNCTION(crypt_get_uuid);
DLSYM_FUNCTION(crypt_get_verity_info);
DLSYM_FUNCTION(crypt_get_volume_key_size);
DLSYM_FUNCTION(crypt_init);
DLSYM_FUNCTION(crypt_init_by_name);
DLSYM_FUNCTION(crypt_keyslot_add_by_volume_key);
DLSYM_FUNCTION(crypt_keyslot_destroy);
DLSYM_FUNCTION(crypt_keyslot_max);
DLSYM_FUNCTION(crypt_load);
DLSYM_FUNCTION(crypt_resize);
DLSYM_PROTOTYPE(crypt_activate_by_volume_key) = NULL;
DLSYM_PROTOTYPE(crypt_deactivate_by_name) = NULL;
DLSYM_PROTOTYPE(crypt_format) = NULL;
DLSYM_PROTOTYPE(crypt_free) = NULL;
DLSYM_PROTOTYPE(crypt_get_cipher) = NULL;
DLSYM_PROTOTYPE(crypt_get_cipher_mode) = NULL;
DLSYM_PROTOTYPE(crypt_get_data_offset) = NULL;
DLSYM_PROTOTYPE(crypt_get_device_name) = NULL;
DLSYM_PROTOTYPE(crypt_get_dir) = NULL;
DLSYM_PROTOTYPE(crypt_get_type) = NULL;
DLSYM_PROTOTYPE(crypt_get_uuid) = NULL;
DLSYM_PROTOTYPE(crypt_get_verity_info) = NULL;
DLSYM_PROTOTYPE(crypt_get_volume_key_size) = NULL;
DLSYM_PROTOTYPE(crypt_init) = NULL;
DLSYM_PROTOTYPE(crypt_init_by_name) = NULL;
DLSYM_PROTOTYPE(crypt_keyslot_add_by_volume_key) = NULL;
DLSYM_PROTOTYPE(crypt_keyslot_destroy) = NULL;
DLSYM_PROTOTYPE(crypt_keyslot_max) = NULL;
DLSYM_PROTOTYPE(crypt_load) = NULL;
DLSYM_PROTOTYPE(crypt_resize) = NULL;
#if HAVE_CRYPT_RESUME_BY_VOLUME_KEY
DLSYM_FUNCTION(crypt_resume_by_volume_key);
DLSYM_PROTOTYPE(crypt_resume_by_volume_key) = NULL;
#endif
DLSYM_FUNCTION(crypt_set_data_device);
DLSYM_FUNCTION(crypt_set_debug_level);
DLSYM_FUNCTION(crypt_set_log_callback);
DLSYM_PROTOTYPE(crypt_set_data_device) = NULL;
DLSYM_PROTOTYPE(crypt_set_debug_level) = NULL;
DLSYM_PROTOTYPE(crypt_set_log_callback) = NULL;
#if HAVE_CRYPT_SET_METADATA_SIZE
DLSYM_FUNCTION(crypt_set_metadata_size);
DLSYM_PROTOTYPE(crypt_set_metadata_size) = NULL;
#endif
DLSYM_FUNCTION(crypt_set_pbkdf_type);
DLSYM_FUNCTION(crypt_suspend);
DLSYM_FUNCTION(crypt_token_json_get);
DLSYM_FUNCTION(crypt_token_json_set);
DLSYM_PROTOTYPE(crypt_set_pbkdf_type) = NULL;
DLSYM_PROTOTYPE(crypt_suspend) = NULL;
DLSYM_PROTOTYPE(crypt_token_json_get) = NULL;
DLSYM_PROTOTYPE(crypt_token_json_set) = NULL;
#if HAVE_CRYPT_TOKEN_MAX
DLSYM_FUNCTION(crypt_token_max);
DLSYM_PROTOTYPE(crypt_token_max) = NULL;
#endif
DLSYM_FUNCTION(crypt_token_status);
DLSYM_FUNCTION(crypt_volume_key_get);
DLSYM_PROTOTYPE(crypt_token_status) = NULL;
DLSYM_PROTOTYPE(crypt_volume_key_get) = NULL;
#if HAVE_CRYPT_REENCRYPT_INIT_BY_PASSPHRASE
DLSYM_FUNCTION(crypt_reencrypt_init_by_passphrase);
DLSYM_PROTOTYPE(crypt_reencrypt_init_by_passphrase) = NULL;
#endif
#if HAVE_CRYPT_REENCRYPT_RUN
DLSYM_FUNCTION(crypt_reencrypt_run);
DLSYM_PROTOTYPE(crypt_reencrypt_run);
#elif HAVE_CRYPT_REENCRYPT
DLSYM_FUNCTION(crypt_reencrypt);
DLSYM_PROTOTYPE(crypt_reencrypt);
#endif
DLSYM_FUNCTION(crypt_metadata_locking);
DLSYM_PROTOTYPE(crypt_metadata_locking) = NULL;
#if HAVE_CRYPT_SET_DATA_OFFSET
DLSYM_FUNCTION(crypt_set_data_offset);
DLSYM_PROTOTYPE(crypt_set_data_offset) = NULL;
#endif
DLSYM_FUNCTION(crypt_header_restore);
DLSYM_FUNCTION(crypt_volume_key_keyring);
DLSYM_PROTOTYPE(crypt_header_restore) = NULL;
DLSYM_PROTOTYPE(crypt_volume_key_keyring) = NULL;
/* Unfortunately libcryptsetup provides neither an environment variable to redirect where to look for token
* modules, nor does it have an API to change the token lookup path at runtime. The maintainers suggest using

View File

@ -17,45 +17,45 @@
#define CRYPT_ACTIVATE_NO_WRITE_WORKQUEUE (1 << 25)
#endif
DLSYM_PROTOTYPE(crypt_activate_by_passphrase);
extern DLSYM_PROTOTYPE(crypt_activate_by_passphrase);
#if HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY
DLSYM_PROTOTYPE(crypt_activate_by_signed_key);
extern DLSYM_PROTOTYPE(crypt_activate_by_signed_key);
#endif
DLSYM_PROTOTYPE(crypt_activate_by_volume_key);
DLSYM_PROTOTYPE(crypt_deactivate_by_name);
DLSYM_PROTOTYPE(crypt_format);
DLSYM_PROTOTYPE(crypt_free);
DLSYM_PROTOTYPE(crypt_get_cipher);
DLSYM_PROTOTYPE(crypt_get_cipher_mode);
DLSYM_PROTOTYPE(crypt_get_data_offset);
DLSYM_PROTOTYPE(crypt_get_device_name);
DLSYM_PROTOTYPE(crypt_get_dir);
DLSYM_PROTOTYPE(crypt_get_type);
DLSYM_PROTOTYPE(crypt_get_uuid);
DLSYM_PROTOTYPE(crypt_get_verity_info);
DLSYM_PROTOTYPE(crypt_get_volume_key_size);
DLSYM_PROTOTYPE(crypt_init);
DLSYM_PROTOTYPE(crypt_init_by_name);
DLSYM_PROTOTYPE(crypt_keyslot_add_by_volume_key);
DLSYM_PROTOTYPE(crypt_keyslot_destroy);
DLSYM_PROTOTYPE(crypt_keyslot_max);
DLSYM_PROTOTYPE(crypt_load);
DLSYM_PROTOTYPE(crypt_resize);
extern DLSYM_PROTOTYPE(crypt_activate_by_volume_key);
extern DLSYM_PROTOTYPE(crypt_deactivate_by_name);
extern DLSYM_PROTOTYPE(crypt_format);
extern DLSYM_PROTOTYPE(crypt_free);
extern DLSYM_PROTOTYPE(crypt_get_cipher);
extern DLSYM_PROTOTYPE(crypt_get_cipher_mode);
extern DLSYM_PROTOTYPE(crypt_get_data_offset);
extern DLSYM_PROTOTYPE(crypt_get_device_name);
extern DLSYM_PROTOTYPE(crypt_get_dir);
extern DLSYM_PROTOTYPE(crypt_get_type);
extern DLSYM_PROTOTYPE(crypt_get_uuid);
extern DLSYM_PROTOTYPE(crypt_get_verity_info);
extern DLSYM_PROTOTYPE(crypt_get_volume_key_size);
extern DLSYM_PROTOTYPE(crypt_init);
extern DLSYM_PROTOTYPE(crypt_init_by_name);
extern DLSYM_PROTOTYPE(crypt_keyslot_add_by_volume_key);
extern DLSYM_PROTOTYPE(crypt_keyslot_destroy);
extern DLSYM_PROTOTYPE(crypt_keyslot_max);
extern DLSYM_PROTOTYPE(crypt_load);
extern DLSYM_PROTOTYPE(crypt_resize);
#if HAVE_CRYPT_RESUME_BY_VOLUME_KEY
DLSYM_PROTOTYPE(crypt_resume_by_volume_key);
extern DLSYM_PROTOTYPE(crypt_resume_by_volume_key);
#endif
DLSYM_PROTOTYPE(crypt_set_data_device);
DLSYM_PROTOTYPE(crypt_set_debug_level);
DLSYM_PROTOTYPE(crypt_set_log_callback);
extern DLSYM_PROTOTYPE(crypt_set_data_device);
extern DLSYM_PROTOTYPE(crypt_set_debug_level);
extern DLSYM_PROTOTYPE(crypt_set_log_callback);
#if HAVE_CRYPT_SET_METADATA_SIZE
DLSYM_PROTOTYPE(crypt_set_metadata_size);
extern DLSYM_PROTOTYPE(crypt_set_metadata_size);
#endif
DLSYM_PROTOTYPE(crypt_set_pbkdf_type);
DLSYM_PROTOTYPE(crypt_suspend);
DLSYM_PROTOTYPE(crypt_token_json_get);
DLSYM_PROTOTYPE(crypt_token_json_set);
extern DLSYM_PROTOTYPE(crypt_set_pbkdf_type);
extern DLSYM_PROTOTYPE(crypt_suspend);
extern DLSYM_PROTOTYPE(crypt_token_json_get);
extern DLSYM_PROTOTYPE(crypt_token_json_set);
#if HAVE_CRYPT_TOKEN_MAX
DLSYM_PROTOTYPE(crypt_token_max);
extern DLSYM_PROTOTYPE(crypt_token_max);
#else
/* As a fallback, use the same hard-coded value libcryptsetup uses internally. */
static inline int crypt_token_max(_unused_ const char *type) {
@ -65,22 +65,22 @@ static inline int crypt_token_max(_unused_ const char *type) {
}
#define sym_crypt_token_max(type) crypt_token_max(type)
#endif
DLSYM_PROTOTYPE(crypt_token_status);
DLSYM_PROTOTYPE(crypt_volume_key_get);
extern DLSYM_PROTOTYPE(crypt_token_status);
extern DLSYM_PROTOTYPE(crypt_volume_key_get);
#if HAVE_CRYPT_REENCRYPT_INIT_BY_PASSPHRASE
DLSYM_PROTOTYPE(crypt_reencrypt_init_by_passphrase);
extern DLSYM_PROTOTYPE(crypt_reencrypt_init_by_passphrase);
#endif
#if HAVE_CRYPT_REENCRYPT_RUN
DLSYM_PROTOTYPE(crypt_reencrypt_run);
extern DLSYM_PROTOTYPE(crypt_reencrypt_run);
#elif HAVE_CRYPT_REENCRYPT
DLSYM_PROTOTYPE(crypt_reencrypt);
extern DLSYM_PROTOTYPE(crypt_reencrypt);
#endif
DLSYM_PROTOTYPE(crypt_metadata_locking);
extern DLSYM_PROTOTYPE(crypt_metadata_locking);
#if HAVE_CRYPT_SET_DATA_OFFSET
DLSYM_PROTOTYPE(crypt_set_data_offset);
extern DLSYM_PROTOTYPE(crypt_set_data_offset);
#endif
DLSYM_PROTOTYPE(crypt_header_restore);
DLSYM_PROTOTYPE(crypt_volume_key_keyring);
extern DLSYM_PROTOTYPE(crypt_header_restore);
extern DLSYM_PROTOTYPE(crypt_volume_key_keyring);
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(struct crypt_device *, crypt_free, NULL);
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(struct crypt_device *, sym_crypt_free, NULL);

View File

@ -38,51 +38,51 @@ static void *dw_dl = NULL;
static void *elf_dl = NULL;
/* libdw symbols */
static DLSYM_FUNCTION(dwarf_attr_integrate);
static DLSYM_FUNCTION(dwarf_diename);
static DLSYM_FUNCTION(dwarf_formstring);
static DLSYM_FUNCTION(dwarf_getscopes);
static DLSYM_FUNCTION(dwarf_getscopes_die);
static DLSYM_FUNCTION(dwelf_elf_begin);
static DLSYM_PROTOTYPE(dwarf_attr_integrate) = NULL;
static DLSYM_PROTOTYPE(dwarf_diename) = NULL;
static DLSYM_PROTOTYPE(dwarf_formstring) = NULL;
static DLSYM_PROTOTYPE(dwarf_getscopes) = NULL;
static DLSYM_PROTOTYPE(dwarf_getscopes_die) = NULL;
static DLSYM_PROTOTYPE(dwelf_elf_begin) = NULL;
#if HAVE_DWELF_ELF_E_MACHINE_STRING
static DLSYM_FUNCTION(dwelf_elf_e_machine_string);
static DLSYM_PROTOTYPE(dwelf_elf_e_machine_string) = NULL;
#endif
static DLSYM_FUNCTION(dwelf_elf_gnu_build_id);
static DLSYM_FUNCTION(dwarf_tag);
static DLSYM_FUNCTION(dwfl_addrmodule);
static DLSYM_FUNCTION(dwfl_begin);
static DLSYM_FUNCTION(dwfl_build_id_find_elf);
static DLSYM_FUNCTION(dwfl_core_file_attach);
static DLSYM_FUNCTION(dwfl_core_file_report);
static DLSYM_FUNCTION(dwfl_end);
static DLSYM_FUNCTION(dwfl_errmsg);
static DLSYM_FUNCTION(dwfl_errno);
static DLSYM_FUNCTION(dwfl_frame_pc);
static DLSYM_FUNCTION(dwfl_getmodules);
static DLSYM_FUNCTION(dwfl_getthreads);
static DLSYM_FUNCTION(dwfl_module_addrdie);
static DLSYM_FUNCTION(dwfl_module_addrname);
static DLSYM_FUNCTION(dwfl_module_build_id);
static DLSYM_FUNCTION(dwfl_module_getelf);
static DLSYM_FUNCTION(dwfl_module_info);
static DLSYM_FUNCTION(dwfl_offline_section_address);
static DLSYM_FUNCTION(dwfl_report_end);
static DLSYM_FUNCTION(dwfl_standard_find_debuginfo);
static DLSYM_FUNCTION(dwfl_thread_getframes);
static DLSYM_FUNCTION(dwfl_thread_tid);
static DLSYM_PROTOTYPE(dwelf_elf_gnu_build_id) = NULL;
static DLSYM_PROTOTYPE(dwarf_tag) = NULL;
static DLSYM_PROTOTYPE(dwfl_addrmodule) = NULL;
static DLSYM_PROTOTYPE(dwfl_begin) = NULL;
static DLSYM_PROTOTYPE(dwfl_build_id_find_elf) = NULL;
static DLSYM_PROTOTYPE(dwfl_core_file_attach) = NULL;
static DLSYM_PROTOTYPE(dwfl_core_file_report) = NULL;
static DLSYM_PROTOTYPE(dwfl_end) = NULL;
static DLSYM_PROTOTYPE(dwfl_errmsg) = NULL;
static DLSYM_PROTOTYPE(dwfl_errno) = NULL;
static DLSYM_PROTOTYPE(dwfl_frame_pc) = NULL;
static DLSYM_PROTOTYPE(dwfl_getmodules) = NULL;
static DLSYM_PROTOTYPE(dwfl_getthreads) = NULL;
static DLSYM_PROTOTYPE(dwfl_module_addrdie) = NULL;
static DLSYM_PROTOTYPE(dwfl_module_addrname) = NULL;
static DLSYM_PROTOTYPE(dwfl_module_build_id) = NULL;
static DLSYM_PROTOTYPE(dwfl_module_getelf) = NULL;
static DLSYM_PROTOTYPE(dwfl_module_info) = NULL;
static DLSYM_PROTOTYPE(dwfl_offline_section_address) = NULL;
static DLSYM_PROTOTYPE(dwfl_report_end) = NULL;
static DLSYM_PROTOTYPE(dwfl_standard_find_debuginfo) = NULL;
static DLSYM_PROTOTYPE(dwfl_thread_getframes) = NULL;
static DLSYM_PROTOTYPE(dwfl_thread_tid) = NULL;
/* libelf symbols */
static DLSYM_FUNCTION(elf_begin);
static DLSYM_FUNCTION(elf_end);
static DLSYM_FUNCTION(elf_getdata_rawchunk);
static DLSYM_FUNCTION(gelf_getehdr);
static DLSYM_FUNCTION(elf_getphdrnum);
static DLSYM_FUNCTION(elf_errmsg);
static DLSYM_FUNCTION(elf_errno);
static DLSYM_FUNCTION(elf_memory);
static DLSYM_FUNCTION(elf_version);
static DLSYM_FUNCTION(gelf_getphdr);
static DLSYM_FUNCTION(gelf_getnote);
static DLSYM_PROTOTYPE(elf_begin) = NULL;
static DLSYM_PROTOTYPE(elf_end) = NULL;
static DLSYM_PROTOTYPE(elf_getdata_rawchunk) = NULL;
static DLSYM_PROTOTYPE(gelf_getehdr) = NULL;
static DLSYM_PROTOTYPE(elf_getphdrnum) = NULL;
static DLSYM_PROTOTYPE(elf_errmsg) = NULL;
static DLSYM_PROTOTYPE(elf_errno) = NULL;
static DLSYM_PROTOTYPE(elf_memory) = NULL;
static DLSYM_PROTOTYPE(elf_version) = NULL;
static DLSYM_PROTOTYPE(gelf_getphdr) = NULL;
static DLSYM_PROTOTYPE(gelf_getnote) = NULL;
int dlopen_dw(void) {
int r;

View File

@ -21,13 +21,13 @@
#include "macro.h"
#include "socket-util.h"
static DLSYM_FUNCTION(iptc_check_entry);
static DLSYM_FUNCTION(iptc_commit);
static DLSYM_FUNCTION(iptc_delete_entry);
static DLSYM_FUNCTION(iptc_free);
static DLSYM_FUNCTION(iptc_init);
static DLSYM_FUNCTION(iptc_insert_entry);
static DLSYM_FUNCTION(iptc_strerror);
static DLSYM_PROTOTYPE(iptc_check_entry) = NULL;
static DLSYM_PROTOTYPE(iptc_commit) = NULL;
static DLSYM_PROTOTYPE(iptc_delete_entry) = NULL;
static DLSYM_PROTOTYPE(iptc_free) = NULL;
static DLSYM_PROTOTYPE(iptc_init) = NULL;
static DLSYM_PROTOTYPE(iptc_insert_entry) = NULL;
static DLSYM_PROTOTYPE(iptc_strerror) = NULL;
static void *iptc_dl = NULL;

View File

@ -16,9 +16,9 @@ static void* idn_dl = NULL;
#endif
#if HAVE_LIBIDN2
DLSYM_FUNCTION(idn2_lookup_u8);
DLSYM_PROTOTYPE(idn2_lookup_u8) = NULL;
const char *(*sym_idn2_strerror)(int rc) _const_ = NULL;
DLSYM_FUNCTION(idn2_to_unicode_8z8z);
DLSYM_PROTOTYPE(idn2_to_unicode_8z8z) = NULL;
int dlopen_idn(void) {
ELF_NOTE_DLOPEN("idn",
@ -35,10 +35,10 @@ int dlopen_idn(void) {
#endif
#if HAVE_LIBIDN
DLSYM_FUNCTION(idna_to_ascii_4i);
DLSYM_FUNCTION(idna_to_unicode_44i);
DLSYM_FUNCTION(stringprep_ucs4_to_utf8);
DLSYM_FUNCTION(stringprep_utf8_to_ucs4);
DLSYM_PROTOTYPE(idna_to_ascii_4i) = NULL;
DLSYM_PROTOTYPE(idna_to_unicode_44i) = NULL;
DLSYM_PROTOTYPE(stringprep_ucs4_to_utf8) = NULL;
DLSYM_PROTOTYPE(stringprep_utf8_to_ucs4) = NULL;
int dlopen_idn(void) {
_cleanup_(dlclosep) void *dl = NULL;

View File

@ -21,14 +21,14 @@ static inline int dlopen_idn(void) {
#endif
#if HAVE_LIBIDN2
DLSYM_PROTOTYPE(idn2_lookup_u8);
extern DLSYM_PROTOTYPE(idn2_lookup_u8);
extern const char *(*sym_idn2_strerror)(int rc) _const_;
DLSYM_PROTOTYPE(idn2_to_unicode_8z8z);
extern DLSYM_PROTOTYPE(idn2_to_unicode_8z8z);
#endif
#if HAVE_LIBIDN
DLSYM_PROTOTYPE(idna_to_ascii_4i);
DLSYM_PROTOTYPE(idna_to_unicode_44i);
DLSYM_PROTOTYPE(stringprep_ucs4_to_utf8);
DLSYM_PROTOTYPE(stringprep_utf8_to_ucs4);
extern DLSYM_PROTOTYPE(idna_to_ascii_4i);
extern DLSYM_PROTOTYPE(idna_to_unicode_44i);
extern DLSYM_PROTOTYPE(stringprep_ucs4_to_utf8);
extern DLSYM_PROTOTYPE(stringprep_utf8_to_ucs4);
#endif

View File

@ -5,29 +5,29 @@
#if HAVE_LIBARCHIVE
static void *libarchive_dl = NULL;
DLSYM_FUNCTION(archive_entry_free);
DLSYM_FUNCTION(archive_entry_new);
DLSYM_FUNCTION(archive_entry_set_ctime);
DLSYM_FUNCTION(archive_entry_set_filetype);
DLSYM_FUNCTION(archive_entry_set_gid);
DLSYM_FUNCTION(archive_entry_set_mtime);
DLSYM_FUNCTION(archive_entry_set_pathname);
DLSYM_FUNCTION(archive_entry_set_perm);
DLSYM_FUNCTION(archive_entry_set_rdevmajor);
DLSYM_FUNCTION(archive_entry_set_rdevminor);
DLSYM_FUNCTION(archive_entry_set_symlink);
DLSYM_FUNCTION(archive_entry_set_size);
DLSYM_FUNCTION(archive_entry_set_uid);
DLSYM_FUNCTION(archive_error_string);
DLSYM_FUNCTION(archive_write_close);
DLSYM_FUNCTION(archive_write_data);
DLSYM_FUNCTION(archive_write_free);
DLSYM_FUNCTION(archive_write_header);
DLSYM_FUNCTION(archive_write_new);
DLSYM_FUNCTION(archive_write_open_FILE);
DLSYM_FUNCTION(archive_write_open_fd);
DLSYM_FUNCTION(archive_write_set_format_filter_by_ext);
DLSYM_FUNCTION(archive_write_set_format_gnutar);
DLSYM_PROTOTYPE(archive_entry_free) = NULL;
DLSYM_PROTOTYPE(archive_entry_new) = NULL;
DLSYM_PROTOTYPE(archive_entry_set_ctime) = NULL;
DLSYM_PROTOTYPE(archive_entry_set_filetype) = NULL;
DLSYM_PROTOTYPE(archive_entry_set_gid) = NULL;
DLSYM_PROTOTYPE(archive_entry_set_mtime) = NULL;
DLSYM_PROTOTYPE(archive_entry_set_pathname) = NULL;
DLSYM_PROTOTYPE(archive_entry_set_perm) = NULL;
DLSYM_PROTOTYPE(archive_entry_set_rdevmajor) = NULL;
DLSYM_PROTOTYPE(archive_entry_set_rdevminor) = NULL;
DLSYM_PROTOTYPE(archive_entry_set_symlink) = NULL;
DLSYM_PROTOTYPE(archive_entry_set_size) = NULL;
DLSYM_PROTOTYPE(archive_entry_set_uid) = NULL;
DLSYM_PROTOTYPE(archive_error_string) = NULL;
DLSYM_PROTOTYPE(archive_write_close) = NULL;
DLSYM_PROTOTYPE(archive_write_data) = NULL;
DLSYM_PROTOTYPE(archive_write_free) = NULL;
DLSYM_PROTOTYPE(archive_write_header) = NULL;
DLSYM_PROTOTYPE(archive_write_new) = NULL;
DLSYM_PROTOTYPE(archive_write_open_FILE) = NULL;
DLSYM_PROTOTYPE(archive_write_open_fd) = NULL;
DLSYM_PROTOTYPE(archive_write_set_format_filter_by_ext) = NULL;
DLSYM_PROTOTYPE(archive_write_set_format_gnutar) = NULL;
int dlopen_libarchive(void) {
ELF_NOTE_DLOPEN("archive",

View File

@ -7,29 +7,29 @@
#include <archive.h>
#include <archive_entry.h>
DLSYM_PROTOTYPE(archive_entry_free);
DLSYM_PROTOTYPE(archive_entry_new);
DLSYM_PROTOTYPE(archive_entry_set_ctime);
DLSYM_PROTOTYPE(archive_entry_set_filetype);
DLSYM_PROTOTYPE(archive_entry_set_gid);
DLSYM_PROTOTYPE(archive_entry_set_mtime);
DLSYM_PROTOTYPE(archive_entry_set_pathname);
DLSYM_PROTOTYPE(archive_entry_set_perm);
DLSYM_PROTOTYPE(archive_entry_set_rdevmajor);
DLSYM_PROTOTYPE(archive_entry_set_rdevminor);
DLSYM_PROTOTYPE(archive_entry_set_symlink);
DLSYM_PROTOTYPE(archive_entry_set_size);
DLSYM_PROTOTYPE(archive_entry_set_uid);
DLSYM_PROTOTYPE(archive_error_string);
DLSYM_PROTOTYPE(archive_write_close);
DLSYM_PROTOTYPE(archive_write_data);
DLSYM_PROTOTYPE(archive_write_free);
DLSYM_PROTOTYPE(archive_write_header);
DLSYM_PROTOTYPE(archive_write_new);
DLSYM_PROTOTYPE(archive_write_open_FILE);
DLSYM_PROTOTYPE(archive_write_open_fd);
DLSYM_PROTOTYPE(archive_write_set_format_filter_by_ext);
DLSYM_PROTOTYPE(archive_write_set_format_gnutar);
extern DLSYM_PROTOTYPE(archive_entry_free);
extern DLSYM_PROTOTYPE(archive_entry_new);
extern DLSYM_PROTOTYPE(archive_entry_set_ctime);
extern DLSYM_PROTOTYPE(archive_entry_set_filetype);
extern DLSYM_PROTOTYPE(archive_entry_set_gid);
extern DLSYM_PROTOTYPE(archive_entry_set_mtime);
extern DLSYM_PROTOTYPE(archive_entry_set_pathname);
extern DLSYM_PROTOTYPE(archive_entry_set_perm);
extern DLSYM_PROTOTYPE(archive_entry_set_rdevmajor);
extern DLSYM_PROTOTYPE(archive_entry_set_rdevminor);
extern DLSYM_PROTOTYPE(archive_entry_set_symlink);
extern DLSYM_PROTOTYPE(archive_entry_set_size);
extern DLSYM_PROTOTYPE(archive_entry_set_uid);
extern DLSYM_PROTOTYPE(archive_error_string);
extern DLSYM_PROTOTYPE(archive_write_close);
extern DLSYM_PROTOTYPE(archive_write_data);
extern DLSYM_PROTOTYPE(archive_write_free);
extern DLSYM_PROTOTYPE(archive_write_header);
extern DLSYM_PROTOTYPE(archive_write_new);
extern DLSYM_PROTOTYPE(archive_write_open_FILE);
extern DLSYM_PROTOTYPE(archive_write_open_fd);
extern DLSYM_PROTOTYPE(archive_write_set_format_filter_by_ext);
extern DLSYM_PROTOTYPE(archive_write_set_format_gnutar);
int dlopen_libarchive(void);

View File

@ -16,54 +16,54 @@
static void *libfido2_dl = NULL;
DLSYM_FUNCTION(fido_assert_allow_cred);
DLSYM_FUNCTION(fido_assert_free);
DLSYM_FUNCTION(fido_assert_hmac_secret_len);
DLSYM_FUNCTION(fido_assert_hmac_secret_ptr);
DLSYM_FUNCTION(fido_assert_new);
DLSYM_FUNCTION(fido_assert_set_clientdata_hash);
DLSYM_FUNCTION(fido_assert_set_extensions);
DLSYM_FUNCTION(fido_assert_set_hmac_salt);
DLSYM_FUNCTION(fido_assert_set_rp);
DLSYM_FUNCTION(fido_assert_set_up);
DLSYM_FUNCTION(fido_assert_set_uv);
DLSYM_FUNCTION(fido_cbor_info_extensions_len);
DLSYM_FUNCTION(fido_cbor_info_extensions_ptr);
DLSYM_FUNCTION(fido_cbor_info_free);
DLSYM_FUNCTION(fido_cbor_info_new);
DLSYM_FUNCTION(fido_cbor_info_options_len);
DLSYM_FUNCTION(fido_cbor_info_options_name_ptr);
DLSYM_FUNCTION(fido_cbor_info_options_value_ptr);
DLSYM_FUNCTION(fido_cred_free);
DLSYM_FUNCTION(fido_cred_id_len);
DLSYM_FUNCTION(fido_cred_id_ptr);
DLSYM_FUNCTION(fido_cred_new);
DLSYM_FUNCTION(fido_cred_set_clientdata_hash);
DLSYM_FUNCTION(fido_cred_set_extensions);
DLSYM_FUNCTION(fido_cred_set_prot);
DLSYM_FUNCTION(fido_cred_set_rk);
DLSYM_FUNCTION(fido_cred_set_rp);
DLSYM_FUNCTION(fido_cred_set_type);
DLSYM_FUNCTION(fido_cred_set_user);
DLSYM_FUNCTION(fido_cred_set_uv);
DLSYM_FUNCTION(fido_dev_free);
DLSYM_FUNCTION(fido_dev_get_assert);
DLSYM_FUNCTION(fido_dev_get_cbor_info);
DLSYM_FUNCTION(fido_dev_info_free);
DLSYM_FUNCTION(fido_dev_info_manifest);
DLSYM_FUNCTION(fido_dev_info_manufacturer_string);
DLSYM_FUNCTION(fido_dev_info_product_string);
DLSYM_FUNCTION(fido_dev_info_new);
DLSYM_FUNCTION(fido_dev_info_path);
DLSYM_FUNCTION(fido_dev_info_ptr);
DLSYM_FUNCTION(fido_dev_is_fido2);
DLSYM_FUNCTION(fido_dev_make_cred);
DLSYM_FUNCTION(fido_dev_new);
DLSYM_FUNCTION(fido_dev_open);
DLSYM_FUNCTION(fido_dev_close);
DLSYM_FUNCTION(fido_init);
DLSYM_FUNCTION(fido_set_log_handler);
DLSYM_FUNCTION(fido_strerr);
DLSYM_PROTOTYPE(fido_assert_allow_cred) = NULL;
DLSYM_PROTOTYPE(fido_assert_free) = NULL;
DLSYM_PROTOTYPE(fido_assert_hmac_secret_len) = NULL;
DLSYM_PROTOTYPE(fido_assert_hmac_secret_ptr) = NULL;
DLSYM_PROTOTYPE(fido_assert_new) = NULL;
DLSYM_PROTOTYPE(fido_assert_set_clientdata_hash) = NULL;
DLSYM_PROTOTYPE(fido_assert_set_extensions) = NULL;
DLSYM_PROTOTYPE(fido_assert_set_hmac_salt) = NULL;
DLSYM_PROTOTYPE(fido_assert_set_rp) = NULL;
DLSYM_PROTOTYPE(fido_assert_set_up) = NULL;
DLSYM_PROTOTYPE(fido_assert_set_uv) = NULL;
DLSYM_PROTOTYPE(fido_cbor_info_extensions_len) = NULL;
DLSYM_PROTOTYPE(fido_cbor_info_extensions_ptr) = NULL;
DLSYM_PROTOTYPE(fido_cbor_info_free) = NULL;
DLSYM_PROTOTYPE(fido_cbor_info_new) = NULL;
DLSYM_PROTOTYPE(fido_cbor_info_options_len) = NULL;
DLSYM_PROTOTYPE(fido_cbor_info_options_name_ptr) = NULL;
DLSYM_PROTOTYPE(fido_cbor_info_options_value_ptr) = NULL;
DLSYM_PROTOTYPE(fido_cred_free) = NULL;
DLSYM_PROTOTYPE(fido_cred_id_len) = NULL;
DLSYM_PROTOTYPE(fido_cred_id_ptr) = NULL;
DLSYM_PROTOTYPE(fido_cred_new) = NULL;
DLSYM_PROTOTYPE(fido_cred_set_clientdata_hash) = NULL;
DLSYM_PROTOTYPE(fido_cred_set_extensions) = NULL;
DLSYM_PROTOTYPE(fido_cred_set_prot) = NULL;
DLSYM_PROTOTYPE(fido_cred_set_rk) = NULL;
DLSYM_PROTOTYPE(fido_cred_set_rp) = NULL;
DLSYM_PROTOTYPE(fido_cred_set_type) = NULL;
DLSYM_PROTOTYPE(fido_cred_set_user) = NULL;
DLSYM_PROTOTYPE(fido_cred_set_uv) = NULL;
DLSYM_PROTOTYPE(fido_dev_free) = NULL;
DLSYM_PROTOTYPE(fido_dev_get_assert) = NULL;
DLSYM_PROTOTYPE(fido_dev_get_cbor_info) = NULL;
DLSYM_PROTOTYPE(fido_dev_info_free) = NULL;
DLSYM_PROTOTYPE(fido_dev_info_manifest) = NULL;
DLSYM_PROTOTYPE(fido_dev_info_manufacturer_string) = NULL;
DLSYM_PROTOTYPE(fido_dev_info_product_string) = NULL;
DLSYM_PROTOTYPE(fido_dev_info_new) = NULL;
DLSYM_PROTOTYPE(fido_dev_info_path) = NULL;
DLSYM_PROTOTYPE(fido_dev_info_ptr) = NULL;
DLSYM_PROTOTYPE(fido_dev_is_fido2) = NULL;
DLSYM_PROTOTYPE(fido_dev_make_cred) = NULL;
DLSYM_PROTOTYPE(fido_dev_new) = NULL;
DLSYM_PROTOTYPE(fido_dev_open) = NULL;
DLSYM_PROTOTYPE(fido_dev_close) = NULL;
DLSYM_PROTOTYPE(fido_init) = NULL;
DLSYM_PROTOTYPE(fido_set_log_handler) = NULL;
DLSYM_PROTOTYPE(fido_strerr) = NULL;
static void fido_log_propagate_handler(const char *s) {
log_debug("libfido2: %s", strempty(s));

View File

@ -19,54 +19,54 @@ typedef enum Fido2EnrollFlags {
#include "dlfcn-util.h"
DLSYM_PROTOTYPE(fido_assert_allow_cred);
DLSYM_PROTOTYPE(fido_assert_free);
DLSYM_PROTOTYPE(fido_assert_hmac_secret_len);
DLSYM_PROTOTYPE(fido_assert_hmac_secret_ptr);
DLSYM_PROTOTYPE(fido_assert_new);
DLSYM_PROTOTYPE(fido_assert_set_clientdata_hash);
DLSYM_PROTOTYPE(fido_assert_set_extensions);
DLSYM_PROTOTYPE(fido_assert_set_hmac_salt);
DLSYM_PROTOTYPE(fido_assert_set_rp);
DLSYM_PROTOTYPE(fido_assert_set_up);
DLSYM_PROTOTYPE(fido_assert_set_uv);
DLSYM_PROTOTYPE(fido_cbor_info_extensions_len);
DLSYM_PROTOTYPE(fido_cbor_info_extensions_ptr);
DLSYM_PROTOTYPE(fido_cbor_info_free);
DLSYM_PROTOTYPE(fido_cbor_info_new);
DLSYM_PROTOTYPE(fido_cbor_info_options_len);
DLSYM_PROTOTYPE(fido_cbor_info_options_name_ptr);
DLSYM_PROTOTYPE(fido_cbor_info_options_value_ptr);
DLSYM_PROTOTYPE(fido_cred_free);
DLSYM_PROTOTYPE(fido_cred_id_len);
DLSYM_PROTOTYPE(fido_cred_id_ptr);
DLSYM_PROTOTYPE(fido_cred_new);
DLSYM_PROTOTYPE(fido_cred_set_clientdata_hash);
DLSYM_PROTOTYPE(fido_cred_set_extensions);
DLSYM_PROTOTYPE(fido_cred_set_prot);
DLSYM_PROTOTYPE(fido_cred_set_rk);
DLSYM_PROTOTYPE(fido_cred_set_rp);
DLSYM_PROTOTYPE(fido_cred_set_type);
DLSYM_PROTOTYPE(fido_cred_set_user);
DLSYM_PROTOTYPE(fido_cred_set_uv);
DLSYM_PROTOTYPE(fido_dev_free);
DLSYM_PROTOTYPE(fido_dev_get_assert);
DLSYM_PROTOTYPE(fido_dev_get_cbor_info);
DLSYM_PROTOTYPE(fido_dev_info_free);
DLSYM_PROTOTYPE(fido_dev_info_manifest);
DLSYM_PROTOTYPE(fido_dev_info_manufacturer_string);
DLSYM_PROTOTYPE(fido_dev_info_product_string);
DLSYM_PROTOTYPE(fido_dev_info_new);
DLSYM_PROTOTYPE(fido_dev_info_path);
DLSYM_PROTOTYPE(fido_dev_info_ptr);
DLSYM_PROTOTYPE(fido_dev_is_fido2);
DLSYM_PROTOTYPE(fido_dev_make_cred);
DLSYM_PROTOTYPE(fido_dev_new);
DLSYM_PROTOTYPE(fido_dev_open);
DLSYM_PROTOTYPE(fido_dev_close);
DLSYM_PROTOTYPE(fido_init);
DLSYM_PROTOTYPE(fido_set_log_handler);
DLSYM_PROTOTYPE(fido_strerr);
extern DLSYM_PROTOTYPE(fido_assert_allow_cred);
extern DLSYM_PROTOTYPE(fido_assert_free);
extern DLSYM_PROTOTYPE(fido_assert_hmac_secret_len);
extern DLSYM_PROTOTYPE(fido_assert_hmac_secret_ptr);
extern DLSYM_PROTOTYPE(fido_assert_new);
extern DLSYM_PROTOTYPE(fido_assert_set_clientdata_hash);
extern DLSYM_PROTOTYPE(fido_assert_set_extensions);
extern DLSYM_PROTOTYPE(fido_assert_set_hmac_salt);
extern DLSYM_PROTOTYPE(fido_assert_set_rp);
extern DLSYM_PROTOTYPE(fido_assert_set_up);
extern DLSYM_PROTOTYPE(fido_assert_set_uv);
extern DLSYM_PROTOTYPE(fido_cbor_info_extensions_len);
extern DLSYM_PROTOTYPE(fido_cbor_info_extensions_ptr);
extern DLSYM_PROTOTYPE(fido_cbor_info_free);
extern DLSYM_PROTOTYPE(fido_cbor_info_new);
extern DLSYM_PROTOTYPE(fido_cbor_info_options_len);
extern DLSYM_PROTOTYPE(fido_cbor_info_options_name_ptr);
extern DLSYM_PROTOTYPE(fido_cbor_info_options_value_ptr);
extern DLSYM_PROTOTYPE(fido_cred_free);
extern DLSYM_PROTOTYPE(fido_cred_id_len);
extern DLSYM_PROTOTYPE(fido_cred_id_ptr);
extern DLSYM_PROTOTYPE(fido_cred_new);
extern DLSYM_PROTOTYPE(fido_cred_set_clientdata_hash);
extern DLSYM_PROTOTYPE(fido_cred_set_extensions);
extern DLSYM_PROTOTYPE(fido_cred_set_prot);
extern DLSYM_PROTOTYPE(fido_cred_set_rk);
extern DLSYM_PROTOTYPE(fido_cred_set_rp);
extern DLSYM_PROTOTYPE(fido_cred_set_type);
extern DLSYM_PROTOTYPE(fido_cred_set_user);
extern DLSYM_PROTOTYPE(fido_cred_set_uv);
extern DLSYM_PROTOTYPE(fido_dev_free);
extern DLSYM_PROTOTYPE(fido_dev_get_assert);
extern DLSYM_PROTOTYPE(fido_dev_get_cbor_info);
extern DLSYM_PROTOTYPE(fido_dev_info_free);
extern DLSYM_PROTOTYPE(fido_dev_info_manifest);
extern DLSYM_PROTOTYPE(fido_dev_info_manufacturer_string);
extern DLSYM_PROTOTYPE(fido_dev_info_product_string);
extern DLSYM_PROTOTYPE(fido_dev_info_new);
extern DLSYM_PROTOTYPE(fido_dev_info_path);
extern DLSYM_PROTOTYPE(fido_dev_info_ptr);
extern DLSYM_PROTOTYPE(fido_dev_is_fido2);
extern DLSYM_PROTOTYPE(fido_dev_make_cred);
extern DLSYM_PROTOTYPE(fido_dev_new);
extern DLSYM_PROTOTYPE(fido_dev_open);
extern DLSYM_PROTOTYPE(fido_dev_close);
extern DLSYM_PROTOTYPE(fido_init);
extern DLSYM_PROTOTYPE(fido_set_log_handler);
extern DLSYM_PROTOTYPE(fido_strerr);
int dlopen_libfido2(void);

View File

@ -10,19 +10,19 @@
static void *libkmod_dl = NULL;
DLSYM_FUNCTION(kmod_list_next);
DLSYM_FUNCTION(kmod_load_resources);
DLSYM_FUNCTION(kmod_module_get_initstate);
DLSYM_FUNCTION(kmod_module_get_module);
DLSYM_FUNCTION(kmod_module_get_name);
DLSYM_FUNCTION(kmod_module_new_from_lookup);
DLSYM_FUNCTION(kmod_module_probe_insert_module);
DLSYM_FUNCTION(kmod_module_unref);
DLSYM_FUNCTION(kmod_module_unref_list);
DLSYM_FUNCTION(kmod_new);
DLSYM_FUNCTION(kmod_set_log_fn);
DLSYM_FUNCTION(kmod_unref);
DLSYM_FUNCTION(kmod_validate_resources);
DLSYM_PROTOTYPE(kmod_list_next) = NULL;
DLSYM_PROTOTYPE(kmod_load_resources) = NULL;
DLSYM_PROTOTYPE(kmod_module_get_initstate) = NULL;
DLSYM_PROTOTYPE(kmod_module_get_module) = NULL;
DLSYM_PROTOTYPE(kmod_module_get_name) = NULL;
DLSYM_PROTOTYPE(kmod_module_new_from_lookup) = NULL;
DLSYM_PROTOTYPE(kmod_module_probe_insert_module) = NULL;
DLSYM_PROTOTYPE(kmod_module_unref) = NULL;
DLSYM_PROTOTYPE(kmod_module_unref_list) = NULL;
DLSYM_PROTOTYPE(kmod_new) = NULL;
DLSYM_PROTOTYPE(kmod_set_log_fn) = NULL;
DLSYM_PROTOTYPE(kmod_unref) = NULL;
DLSYM_PROTOTYPE(kmod_validate_resources) = NULL;
int dlopen_libkmod(void) {
ELF_NOTE_DLOPEN("kmod",

View File

@ -9,19 +9,19 @@
#include "macro.h"
DLSYM_PROTOTYPE(kmod_list_next);
DLSYM_PROTOTYPE(kmod_load_resources);
DLSYM_PROTOTYPE(kmod_module_get_initstate);
DLSYM_PROTOTYPE(kmod_module_get_module);
DLSYM_PROTOTYPE(kmod_module_get_name);
DLSYM_PROTOTYPE(kmod_module_new_from_lookup);
DLSYM_PROTOTYPE(kmod_module_probe_insert_module);
DLSYM_PROTOTYPE(kmod_module_unref);
DLSYM_PROTOTYPE(kmod_module_unref_list);
DLSYM_PROTOTYPE(kmod_new);
DLSYM_PROTOTYPE(kmod_set_log_fn);
DLSYM_PROTOTYPE(kmod_unref);
DLSYM_PROTOTYPE(kmod_validate_resources);
extern DLSYM_PROTOTYPE(kmod_list_next);
extern DLSYM_PROTOTYPE(kmod_load_resources);
extern DLSYM_PROTOTYPE(kmod_module_get_initstate);
extern DLSYM_PROTOTYPE(kmod_module_get_module);
extern DLSYM_PROTOTYPE(kmod_module_get_name);
extern DLSYM_PROTOTYPE(kmod_module_new_from_lookup);
extern DLSYM_PROTOTYPE(kmod_module_probe_insert_module);
extern DLSYM_PROTOTYPE(kmod_module_unref);
extern DLSYM_PROTOTYPE(kmod_module_unref_list);
extern DLSYM_PROTOTYPE(kmod_new);
extern DLSYM_PROTOTYPE(kmod_set_log_fn);
extern DLSYM_PROTOTYPE(kmod_unref);
extern DLSYM_PROTOTYPE(kmod_validate_resources);
int dlopen_libkmod(void);

View File

@ -12,12 +12,12 @@
static void *passwdqc_dl = NULL;
DLSYM_FUNCTION(passwdqc_params_reset);
DLSYM_FUNCTION(passwdqc_params_load);
DLSYM_FUNCTION(passwdqc_params_parse);
DLSYM_FUNCTION(passwdqc_params_free);
DLSYM_FUNCTION(passwdqc_check);
DLSYM_FUNCTION(passwdqc_random);
DLSYM_PROTOTYPE(passwdqc_params_reset) = NULL;
DLSYM_PROTOTYPE(passwdqc_params_load) = NULL;
DLSYM_PROTOTYPE(passwdqc_params_parse) = NULL;
DLSYM_PROTOTYPE(passwdqc_params_free) = NULL;
DLSYM_PROTOTYPE(passwdqc_check) = NULL;
DLSYM_PROTOTYPE(passwdqc_random) = NULL;
int dlopen_passwdqc(void) {
ELF_NOTE_DLOPEN("passwdqc",

View File

@ -8,12 +8,12 @@
#include "dlfcn-util.h"
DLSYM_PROTOTYPE(passwdqc_params_reset);
DLSYM_PROTOTYPE(passwdqc_params_load);
DLSYM_PROTOTYPE(passwdqc_params_parse);
DLSYM_PROTOTYPE(passwdqc_params_free);
DLSYM_PROTOTYPE(passwdqc_check);
DLSYM_PROTOTYPE(passwdqc_random);
extern DLSYM_PROTOTYPE(passwdqc_params_reset);
extern DLSYM_PROTOTYPE(passwdqc_params_load);
extern DLSYM_PROTOTYPE(passwdqc_params_parse);
extern DLSYM_PROTOTYPE(passwdqc_params_free);
extern DLSYM_PROTOTYPE(passwdqc_check);
extern DLSYM_PROTOTYPE(passwdqc_random);
int dlopen_passwdqc(void);

View File

@ -14,14 +14,14 @@
static void *pwquality_dl = NULL;
DLSYM_FUNCTION(pwquality_check);
DLSYM_FUNCTION(pwquality_default_settings);
DLSYM_FUNCTION(pwquality_free_settings);
DLSYM_FUNCTION(pwquality_generate);
DLSYM_FUNCTION(pwquality_get_str_value);
DLSYM_FUNCTION(pwquality_read_config);
DLSYM_FUNCTION(pwquality_set_int_value);
DLSYM_FUNCTION(pwquality_strerror);
DLSYM_PROTOTYPE(pwquality_check) = NULL;
DLSYM_PROTOTYPE(pwquality_default_settings) = NULL;
DLSYM_PROTOTYPE(pwquality_free_settings) = NULL;
DLSYM_PROTOTYPE(pwquality_generate) = NULL;
DLSYM_PROTOTYPE(pwquality_get_str_value) = NULL;
DLSYM_PROTOTYPE(pwquality_read_config) = NULL;
DLSYM_PROTOTYPE(pwquality_set_int_value) = NULL;
DLSYM_PROTOTYPE(pwquality_strerror) = NULL;
int dlopen_pwquality(void) {
ELF_NOTE_DLOPEN("pwquality",

View File

@ -10,14 +10,14 @@
#include "dlfcn-util.h"
DLSYM_PROTOTYPE(pwquality_check);
DLSYM_PROTOTYPE(pwquality_default_settings);
DLSYM_PROTOTYPE(pwquality_free_settings);
DLSYM_PROTOTYPE(pwquality_generate);
DLSYM_PROTOTYPE(pwquality_get_str_value);
DLSYM_PROTOTYPE(pwquality_read_config);
DLSYM_PROTOTYPE(pwquality_set_int_value);
DLSYM_PROTOTYPE(pwquality_strerror);
extern DLSYM_PROTOTYPE(pwquality_check);
extern DLSYM_PROTOTYPE(pwquality_default_settings);
extern DLSYM_PROTOTYPE(pwquality_free_settings);
extern DLSYM_PROTOTYPE(pwquality_generate);
extern DLSYM_PROTOTYPE(pwquality_get_str_value);
extern DLSYM_PROTOTYPE(pwquality_read_config);
extern DLSYM_PROTOTYPE(pwquality_set_int_value);
extern DLSYM_PROTOTYPE(pwquality_strerror);
int dlopen_pwquality(void);

View File

@ -7,13 +7,13 @@
#if HAVE_PCRE2
static void *pcre2_dl = NULL;
DLSYM_FUNCTION(pcre2_match_data_create);
DLSYM_FUNCTION(pcre2_match_data_free);
DLSYM_FUNCTION(pcre2_code_free);
DLSYM_FUNCTION(pcre2_compile);
DLSYM_FUNCTION(pcre2_get_error_message);
DLSYM_FUNCTION(pcre2_match);
DLSYM_FUNCTION(pcre2_get_ovector_pointer);
DLSYM_PROTOTYPE(pcre2_match_data_create) = NULL;
DLSYM_PROTOTYPE(pcre2_match_data_free) = NULL;
DLSYM_PROTOTYPE(pcre2_code_free) = NULL;
DLSYM_PROTOTYPE(pcre2_compile) = NULL;
DLSYM_PROTOTYPE(pcre2_get_error_message) = NULL;
DLSYM_PROTOTYPE(pcre2_match) = NULL;
DLSYM_PROTOTYPE(pcre2_get_ovector_pointer) = NULL;
DEFINE_HASH_OPS_WITH_KEY_DESTRUCTOR(
pcre2_code_hash_ops_free,

View File

@ -11,13 +11,13 @@
#define PCRE2_CODE_UNIT_WIDTH 8
#include <pcre2.h>
DLSYM_PROTOTYPE(pcre2_match_data_create);
DLSYM_PROTOTYPE(pcre2_match_data_free);
DLSYM_PROTOTYPE(pcre2_code_free);
DLSYM_PROTOTYPE(pcre2_compile);
DLSYM_PROTOTYPE(pcre2_get_error_message);
DLSYM_PROTOTYPE(pcre2_match);
DLSYM_PROTOTYPE(pcre2_get_ovector_pointer);
extern DLSYM_PROTOTYPE(pcre2_match_data_create);
extern DLSYM_PROTOTYPE(pcre2_match_data_free);
extern DLSYM_PROTOTYPE(pcre2_code_free);
extern DLSYM_PROTOTYPE(pcre2_compile);
extern DLSYM_PROTOTYPE(pcre2_get_error_message);
extern DLSYM_PROTOTYPE(pcre2_match);
extern DLSYM_PROTOTYPE(pcre2_get_ovector_pointer);
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(pcre2_match_data*, sym_pcre2_match_data_free, NULL);
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(pcre2_code*, sym_pcre2_code_free, NULL);

View File

@ -43,22 +43,22 @@ bool pkcs11_uri_valid(const char *uri) {
static void *p11kit_dl = NULL;
DLSYM_FUNCTION(p11_kit_module_get_name);
DLSYM_FUNCTION(p11_kit_modules_finalize_and_release);
DLSYM_FUNCTION(p11_kit_modules_load_and_initialize);
DLSYM_FUNCTION(p11_kit_strerror);
DLSYM_FUNCTION(p11_kit_uri_format);
DLSYM_FUNCTION(p11_kit_uri_free);
DLSYM_FUNCTION(p11_kit_uri_get_attributes);
DLSYM_FUNCTION(p11_kit_uri_get_attribute);
DLSYM_FUNCTION(p11_kit_uri_set_attribute);
DLSYM_FUNCTION(p11_kit_uri_get_module_info);
DLSYM_FUNCTION(p11_kit_uri_get_slot_info);
DLSYM_FUNCTION(p11_kit_uri_get_token_info);
DLSYM_FUNCTION(p11_kit_uri_match_token_info);
DLSYM_FUNCTION(p11_kit_uri_message);
DLSYM_FUNCTION(p11_kit_uri_new);
DLSYM_FUNCTION(p11_kit_uri_parse);
DLSYM_PROTOTYPE(p11_kit_module_get_name) = NULL;
DLSYM_PROTOTYPE(p11_kit_modules_finalize_and_release) = NULL;
DLSYM_PROTOTYPE(p11_kit_modules_load_and_initialize) = NULL;
DLSYM_PROTOTYPE(p11_kit_strerror) = NULL;
DLSYM_PROTOTYPE(p11_kit_uri_format) = NULL;
DLSYM_PROTOTYPE(p11_kit_uri_free) = NULL;
DLSYM_PROTOTYPE(p11_kit_uri_get_attributes) = NULL;
DLSYM_PROTOTYPE(p11_kit_uri_get_attribute) = NULL;
DLSYM_PROTOTYPE(p11_kit_uri_set_attribute) = NULL;
DLSYM_PROTOTYPE(p11_kit_uri_get_module_info) = NULL;
DLSYM_PROTOTYPE(p11_kit_uri_get_slot_info) = NULL;
DLSYM_PROTOTYPE(p11_kit_uri_get_token_info) = NULL;
DLSYM_PROTOTYPE(p11_kit_uri_match_token_info) = NULL;
DLSYM_PROTOTYPE(p11_kit_uri_message) = NULL;
DLSYM_PROTOTYPE(p11_kit_uri_new) = NULL;
DLSYM_PROTOTYPE(p11_kit_uri_parse) = NULL;
int dlopen_p11kit(void) {
ELF_NOTE_DLOPEN("p11-kit",

View File

@ -20,22 +20,22 @@
bool pkcs11_uri_valid(const char *uri);
#if HAVE_P11KIT
DLSYM_PROTOTYPE(p11_kit_module_get_name);
DLSYM_PROTOTYPE(p11_kit_modules_finalize_and_release);
DLSYM_PROTOTYPE(p11_kit_modules_load_and_initialize);
DLSYM_PROTOTYPE(p11_kit_strerror);
DLSYM_PROTOTYPE(p11_kit_uri_format);
DLSYM_PROTOTYPE(p11_kit_uri_free);
DLSYM_PROTOTYPE(p11_kit_uri_get_attributes);
DLSYM_PROTOTYPE(p11_kit_uri_get_attribute);
DLSYM_PROTOTYPE(p11_kit_uri_set_attribute);
DLSYM_PROTOTYPE(p11_kit_uri_get_module_info);
DLSYM_PROTOTYPE(p11_kit_uri_get_slot_info);
DLSYM_PROTOTYPE(p11_kit_uri_get_token_info);
DLSYM_PROTOTYPE(p11_kit_uri_match_token_info);
DLSYM_PROTOTYPE(p11_kit_uri_message);
DLSYM_PROTOTYPE(p11_kit_uri_new);
DLSYM_PROTOTYPE(p11_kit_uri_parse);
extern DLSYM_PROTOTYPE(p11_kit_module_get_name);
extern DLSYM_PROTOTYPE(p11_kit_modules_finalize_and_release);
extern DLSYM_PROTOTYPE(p11_kit_modules_load_and_initialize);
extern DLSYM_PROTOTYPE(p11_kit_strerror);
extern DLSYM_PROTOTYPE(p11_kit_uri_format);
extern DLSYM_PROTOTYPE(p11_kit_uri_free);
extern DLSYM_PROTOTYPE(p11_kit_uri_get_attributes);
extern DLSYM_PROTOTYPE(p11_kit_uri_get_attribute);
extern DLSYM_PROTOTYPE(p11_kit_uri_set_attribute);
extern DLSYM_PROTOTYPE(p11_kit_uri_get_module_info);
extern DLSYM_PROTOTYPE(p11_kit_uri_get_slot_info);
extern DLSYM_PROTOTYPE(p11_kit_uri_get_token_info);
extern DLSYM_PROTOTYPE(p11_kit_uri_match_token_info);
extern DLSYM_PROTOTYPE(p11_kit_uri_message);
extern DLSYM_PROTOTYPE(p11_kit_uri_new);
extern DLSYM_PROTOTYPE(p11_kit_uri_parse);
int uri_from_string(const char *p, P11KitUri **ret);

View File

@ -18,8 +18,8 @@
static void *qrcode_dl = NULL;
static DLSYM_FUNCTION(QRcode_encodeString);
static DLSYM_FUNCTION(QRcode_free);
static DLSYM_PROTOTYPE(QRcode_encodeString) = NULL;
static DLSYM_PROTOTYPE(QRcode_free) = NULL;
int dlopen_qrencode(void) {
int r;

View File

@ -46,69 +46,69 @@ static void *libtss2_esys_dl = NULL;
static void *libtss2_rc_dl = NULL;
static void *libtss2_mu_dl = NULL;
static DLSYM_FUNCTION(Esys_Create);
static DLSYM_FUNCTION(Esys_CreateLoaded);
static DLSYM_FUNCTION(Esys_CreatePrimary);
static DLSYM_FUNCTION(Esys_EvictControl);
static DLSYM_FUNCTION(Esys_Finalize);
static DLSYM_FUNCTION(Esys_FlushContext);
static DLSYM_FUNCTION(Esys_Free);
static DLSYM_FUNCTION(Esys_GetCapability);
static DLSYM_FUNCTION(Esys_GetRandom);
static DLSYM_FUNCTION(Esys_Import);
static DLSYM_FUNCTION(Esys_Initialize);
static DLSYM_FUNCTION(Esys_Load);
static DLSYM_FUNCTION(Esys_LoadExternal);
static DLSYM_FUNCTION(Esys_NV_DefineSpace);
static DLSYM_FUNCTION(Esys_NV_UndefineSpace);
static DLSYM_FUNCTION(Esys_NV_Write);
static DLSYM_FUNCTION(Esys_PCR_Extend);
static DLSYM_FUNCTION(Esys_PCR_Read);
static DLSYM_FUNCTION(Esys_PolicyAuthValue);
static DLSYM_FUNCTION(Esys_PolicyAuthorize);
static DLSYM_FUNCTION(Esys_PolicyAuthorizeNV);
static DLSYM_FUNCTION(Esys_PolicyGetDigest);
static DLSYM_FUNCTION(Esys_PolicyOR);
static DLSYM_FUNCTION(Esys_PolicyPCR);
static DLSYM_FUNCTION(Esys_PolicySigned);
static DLSYM_FUNCTION(Esys_ReadPublic);
static DLSYM_FUNCTION(Esys_StartAuthSession);
static DLSYM_FUNCTION(Esys_Startup);
static DLSYM_FUNCTION(Esys_TestParms);
static DLSYM_FUNCTION(Esys_TR_Close);
static DLSYM_FUNCTION(Esys_TR_Deserialize);
static DLSYM_FUNCTION(Esys_TR_FromTPMPublic);
static DLSYM_FUNCTION(Esys_TR_GetName);
static DLSYM_FUNCTION(Esys_TR_GetTpmHandle);
static DLSYM_FUNCTION(Esys_TR_Serialize);
static DLSYM_FUNCTION(Esys_TR_SetAuth);
static DLSYM_FUNCTION(Esys_TRSess_GetAttributes);
static DLSYM_FUNCTION(Esys_TRSess_GetNonceTPM);
static DLSYM_FUNCTION(Esys_TRSess_SetAttributes);
static DLSYM_FUNCTION(Esys_Unseal);
static DLSYM_FUNCTION(Esys_VerifySignature);
static DLSYM_PROTOTYPE(Esys_Create) = NULL;
static DLSYM_PROTOTYPE(Esys_CreateLoaded) = NULL;
static DLSYM_PROTOTYPE(Esys_CreatePrimary) = NULL;
static DLSYM_PROTOTYPE(Esys_EvictControl) = NULL;
static DLSYM_PROTOTYPE(Esys_Finalize) = NULL;
static DLSYM_PROTOTYPE(Esys_FlushContext) = NULL;
static DLSYM_PROTOTYPE(Esys_Free) = NULL;
static DLSYM_PROTOTYPE(Esys_GetCapability) = NULL;
static DLSYM_PROTOTYPE(Esys_GetRandom) = NULL;
static DLSYM_PROTOTYPE(Esys_Import) = NULL;
static DLSYM_PROTOTYPE(Esys_Initialize) = NULL;
static DLSYM_PROTOTYPE(Esys_Load) = NULL;
static DLSYM_PROTOTYPE(Esys_LoadExternal) = NULL;
static DLSYM_PROTOTYPE(Esys_NV_DefineSpace) = NULL;
static DLSYM_PROTOTYPE(Esys_NV_UndefineSpace) = NULL;
static DLSYM_PROTOTYPE(Esys_NV_Write) = NULL;
static DLSYM_PROTOTYPE(Esys_PCR_Extend) = NULL;
static DLSYM_PROTOTYPE(Esys_PCR_Read) = NULL;
static DLSYM_PROTOTYPE(Esys_PolicyAuthValue) = NULL;
static DLSYM_PROTOTYPE(Esys_PolicyAuthorize) = NULL;
static DLSYM_PROTOTYPE(Esys_PolicyAuthorizeNV) = NULL;
static DLSYM_PROTOTYPE(Esys_PolicyGetDigest) = NULL;
static DLSYM_PROTOTYPE(Esys_PolicyOR) = NULL;
static DLSYM_PROTOTYPE(Esys_PolicyPCR) = NULL;
static DLSYM_PROTOTYPE(Esys_PolicySigned) = NULL;
static DLSYM_PROTOTYPE(Esys_ReadPublic) = NULL;
static DLSYM_PROTOTYPE(Esys_StartAuthSession) = NULL;
static DLSYM_PROTOTYPE(Esys_Startup) = NULL;
static DLSYM_PROTOTYPE(Esys_TestParms) = NULL;
static DLSYM_PROTOTYPE(Esys_TR_Close) = NULL;
static DLSYM_PROTOTYPE(Esys_TR_Deserialize) = NULL;
static DLSYM_PROTOTYPE(Esys_TR_FromTPMPublic) = NULL;
static DLSYM_PROTOTYPE(Esys_TR_GetName) = NULL;
static DLSYM_PROTOTYPE(Esys_TR_GetTpmHandle) = NULL;
static DLSYM_PROTOTYPE(Esys_TR_Serialize) = NULL;
static DLSYM_PROTOTYPE(Esys_TR_SetAuth) = NULL;
static DLSYM_PROTOTYPE(Esys_TRSess_GetAttributes) = NULL;
static DLSYM_PROTOTYPE(Esys_TRSess_GetNonceTPM) = NULL;
static DLSYM_PROTOTYPE(Esys_TRSess_SetAttributes) = NULL;
static DLSYM_PROTOTYPE(Esys_Unseal) = NULL;
static DLSYM_PROTOTYPE(Esys_VerifySignature) = NULL;
static DLSYM_FUNCTION(Tss2_MU_TPM2_CC_Marshal);
static DLSYM_FUNCTION(Tss2_MU_TPM2_HANDLE_Marshal);
static DLSYM_FUNCTION(Tss2_MU_TPM2B_DIGEST_Marshal);
static DLSYM_FUNCTION(Tss2_MU_TPM2B_ENCRYPTED_SECRET_Marshal);
static DLSYM_FUNCTION(Tss2_MU_TPM2B_ENCRYPTED_SECRET_Unmarshal);
static DLSYM_FUNCTION(Tss2_MU_TPM2B_NAME_Marshal);
static DLSYM_FUNCTION(Tss2_MU_TPM2B_PRIVATE_Marshal);
static DLSYM_FUNCTION(Tss2_MU_TPM2B_PRIVATE_Unmarshal);
static DLSYM_FUNCTION(Tss2_MU_TPM2B_PUBLIC_Marshal);
static DLSYM_FUNCTION(Tss2_MU_TPM2B_PUBLIC_Unmarshal);
static DLSYM_FUNCTION(Tss2_MU_TPM2B_SENSITIVE_Marshal);
static DLSYM_FUNCTION(Tss2_MU_TPML_PCR_SELECTION_Marshal);
static DLSYM_FUNCTION(Tss2_MU_TPMS_NV_PUBLIC_Marshal);
static DLSYM_FUNCTION(Tss2_MU_TPM2B_NV_PUBLIC_Marshal);
static DLSYM_FUNCTION(Tss2_MU_TPM2B_NV_PUBLIC_Unmarshal);
static DLSYM_FUNCTION(Tss2_MU_TPMS_ECC_POINT_Marshal);
static DLSYM_FUNCTION(Tss2_MU_TPMT_HA_Marshal);
static DLSYM_FUNCTION(Tss2_MU_TPMT_PUBLIC_Marshal);
static DLSYM_FUNCTION(Tss2_MU_UINT32_Marshal);
static DLSYM_PROTOTYPE(Tss2_MU_TPM2_CC_Marshal) = NULL;
static DLSYM_PROTOTYPE(Tss2_MU_TPM2_HANDLE_Marshal) = NULL;
static DLSYM_PROTOTYPE(Tss2_MU_TPM2B_DIGEST_Marshal) = NULL;
static DLSYM_PROTOTYPE(Tss2_MU_TPM2B_ENCRYPTED_SECRET_Marshal) = NULL;
static DLSYM_PROTOTYPE(Tss2_MU_TPM2B_ENCRYPTED_SECRET_Unmarshal) = NULL;
static DLSYM_PROTOTYPE(Tss2_MU_TPM2B_NAME_Marshal) = NULL;
static DLSYM_PROTOTYPE(Tss2_MU_TPM2B_PRIVATE_Marshal) = NULL;
static DLSYM_PROTOTYPE(Tss2_MU_TPM2B_PRIVATE_Unmarshal) = NULL;
static DLSYM_PROTOTYPE(Tss2_MU_TPM2B_PUBLIC_Marshal) = NULL;
static DLSYM_PROTOTYPE(Tss2_MU_TPM2B_PUBLIC_Unmarshal) = NULL;
static DLSYM_PROTOTYPE(Tss2_MU_TPM2B_SENSITIVE_Marshal) = NULL;
static DLSYM_PROTOTYPE(Tss2_MU_TPML_PCR_SELECTION_Marshal) = NULL;
static DLSYM_PROTOTYPE(Tss2_MU_TPMS_NV_PUBLIC_Marshal) = NULL;
static DLSYM_PROTOTYPE(Tss2_MU_TPM2B_NV_PUBLIC_Marshal) = NULL;
static DLSYM_PROTOTYPE(Tss2_MU_TPM2B_NV_PUBLIC_Unmarshal) = NULL;
static DLSYM_PROTOTYPE(Tss2_MU_TPMS_ECC_POINT_Marshal) = NULL;
static DLSYM_PROTOTYPE(Tss2_MU_TPMT_HA_Marshal) = NULL;
static DLSYM_PROTOTYPE(Tss2_MU_TPMT_PUBLIC_Marshal) = NULL;
static DLSYM_PROTOTYPE(Tss2_MU_UINT32_Marshal) = NULL;
static DLSYM_FUNCTION(Tss2_RC_Decode);
static DLSYM_PROTOTYPE(Tss2_RC_Decode) = NULL;
int dlopen_tpm2(void) {
int r;