aboutsummaryrefslogtreecommitdiffstats
path: root/src/dns.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-06 20:38:03 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-06 20:38:03 +0400
commit75bf13b9bda0d1eb98671b68064becd4f6946c14 (patch)
tree91a5c03c1d4f394762301fa0aac588baacd99b49 /src/dns.h
parent52c0b882c0b885a70d6e6af858c08771b6db3ea6 (diff)
downloadrspamd-75bf13b9bda0d1eb98671b68064becd4f6946c14.tar.gz
rspamd-75bf13b9bda0d1eb98671b68064becd4f6946c14.zip
* Add ability to test regexp with 'T' flag
* Write more code for DNS resolver: - initial RR parser - name compression - replies handler
Diffstat (limited to 'src/dns.h')
-rw-r--r--src/dns.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/dns.h b/src/dns.h
index 8f1f2c6cc..6573377cb 100644
--- a/src/dns.h
+++ b/src/dns.h
@@ -11,6 +11,8 @@
#define DNS_D_MAXLABEL 63 /* + 1 '\0' */
#define DNS_D_MAXNAME 255 /* + 1 '\0' */
+#define MAX_ADDRS 64
+
struct rspamd_dns_reply;
struct config_file;
@@ -23,6 +25,7 @@ struct rspamd_dns_server {
struct in_addr addr; /**< address of DNS server */
char *name; /**< name of DNS server */
int sock; /**< persistent socket */
+ struct event ev;
};
#define DNS_K_TEA_KEY_SIZE 16
@@ -52,6 +55,13 @@ struct rspamd_dns_resolver {
struct dns_header;
struct dns_query;
+enum rspamd_request_type {
+ DNS_REQUEST_A = 0,
+ DNS_REQUEST_PTR,
+ DNS_REQUEST_MX,
+ DNS_REQUEST_TXT
+};
+
struct rspamd_dns_request {
memory_pool_t *pool; /**< pool associated with request */
struct rspamd_dns_resolver *resolver;
@@ -69,18 +79,15 @@ struct rspamd_dns_request {
off_t pos;
guint packet_len;
int sock;
+ enum rspamd_request_type type;
};
-enum rspamd_request_type {
- DNS_REQUEST_A = 0,
- DNS_REQUEST_PTR,
- DNS_REQUEST_MX,
- DNS_REQUEST_TXT
-};
+
union rspamd_reply_element {
struct {
- struct in_addr addr;
+ struct in_addr addr[MAX_ADDRS];
+ guint16 addrcount;
} a;
struct {
char *name;