nuclei/pkg/protocols/dns/cluster.go
Tarun Koyalwar dc44105baf
nuclei v3 : misc updates (#4247)
* use parsed options while signing

* update project layout to v3

* fix .gitignore

* remove example template

* misc updates

* bump tlsx version

* hide template sig warning with env

* js: retain value while using log

* fix nil pointer derefernce

* misc doc update

---------

Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2023-10-17 17:44:13 +05:30

28 lines
759 B
Go

package dns
// CanCluster returns true if the request can be clustered.
//
// This used by the clustering engine to decide whether two requests
// are similar enough to be considered one and can be checked by
// just adding the matcher/extractors for the request and the correct IDs.
func (request *Request) CanCluster(other *Request) bool {
if len(request.Resolvers) > 0 || request.Trace || request.ID != "" {
return false
}
if request.Name != other.Name ||
request.class != other.class ||
request.Retries != other.Retries ||
request.question != other.question {
return false
}
if request.Recursion != nil {
if other.Recursion == nil {
return false
}
if *request.Recursion != *other.Recursion {
return false
}
}
return true
}