mirror of
https://github.com/wader/fq.git
synced 2024-12-25 22:34:14 +03:00
5d25bbc2e1
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
23 lines
491 B
Go
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)
|
|
}
|