#include "spf_sys_config.h"
#include "spf.h"
#include "spf_dns.h"
#include "spf_request.h"
#include "spf_internal.h"
Go to the source code of this file.
#define SPF_FREE | ( | x | ) | do { if (x) free(x); (x) = NULL; } while(0) |
Definition at line 37 of file spf_request.c.
Referenced by SPF_request_free(), SPF_request_set_env_from(), and SPF_request_set_helo_dom().
void SPF_request_free | ( | SPF_request_t * | sr | ) |
Definition at line 59 of file spf_request.c.
References SPF_request_struct::client_dom, SPF_request_struct::env_from, SPF_request_struct::env_from_dp, SPF_request_struct::env_from_lp, SPF_request_struct::helo_dom, SPF_ASSERT_NOTNULL, and SPF_FREE.
Referenced by main().
const char* SPF_request_get_client_dom | ( | SPF_request_t * | sr | ) |
Definition at line 196 of file spf_request.c.
References SPF_request_struct::client_dom, NULL, SPF_server_struct::resolver, SPF_ASSERT_NOTNULL, SPF_dns_get_client_dom(), and SPF_request_struct::spf_server.
Referenced by SPF_record_expand_data().
const char* SPF_request_get_rec_dom | ( | SPF_request_t * | sr | ) |
Definition at line 131 of file spf_request.c.
References SPF_server_struct::rec_dom, and SPF_request_struct::spf_server.
Referenced by SPF_record_expand_data().
int SPF_request_is_loopback | ( | SPF_request_t * | sr | ) |
Definition at line 212 of file spf_request.c.
References SPF_request_struct::client_ver, FALSE, SPF_request_struct::ipv4, SPF_request_struct::ipv6, and TRUE.
Referenced by SPF_record_interpret(), SPF_request_query_fallback(), SPF_request_query_mailfrom(), and SPF_request_query_rcptto().
SPF_request_t* SPF_request_new | ( | SPF_server_t * | spf_server | ) |
Definition at line 41 of file spf_request.c.
References SPF_request_struct::client_ver, SPF_request_struct::ipv4, SPF_request_struct::ipv6, and SPF_request_struct::spf_server.
Referenced by main().
SPF_errcode_t SPF_request_query_fallback | ( | SPF_request_t * | spf_request, | |
SPF_response_t ** | spf_responsep, | |||
const char * | record | |||
) |
Definition at line 299 of file spf_request.c.
References SPF_ASSERT_NOTNULL, SPF_E_NO_MEMORY, SPF_E_SUCCESS, SPF_i_done(), SPF_REASON_LOCALHOST, SPF_record_compile(), SPF_request_is_loopback(), SPF_response_new(), SPF_RESULT_PASS, and SPF_request_struct::spf_server.
Referenced by main().
SPF_errcode_t SPF_request_query_mailfrom | ( | SPF_request_t * | spf_request, | |
SPF_response_t ** | spf_responsep | |||
) |
The big entry point.
Definition at line 269 of file spf_request.c.
References SPF_ASSERT_NOTNULL, SPF_E_NO_MEMORY, SPF_E_SUCCESS, SPF_i_done(), SPF_REASON_LOCALHOST, SPF_request_is_loopback(), SPF_response_new(), SPF_RESULT_PASS, SPF_request_struct::spf_server, and SPF_server_get_record().
Referenced by main().
SPF_errcode_t SPF_request_query_rcptto | ( | SPF_request_t * | spf_request, | |
SPF_response_t ** | spf_responsep, | |||
const char * | rcpt_to | |||
) |
This replaces _2mx
build record as SPF_VER_STR " mx:%s" Set cur_dom to the rcpt_to domain. Query on the 'fixed' 2mx record. Clobber the primary result.
Definition at line 339 of file spf_request.c.
References SPF_request_struct::cur_dom, NULL, SPF_ASSERT_NOTNULL, SPF_E_NO_MEMORY, SPF_E_SUCCESS, SPF_i_done(), SPF_REASON_LOCALHOST, SPF_record_compile(), SPF_request_is_loopback(), SPF_response_new(), SPF_RESULT_PASS, SPF_request_struct::spf_server, and SPF_VER_STR.
Referenced by main().
int SPF_request_set_env_from | ( | SPF_request_t * | sr, | |
const char * | from | |||
) |
Definition at line 139 of file spf_request.c.
References SPF_request_struct::env_from, SPF_request_struct::env_from_dp, SPF_request_struct::env_from_lp, SPF_request_struct::helo_dom, NULL, SPF_ASSERT_NOTNULL, SPF_E_NO_MEMORY, and SPF_FREE.
Referenced by main(), and SPF_request_set_helo_dom().
SPF_errcode_t SPF_request_set_helo_dom | ( | SPF_request_t * | sr, | |
const char * | dom | |||
) |
Definition at line 117 of file spf_request.c.
References SPF_request_struct::env_from, SPF_request_struct::helo_dom, NULL, SPF_ASSERT_NOTNULL, SPF_E_NO_MEMORY, SPF_E_SUCCESS, SPF_FREE, and SPF_request_set_env_from().
Referenced by main().
SPF_errcode_t SPF_request_set_ipv4 | ( | SPF_request_t * | sr, | |
struct in_addr | addr | |||
) |
Definition at line 71 of file spf_request.c.
References SPF_request_struct::client_dom, SPF_request_struct::client_ver, SPF_request_struct::ipv4, NULL, and SPF_E_SUCCESS.
Referenced by SPF_request_set_ipv4_str().
SPF_errcode_t SPF_request_set_ipv4_str | ( | SPF_request_t * | sr, | |
const char * | astr | |||
) |
Definition at line 95 of file spf_request.c.
References NULL, SPF_E_INVALID_IP4, and SPF_request_set_ipv4().
Referenced by main().
SPF_errcode_t SPF_request_set_ipv6 | ( | SPF_request_t * | sr, | |
struct in6_addr | addr | |||
) |
Definition at line 83 of file spf_request.c.
References SPF_request_struct::client_dom, SPF_request_struct::client_ver, SPF_request_struct::ipv6, NULL, and SPF_E_SUCCESS.
Referenced by SPF_request_set_ipv6_str().
SPF_errcode_t SPF_request_set_ipv6_str | ( | SPF_request_t * | sr, | |
const char * | astr | |||
) |
Definition at line 106 of file spf_request.c.
References NULL, SPF_E_INVALID_IP6, and SPF_request_set_ipv6().
Referenced by main().