1 #ifndef ACL_DNS_INCLUDE_H 2 #define ACL_DNS_INCLUDE_H 8 #include "../stdlib/acl_define.h" 9 #include "../stdlib/acl_htable.h" 10 #include "../stdlib/acl_cache2.h" 12 #include <netinet/in.h> 13 #include <arpa/inet.h> 15 #include "../event/acl_events.h" 16 #include "../aio/acl_aio.h" 24 #define ACL_DNS_OK_CACHE 1 25 #define ACL_DNS_ERR_FMT -1 26 #define ACL_DNS_ERR_SVR -2 27 #define ACL_DNS_ERR_NO_EXIST -3 28 #define ACL_DNS_ERR_NO_SUPPORT -4 29 #define ACL_DNS_ERR_DENY -5 30 #define ACL_DNS_ERR_YX -6 31 #define ACL_DNS_ERR_YXRR -7 32 #define ACL_DNS_ERR_NXRR -8 33 #define ACL_DNS_ERR_NO_AUTH -9 34 #define ACL_DNS_ERR_NOT_ZONE -10 35 #define ACL_DNS_ERR_UNPACK -15 36 #define ACL_DNS_ERR_TIMEOUT -16 37 #define ACL_DNS_ERR_EXIST -17 38 #define ACL_DNS_ERR_BUILD_REQ -18 63 #define ACL_DNS_FLAG_ALLOC (1 << 0) 64 #define ACL_DNS_FLAG_CHECK_DNS_IP (1 << 1) 65 #define ACL_DNS_FLAG_CHECK_DNS_NET (1 << 2) 105 unsigned short dns_port,
int mask_length);
215 const char *ip_list,
const char *excepts);
ACL_API void acl_dns_add_dns(ACL_DNS *dns, const char *dns_ip, unsigned short dns_port, int mask_length)
ACL_API void acl_dns_cancel(ACL_DNS_REQ *handle)
struct ACL_DNS_REQ ACL_DNS_REQ
ACL_API void acl_dns_clear_dns(ACL_DNS *dns)
ACL_API void acl_dns_del_dns(ACL_DNS *dns, const char *ip, unsigned short port)
ACL_API void acl_dns_lookup(ACL_DNS *dns, const char *domain, void(*callback)(ACL_DNS_DB *, void *, int, const ACL_RFC1035_MESSAGE *), void *ctx)
ACL_API const char * acl_dns_serror(int errnum)
ACL_API void acl_dns_check_dns_net(ACL_DNS *dns)
ACL_API ACL_ARRAY * acl_dns_list(ACL_DNS *dns)
ACL_API void acl_dns_add_group(ACL_DNS *dns, const char *group, const char *refer, const char *ip_list, const char *excepts)
ACL_API size_t acl_dns_size(ACL_DNS *dns)
ACL_API void acl_dns_lookup2(ACL_DNS *dns, const char *domain, unsigned short type, void(*callback)(ACL_DNS_DB *, void *, int, const ACL_RFC1035_MESSAGE *), void *ctx)
ACL_API int acl_dns_empty(ACL_DNS *dns)
ACL_API ACL_DNS * acl_dns_create(ACL_AIO *aio, int timeout)
ACL_HTABLE * lookup_table
ACL_API void acl_dns_set_retry_limit(ACL_DNS *dns, int retry_limit)
ACL_API void acl_dns_close(ACL_DNS *dns)
ACL_API void acl_dns_add_host(ACL_DNS *dns, const char *domain, const char *ip_list)
ACL_API void acl_dns_open_cache(ACL_DNS *dns, int limit)
struct ACL_DNS_ADDR ACL_DNS_ADDR
ACL_EVENT_NOTIFY_TIME lookup_timeout
ACL_API void acl_dns_check_dns_ip(ACL_DNS *dns)
void(* ACL_EVENT_NOTIFY_TIME)(int event_type, ACL_EVENT *event, void *context)
ACL_API int acl_dns_init(ACL_DNS *dns, ACL_AIO *aio, int timeout)