s/qmail 4.2.29a
Next generation secure email transport
Loading...
Searching...
No Matches
Functions | Variables
spfdnsip.c File Reference
#include <unistd.h>
#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"
Include dependency graph for spfdnsip.c:

Go to the source code of this file.

Functions

int match_ip4 (unsigned char ip1[4], int prefix, char ip2[4])
 match_ip compares IPv4/IPv6 addreses up to prefix length
 
int match_ip6 (unsigned char ip1[16], int prefix, char ip2[16])
 
int get_prefix (char *prefix)
 get_prefix return integer value of prefix length
 
int spf_records (stralloc *spfrec, stralloc *domain)
 spf_records get TXT records for domain and extract SPF information
 
int spf_a (char *spfspec, char *prefix)
 spf_a (a; a:fqdns; a:fqdns/56) compares A + AAAA records for SPF info and client host
 
int spf_mx (char *spfspec, char *prefix)
 spf_mx (mx; mx:domain; mx:domain/24) compares MX records for SPF info and client host
 
int spf_ptr (char *spfspec, char *prefix)
 spf_ptr (ptr; ptr:fqdn) compares PTR records from SPF info and client host
 
int spf_ip4 (char *spfspec, char *prefix)
 spf_ip4 (ip4; ip4:fqdn; ip4:fqdn/24) compares A records for SPF info and client host
 
int spf_ip6 (char *spfspec, char *prefix)
 spf_ip6 (ip6; ip6:fqdn; ip6:fqdn/56) compares AAAA records for SPF info and client host
 
int spf_exists (char *spfspec, char *prefix)
 spf_exists (exists; exists:fqdn) simply looks for a A records only for SPF info and client host
 

Variables

stralloc dnsname
 
char ip4remote [4]
 
char ip6remote [16]
 
int flagip6
 

Function Documentation

◆ get_prefix()

int get_prefix ( char *  prefix)

get_prefix return integer value of prefix length

Parameters
inputpointer to prefix
Returns
(int) length of prefix

Definition at line 65 of file spfdnsip.c.

Here is the caller graph for this function:

◆ match_ip4()

int match_ip4 ( unsigned char  ip1[4],
int  prefix,
char  ip2[4] 
)

match_ip compares IPv4/IPv6 addreses up to prefix length

Parameters
inputip_address1,prefix length, ip_address2
Returns
1 ok; 0 failure

Definition at line 30 of file spfdnsip.c.

Here is the caller graph for this function:

◆ match_ip6()

int match_ip6 ( unsigned char  ip1[16],
int  prefix,
char  ip2[16] 
)

Definition at line 44 of file spfdnsip.c.

Here is the caller graph for this function:

◆ spf_a()

int spf_a ( char *  spfspec,
char *  prefix 
)

spf_a (a; a:fqdns; a:fqdns/56) compares A + AAAA records for SPF info and client host

Parameters
inputpointer to spfspecification, pointer to prefix
Returns
SPF_OK, SPF_NONE; SPF_DNSSOFT, SPF_NOMEM

Definition at line 145 of file spfdnsip.c.

Here is the call graph for this function:

◆ spf_exists()

int spf_exists ( char *  spfspec,
char *  prefix 
)

spf_exists (exists; exists:fqdn) simply looks for a A records only for SPF info and client host

Parameters
inputpointer to spfspecification, prefix not used
Returns
SPF_OK, SPF_NONE; SPF_DNSSOFT, SPF_NOMEM

Definition at line 391 of file spfdnsip.c.

Here is the call graph for this function:

◆ spf_ip4()

int spf_ip4 ( char *  spfspec,
char *  prefix 
)

spf_ip4 (ip4; ip4:fqdn; ip4:fqdn/24) compares A records for SPF info and client host

Parameters
inputpointer to spfspecification, pointer to prefix
Returns
SPF_OK, SPF_NONE; SPF_DNSSOFT, SPF_NOMEM

Definition at line 345 of file spfdnsip.c.

Here is the call graph for this function:

◆ spf_ip6()

int spf_ip6 ( char *  spfspec,
char *  prefix 
)

spf_ip6 (ip6; ip6:fqdn; ip6:fqdn/56) compares AAAA records for SPF info and client host

Parameters
inputpointer to spfspecification, pointer to prefix
Returns
SPF_OK, SPF_NONE; SPF_DNSSOFT, SPF_NOMEM

Definition at line 368 of file spfdnsip.c.

Here is the call graph for this function:

◆ spf_mx()

int spf_mx ( char *  spfspec,
char *  prefix 
)

spf_mx (mx; mx:domain; mx:domain/24) compares MX records for SPF info and client host

Parameters
inputpointer to spfspecification, pointer to prefix
Returns
SPF_OK, SPF_NONE; SPF_DNSSOFT, SPF_NOMEM

Definition at line 192 of file spfdnsip.c.

Here is the call graph for this function:

◆ spf_ptr()

int spf_ptr ( char *  spfspec,
char *  prefix 
)

spf_ptr (ptr; ptr:fqdn) compares PTR records from SPF info and client host

Parameters
inputpointer to spfspecification; prefix not used
Returns
SPF_OK, SPF_NONE; SPF_DNSSOFT, SPF_NOMEM

Definition at line 235 of file spfdnsip.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spf_records()

int spf_records ( stralloc *  spfrec,
stralloc *  domain 
)

spf_records get TXT records for domain and extract SPF information

Parameters
inputpointer stralloc domain output: pointer to stralloc spf records
Returns
SPF_OK, SPF_NONE; SPF_MULTIRR, SPF_DNSSOFT, SPF_NOMEM

Definition at line 93 of file spfdnsip.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ dnsname

stralloc dnsname
extern

Definition at line 27 of file spf.c.

◆ flagip6

int flagip6
extern

Definition at line 32 of file spf.c.

◆ ip4remote

char ip4remote[4]
extern

Definition at line 38 of file spf.c.

◆ ip6remote

char ip6remote[16]
extern

Definition at line 39 of file spf.c.