diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-06-11 16:37:26 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-06-11 16:37:26 +0100 |
commit | 99dfcd69920f04aea5ac41a411562af3e5f78af5 (patch) | |
tree | 48609dce46ad338fcd6617815915ec6d73533349 /contrib | |
parent | f30371e886c11afd75e3f7e7e95bd59ffed72ec9 (diff) | |
download | rspamd-99dfcd69920f04aea5ac41a411562af3e5f78af5.tar.gz rspamd-99dfcd69920f04aea5ac41a411562af3e5f78af5.zip |
[Minor] Add special codes to mark invalid request/reply
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/librdns/rdns.h | 2 | ||||
-rw-r--r-- | contrib/librdns/util.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/contrib/librdns/rdns.h b/contrib/librdns/rdns.h index 7ace6e5cd..7ed35514f 100644 --- a/contrib/librdns/rdns.h +++ b/contrib/librdns/rdns.h @@ -45,6 +45,7 @@ struct rdns_io_channel; typedef void (*dns_callback_type) (struct rdns_reply *reply, void *arg); enum rdns_request_type { + RDNS_REQUEST_INVALID = -1, RDNS_REQUEST_A = 1, RDNS_REQUEST_NS = 2, RDNS_REQUEST_SOA = 6, @@ -111,6 +112,7 @@ struct rdns_reply_entry { enum dns_rcode { + RDNS_RC_INVALID = -1, RDNS_RC_NOERROR = 0, RDNS_RC_FORMERR = 1, RDNS_RC_SERVFAIL = 2, diff --git a/contrib/librdns/util.c b/contrib/librdns/util.c index a4018cbd3..401c6aad3 100644 --- a/contrib/librdns/util.c +++ b/contrib/librdns/util.c @@ -286,7 +286,7 @@ rdns_type_fromstr (const char *str) } } - return -1; + return RDNS_REQUEST_INVALID; } enum dns_rcode @@ -334,7 +334,7 @@ rdns_rcode_fromstr (const char *str) } } - return -1; + return RDNS_RC_INVALID; } uint16_t |