代码拉取完成,页面将自动刷新
package dns
import (
"github.com/elastic/beats/libbeat/logp"
"github.com/elastic/beats/packetbeat/procs"
"github.com/elastic/beats/packetbeat/protos"
)
// Only EDNS packets should have their size beyond this value
const maxDNSPacketSize = (1 << 9) // 512 (bytes)
func (dns *dnsPlugin) ParseUDP(pkt *protos.Packet) {
defer logp.Recover("Dns ParseUdp")
packetSize := len(pkt.Payload)
debugf("Parsing packet addressed with %s of length %d.",
pkt.Tuple.String(), packetSize)
dnsPkt, err := decodeDNSData(transportUDP, pkt.Payload)
if err != nil {
// This means that malformed requests or responses are being sent or
// that someone is attempting to the DNS port for non-DNS traffic. Both
// are issues that a monitoring system should report.
debugf("%s", err.Error())
return
}
dnsTuple := dnsTupleFromIPPort(&pkt.Tuple, transportUDP, dnsPkt.Id)
dnsMsg := &dnsMessage{
ts: pkt.Ts,
tuple: pkt.Tuple,
cmdlineTuple: procs.ProcWatcher.FindProcessesTuple(&pkt.Tuple),
data: dnsPkt,
length: packetSize,
}
if dnsMsg.data.Response {
dns.receivedDNSResponse(&dnsTuple, dnsMsg)
} else /* Query */ {
dns.receivedDNSRequest(&dnsTuple, dnsMsg)
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。