123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- #pragma once
- #include "netd_resolv/resolv.h"
- #include <stddef.h>
- #include <unordered_map>
- #include <vector>
- struct __res_state;
- constexpr int DNSEVENT_SUBSAMPLING_MAP_DEFAULT_KEY = -1;
- void _resolv_populate_res_for_net(struct __res_state* statp);
- std::vector<unsigned> resolv_list_caches();
- std::vector<std::string> resolv_cache_dump_subsampling_map(unsigned netid);
- uint32_t resolv_cache_get_subsampling_denom(unsigned netid, int return_code);
- typedef enum {
- RESOLV_CACHE_UNSUPPORTED,
-
- RESOLV_CACHE_NOTFOUND,
- RESOLV_CACHE_FOUND,
- RESOLV_CACHE_SKIP
- } ResolvCacheStatus;
- ResolvCacheStatus _resolv_cache_lookup(unsigned netid, const void* query, int querylen,
- void* answer, int answersize, int* answerlen,
- uint32_t flags);
- void _resolv_cache_add(unsigned netid, const void* query, int querylen, const void* answer,
- int answerlen);
- void _resolv_cache_query_failed(unsigned netid, const void* query, int querylen, uint32_t flags);
- int resolv_set_nameservers_for_net(unsigned netid, const char** servers, int numservers,
- const char* domains, const res_params* params);
- int resolv_create_cache_for_net(unsigned netid);
- void resolv_delete_cache_for_net(unsigned netid);
|