2018-03-21 13:44:58 +00:00
|
|
|
// Code generated by "go run compress_generate.go"; DO NOT EDIT.
|
2017-10-06 18:34:41 +00:00
|
|
|
|
|
|
|
package dns
|
|
|
|
|
2018-05-16 08:52:51 +00:00
|
|
|
func compressionLenHelperType(c map[string]int, r RR, initLen int) int {
|
|
|
|
currentLen := initLen
|
2017-10-06 18:34:41 +00:00
|
|
|
switch x := r.(type) {
|
|
|
|
case *AFSDB:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Hostname) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Hostname, currentLen)
|
2018-03-21 13:44:58 +00:00
|
|
|
case *CNAME:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Target) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Target, currentLen)
|
2018-03-21 13:44:58 +00:00
|
|
|
case *DNAME:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Target) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Target, currentLen)
|
2017-10-06 18:34:41 +00:00
|
|
|
case *HIP:
|
|
|
|
for i := range x.RendezvousServers {
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.RendezvousServers[i]) + 1
|
|
|
|
}
|
|
|
|
for i := range x.RendezvousServers {
|
|
|
|
currentLen += compressionLenHelper(c, x.RendezvousServers[i], currentLen)
|
2017-10-06 18:34:41 +00:00
|
|
|
}
|
2018-03-21 13:44:58 +00:00
|
|
|
case *KX:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Exchanger) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Exchanger, currentLen)
|
2017-10-06 18:34:41 +00:00
|
|
|
case *LP:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Fqdn) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Fqdn, currentLen)
|
2017-10-06 18:34:41 +00:00
|
|
|
case *MB:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Mb) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Mb, currentLen)
|
2018-03-21 13:44:58 +00:00
|
|
|
case *MD:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Md) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Md, currentLen)
|
2017-10-06 18:34:41 +00:00
|
|
|
case *MF:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Mf) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Mf, currentLen)
|
2018-03-21 13:44:58 +00:00
|
|
|
case *MG:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Mg) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Mg, currentLen)
|
2017-10-06 18:34:41 +00:00
|
|
|
case *MINFO:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Rmail) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Rmail, currentLen)
|
|
|
|
currentLen -= len(x.Email) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Email, currentLen)
|
2017-10-06 18:34:41 +00:00
|
|
|
case *MR:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Mr) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Mr, currentLen)
|
2017-10-06 18:34:41 +00:00
|
|
|
case *MX:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Mx) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Mx, currentLen)
|
2017-10-06 18:34:41 +00:00
|
|
|
case *NAPTR:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Replacement) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Replacement, currentLen)
|
2017-10-06 18:34:41 +00:00
|
|
|
case *NS:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Ns) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Ns, currentLen)
|
2018-03-21 13:44:58 +00:00
|
|
|
case *NSAPPTR:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Ptr) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Ptr, currentLen)
|
2018-03-21 13:44:58 +00:00
|
|
|
case *NSEC:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.NextDomain) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.NextDomain, currentLen)
|
2018-03-21 13:44:58 +00:00
|
|
|
case *PTR:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Ptr) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Ptr, currentLen)
|
2018-03-21 13:44:58 +00:00
|
|
|
case *PX:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Map822) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Map822, currentLen)
|
|
|
|
currentLen -= len(x.Mapx400) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Mapx400, currentLen)
|
2018-03-21 13:44:58 +00:00
|
|
|
case *RP:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Mbox) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Mbox, currentLen)
|
|
|
|
currentLen -= len(x.Txt) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Txt, currentLen)
|
2018-03-21 13:44:58 +00:00
|
|
|
case *RRSIG:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.SignerName) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.SignerName, currentLen)
|
2017-10-06 18:34:41 +00:00
|
|
|
case *RT:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Host) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Host, currentLen)
|
2018-03-21 13:44:58 +00:00
|
|
|
case *SIG:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.SignerName) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.SignerName, currentLen)
|
2018-03-21 13:44:58 +00:00
|
|
|
case *SOA:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Ns) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Ns, currentLen)
|
|
|
|
currentLen -= len(x.Mbox) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Mbox, currentLen)
|
2018-03-21 13:44:58 +00:00
|
|
|
case *SRV:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Target) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Target, currentLen)
|
2018-03-21 13:44:58 +00:00
|
|
|
case *TALINK:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.PreviousName) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.PreviousName, currentLen)
|
|
|
|
currentLen -= len(x.NextName) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.NextName, currentLen)
|
2018-03-21 13:44:58 +00:00
|
|
|
case *TKEY:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Algorithm) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Algorithm, currentLen)
|
2018-03-21 13:44:58 +00:00
|
|
|
case *TSIG:
|
2018-05-16 08:52:51 +00:00
|
|
|
currentLen -= len(x.Algorithm) + 1
|
|
|
|
currentLen += compressionLenHelper(c, x.Algorithm, currentLen)
|
2017-10-06 18:34:41 +00:00
|
|
|
}
|
2018-05-16 08:52:51 +00:00
|
|
|
return currentLen - initLen
|
2017-10-06 18:34:41 +00:00
|
|
|
}
|
|
|
|
|
2018-05-16 08:52:51 +00:00
|
|
|
func compressionLenSearchType(c map[string]int, r RR) (int, bool, int) {
|
2017-10-06 18:34:41 +00:00
|
|
|
switch x := r.(type) {
|
2018-03-21 13:44:58 +00:00
|
|
|
case *CNAME:
|
2018-05-16 08:52:51 +00:00
|
|
|
k1, ok1, sz1 := compressionLenSearch(c, x.Target)
|
|
|
|
return k1, ok1, sz1
|
2017-10-06 18:34:41 +00:00
|
|
|
case *MB:
|
2018-05-16 08:52:51 +00:00
|
|
|
k1, ok1, sz1 := compressionLenSearch(c, x.Mb)
|
|
|
|
return k1, ok1, sz1
|
2017-10-06 18:34:41 +00:00
|
|
|
case *MD:
|
2018-05-16 08:52:51 +00:00
|
|
|
k1, ok1, sz1 := compressionLenSearch(c, x.Md)
|
|
|
|
return k1, ok1, sz1
|
2017-10-06 18:34:41 +00:00
|
|
|
case *MF:
|
2018-05-16 08:52:51 +00:00
|
|
|
k1, ok1, sz1 := compressionLenSearch(c, x.Mf)
|
|
|
|
return k1, ok1, sz1
|
2018-03-21 13:44:58 +00:00
|
|
|
case *MG:
|
2018-05-16 08:52:51 +00:00
|
|
|
k1, ok1, sz1 := compressionLenSearch(c, x.Mg)
|
|
|
|
return k1, ok1, sz1
|
2017-10-06 18:34:41 +00:00
|
|
|
case *MINFO:
|
2018-05-16 08:52:51 +00:00
|
|
|
k1, ok1, sz1 := compressionLenSearch(c, x.Rmail)
|
|
|
|
k2, ok2, sz2 := compressionLenSearch(c, x.Email)
|
|
|
|
return k1 + k2, ok1 && ok2, sz1 + sz2
|
2017-10-06 18:34:41 +00:00
|
|
|
case *MR:
|
2018-05-16 08:52:51 +00:00
|
|
|
k1, ok1, sz1 := compressionLenSearch(c, x.Mr)
|
|
|
|
return k1, ok1, sz1
|
2017-10-06 18:34:41 +00:00
|
|
|
case *MX:
|
2018-05-16 08:52:51 +00:00
|
|
|
k1, ok1, sz1 := compressionLenSearch(c, x.Mx)
|
|
|
|
return k1, ok1, sz1
|
2018-03-21 13:44:58 +00:00
|
|
|
case *NS:
|
2018-05-16 08:52:51 +00:00
|
|
|
k1, ok1, sz1 := compressionLenSearch(c, x.Ns)
|
|
|
|
return k1, ok1, sz1
|
2018-03-21 13:44:58 +00:00
|
|
|
case *PTR:
|
2018-05-16 08:52:51 +00:00
|
|
|
k1, ok1, sz1 := compressionLenSearch(c, x.Ptr)
|
|
|
|
return k1, ok1, sz1
|
2018-03-21 13:44:58 +00:00
|
|
|
case *RT:
|
2018-05-16 08:52:51 +00:00
|
|
|
k1, ok1, sz1 := compressionLenSearch(c, x.Host)
|
|
|
|
return k1, ok1, sz1
|
2018-03-21 13:44:58 +00:00
|
|
|
case *SOA:
|
2018-05-16 08:52:51 +00:00
|
|
|
k1, ok1, sz1 := compressionLenSearch(c, x.Ns)
|
|
|
|
k2, ok2, sz2 := compressionLenSearch(c, x.Mbox)
|
|
|
|
return k1 + k2, ok1 && ok2, sz1 + sz2
|
2017-10-06 18:34:41 +00:00
|
|
|
}
|
2018-05-16 08:52:51 +00:00
|
|
|
return 0, false, 0
|
2017-10-06 18:34:41 +00:00
|
|
|
}
|