libspf2 1.2.11
spf_dns.c File Reference
#include "spf_sys_config.h"
#include "spf.h"
#include "spf_dns.h"
#include "spf_internal.h"
#include "spf_dns_internal.h"
Include dependency graph for spf_dns.c:

Go to the source code of this file.

Functions

void SPF_dns_free (SPF_dns_server_t *spf_dns_server)
SPF_dns_rr_tSPF_dns_lookup (SPF_dns_server_t *spf_dns_server, const char *domain, ns_type rr_type, int should_cache)
SPF_dns_rr_tSPF_dns_rlookup (SPF_dns_server_t *spf_dns_server, struct in_addr ipv4, ns_type rr_type, int should_cache)
SPF_dns_rr_tSPF_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)

Function Documentation

◆ SPF_dns_free()

void SPF_dns_free ( SPF_dns_server_t * spf_dns_server)

Definition at line 116 of file spf_dns.c.

References NULL, SPF_ASSERT_NOTNULL, and SPF_dns_free().

Referenced by SPF_dns_free(), and SPF_server_free().

Here is the call graph for this function:

◆ SPF_dns_get_client_dom()

char * SPF_dns_get_client_dom ( SPF_dns_server_t * spf_dns_server,
SPF_request_t * sr )

This may return NULL if the strdup() fails.

This ought to be refactored with the PTR code in the interpreter.

The client domain is the validated domain name of the client IP address. This is not just the domain name(s) found in the reverse DNS tree, but involves checking to make sure these name(s) use the client IP address. The complete validation procedure is described in section 5.4 of the SPF spec.

Definition at line 206 of file spf_dns.c.

References SPF_dns_rr_data_t::a, SPF_dns_rr_data_t::aaaa, FALSE, ns_t_a, ns_t_aaaa, ns_t_ptr, SPF_dns_rr_t::num_rr, SPF_dns_rr_data_t::ptr, SPF_dns_rr_t::rr, SPF_ASSERT_NOTNULL, SPF_dns_lookup(), SPF_dns_rlookup(), SPF_dns_rlookup6(), SPF_dns_rr_free(), and SPF_MAX_DNS_PTR.

Referenced by SPF_request_get_client_dom().

Here is the call graph for this function:

◆ SPF_dns_lookup()

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_rlookup()

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 )

Definition at line 150 of file spf_dns.c.

References SPF_dns_lookup().

Referenced by main(), SPF_dns_get_client_dom(), and SPF_record_interpret().

Here is the call graph for this function:

◆ SPF_dns_rlookup6()

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 )

Definition at line 171 of file spf_dns.c.

References SPF_dns_lookup().

Referenced by SPF_dns_get_client_dom(), and SPF_record_interpret().

Here is the call graph for this function: