aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/dlink-ng2dns.pl14
-rw-r--r--tools/v6-netlist-from-v4.pl33
2 files changed, 40 insertions, 7 deletions
diff --git a/tools/dlink-ng2dns.pl b/tools/dlink-ng2dns.pl
index a7e01a8..157d43b 100755
--- a/tools/dlink-ng2dns.pl
+++ b/tools/dlink-ng2dns.pl
@@ -38,21 +38,21 @@ while (<STDIN>)
my $text_info = $distro . " - " . join(' + ', @ports) . ", po" . $ponum . ", gwaddr " . $gwaddr;
# A-record to the switch
- print "prereq nxdomain " . $sw_fqdn . "\n" unless $delete;
- print "update add " . $sw_fqdn . " \t 3600 IN A \t " . $ipaddr . "\n" unless $delete;
- print "update delete " . $sw_fqdn . " \t IN A\n" if $delete;
+ print "prereq nxdomain sw." . $fqdn . "\n" unless $delete;
+ print "update add sw." . $fqdn . " \t 3600 IN A \t " . $ipaddr . "\n" unless $delete;
+ print "update delete sw." . $fqdn . " \t IN A\n" if $delete;
print "send\n";
# PTR to the switch
print "prereq nxdomain " . $ip->reverse_ip() . "\n" unless $delete;
- print "update add " . $ip->reverse_ip() . " \t 3600 IN PTR \t " . $sw_fqdn . "\n" unless $delete;
+ print "update add " . $ip->reverse_ip() . " \t 3600 IN PTR \t sw." . $fqdn . "\n" unless $delete;
print "update delete " . $ip->reverse_ip() . " \t IN PTR\n" if $delete;
print "send\n";
# TXT-record with details
- print "update delete " . $sw_fqdn . " IN TXT\n" unless $delete;
- print "update add " . $sw_fqdn . " \t 3600 IN TXT \t \"" . $text_info . "\"\n" unless $delete;
- print "update delete " . $sw_fqdn . " \t IN TXT\n" if $delete;
+ print "update delete sw." . $fqdn . " IN TXT\n" unless $delete;
+ print "update add sw." . $fqdn . " \t 3600 IN TXT \t \"" . $text_info . "\"\n" unless $delete;
+ print "update delete sw." . $fqdn . " \t IN TXT\n" if $delete;
print "send\n";
# A and AAAA-record to the gateway/router
diff --git a/tools/v6-netlist-from-v4.pl b/tools/v6-netlist-from-v4.pl
new file mode 100644
index 0000000..ea79268
--- /dev/null
+++ b/tools/v6-netlist-from-v4.pl
@@ -0,0 +1,33 @@
+#! /usr/bin/perl
+use strict;
+use warnings;
+
+while (<>) {
+ chomp;
+ /^#/ and next;
+ /^(151\.216\.(\d+)\.(\d+)) (\d+) (\S+)$/ or die;
+ my $z;
+ my ($ip, $third, $fourth, $len, $name) = ($1, $2, $3, $4, $5);
+ if ($len == 24) {
+ $z = '2a02:ed02:' . $third . '::/64';
+ } elsif ($len == 25) {
+ if ($fourth == 0) {
+ $z = '2a02:ed02:' . $third . 'a::/64';
+ } else {
+ $z = '2a02:ed02:' . $third . 'b::/64';
+ }
+ } elsif ($len == 26) {
+ if ($fourth == 0) {
+ $z = '2a02:ed02:' . $third . 'a::/64';
+ } elsif ($fourth == 64) {
+ $z = '2a02:ed02:' . $third . 'b::/64';
+ } elsif ($fourth == 128) {
+ $z = '2a02:ed02:' . $third . 'c::/64';
+ } else {
+ $z = '2a02:ed02:' . $third . 'd::/64';
+ }
+ } else {
+ warn "Unknown len $ip/$len";
+ }
+ print "$z $name\n" if (defined($z));
+}