spfquery.c File Reference

#include "libreplace/win32_config.h"
#include "libreplace/getopt.h"
#include "spf.h"
#include "spf_dns.h"
#include "spf_dns_null.h"
#include "spf_dns_test.h"
#include "spf_dns_cache.h"
#include "spf_dns_resolv.h"

Include dependency graph for spfquery.c:

Go to the source code of this file.

Data Structures

struct  SPF_client_options_struct
struct  SPF_client_request_struct

Defines

#define SPF_TEST_VERSION   "3.0"
#define TRUE   1
#define FALSE   0
#define FREE(x, f)   do { if ((x)) (f)((x)); (x) = NULL; } while(0)
#define FREE_REQUEST(x)   FREE((x), SPF_request_free)
#define FREE_RESPONSE(x)   FREE((x), SPF_response_free)
#define CONTINUE_ERROR   do { res = 255; continue; } while(0)
#define WARN_ERROR   do { res = 255; } while(0)
#define FAIL_ERROR   do { res = 255; goto error; } while(0)
#define RESIZE_RESULT(n)
#define APPEND_RESULT(n)
#define X_OR_EMPTY(x)   ((x) ? (x) : "")

Typedefs

typedef SPF_client_options_struct SPF_client_options_t
typedef SPF_client_request_struct SPF_client_request_t

Functions

int main (int argc, char *argv[])


Define Documentation

#define APPEND_RESULT (  ) 

Value:

do { \
        partial_result = SPF_strresult(n); \
        RESIZE_RESULT(strlen(partial_result)); \
        strcat(result, partial_result); \
} while(0)

Definition at line 137 of file spfquery.c.

Referenced by main().

#define CONTINUE_ERROR   do { res = 255; continue; } while(0)

Definition at line 122 of file spfquery.c.

Referenced by main().

#define FAIL_ERROR   do { res = 255; goto error; } while(0)

Definition at line 124 of file spfquery.c.

Referenced by main().

#define FALSE   0

Definition at line 116 of file spfquery.c.

#define FREE ( x,
 )     do { if ((x)) (f)((x)); (x) = NULL; } while(0)

Definition at line 118 of file spfquery.c.

#define FREE_REQUEST (  )     FREE((x), SPF_request_free)

Definition at line 119 of file spfquery.c.

#define FREE_RESPONSE (  )     FREE((x), SPF_response_free)

Definition at line 120 of file spfquery.c.

#define RESIZE_RESULT (  ) 

Value:

do { \
        if (result == NULL) { \
                result_len = 256 + n; \
                result = malloc(result_len); \
                result[0] = '\0'; \
        } \
        else if (strlen(result) + n >= result_len) { \
                result_len = result_len + (result_len >> 1) + 8 + n; \
                result = realloc(result, result_len); \
        } \
} while(0)

Definition at line 126 of file spfquery.c.

#define SPF_TEST_VERSION   "3.0"

Definition at line 47 of file spfquery.c.

Referenced by main().

#define TRUE   1

Definition at line 115 of file spfquery.c.

#define WARN_ERROR   do { res = 255; } while(0)

Definition at line 123 of file spfquery.c.

Referenced by main().

#define X_OR_EMPTY (  )     ((x) ? (x) : "")

Definition at line 143 of file spfquery.c.

Referenced by main().


Typedef Documentation

typedef struct SPF_client_options_struct SPF_client_options_t

typedef struct SPF_client_request_struct SPF_client_request_t


Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 333 of file spfquery.c.

References APPEND_RESULT, CONTINUE_ERROR, SPF_client_options_struct::debug, SPF_client_options_struct::explanation, FAIL_ERROR, SPF_client_options_struct::fallback, FALSE, FREE, FREE_REQUEST, FREE_RESPONSE, getopt_long_only(), SPF_client_request_struct::helo, SPF_client_request_struct::ip, SPF_client_options_struct::localpolicy, SPF_client_options_struct::max_lookup, NULL, optarg, optind, SPF_client_request_struct::rcpt_to, SPF_client_options_struct::rec_dom, SPF_client_options_struct::sanitize, SPF_client_request_struct::sender, SPF_DNS_CACHE, SPF_get_lib_version(), SPF_LIB_VERSION_MAJOR, SPF_LIB_VERSION_MINOR, SPF_LIB_VERSION_PATCH, SPF_request_new(), SPF_request_query_fallback(), SPF_request_query_mailfrom(), SPF_request_query_rcptto(), SPF_request_set_env_from(), SPF_request_set_helo_dom(), SPF_request_set_ipv4_str(), SPF_request_set_ipv6_str(), SPF_response_combine(), SPF_response_get_header_comment(), SPF_response_get_received_spf(), SPF_response_get_smtp_comment(), SPF_response_result(), SPF_RESULT_PASS, SPF_server_free(), SPF_server_new(), SPF_server_set_explanation(), SPF_server_set_localpolicy(), SPF_server_set_rec_dom(), SPF_server_set_sanitize(), SPF_TEST_VERSION, TRUE, usage(), SPF_client_options_struct::use_trusted, WARN_ERROR, and X_OR_EMPTY.

Here is the call graph for this function:


Generated on Mon May 11 16:17:58 2009 for libspf2 by  doxygen 1.4.7