#include "stralloc.h"
#include "alloc.h"
#include "ip.h"
#include "ipalloc.h"
#include "ipme.h"
#include "str.h"
#include "fmt.h"
#include "scan.h"
#include "byte.h"
#include "now.h"
#include "dns.h"
#include "case.h"
#include "spf.h"
Go to the source code of this file.
|
struct | spf_aliases |
|
struct | mechanisms |
|
|
int | spf_query (const char *remoteip, const char *helo, const char *mf, const char *local, const int flagip) |
| spf_query prepares the SPF TXT record query
|
|
int | spf_lookup (stralloc *domain) |
| spf_lookup calles the actual (recursive) SPF DNS query
|
|
int | spf_mechanism (char *mechanism, char *spfspec, char *prefix, char *domain) |
| spf_mechanism evaluates the provided mechanisms in the SPF record [RFC7208 Sec 5.]
|
|
int | spf_include (char *spfspec, char *prefix) |
| spf_include deals with recursive evaluation of SPF record [RFC7208 Sec. 5.2]
|
|
int | spf_parse (stralloc *sa, char *spfspec, char *domain) |
| spf_parse parses the substructure of the SPF record and calls spf_macros
|
|
int | spf_macros (stralloc *expand, char *macro, char *domain) |
| spf_macros deals with macros in the SPF specificaton [RFC7208 Sec. 7ff]
|
|
int | spf_info (char *s, const char *t) |
|
◆ spf_include()
int spf_include |
( |
char * |
spfspec, |
|
|
char * |
prefix |
|
) |
| |
spf_include deals with recursive evaluation of SPF record [RFC7208 Sec. 5.2]
- Parameters
-
input | pointer to included SPF specification; CIDR prefix length |
- Returns
- int r = 1 ok; 0 failure
Definition at line 431 of file spf.c.
◆ spf_info()
int spf_info |
( |
char * |
s, |
|
|
const char * |
t |
|
) |
| |
◆ spf_lookup()
int spf_lookup |
( |
stralloc * |
domain | ) |
|
spf_lookup calles the actual (recursive) SPF DNS query
- Parameters
-
input | pointer to stralloc domain (fqdn) @input stralloc spflocalrules (if provided – for artificial results) @output stralloc spfdata with RDATA (+ artificial information) |
- Returns
- int r = SPF return code
Definition at line 158 of file spf.c.
◆ spf_macros()
int spf_macros |
( |
stralloc * |
expand, |
|
|
char * |
macro, |
|
|
char * |
domain |
|
) |
| |
spf_macros deals with macros in the SPF specificaton [RFC7208 Sec. 7ff]
- Parameters
-
input | pointer to SPF macro, pointer to domain output: pointer to stralloc expand(ed information) |
- Returns
- int r = 1 ok; 0 failure
Definition at line 502 of file spf.c.
◆ spf_mechanism()
int spf_mechanism |
( |
char * |
mechanism, |
|
|
char * |
spfspec, |
|
|
char * |
prefix, |
|
|
char * |
domain |
|
) |
| |
spf_mechanism evaluates the provided mechanisms in the SPF record [RFC7208 Sec 5.]
- Parameters
-
input | pointer to mechanism, SPF specification from record, CIDR prefix length, domain @input stralloc spflocalrules (if provided) @output pointer to spfspec: data evaluated |
- Returns
- int r
Definition at line 391 of file spf.c.
◆ spf_parse()
int spf_parse |
( |
stralloc * |
sa, |
|
|
char * |
spfspec, |
|
|
char * |
domain |
|
) |
| |
spf_parse parses the substructure of the SPF record and calls spf_macros
- Parameters
-
input | pointer to SPF specification, pointer to domain output: stralloc sa – @output pointer to spfspec: with found data |
- Returns
- int r = 1 ok; 0 failure
Definition at line 461 of file spf.c.
◆ spf_query()
int spf_query |
( |
const char * |
remoteip, |
|
|
const char * |
helo, |
|
|
const char * |
mf, |
|
|
const char * |
local, |
|
|
const int |
flagip |
|
) |
| |
spf_query prepares the SPF TXT record query
- Parameters
-
input | pointer to remoteip, helo, mf, localhost, and flagIP6 |
- Returns
- int r = SPF return code
Definition at line 58 of file spf.c.
◆ dnsname
Definition at line 27 of file spf.c.
◆ domain
Definition at line 34 of file spf.c.
◆ expdomain
Definition at line 31 of file spf.c.
◆ flagip6
Definition at line 32 of file spf.c.
◆ identity
Definition at line 35 of file spf.c.
◆ ip4remote
char ip4remote[4] = {0, 0, 0, 0} |
Definition at line 38 of file spf.c.
◆ ip6remote
char ip6remote[16] = {16 * 0} |
Definition at line 39 of file spf.c.
◆ spfexplain
Definition at line 23 of file spf.c.
◆ spfexpmsg
Definition at line 30 of file spf.c.
◆ spfhelo
Definition at line 26 of file spf.c.
◆ spfinfo
Definition at line 17 of file spf.c.
◆ spflocal
Definition at line 28 of file spf.c.
◆ spflocalrules
Definition at line 22 of file spf.c.
◆ spfmf
Definition at line 25 of file spf.c.
◆ spfrecord
Definition at line 18 of file spf.c.