1
1
mirror of https://github.com/wader/fq.git synced 2024-12-26 15:02:28 +03:00
fq/format/dns/dns_tcp.go
Mattias Wadman 5d25bbc2e1 tcp,udp: Refactor and make port matching better
rtmp: check port based on tcp direction
dns,rtmp: refactor to use tcp and udp port match helpers
flow: add has start/end to tcp to know if stream has missing bytes
2022-04-08 17:44:39 +02:00

23 lines
491 B
Go

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{} {
if tsi, ok := in.(format.TCPStreamIn); ok {
tsi.MustIsPort(d.Fatalf, format.TCPPortDomain, format.TCPPortDomain)
}
return dnsDecode(d, true)
}