Thanks(Xpert) !ipv6 2001:618:400:bf69::63
(eggush) 20010400:BF69:0000:0000:0000:0063 PTR RECORD 3.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.6.f.b.0.0.4.0.8.1.6.0.1.0.0.2.ip6.arpa
Thanks(Xpert) !ipv6 2001:618:400:bf69::63
(eggush) 20010400:BF69:0000:0000:0000:0063 PTR RECORD 3.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.6.f.b.0.0.4.0.8.1.6.0.1.0.0.2.ip6.arpa
Code: Select all
proc ipv6tonibble {ip {type "int"}} {
set newip ""
set nlist ""
set mlist [split $ip ":"]
foreach element $mlist {
if {[string trim $element] == ""} {
set totzeros [expr 8 - [llength $mlist]]
for {set i 0} {$i <= $totzeros} {incr i} {
lappend nlist 0
}
} else {
lappend nlist $element
}
}
for {set i [expr [llength $nlist] - 1]} {$i >= 0} {incr i -1} {
set seg [lindex $nlist $i]
for {set j 0} {$j < 4} {incr j} {
if {$seg != ""} {
append newip "[string index $seg [expr [string length $seg] - 1]]."
if {[string length $seg] > 1} {
set seg [string range $seg 0 [expr [string length $seg] - 2]]
} else {
set seg ""
}
} else {
append newip "0."
}
}
}
append newip "ip6.$type"
return $newip
}