spf_response.c File Reference

#include "spf_sys_config.h"
#include "spf.h"
#include "spf_dns.h"
#include "spf_response.h"

Include dependency graph for spf_response.c:

Go to the source code of this file.

Defines

#define SPF_ERRMSGSIZE   4096
#define SPF_ADD_ERROR(_ise, _txt, _ix)
#define SPF_ADD_WARN(_ise, _txt, _ix)

Functions

SPF_response_tSPF_response_new (SPF_request_t *spf_request)
void SPF_response_free (SPF_response_t *rp)
SPF_response_tSPF_response_combine (SPF_response_t *main, SPF_response_t *r2mx)
SPF_result_t SPF_response_result (SPF_response_t *rp)
SPF_reason_t SPF_response_reason (SPF_response_t *rp)
SPF_errcode_t SPF_response_errcode (SPF_response_t *rp)
const char * SPF_response_get_received_spf (SPF_response_t *rp)
const char * SPF_response_get_received_spf_value (SPF_response_t *rp)
const char * SPF_response_get_header_comment (SPF_response_t *rp)
const char * SPF_response_get_smtp_comment (SPF_response_t *rp)
const char * SPF_response_get_explanation (SPF_response_t *rp)
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,...)
SPF_errcode_t SPF_response_add_error_idx (SPF_response_t *rp, SPF_errcode_t code, const char *text, int idx, const char *format,...)
SPF_errcode_t SPF_response_add_error (SPF_response_t *rp, SPF_errcode_t code, const char *format,...)
SPF_errcode_t SPF_response_add_warn_ptr (SPF_response_t *rp, SPF_errcode_t code, const char *text, const char *tptr, const char *format,...)
SPF_errcode_t SPF_response_add_warn_idx (SPF_response_t *rp, SPF_errcode_t code, const char *text, int idx, const char *format,...)
SPF_errcode_t SPF_response_add_warn (SPF_response_t *rp, SPF_errcode_t code, const char *format,...)
int SPF_response_messages (SPF_response_t *rp)
int SPF_response_errors (SPF_response_t *rp)
int SPF_response_warnings (SPF_response_t *rp)
SPF_error_tSPF_response_message (SPF_response_t *rp, int idx)
SPF_errcode_t SPF_error_code (SPF_error_t *err)
const char * SPF_error_message (SPF_error_t *err)
char SPF_error_errorp (SPF_error_t *err)


Define Documentation

#define SPF_ADD_ERROR ( _ise,
_txt,
_ix   ) 

Value:

va_list  ap; va_start(ap, format);         SPF_response_add_error_v(rp, code, _ise, _txt, _ix, format, ap);         rp->num_errors++;     va_end(ap); return code;

Definition at line 227 of file spf_response.c.

Referenced by SPF_response_add_error(), SPF_response_add_error_idx(), and SPF_response_add_error_ptr().

#define SPF_ADD_WARN ( _ise,
_txt,
_ix   ) 

Value:

va_list  ap; va_start(ap, format);         SPF_response_add_error_v(rp, code, _ise, _txt, _ix, format, ap);     va_end(ap); return code;

Definition at line 232 of file spf_response.c.

Referenced by SPF_response_add_warn(), SPF_response_add_warn_idx(), and SPF_response_add_warn_ptr().

#define SPF_ERRMSGSIZE   4096

Definition at line 184 of file spf_response.c.


Function Documentation

SPF_errcode_t SPF_error_code ( SPF_error_t err  ) 

Definition at line 314 of file spf_response.c.

References SPF_error_t::code.

Referenced by main(), and SPF_record_compile().

char SPF_error_errorp ( SPF_error_t err  ) 

Definition at line 326 of file spf_response.c.

References SPF_error_t::is_error.

Referenced by main(), and SPF_record_compile().

const char* SPF_error_message ( SPF_error_t err  ) 

Definition at line 320 of file spf_response.c.

References SPF_error_t::message.

Referenced by main().

SPF_errcode_t SPF_response_add_error ( SPF_response_t rp,
SPF_errcode_t  code,
const char *  format,
  ... 
)

Definition at line 256 of file spf_response.c.

References NULL, and SPF_ADD_ERROR.

Referenced by SPF_record_compile(), SPF_server_get_record(), SPF_server_set_explanation(), and SPF_server_set_localpolicy().

SPF_errcode_t SPF_response_add_error_idx ( SPF_response_t rp,
SPF_errcode_t  code,
const char *  text,
int  idx,
const char *  format,
  ... 
)

Definition at line 247 of file spf_response.c.

References SPF_ADD_ERROR.

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,
  ... 
)

Internal functions for adding errors.

Definition at line 238 of file spf_response.c.

References SPF_ADD_ERROR.

Referenced by SPF_record_compile().

SPF_errcode_t SPF_response_add_warn ( SPF_response_t rp,
SPF_errcode_t  code,
const char *  format,
  ... 
)

Definition at line 282 of file spf_response.c.

References NULL, and SPF_ADD_WARN.

Referenced by SPF_request_get_exp().

SPF_errcode_t SPF_response_add_warn_idx ( SPF_response_t rp,
SPF_errcode_t  code,
const char *  text,
int  idx,
const char *  format,
  ... 
)

Definition at line 273 of file spf_response.c.

References SPF_ADD_WARN.

SPF_errcode_t SPF_response_add_warn_ptr ( SPF_response_t rp,
SPF_errcode_t  code,
const char *  text,
const char *  tptr,
const char *  format,
  ... 
)

Definition at line 264 of file spf_response.c.

References SPF_ADD_WARN.

Referenced by SPF_record_compile().

SPF_response_t* SPF_response_combine ( SPF_response_t main,
SPF_response_t r2mx 
)

Definition at line 90 of file spf_response.c.

References SPF_response_result(), SPF_RESULT_FAIL, SPF_RESULT_INVALID, SPF_RESULT_NEUTRAL, SPF_RESULT_PASS, SPF_RESULT_PERMERROR, SPF_RESULT_SOFTFAIL, and SPF_RESULT_TEMPERROR.

Referenced by main().

Here is the call graph for this function:

SPF_errcode_t SPF_response_errcode ( SPF_response_t rp  ) 

Definition at line 147 of file spf_response.c.

References SPF_response_struct::err.

Referenced by main(), and SPF_record_interpret().

int SPF_response_errors ( SPF_response_t rp  ) 

How many errors were generated?

Definition at line 296 of file spf_response.c.

References SPF_response_struct::num_errors.

Referenced by main(), and SPF_record_compile().

void SPF_response_free ( SPF_response_t rp  ) 

Definition at line 53 of file spf_response.c.

References SPF_response_struct::errors, SPF_response_struct::errors_length, SPF_response_struct::explanation, SPF_response_struct::header_comment, SPF_error_t::message, SPF_response_struct::received_spf, and SPF_response_struct::smtp_comment.

Referenced by main(), and SPF_record_interpret().

const char* SPF_response_get_explanation ( SPF_response_t rp  ) 

Definition at line 177 of file spf_response.c.

References SPF_response_struct::explanation.

const char* SPF_response_get_header_comment ( SPF_response_t rp  ) 

Definition at line 165 of file spf_response.c.

References SPF_response_struct::header_comment.

Referenced by main().

const char* SPF_response_get_received_spf ( SPF_response_t rp  ) 

Definition at line 153 of file spf_response.c.

References SPF_response_struct::received_spf.

Referenced by main().

const char* SPF_response_get_received_spf_value ( SPF_response_t rp  ) 

Definition at line 159 of file spf_response.c.

References SPF_response_struct::received_spf_value.

const char* SPF_response_get_smtp_comment ( SPF_response_t rp  ) 

Definition at line 171 of file spf_response.c.

References SPF_response_struct::smtp_comment.

Referenced by main().

SPF_error_t* SPF_response_message ( SPF_response_t rp,
int  idx 
)

Returns an individual message

Definition at line 308 of file spf_response.c.

References SPF_response_struct::errors.

Referenced by main(), and SPF_record_compile().

int SPF_response_messages ( SPF_response_t rp  ) 

How many warnings were generated?

Definition at line 290 of file spf_response.c.

References SPF_response_struct::errors_length.

Referenced by main(), and SPF_record_compile().

SPF_response_t* SPF_response_new ( SPF_request_t spf_request  ) 

Definition at line 37 of file spf_response.c.

References SPF_response_struct::result, SPF_response_struct::spf_request, and SPF_RESULT_INVALID.

Referenced by main(), SPF_record_interpret(), SPF_request_query_fallback(), SPF_request_query_mailfrom(), SPF_request_query_rcptto(), SPF_server_set_explanation(), and SPF_server_set_localpolicy().

SPF_reason_t SPF_response_reason ( SPF_response_t rp  ) 

Definition at line 141 of file spf_response.c.

References SPF_response_struct::reason.

SPF_result_t SPF_response_result ( SPF_response_t rp  ) 

Definition at line 135 of file spf_response.c.

References SPF_response_struct::result.

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

int SPF_response_warnings ( SPF_response_t rp  ) 

Errors + warnings

Definition at line 302 of file spf_response.c.

References SPF_response_struct::errors_length, and SPF_response_struct::num_errors.


Generated on Tue Nov 4 13:27:52 2008 for libspf2 by  doxygen 1.5.4