spf_utils.c File Reference

#include "spf_sys_config.h"
#include "spf.h"
#include "spf_internal.h"

Include dependency graph for spf_utils.c:

Go to the source code of this file.

Functions

void SPF_get_lib_version (int *major, int *minor, int *patch)
char * SPF_sanitize (SPF_server_t *spf_server, char *str)
const char * SPF_strresult (SPF_result_t result)
const char * SPF_strreason (SPF_reason_t reason)
const char * SPF_strrrtype (ns_type rr_type)
SPF_errcode_t SPF_realloc (char **bufp, size_t *buflenp, int buflen)


Function Documentation

void SPF_get_lib_version ( int *  major,
int *  minor,
int *  patch 
)

Returns the version numbers of this library.

Definition at line 38 of file spf_utils.c.

References SPF_LIB_VERSION_MAJOR, SPF_LIB_VERSION_MINOR, and SPF_LIB_VERSION_PATCH.

Referenced by main().

SPF_errcode_t SPF_realloc ( char **  bufp,
size_t *  buflenp,
int  buflen 
)

This is NOT a general-purpose realloc. It is used only for text buffers. It will allocate at least 64 bytes of storage.

Definition at line 183 of file spf_utils.c.

References NULL, SPF_ASSERT_NOTNULL, SPF_E_NO_MEMORY, and SPF_E_SUCCESS.

Referenced by SPF_record_expand_data(), and SPF_record_stringify().

char* SPF_sanitize ( SPF_server_t spf_server,
char *  str 
)

Sanitizes a string for printing.

This replaces all nonprintable characters in str with a '?'. The source string is modified in-place.

Definition at line 54 of file spf_utils.c.

References NULL, SPF_server_struct::sanitize, and SPF_ASSERT_NOTNULL.

const char* SPF_strreason ( SPF_reason_t  reason  ) 

Converts an SPF reason to a short human-readable string.

Definition at line 128 of file spf_utils.c.

References SPF_REASON_2MX, SPF_REASON_DEFAULT, SPF_REASON_LOCAL_POLICY, SPF_REASON_LOCALHOST, SPF_REASON_MECH, and SPF_REASON_NONE.

Referenced by SPF_record_interpret().

const char* SPF_strresult ( SPF_result_t  result  ) 

Converts an SPF result to a short human-readable string.

Definition at line 81 of file spf_utils.c.

References SPF_RESULT_FAIL, SPF_RESULT_INVALID, SPF_RESULT_NEUTRAL, SPF_RESULT_NONE, SPF_RESULT_PASS, SPF_RESULT_PERMERROR, SPF_RESULT_SOFTFAIL, and SPF_RESULT_TEMPERROR.

Referenced by main(), and SPF_record_interpret().

const char* SPF_strrrtype ( ns_type  rr_type  ) 

Definition at line 163 of file spf_utils.c.

References ns_t_a, ns_t_aaaa, ns_t_any, ns_t_invalid, ns_t_mx, ns_t_ptr, ns_t_spf, and ns_t_txt.


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