Documentation ¶
Index ¶
- Constants
- Variables
- func AddRequestMsgMap(clientIP, srvIP string, reqID uint16, questions []mkdns.Question)
- func CalculateAverageTime(clientIp string, responseTime float64)
- func CalculateAverageTimePerView(clientIp string, responseTime float64, metricType string)
- func CalculateRecursiveMsg(clientIP, srvIP string, reqID uint16, questions []mkdns.Question, ...)
- func CheckMetricType(srcIp string, dstIp string, mode string) (statIP string, metricType string)
- func CreateCounterMetric(srcIp string, dstIp string, mode string) (statIP string)
- func CreateCounterMetricPerView(mapViewIPs map[int]map[string][]string)
- func FindClientInView(clientIP string) string
- func GetConfigDNSStatistics()
- func HandleRequestDecodeErr(clientIP, srvIP string)
- func HandleResponseDecodeErr(clientIP, srvIP string, RCodeString string)
- func IncrDNSStatsDuplicated(clientIp string)
- func IncrDNSStatsDuplicatedForPerView(clientIp string)
- func IncrDNSStatsFormatError(clientIp string)
- func IncrDNSStatsFormatErrorForPerView(clientIp string, metricType string)
- func IncrDNSStatsNXDomain(clientIp string)
- func IncrDNSStatsNXDomainForPerView(clientIp string, metricType string)
- func IncrDNSStatsNXRRSet(clientIp string)
- func IncrDNSStatsNXRRSetForPerView(clientIp string, metricType string)
- func IncrDNSStatsOtherRCode(clientIp string)
- func IncrDNSStatsOtherRCodeForPerView(clientIp string, metricType string)
- func IncrDNSStatsRecursive(clientIp string)
- func IncrDNSStatsRecursiveForPerView(clientIp string)
- func IncrDNSStatsReferral(clientIp string)
- func IncrDNSStatsReferralForPerView(clientIp string, metricType string)
- func IncrDNSStatsRefused(clientIp string)
- func IncrDNSStatsRefusedForPerView(clientIp string, metricType string)
- func IncrDNSStatsServerFail(clientIp string)
- func IncrDNSStatsServerFailForPerView(clientIp string, metricType string)
- func IncrDNSStatsSuccessful(clientIp string)
- func IncrDNSStatsSuccessfulForPerView(clientIp string, metricType string)
- func IncrDNSStatsSuccessfulNoAuthAns(clientIp string)
- func IncrDNSStatsSuccessfulNoAuthAnsForPerView(clientIp string)
- func IncrDNSStatsSuccessfulRecursive(clientIp string)
- func IncrDNSStatsSuccessfulRecursiveForPerView(clientIp string)
- func IncrDNSStatsTotalQueries(clientIp string)
- func IncrDNSStatsTotalQueriesForPerView(clientIp string)
- func IncrDNSStatsTotalResponses(clientIp string)
- func IncreaseQueryCounter(srcIp string, dstIp string, mode string)
- func IncreaseQueryCounterForPerView(srcIp string, dstIp string, mode string)
- func InitStatisticsDNS()
- func IsValidInACL(statIP string, metricType string) bool
- func Queries(srcIp string, dstIp string)
- func QueriesForPerView(srcIp string)
- func ReceiveHttpRequest(payloadString string)
- func ReceivedMessage(msg *model.Record)
- func Response(srcIp string, dstIp string)
- func ResponseForPerView(dstIp string)
- func Stop()
- type DNSMetrics
- type QueryDNS
- type QueueStatDNS
- type RecursiveDNS
- type RequestMap
- type StatisticsDNS
- type StatisticsService
Constants ¶
View Source
const ( CLIENT = "perClient" AUTHSERVER = "perServer" VIEW = "perView" NOERROR = "NOERROR" NXDOMAIN = "NXDOMAIN" SERVFAIL = "SERVFAIL" FORMERR = "FORMERR" REFUSED = "REFUSED" RR_NS = "NS" RQ_C_MAP = "Incoming" RQ_S_MAP = "Outgoing" QUERY = "Query" RESPONSE = "Response" RQ_ERR_MAP = "Formerr" NXRRSET = "NXRRSET" )
Variables ¶
View Source
var ( StatSrv *StatisticsService ReqMaps []*RequestMap StatInterval = time.Duration(30) MaximumClients = 200 MaximumReqMap = 2 IpNetsClient []*net.IPNet IpNetsServer []*net.IPNet IpsClient []string IpsServer []string UrlAnnouncementDeployFromBam string MapViewIPs map[int]map[string][]string QStatDNS *QueueStatDNS IsActive bool )
Functions ¶
func AddRequestMsgMap ¶
Store all request messages into the corresponding map for Incoming messages and Outgoing messages
func CalculateAverageTime ¶
func CalculateRecursiveMsg ¶
func CalculateRecursiveMsg(clientIP, srvIP string, reqID uint16, questions []mkdns.Question, dnsMsg *mkdns.Msg)
Extract the client question from the response and find it from the Outgoing messages Then find client question from the Incoming messages All found the client question, increase the recursive value for the client stat, then remove out the request from the maps
func CheckMetricType ¶
func CreateCounterMetric ¶
Create metric for the Client/AS/Forwarder
func CreateCounterMetricPerView ¶
Create metric for perView
func FindClientInView ¶
func GetConfigDNSStatistics ¶
func GetConfigDNSStatistics()
func HandleRequestDecodeErr ¶
func HandleRequestDecodeErr(clientIP, srvIP string)
func HandleResponseDecodeErr ¶
func IncrDNSStatsDuplicated ¶
func IncrDNSStatsDuplicated(clientIp string)
func IncrDNSStatsDuplicatedForPerView ¶
func IncrDNSStatsDuplicatedForPerView(clientIp string)
func IncrDNSStatsFormatError ¶
func IncrDNSStatsFormatError(clientIp string)
func IncrDNSStatsNXDomain ¶
func IncrDNSStatsNXDomain(clientIp string)
func IncrDNSStatsNXRRSet ¶
func IncrDNSStatsNXRRSet(clientIp string)
func IncrDNSStatsOtherRCode ¶
func IncrDNSStatsOtherRCode(clientIp string)
func IncrDNSStatsRecursive ¶
func IncrDNSStatsRecursive(clientIp string)
func IncrDNSStatsRecursiveForPerView ¶
func IncrDNSStatsRecursiveForPerView(clientIp string)
func IncrDNSStatsReferral ¶
func IncrDNSStatsReferral(clientIp string)
func IncrDNSStatsRefused ¶
func IncrDNSStatsRefused(clientIp string)
func IncrDNSStatsServerFail ¶
func IncrDNSStatsServerFail(clientIp string)
func IncrDNSStatsSuccessful ¶
func IncrDNSStatsSuccessful(clientIp string)
func IncrDNSStatsSuccessfulNoAuthAns ¶
func IncrDNSStatsSuccessfulNoAuthAns(clientIp string)
func IncrDNSStatsSuccessfulNoAuthAnsForPerView ¶
func IncrDNSStatsSuccessfulNoAuthAnsForPerView(clientIp string)
func IncrDNSStatsSuccessfulRecursive ¶
func IncrDNSStatsSuccessfulRecursive(clientIp string)
func IncrDNSStatsSuccessfulRecursiveForPerView ¶
func IncrDNSStatsSuccessfulRecursiveForPerView(clientIp string)
func IncrDNSStatsTotalQueries ¶
func IncrDNSStatsTotalQueries(clientIp string)
func IncrDNSStatsTotalQueriesForPerView ¶
func IncrDNSStatsTotalQueriesForPerView(clientIp string)
func IncrDNSStatsTotalResponses ¶
func IncrDNSStatsTotalResponses(clientIp string)
func IncreaseQueryCounter ¶
func InitStatisticsDNS ¶
func InitStatisticsDNS()
func IsValidInACL ¶
func QueriesForPerView ¶
func QueriesForPerView(srcIp string)
func ReceiveHttpRequest ¶
func ReceiveHttpRequest(payloadString string)
func ReceivedMessage ¶
func ResponseForPerView ¶
func ResponseForPerView(dstIp string)
Types ¶
type DNSMetrics ¶
type DNSMetrics struct { TotalQueries int64 `json:"total_queries"` TotalResponses int64 `json:"total_responses"` Recursive int64 `json:"recursive"` SuccessfulRecursive int64 `json:"successful_recursive"` SuccessfulNoAuthAns int64 `json:"successful_noauthans"` Duplicated int64 `json:"duplicated"` AverageTime *float64 `json:"average_time"` Successful int64 `json:"successful"` ServerFail int64 `json:"server_fail"` NXDomain int64 `json:"nx_domain"` FormatError int64 `json:"format_error"` NXRRSet int64 `json:"nx_rrset"` Referral int64 `json:"referral"` Refused int64 `json:"refused"` OtherRcode int64 `json:"other_rcode"` }
Statistics details
type QueryDNS ¶
type QueryDNS struct {
// contains filtered or unexported fields
}
DNS data after decode
func NewQueryDNS ¶
type QueueStatDNS ¶
type QueueStatDNS struct {
// contains filtered or unexported fields
}
func NewQueueStatDNS ¶
func NewQueueStatDNS() (queue *QueueStatDNS)
func (*QueueStatDNS) PopStatDNS ¶
func (queue *QueueStatDNS) PopStatDNS()
func (*QueueStatDNS) PushQueryDNS ¶
func (queue *QueueStatDNS) PushQueryDNS(queryDNS *QueryDNS)
func (*QueueStatDNS) PushRecordDNS ¶
func (queue *QueueStatDNS) PushRecordDNS(record *model.Record)
func (*QueueStatDNS) PushRecursiveDNS ¶
func (queue *QueueStatDNS) PushRecursiveDNS(recursiveDNS *RecursiveDNS)
func (*QueueStatDNS) Stop ¶
func (queue *QueueStatDNS) Stop()
type RecursiveDNS ¶
type RecursiveDNS struct { IP string // contains filtered or unexported fields }
func NewRecursiveDNS ¶
func NewRecursiveDNS(IP string, isSuccess bool) (recursiveDNS *RecursiveDNS)
type RequestMap ¶
Query map for recursion counting
type StatisticsDNS ¶
type StatisticsDNS struct { Type string `json:"type"` DNSMetrics *DNSMetrics `json:"dnsmetrics"` }
Statistics for a client or an AS.
type StatisticsService ¶
type StatisticsService struct { Start time.Time `json:"start"` End time.Time `json:"end"` StatsMap map[string]*StatisticsDNS `json:"stats_map"` }
Statistics service
Click to show internal directories.
Click to hide internal directories.