- Timestamp:
- 06/11/14 14:52:25 (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r642 r644 219 219 # 'all' (all IP values in any reverse zone view) 220 220 showrev_arpa => 'none', 221 # Two options for template record expansion: 222 template_skip_0 => 0, # publish .0 by default 223 template_skip_255 => 0, # publish .255 by default 221 224 ); 222 225 … … 248 251 249 252 # Several settings are booleans. Handle multiple possible ways of setting them. 250 for my $boolopt ('log_failures', 'force_refresh', 'lowercase', 'usecache') { 253 for my $boolopt ('log_failures', 'force_refresh', 'lowercase', 'usecache', 254 'template_skip_0', 'template_skip_255') { 251 255 if ($self->{$boolopt} ne '1' && $self->{$boolopt} ne '0') { 252 256 # true/false, on/off, yes/no all valid. … … 1700 1704 $cfg->{lowercase} = $1 if /^lowercase\s*=\s*([a-z01]+)/i; 1701 1705 $cfg->{showrev_arpa} = $1 if /^showrev_arpa\s*=\s*([a-z]+)/i; 1706 $cfg->{template_skip_0} = $1 if /^template_skip_0\s*=\s*([a-z01]+)/i; 1707 $cfg->{template_skip_255} = $1 if /^template_skip_255\s*=\s*([a-z01]+)/i; 1702 1708 # not supported in dns.cgi yet 1703 1709 # $cfg->{templatedir} = $1 if m{^templatedir\s*=\s*([a-z0-9/_.-]+)}i; … … 5554 5560 $soasth->execute($revid); 5555 5561 my (@zsoa) = $soasth->fetchrow_array(); 5556 _printrec_tiny($zonefilehandle, $zsoa[7], 'y',\%recflags,$revzone,5562 $self->_printrec_tiny($zonefilehandle, $zsoa[7], 'y',\%recflags,$revzone, 5557 5563 $zsoa[0],$zsoa[1],$zsoa[2],$zsoa[3],$zsoa[4],$zsoa[5],$zsoa[6],$zsoa[8],''); 5558 5564 … … 5588 5594 } 5589 5595 5590 _printrec_tiny($zonefilehandle, $recid, 'y', \%recflags, $revzone,5596 $self->_printrec_tiny($zonefilehandle, $recid, 'y', \%recflags, $revzone, 5591 5597 $host, $type, $val, $dist, $weight, $port, $ttl, $loc, $stamp, $expires, $stampactive); 5592 5598 … … 5665 5671 $soasth->execute($domid); 5666 5672 my (@zsoa) = $soasth->fetchrow_array(); 5667 _printrec_tiny($zonefilehandle, $zsoa[7], 'n',\%recflags,$dom,5673 $self->_printrec_tiny($zonefilehandle, $zsoa[7], 'n',\%recflags,$dom, 5668 5674 $zsoa[0],$zsoa[1],$zsoa[2],$zsoa[3],$zsoa[4],$zsoa[5],$zsoa[6],$zsoa[8],''); 5669 5675 … … 5687 5693 } 5688 5694 5689 _printrec_tiny($zonefilehandle, $recid, 'n', \%recflags,5695 $self->_printrec_tiny($zonefilehandle, $recid, 'n', \%recflags, 5690 5696 $dom, $host, $type, $val, $dist, $weight, $port, $ttl, $loc, $stamp, $expires, $stampactive); 5691 5697 … … 5736 5742 # Utility sub for __export_tiny above 5737 5743 sub _printrec_tiny { 5744 my $self = shift; 5738 5745 my ($datafile, $recid, $revrec, $recflags, $zone, $host, $type, $val, $dist, $weight, $port, $ttl, 5739 5746 $loc, $stamp, $expires, $stampactive) = @_; … … 5840 5847 ## forked process 5841 5848 sub __publish_subnet { 5849 my $obj = shift; # *sigh* need to pass in the DNSDB object so we can read a couple of options 5842 5850 my $sub = shift; 5843 5851 my $recflags = shift; … … 5858 5866 # make as if we split the non-octet-aligned block into octet-aligned blocks as with SOA 5859 5867 my $lastoct = (split /\./, $ip)[3]; 5860 next if $ip =~ /\.(0|255)$/; # && $self->{skip_net_0} 5868 next if $ip =~ /\.0$/ && $obj->{template_skip_0}; 5869 next if $ip =~ /\.255$/ && $obj->{template_skip_255}; 5861 5870 next if $$recflags{$ip}; # && $self->{skip_bcast_255} 5862 5871 $$recflags{$ip}++; … … 6076 6085 # print both; a dangling record is harmless, and impossible via web 6077 6086 # UI anyway 6078 _printrec_tiny($datafile,$revrec,$recflags,$zone,$host,28,$val,$dist,$weight,$port,$ttl,$loc,$stamp);6079 _printrec_tiny($datafile,$revrec,$recflags,$zone,$host,12,$val,$dist,$weight,$port,$ttl,$loc,$stamp);6087 $self->_printrec_tiny($datafile,$revrec,$recflags,$zone,$host,28,$val,$dist,$weight,$port,$ttl,$loc,$stamp); 6088 $self->_printrec_tiny($datafile,$revrec,$recflags,$zone,$host,12,$val,$dist,$weight,$port,$ttl,$loc,$stamp); 6080 6089 ##fixme: add a config flag to indicate use of the patch from http://www.fefe.de/dns/ 6081 6090 # type 6 is for AAAA+PTR, type 3 is for AAAA … … 6090 6099 if ($val->masklen <= 16) { 6091 6100 foreach my $sub ($val->split(16)) { 6092 __publish_subnet($sub, $recflags, $host, $datafile, $ttl, $stamp, $loc, $zone, 1);6101 $self->__publish_subnet($sub, $recflags, $host, $datafile, $ttl, $stamp, $loc, $zone, 1); 6093 6102 } 6094 6103 } else { 6095 __publish_subnet($val, $recflags, $host, $datafile, $ttl, $stamp, $loc, $zone, 1);6104 $self->__publish_subnet($val, $recflags, $host, $datafile, $ttl, $stamp, $loc, $zone, 1); 6096 6105 } 6097 6106 … … 6104 6113 if ($val->masklen <= 16) { 6105 6114 foreach my $sub ($val->split(16)) { 6106 __publish_subnet($sub, $recflags, $host, $datafile, $ttl, $stamp, $loc, $zone, 0);6115 $self->__publish_subnet($sub, $recflags, $host, $datafile, $ttl, $stamp, $loc, $zone, 0); 6107 6116 } 6108 6117 } else { 6109 __publish_subnet($val, $recflags, $host, $datafile, $ttl, $stamp, $loc, $zone, 0);6118 $self->__publish_subnet($val, $recflags, $host, $datafile, $ttl, $stamp, $loc, $zone, 0); 6110 6119 } 6111 6120 … … 6119 6128 6120 6129 # All delegations need to create one or more NS records. The NS record handler knows what to do. 6121 _printrec_tiny($datafile,$recid,$revrec,$recflags,$zone,$host,$reverse_typemap{'NS'},6130 $self->_printrec_tiny($datafile,$recid,$revrec,$recflags,$zone,$host,$reverse_typemap{'NS'}, 6122 6131 $val,$dist,$weight,$port,$ttl,$loc,$stamp); 6123 6132 if ($revrec eq 'y') { -
trunk/dnsdb.conf
r583 r644 41 41 #showrev_arpa = 0 42 42 43 # publish .0 IP when expanding a template pattern 44 #template_skip_0 = 0 45 46 # publish .255 IP when expanding a template pattern 47 #template_skip_255 = 0 48 43 49 ## General RPC options 44 50 # may already be obsolete. how do we want to run RPC requests?
Note:
See TracChangeset
for help on using the changeset viewer.