libspf2 1.2.11
Macros | Functions
spf_request.c File Reference
#include "spf_sys_config.h"
#include "spf.h"
#include "spf_dns.h"
#include "spf_request.h"
#include "spf_internal.h"
Include dependency graph for spf_request.c:

Go to the source code of this file.

Macros

#define SPF_FREE(x)    do { if (x) free(x); (x) = NULL; } while(0)
 

Functions

SPF_request_t * SPF_request_new (SPF_server_t *spf_server)
 
void SPF_request_free (SPF_request_t *sr)
 
SPF_errcode_t SPF_request_set_ipv4 (SPF_request_t *sr, struct in_addr addr)
 
SPF_errcode_t SPF_request_set_ipv6 (SPF_request_t *sr, struct in6_addr addr)
 
SPF_errcode_t SPF_request_set_ipv4_str (SPF_request_t *sr, const char *astr)
 
SPF_errcode_t SPF_request_set_ipv6_str (SPF_request_t *sr, const char *astr)
 
SPF_errcode_t SPF_request_set_helo_dom (SPF_request_t *sr, const char *dom)
 
const char * SPF_request_get_rec_dom (SPF_request_t *sr)
 
int SPF_request_set_env_from (SPF_request_t *sr, const char *from)
 
const char * SPF_request_get_client_dom (SPF_request_t *sr)
 
int SPF_request_is_loopback (SPF_request_t *sr)
 
SPF_errcode_t SPF_request_query_mailfrom (SPF_request_t *spf_request, SPF_response_t **spf_responsep)
 
SPF_errcode_t SPF_request_query_fallback (SPF_request_t *spf_request, SPF_response_t **spf_responsep, const char *record)
 
SPF_errcode_t SPF_request_query_rcptto (SPF_request_t *spf_request, SPF_response_t **spf_responsep, const char *rcpt_to)
 

Macro Definition Documentation

◆ SPF_FREE

#define SPF_FREE (   x)     do { if (x) free(x); (x) = NULL; } while(0)

Definition at line 37 of file spf_request.c.

Function Documentation

◆ SPF_request_free()

void SPF_request_free ( SPF_request_t *  sr)

Definition at line 59 of file spf_request.c.

References SPF_ASSERT_NOTNULL, and SPF_FREE.

Referenced by main().

◆ SPF_request_get_client_dom()

const char * SPF_request_get_client_dom ( SPF_request_t *  sr)

Definition at line 196 of file spf_request.c.

References NULL, SPF_ASSERT_NOTNULL, and SPF_dns_get_client_dom().

Referenced by SPF_record_expand_data().

Here is the call graph for this function:

◆ SPF_request_get_rec_dom()

const char * SPF_request_get_rec_dom ( SPF_request_t *  sr)

Definition at line 131 of file spf_request.c.

Referenced by SPF_record_expand_data().

◆ SPF_request_is_loopback()

int SPF_request_is_loopback ( SPF_request_t *  sr)

◆ SPF_request_new()

SPF_request_t * SPF_request_new ( SPF_server_t *  spf_server)

Definition at line 41 of file spf_request.c.

Referenced by main().

◆ SPF_request_query_fallback()

SPF_errcode_t SPF_request_query_fallback ( SPF_request_t *  spf_request,
SPF_response_t **  spf_responsep,
const char *  record 
)

Definition at line 300 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(), and SPF_RESULT_PASS.

Referenced by main().

Here is the call graph for this function:

◆ SPF_request_query_mailfrom()

SPF_errcode_t SPF_request_query_mailfrom ( SPF_request_t *  spf_request,
SPF_response_t **  spf_responsep 
)

The big entry point.

Definition at line 270 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, and SPF_server_get_record().

Referenced by main().

Here is the call graph for this function:

◆ SPF_request_query_rcptto()

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 340 of file spf_request.c.

References 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, and SPF_VER_STR.

Referenced by main().

Here is the call graph for this function:

◆ SPF_request_set_env_from()

int SPF_request_set_env_from ( SPF_request_t *  sr,
const char *  from 
)

Definition at line 139 of file spf_request.c.

References NULL, SPF_ASSERT_NOTNULL, SPF_E_NO_MEMORY, and SPF_FREE.

Referenced by main(), and SPF_request_set_helo_dom().

◆ 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 NULL, SPF_ASSERT_NOTNULL, SPF_E_NO_MEMORY, SPF_E_SUCCESS, SPF_FREE, and SPF_request_set_env_from().

Referenced by main().

Here is the call graph for this function:

◆ SPF_request_set_ipv4()

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 NULL, and SPF_E_SUCCESS.

Referenced by SPF_request_set_ipv4_str().

◆ 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().

Here is the call graph for this function:

◆ SPF_request_set_ipv6()

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 NULL, and SPF_E_SUCCESS.

Referenced by SPF_request_set_ipv6_str().

◆ 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().

Here is the call graph for this function: