File tree Expand file tree Collapse file tree 4 files changed +18
-7
lines changed Expand file tree Collapse file tree 4 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 17
17
inherit ( dns )
18
18
combinators
19
19
evalZone
20
- mkReverseRecord
20
+ mkIPv4ReverseRecord
21
+ mkIPv6ReverseRecord
21
22
types
22
23
;
23
24
Original file line number Diff line number Diff line change 41
41
42
42
inherit combinators ;
43
43
44
- inherit ( dnslib . util ) mkReverseRecord ;
44
+ inherit ( dnslib . util ) mkIPv4ReverseRecord mkIPv6ReverseRecord ;
45
45
}
Original file line number Diff line number Diff line change 35
35
36
36
# : str -> [ str ]
37
37
# Returns the record of the ipv6 as a list
38
- mkRecordAux = v6 :
38
+ mkIPv6RecordAux = v6 :
39
39
let
40
40
v6' = if lib . hasPrefix "::" v6 then
41
41
"0${ v6 } "
50
50
51
51
# : str -> str
52
52
# Returns the reversed record of the ipv6
53
- mkReverseRecord = v6 :
54
- lib . concatStringsSep "." ( lib . reverseList ( mkRecordAux v6 ) ) + ".ip6.arpa" ;
53
+ mkIPv6ReverseRecord = v6 :
54
+ lib . concatStringsSep "." ( lib . reverseList ( mkIPv6RecordAux v6 ) ) + ".ip6.arpa" ;
55
55
56
+ # : str -> str
57
+ # Returns the reversed record of the ipv4
58
+ mkIPv4ReverseRecord = v4 :
59
+ lib . concatStringsSep "." (
60
+ lib . reverseList (
61
+ lib . filter lib . isString (
62
+ lib . splitString "." v4
63
+ )
64
+ )
65
+ ) + ".in-addr.arpa" ;
56
66
in {
57
- inherit writeCharacterString mkReverseRecord ;
67
+ inherit writeCharacterString mkIPv4ReverseRecord mkIPv6ReverseRecord ;
58
68
}
Original file line number Diff line number Diff line change 20
20
inherit ( dns ) evalZone ;
21
21
inherit ( dns ) combinators ;
22
22
inherit ( dns ) types ;
23
- inherit ( dns ) mkReverseRecord ;
23
+ inherit ( dns ) mkIPv4ReverseRecord mkIPv6ReverseRecord ;
24
24
toString = name : zone : builtins . toString ( dns . evalZone name zone ) ;
25
25
} // dns . combinators ;
26
26
You can’t perform that action at this time.
0 commit comments