Go to the source code of this file.
◆ ALIGN_DECL
◆ ALIGNED_DECL
#define ALIGNED_DECL |
( |
|
var | ) |
u.var |
◆ SPF_ADD_LEN_TO
#define SPF_ADD_LEN_TO |
( |
|
_val, |
|
|
|
_len, |
|
|
|
_max |
|
) |
| |
Value: do { \
if ( (_val) + _align_sz(_len) > (_max) ) { \
"SPF domainspec too long " \
"(%d chars, %d max)", \
(_val) + (_len), _max); \
} \
(_val) += _align_sz(_len); \
} while(0)
SPF_errcode_t SPF_response_add_error_ptr(SPF_response_t *rp, SPF_errcode_t code, const char *text, const char *tptr, const char *format,...)
Definition at line 441 of file spf_compile.c.
◆ SPF_CHECK_IN_MODIFIER
#define SPF_CHECK_IN_MODIFIER |
( |
| ) |
|
Value: if ( !is_mod ) \
"'%c' macro is only valid in modifiers", c);
◆ SPF_ENSURE_STRING_AVAIL
#define SPF_ENSURE_STRING_AVAIL |
( |
|
_len | ) |
|
Value: do { \
if (ds_len + _len > ds_avail) \
"String literal fragment too long " \
"(%d chars, %d max)", \
ds_len, ds_avail); \
} while(0)
Definition at line 466 of file spf_compile.c.
◆ SPF_FINI_STRING_LITERAL
#define SPF_FINI_STRING_LITERAL |
( |
| ) |
|
Value: do { \
if ( ds_len > 0 ) { \
"String literal too long " \
"(%d chars, %d max)", \
} \
data->ds.len = ds_len; \
len = sizeof( *data ) + ds_len; \
SPF_ADD_LEN_TO(*data_used, len, data_avail); \
data = SPF_data_next( data ); \
ds_len = 0; \
} \
} while(0)
Definition at line 475 of file spf_compile.c.
◆ SPF_INIT_STRING_LITERAL
#define SPF_INIT_STRING_LITERAL |
( |
|
_avail | ) |
|
Value: do { \
data->ds.len = 0; \
\
data->ds.__unused0 = 0xba; data->ds.__unused1 = 0xbe; \
dst = SPF_data_str( data ); \
"Out of memory for string literal");\
ds_len = 0; \
} while(0)
Definition at line 452 of file spf_compile.c.
◆ spf_num_mechanisms
#define spf_num_mechanisms sizeof(spf_mechtypes) / sizeof(spf_mechtypes[0]) |
◆ SPF_RECORD_BUFSIZ
#define SPF_RECORD_BUFSIZ 4096 |
This is greater than any possible total mechanism or modifier. SPF_MAX_MOD_LEN + SPF_MAX_STR_LEN SPF_MAX_MECH_LEN + SPF_MAX_STR_LEN
Definition at line 62 of file spf_compile.c.
◆ STREQ_SIZEOF
#define STREQ_SIZEOF |
( |
|
a, |
|
|
|
b |
|
) |
| (strncasecmp((a), (b), sizeof( (b) ) - 1) == 0) |
◆ STREQ_SIZEOF_N
#define STREQ_SIZEOF_N |
( |
|
a, |
|
|
|
b, |
|
|
|
n |
|
) |
| (((n) == sizeof(b) - 1) && (strncasecmp((a),(b),(n)) == 0)) |
◆ SPF_cidr_t
Enumerator |
---|
CIDR_NONE | |
CIDR_OPTIONAL | |
CIDR_ONLY | |
Definition at line 47 of file spf_compile.c.
◆ SPF_domspec_t
Enumerator |
---|
DOMSPEC_NONE | |
DOMSPEC_OPTIONAL | |
DOMSPEC_REQUIRED | |
Definition at line 52 of file spf_compile.c.
◆ __attribute__()
__attribute__ |
( |
(warn_unused_result) |
| ) |
|
◆ SPF_record_compile()
SPF_errcode_t SPF_record_compile |
( |
SPF_server_t * |
spf_server, |
|
|
SPF_response_t * |
spf_response, |
|
|
SPF_record_t ** |
spf_recordp, |
|
|
const char * |
record |
|
) |
| |
The SPF compiler.
It converts the SPF record in string format that is easy for people to deal with into a compact binary format that is easy for computers to deal with.
Definition at line 1184 of file spf_compile.c.
References MECH_A, MECH_ALL, MECH_EXISTS, MECH_INCLUDE, MECH_IP4, MECH_IP6, MECH_MX, MECH_PTR, MECH_REDIRECT, SPF_mechtype_t::mech_type, NULL, PREFIX_FAIL, PREFIX_NEUTRAL, PREFIX_PASS, PREFIX_SOFTFAIL, PREFIX_UNKNOWN, SPF_ASSERT_NOTNULL, SPF_debugf, SPF_E_INTERNAL_ERROR, SPF_E_INVALID_CHAR, SPF_E_INVALID_OPT, SPF_E_INVALID_PREFIX, SPF_E_MOD_W_PREF, SPF_E_NO_MEMORY, SPF_E_NOT_SPF, SPF_E_SUCCESS, SPF_E_UNKNOWN_MECH, SPF_error_code(), SPF_error_errorp(), SPF_record_new(), SPF_response_add_error(), SPF_response_add_error_ptr(), SPF_response_add_warn_ptr(), SPF_response_errors(), SPF_response_message(), SPF_response_messages(), SPF_VER_STR, STREQ_SIZEOF, STREQ_SIZEOF_N, and strncasecmp().
Referenced by main(), SPF_request_query_fallback(), SPF_request_query_rcptto(), SPF_server_get_record(), and SPF_server_set_localpolicy().
◆ SPF_record_compile_macro()
SPF_errcode_t SPF_record_compile_macro |
( |
SPF_server_t * |
spf_server, |
|
|
SPF_response_t * |
spf_response, |
|
|
SPF_macro_t ** |
spf_macrop, |
|
|
const char * |
record |
|
) |
| |