#include "spf_request.h"
#include "spf_dns_rr.h"
Include dependency graph for spf_dns.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | SPF_dns_server_struct |
Defines | |
#define | ns_t_invalid 0 |
#define | ns_t_a 1 |
#define | ns_t_ns 2 |
#define | ns_t_cname 5 |
#define | ns_t_ptr 12 |
#define | ns_t_mx 15 |
#define | ns_t_txt 16 |
#define | ns_t_aaaa 28 |
#define | ns_t_any 255 |
#define | ns_t_spf 99 |
#define | ns_t_invalid 0 |
#define | NETDB_SUCCESS 0 |
#define | HOST_NOT_FOUND 1 |
#define | TRY_AGAIN 2 |
#define | NO_RECOVERY 3 |
#define | NO_DATA 4 |
Typedefs | |
typedef int | ns_type |
typedef int | SPF_dns_stat_t |
typedef SPF_dns_server_struct | SPF_dns_server_t |
typedef void(* | SPF_dns_destroy_t )(SPF_dns_server_t *spf_dns_server) |
typedef SPF_dns_rr_t *(* | SPF_dns_lookup_t )(SPF_dns_server_t *spf_dns_server, const char *domain, ns_type ns_type, int should_cache) |
typedef SPF_errcode_t(* | SPF_dns_get_spf_t )(SPF_server_t *spf_server, SPF_request_t *spf_request, SPF_response_t *spf_response, SPF_record_t **spf_recordp) |
typedef SPF_errcode_t(* | SPF_dns_get_exp_t )(SPF_server_t *spf_server, const char *domain, char **buf, size_t *buf_len) |
typedef int(* | SPF_dns_add_cache_t )(SPF_server_t *spf_server, SPF_dns_rr_t spfrr) |
Functions | |
void | SPF_dns_free (SPF_dns_server_t *spf_dns_server) |
SPF_dns_rr_t * | SPF_dns_lookup (SPF_dns_server_t *spf_dns_server, const char *domain, ns_type rr_type, int should_cache) |
SPF_dns_rr_t * | SPF_dns_rlookup (SPF_dns_server_t *spf_dns_server, struct in_addr ipv4, ns_type rr_type, int should_cache) |
SPF_dns_rr_t * | SPF_dns_rlookup6 (SPF_dns_server_t *spf_dns_server, struct in6_addr ipv6, ns_type rr_type, int should_cache) |
char * | SPF_dns_get_client_dom (SPF_dns_server_t *spf_dns_server, SPF_request_t *sr) |
When you create a new DNS layer, you can (optionally) specify the layer below it. If the current DNS layer is not able to resolve the query, it will automatically call the lower layer.
Some of the DNS layers allow for debugging information to be printed, some do caching, and, of course, some return actual DNS results either by query the network or by looking up the query in a database.
For details about each DNS layer, see the appropriate spf_dns_<layer>.h include file.
For example, there is a caching DNS layer that saves the compiled SPF records for future use. While it takes a small amount of time to compile the AOL SPF record, you will more than make up for it by not having to parse the record every time you get a message from AOL.
If you wanted to, you can even run the SPF system without using real DNS lookups at all. For testing, I used a DNS layer that contained a built-in zone file. This idea could easily be extended to being able to read the zone file from disk, or to use a database to access information.
One example of what you could do with such a zone file would be to create your own SPF records for the many free-email providers. Depending on whether you layer this local zone file before or after the real DNS lookups, you can either override published SPF records, or you can provide defaults until SPF records are published.
Definition in file spf_dns.h.
|
NXDOMAIN (authoritative answer) Definition at line 103 of file spf_dns.h. Referenced by SPF_dns_rr_new_nxdomain(), SPF_dns_zone_new(), SPF_request_get_exp(), and SPF_server_get_record(). |
|
Definition at line 102 of file spf_dns.h. Referenced by SPF_request_get_exp(), and SPF_server_get_record(). |
|
host found, but no RR of req type Definition at line 106 of file spf_dns.h. Referenced by SPF_request_get_exp(), and SPF_server_get_record(). |
|
invalid/unimplmeneted query Definition at line 105 of file spf_dns.h. Referenced by SPF_server_get_record(). |
|
Definition at line 75 of file spf_dns.h. Referenced by SPF_dns_get_client_dom(), SPF_dns_rr_dup(), SPF_dns_zone_add_str(), SPF_record_interpret(), and SPF_strrrtype(). |
|
Definition at line 81 of file spf_dns.h. Referenced by SPF_dns_get_client_dom(), SPF_dns_rr_dup(), SPF_dns_zone_add_str(), SPF_record_interpret(), and SPF_strrrtype(). |
|
Wildcard match. Definition at line 83 of file spf_dns.h. Referenced by SPF_dns_rr_new_nxdomain(), SPF_dns_zone_add_str(), SPF_dns_zone_new(), and SPF_strrrtype(). |
|
|
|
|
|
Definition at line 93 of file spf_dns.h. Referenced by SPF_strrrtype(). |
|
Definition at line 79 of file spf_dns.h. Referenced by SPF_dns_rr_dup(), SPF_dns_zone_add_str(), SPF_record_interpret(), and SPF_strrrtype(). |
|
|
|
Definition at line 78 of file spf_dns.h. Referenced by main(), SPF_dns_get_client_dom(), SPF_dns_rr_dup(), SPF_dns_zone_add_str(), SPF_record_interpret(), and SPF_strrrtype(). |
|
Definition at line 89 of file spf_dns.h. Referenced by SPF_dns_rr_dup(), SPF_dns_zone_add_str(), and SPF_strrrtype(). |
|
Definition at line 80 of file spf_dns.h. Referenced by main(), SPF_dns_rr_dup(), SPF_dns_zone_add_str(), SPF_request_get_exp(), and SPF_strrrtype(). |
|
SERVFAIL (no authoritative answer) Definition at line 104 of file spf_dns.h. Referenced by SPF_request_get_exp(), and SPF_server_get_record(). |
|
Definition at line 85 of file spf_dns.h. Referenced by SPF_record_interpret(), and SPF_server_get_record(). |
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 108 of file spf_dns.h. Referenced by SPF_server_get_record(). |
|
Definition at line 116 of file spf_dns.c. References SPF_dns_server_struct::destroy, SPF_dns_server_struct::layer_below, SPF_ASSERT_NOTNULL, and SPF_dns_server_t. Referenced by SPF_server_free(). |
|
This may return NULL if the strdup() fails. This ought to be refactored with the PTR code in the interpreter. Definition at line 206 of file spf_dns.c. References SPF_dns_rr_data_t::a, SPF_dns_rr_data_t::aaaa, SPF_request_struct::client_ver, FALSE, SPF_request_struct::ipv4, SPF_request_struct::ipv6, ns_t_a, ns_t_aaaa, ns_t_ptr, SPF_dns_rr_struct::num_rr, SPF_dns_rr_data_t::ptr, SPF_dns_rr_struct::rr, SPF_ASSERT_NOTNULL, SPF_dns_lookup(), SPF_dns_rlookup(), SPF_dns_rlookup6(), SPF_dns_rr_free(), SPF_dns_rr_t, SPF_dns_server_t, and SPF_request_t. Referenced by SPF_request_get_client_dom(). |
Here is the call graph for this function:
|
Definition at line 133 of file spf_dns.c. References SPF_dns_server_struct::lookup, SPF_ASSERT_NOTNULL, SPF_dns_rr_t, SPF_dns_server_t, and SPF_error. Referenced by main(), SPF_dns_get_client_dom(), SPF_dns_rlookup(), SPF_dns_rlookup6(), SPF_record_interpret(), SPF_request_get_exp(), and SPF_server_get_record(). |
|
Definition at line 150 of file spf_dns.c. References SPF_dns_lookup(), and SPF_dns_server_t. Referenced by main(), SPF_dns_get_client_dom(), and SPF_record_interpret(). |
Here is the call graph for this function:
|
Definition at line 171 of file spf_dns.c. References SPF_dns_lookup(), and SPF_dns_server_t. Referenced by SPF_dns_get_client_dom(), and SPF_record_interpret(). |
Here is the call graph for this function: