Subject: | [patch] add SPF support |
Hi,
the attached patch adds SPF support.
best,
Tom
Subject: | dns-zoneparse-1-10-add-spf.patch |
*** ~ZoneParse.pm 2015-01-28 09:06:06.000000000 +0100
--- ZoneParse.pm 2015-01-27 12:40:36.000000000 +0100
***************
*** 20,26 ****
$VERSION = '1.10';
my (
%dns_id, %dns_soa, %dns_ns, %dns_a, %dns_cname, %dns_mx, %dns_txt,
! %dns_ptr, %dns_a4, %dns_srv, %dns_hinfo, %dns_rp, %dns_loc,
%dns_generate,
%dns_last_name, %dns_last_origin, %dns_last_class, %dns_last_ttl,
%dns_found_origins, %unparseable_line_callback, %last_parse_error_count,
--- 20,26 ----
$VERSION = '1.10';
my (
%dns_id, %dns_soa, %dns_ns, %dns_a, %dns_cname, %dns_mx, %dns_txt,
! %dns_ptr, %dns_a4, %dns_srv, %dns_hinfo, %dns_rp, %dns_loc, %dns_spf,
%dns_generate,
%dns_last_name, %dns_last_origin, %dns_last_class, %dns_last_ttl,
%dns_found_origins, %unparseable_line_callback, %last_parse_error_count,
***************
*** 75,80 ****
--- 75,81 ----
delete $dns_a4{$self};
delete $dns_srv{$self};
delete $dns_hinfo{$self};
+ delete $dns_spf{$self};
delete $dns_rp{$self};
delete $dns_loc{$self};
delete $dns_id{$self};
***************
*** 103,108 ****
--- 104,110 ----
: $method eq 'aaaa' ? $dns_a4{$self}
: $method eq 'srv' ? $dns_srv{$self}
: $method eq 'hinfo' ? $dns_hinfo{$self}
+ : $method eq 'spf' ? $dns_spf{$self}
: $method eq 'rp' ? $dns_rp{$self}
: $method eq 'loc' ? $dns_loc{$self}
: $method eq 'generate' ? $dns_generate{$self}
***************
*** 132,137 ****
--- 134,140 ----
TXT => $dns_txt{$self},
SRV => $dns_srv{$self},
HINFO => $dns_hinfo{$self},
+ SPF => $dns_spf{$self},
RP => $dns_rp{$self},
LOC => $dns_loc{$self},
} );
***************
*** 254,259 ****
--- 257,268 ----
next unless $o->{'ORIGIN'} eq $process_this_origin;
$self->_escape_chars( $o );
$output .= "$o->{name} $o->{ttl} $o->{class} HINFO $o->{cpu} $o->{os}\n";
+ }
+ foreach my $o ( @{ $dns_spf{$self} } ) {
+ next unless defined $o;
+ next unless $o->{'ORIGIN'} eq $process_this_origin;
+ $self->_escape_chars( $o );
+ $output .= "$o->{name} $o->{ttl} $o->{class} SPF $o->{spf}\n";
}
foreach my $o ( @{ $dns_rp{$self} } ) {
next unless defined $o;
***************
*** 365,370 ****
--- 374,380 ----
$dns_a4{$self} = [];
$dns_srv{$self} = [];
$dns_hinfo{$self} = [];
+ $dns_spf{$self} = [];
$dns_rp{$self} = [];
$dns_loc{$self} = [];
$dns_generate{$self} = [];
***************
*** 639,645 ****
cpu => $4,
os => $5,
} );
! } elsif (
/^($valid_name)? \s+
$ttl_cls
RP \s+
--- 649,675 ----
cpu => $4,
os => $5,
} );
! }
!
! elsif (
! /^($valid_name)? \s+
! $ttl_cls
! SPF \s+
! ("$valid_quoted_txt_char*(?<!\\)"|$valid_txt_char+)
! /ixo
! )
! {
! push @{ $dns_spf{$self} },
! $self->_massage( {
! name => $1,
! ttl => $2,
! class => $3,
! spf => $4,
! } );
! }
!
!
! elsif (
/^($valid_name)? \s+
$ttl_cls
RP \s+