mirror of
https://github.com/wader/fq.git
synced 2024-11-26 21:55:57 +03:00
46dca8cdc5
Fixes issue with TCP streams being probed as dns over TCP
24 lines
492 B
Go
24 lines
492 B
Go
package dns
|
|
|
|
import (
|
|
"github.com/wader/fq/format"
|
|
"github.com/wader/fq/pkg/decode"
|
|
"github.com/wader/fq/pkg/interp"
|
|
)
|
|
|
|
func init() {
|
|
interp.RegisterFormat(decode.Format{
|
|
Name: format.DNS_TCP,
|
|
Description: "DNS packet (TCP)",
|
|
Groups: []string{format.TCP_STREAM},
|
|
DecodeFn: dnsTCPDecode,
|
|
})
|
|
}
|
|
|
|
func dnsTCPDecode(d *decode.D, in any) any {
|
|
if tsi, ok := in.(format.TCPStreamIn); ok {
|
|
tsi.MustIsPort(d.Fatalf, format.TCPPortDomain)
|
|
}
|
|
return dnsDecode(d, true)
|
|
}
|