2021-11-24 23:20:46 +03:00
|
|
|
package dns
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/wader/fq/format"
|
|
|
|
"github.com/wader/fq/format/registry"
|
|
|
|
"github.com/wader/fq/pkg/decode"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
registry.MustRegister(decode.Format{
|
|
|
|
Name: format.DNS_TCP,
|
|
|
|
Description: "DNS packet (TCP)",
|
|
|
|
DecodeFn: dnsTCPDecode,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func dnsTCPDecode(d *decode.D, in interface{}) interface{} {
|
2022-04-08 16:03:47 +03:00
|
|
|
if tsi, ok := in.(format.TCPStreamIn); ok {
|
|
|
|
tsi.MustIsPort(d.Fatalf, format.TCPPortDomain, format.TCPPortDomain)
|
|
|
|
}
|
2021-11-24 23:20:46 +03:00
|
|
|
return dnsDecode(d, true)
|
|
|
|
}
|