#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"
Go to the source code of this file.
|
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
|
◆ get_prefix()
int get_prefix |
( |
char * | prefix | ) |
|
get_prefix return integer value of prefix length
- Parameters
-
- Returns
- (int) length of prefix
Definition at line 65 of file spfdnsip.c.
◆ 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
-
input | ip_address1,prefix length, ip_address2 |
- Returns
- 1 ok; 0 failure
Definition at line 30 of file spfdnsip.c.
◆ match_ip6()
int match_ip6 |
( |
unsigned char | ip1[16], |
|
|
int | prefix, |
|
|
char | ip2[16] ) |
◆ 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
-
input | pointer to spfspecification, pointer to prefix |
- Returns
- SPF_OK, SPF_NONE; SPF_DNSSOFT, SPF_NOMEM
Definition at line 145 of file spfdnsip.c.
◆ 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
-
input | pointer to spfspecification, prefix not used |
- Returns
- SPF_OK, SPF_NONE; SPF_DNSSOFT, SPF_NOMEM
Definition at line 391 of file spfdnsip.c.
◆ 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
-
input | pointer to spfspecification, pointer to prefix |
- Returns
- SPF_OK, SPF_NONE; SPF_DNSSOFT, SPF_NOMEM
Definition at line 345 of file spfdnsip.c.
◆ 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
-
input | pointer to spfspecification, pointer to prefix |
- Returns
- SPF_OK, SPF_NONE; SPF_DNSSOFT, SPF_NOMEM
Definition at line 368 of file spfdnsip.c.
◆ 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
-
input | pointer to spfspecification, pointer to prefix |
- Returns
- SPF_OK, SPF_NONE; SPF_DNSSOFT, SPF_NOMEM
Definition at line 192 of file spfdnsip.c.
◆ spf_ptr()
int spf_ptr |
( |
char * | spfspec, |
|
|
char * | prefix ) |
spf_ptr (ptr; ptr:fqdn) compares PTR records from SPF info and client host
- Parameters
-
input | pointer to spfspecification; prefix not used |
- Returns
- SPF_OK, SPF_NONE; SPF_DNSSOFT, SPF_NOMEM
Definition at line 235 of file spfdnsip.c.
◆ spf_records()
int spf_records |
( |
stralloc * | spfrec, |
|
|
stralloc * | domain ) |
spf_records get TXT records for domain and extract SPF information
- Parameters
-
input | pointer 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.
◆ dnsname
Definition at line 27 of file spf.c.
◆ flagip6
Definition at line 32 of file spf.c.
◆ ip4remote
Definition at line 38 of file spf.c.
◆ ip6remote
Definition at line 39 of file spf.c.