-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* removed lots of commented out code
- Loading branch information
Showing
18 changed files
with
25 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
BSD 2-Clause License | ||
|
||
Copyright (c) 2024, DNS Threat and Privacy Internet Research | ||
Copyright (c) 2024 Johan Stenstam, [email protected] | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,5 @@ | ||
// Copyright 2024 Johan Stenstam, [email protected] | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/* | ||
* | ||
* Copyright 2024 Johan Stenstam, [email protected] | ||
*/ | ||
package tapir | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
/* | ||
* Copyright (c) 2024 DNS TAPIR | ||
* | ||
* Copyright (c) 2024 Johan Stenstam, [email protected] | ||
*/ | ||
package tapir | ||
|
||
|
@@ -160,11 +159,6 @@ func (api *ApiClient) SetupTLS(tlsConfig *tls.Config) error { | |
if err != nil { | ||
return fmt.Errorf("error reading CA file '%s': %v", cacert, err) | ||
} | ||
// roots := x509.NewCertPool() | ||
// ok := roots.AppendCertsFromPEM(caCertPEM) | ||
// if !ok { | ||
// log.Printf("Error parsing root cert: %v\n", err) | ||
// } | ||
|
||
client = &http.Client{ | ||
Transport: &http.Transport{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) DNS TAPIR | ||
* Copyright (c) 2024 Johan Stenstam, [email protected] | ||
*/ | ||
|
||
package tapir | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,6 @@ | ||
// Copyright 2024 Johan Stenstam, [email protected] | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/* | ||
* Copyright 2024 Johan Stenstam, [email protected] | ||
*/ | ||
package tapir | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2024 DNS TAPIR | ||
* Copyright (c) 2024 Johan Stenstam, [email protected] | ||
*/ | ||
package tapir | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) DNS TAPIR | ||
* Copyright (c) 2024 Johan Stenstam, [email protected] | ||
*/ | ||
package tapir | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,7 @@ | ||
// Copyright 2024 Johan Stenstam, [email protected] | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/* | ||
* | ||
* Copyright 2024 Johan Stenstam, [email protected] | ||
*/ | ||
|
||
package tapir | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2024 DNS TAPIR | ||
* Copyright (c) 2024 Johan Stenstam, [email protected] | ||
*/ | ||
package tapir | ||
|
||
|
@@ -25,9 +25,6 @@ const ( | |
|
||
// TODO: Add support for TSIG zone transfers. | ||
|
||
// keepfunc(rrtype) is a predicate that is used to decide whether to include a particular | ||
// RRtype in the resulting, kept, zonedata. Used to filter out DNSSEC RRs if needed. | ||
|
||
func (zd *ZoneData) ZoneTransferIn(upstream string, serial uint32, ttype string) (uint32, error) { | ||
|
||
if upstream == "" { | ||
|
@@ -76,8 +73,6 @@ func (zd *ZoneData) ZoneTransferIn(upstream string, serial uint32, ttype string) | |
} | ||
} | ||
|
||
// zd.Logger.Printf("ZoneTransferIn: %s: dropped %d RRs (filter), kept %d apex RRs + %d BodyRRs", | ||
// zd.ZoneName, zd.DroppedRRs, zd.ApexLen, len(zd.BodyRRs)) | ||
zd.Logger.Printf("ZoneTransferIn: %s: dropped %d RRs (filter), kept %d apex RRs", | ||
zd.ZoneName, zd.DroppedRRs, zd.ApexLen) | ||
|
||
|
@@ -138,12 +133,8 @@ func (zd *ZoneData) ReadZone(r io.Reader) (uint32, error) { | |
|
||
zd.ComputeIndices() // for zonetype 3, otherwise no-op | ||
|
||
// fmt.Printf("ReadZoneFile: Size: zoneparser: %d zd.RRs: %d\n", size.Of(zp), size.Of(zd.RRs)) | ||
|
||
zd.XfrType = "axfr" // XXX: technically not true, but the distinction is between complete zone and "diff" | ||
|
||
// zd.Logger.Printf("ReadZoneFile: %s: dropped %d RRs (filter), kept %d apex RRs + %d BodyRRs", | ||
// zd.ZoneName, zd.DroppedRRs, zd.ApexLen, len(zd.BodyRRs)) | ||
zd.Logger.Printf("ReadZoneFile: %s: dropped %d RRs (filter), kept %d apex RRs", | ||
zd.ZoneName, zd.DroppedRRs, zd.ApexLen) | ||
|
||
|
@@ -187,34 +178,28 @@ func (zd *ZoneData) RRSortFunc(rr dns.RR, first_soa *dns.SOA) { | |
zd.ApexLen++ | ||
} | ||
tmp = odmap.RRtypes[rrtype] | ||
// zd.Logger.Printf("RRSortFunc: odmap.RRtypes: %v", odmap.RRtypes) | ||
tmp.RRs = append(tmp.RRs, rr) | ||
odmap.RRtypes[rrtype] = tmp | ||
// odmap.RRtypes[rrtype].RRs = append(odmap.RRtypes[rrtype].RRs, rr) | ||
case *dns.NS: | ||
if owner == zd.ZoneName { | ||
zd.NSrrs = append(zd.NSrrs, rr) | ||
zd.ApexLen++ | ||
tmp = odmap.RRtypes[rrtype] | ||
tmp.RRs = append(tmp.RRs, rr) | ||
odmap.RRtypes[rrtype] = tmp | ||
// odmap.RRtypes[rrtype].RRs = append(odmap.RRtypes[rrtype].RRs, rr) | ||
} else { | ||
tmp = odmap.RRtypes[rrtype] | ||
tmp.RRs = append(tmp.RRs, rr) | ||
odmap.RRtypes[rrtype] = tmp | ||
// odmap.RRtypes[rrtype].RRs = append(odmap.RRtypes[rrtype].RRs, rr) | ||
} | ||
case *dns.RRSIG, *dns.NSEC, *dns.NSEC3, *dns.NSEC3PARAM, *dns.CDS, *dns.CDNSKEY, *dns.DNSKEY: | ||
// ignore | ||
|
||
default: | ||
// log.Printf("RRSortFunc: owner=%s, rrtype=%s", owner, dns.TypeToString[rrtype]) | ||
tmp = odmap.RRtypes[rrtype] | ||
tmp.RRs = append(tmp.RRs, rr) | ||
odmap.RRtypes[rrtype] = tmp | ||
} | ||
// zd.Logger.Printf("ZoneName: %s, zonetype: %d", zd.ZoneName, zd.ZoneType) | ||
zd.Data[owner] = odmap | ||
} | ||
|
||
|
@@ -264,7 +249,6 @@ func (zd *ZoneData) WriteZoneToFile(f *os.File) error { | |
} | ||
totalbytes += bytes | ||
bytes = 0 | ||
// fmt.Printf("Size(zonedata): %d\n", size.Of(zonedata)) | ||
zonedata = "" | ||
} | ||
} | ||
|
@@ -273,7 +257,6 @@ func (zd *ZoneData) WriteZoneToFile(f *os.File) error { | |
return err | ||
} | ||
totalbytes += bytes | ||
// fmt.Printf("Size(zonedata): %d\n", size.Of(zonedata)) | ||
writer.Flush() | ||
|
||
return err | ||
|
@@ -319,9 +302,6 @@ func (zd *ZoneData) ComputeIndices() { | |
soas.RRs = soas.RRs[:1] | ||
zd.Owners[zd.OwnerIndex[zd.ZoneName]].RRtypes[dns.TypeSOA] = soas | ||
} | ||
// if zd.Debug { | ||
// zd.PrintOwners() | ||
// } | ||
} | ||
|
||
func (zd *ZoneData) PrintRRs() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
/* | ||
* Copyright (c) 2024 Johan Stenstam, [email protected] | ||
*/ | ||
package tapir | ||
|
||
// "github.com/spf13/cobra" | ||
// "github.com/spf13/viper" | ||
package tapir | ||
|
||
type CliFlags struct { | ||
ShowHdr bool | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,5 @@ | ||
// Copyright 2024 Johan Stenstam, [email protected] | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/* | ||
* Johan Stenstam, [email protected] | ||
* Copyright 2024 Johan Stenstam, [email protected] | ||
*/ | ||
|
||
package tapir | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.