1
1
mirror of https://github.com/wader/fq.git synced 2024-12-28 08:02:28 +03:00
fq/format/dns/dns_tcp.go
2023-05-01 13:19:04 +02:00

26 lines
491 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(
format.DNS_TCP,
&decode.Format{
Description: "DNS packet (TCP)",
Groups: []*decode.Group{format.TCP_Stream},
DecodeFn: dnsTCPDecode,
})
}
func dnsTCPDecode(d *decode.D) any {
var tsi format.TCP_Stream_In
if d.ArgAs(&tsi) {
tsi.MustIsPort(d.Fatalf, format.TCPPortDomain)
}
return dnsDecode(d, true)
}