1 Star 0 Fork 0

zhangjungang/beats

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
errors.go 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
Steffen Siering 提交于 2016-11-14 14:50 . More Packetbeat cleanups (#2972)
package dns
import (
"fmt"
)
// All dns protocol errors are defined here.
type dnsError struct {
message string
}
func (e *dnsError) Error() string {
if e == nil {
return "<nil>"
}
return e.message
}
func (e *dnsError) responseError() string {
return "Response: " + e.Error()
}
// Common
var (
nonDNSMsg = &dnsError{message: "Message's data could not be decoded as DNS"}
duplicateQueryMsg = &dnsError{message: "Another query with the same DNS ID from this client " +
"was received so this query was closed without receiving a response"}
noResponse = &dnsError{message: "No response to this query was received"}
orphanedResponse = &dnsError{message: "Response: received without an associated Query"}
)
// EDNS
var (
udpPacketTooLarge = &dnsError{message: fmt.Sprintf("Non-EDNS packet has size greater than %d", maxDNSPacketSize)}
respEdnsNoSupport = &dnsError{message: "Responder does not support EDNS"}
respEdnsUnexpected = &dnsError{message: "Unexpected EDNS answer"}
)
// TCP
var (
zeroLengthMsg = &dnsError{message: "Message's length was set to zero"}
unexpectedLengthMsg = &dnsError{message: "Unexpected message data length"}
incompleteMsg = &dnsError{message: "Message's data is incomplete"}
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangjungang/beats.git
git@gitee.com:zhangjungang/beats.git
zhangjungang
beats
beats
v6.0.1

搜索帮助