#ifndef DFSAN_H
#define DFSAN_H
#include "sanitizer_common/sanitizer_internal_defs.h"
#include "dfsan_platform.h"
u32;
u8;
uptr;
dfsan_label;
dfsan_origin;
extern "C" {
void dfsan_add_label(dfsan_label label, void *addr, uptr size);
void dfsan_set_label(dfsan_label label, void *addr, uptr size);
dfsan_label dfsan_read_label(const void *addr, uptr size);
dfsan_label dfsan_union(dfsan_label l1, dfsan_label l2);
void dfsan_clear_arg_tls(uptr offset, uptr size);
void dfsan_clear_thread_local_state();
void dfsan_set_arg_tls(uptr offset, dfsan_label label);
void dfsan_set_arg_origin_tls(uptr offset, dfsan_origin o);
dfsan_origin dfsan_read_origin_of_first_taint(const void *addr, uptr size);
void dfsan_set_label_origin(dfsan_label label, dfsan_origin origin, void *addr,
uptr size);
void dfsan_mem_origin_transfer(const void *dst, const void *src, uptr len);
void dfsan_mem_shadow_transfer(void *dst, const void *src, uptr len);
}
template <typename T>
void dfsan_set_label(dfsan_label label, T &data) { … }
namespace __dfsan {
extern bool dfsan_inited;
extern bool dfsan_init_is_running;
void initialize_interceptors();
inline dfsan_label *shadow_for(void *ptr) { … }
inline const dfsan_label *shadow_for(const void *ptr) { … }
inline uptr unaligned_origin_for(uptr ptr) { … }
inline dfsan_origin *origin_for(void *ptr) { … }
inline const dfsan_origin *origin_for(const void *ptr) { … }
void dfsan_copy_memory(void *dst, const void *src, uptr size);
void dfsan_allocator_init();
void dfsan_deallocate(void *ptr);
void *dfsan_malloc(uptr size);
void *dfsan_calloc(uptr nmemb, uptr size);
void *dfsan_realloc(void *ptr, uptr size);
void *dfsan_reallocarray(void *ptr, uptr nmemb, uptr size);
void *dfsan_valloc(uptr size);
void *dfsan_pvalloc(uptr size);
void *dfsan_aligned_alloc(uptr alignment, uptr size);
void *dfsan_memalign(uptr alignment, uptr size);
int dfsan_posix_memalign(void **memptr, uptr alignment, uptr size);
void dfsan_init();
}
#endif