Documentation ¶
Index ¶
- Constants
- func DrawGraph(g Node, criticalNodes []CriticalNode) (*gographviz.Graph, string)
- type AliasNode
- type CriticalASN
- type CriticalAlias
- type CriticalIP
- type CriticalName
- type CriticalNode
- type CriticalPrefix
- type Cycle
- type DomainNameNode
- type IPNode
- type LeafNode
- type Node
- type RelationshipNode
- func (rn *RelationshipNode) AddChild(c Node)
- func (rn *RelationshipNode) Analyse(DNSSECOnly bool, tree *iradix.Tree) []CriticalNode
- func (rn *RelationshipNode) AnalyseWithoutV4(DNSSECOnly bool, tree *iradix.Tree) ([]CriticalNode, error)
- func (rn *RelationshipNode) AnalyseWithoutV6(DNSSECOnly bool, tree *iradix.Tree) ([]CriticalNode, error)
- func (rn *RelationshipNode) MarshalJSON() ([]byte, error)
- func (rn *RelationshipNode) SimplifyGraph() *RelationshipNode
- func (rn *RelationshipNode) String() string
- func (rn *RelationshipNode) UnmarshalJSON(b []byte) error
- type WorkerAnalysisResult
Constants ¶
const ( // OR_REL is a constant used to designate the OR relationship in RelationshipNode instances OR_REL = iota // AND_REL is a constant used to designate the AND relationship in RelationshipNode instances AND_REL )
Variables ¶
This section is empty.
Functions ¶
func DrawGraph ¶
func DrawGraph(g Node, criticalNodes []CriticalNode) (*gographviz.Graph, string)
DrawGraph initializes a graphviz graph instance rooted on g, then returns it, along with the "root" node of that "subgraph" (since g could be the children of another node). Members of the criticalNodes are highlighted.
Types ¶
type AliasNode ¶
type AliasNode struct {
// contains filtered or unexported fields
}
AliasNode represents a CNAME in the dependency graph of a name.
func NewAliasNode ¶
NewAliasNode returns a new instance of AliasNode after initializing it.
target is the right-hand name of the CNAME RR
source is the owner name of the CNAME RR
func (*AliasNode) MarshalJSON ¶
Implements json.Marshaler
func (*AliasNode) UnmarshalJSON ¶
Implements json.Unmarshaler
type CriticalASN ¶
type CriticalASN struct {
ASN int `json:"asn"`
}
type CriticalAlias ¶
type CriticalIP ¶
type CriticalName ¶
type CriticalName struct {
Name string `json:"name"`
}
type CriticalNode ¶
type CriticalNode interface {
// contains filtered or unexported methods
}
type CriticalPrefix ¶
type Cycle ¶
type Cycle struct {
// contains filtered or unexported fields
}
Cycle instances represent parts of the graph where circular dependencies are detected. During analysis, they signify that this branch of the graph is always invalid.
func (*Cycle) UnmarchalJSON ¶
Implements json.Unmarshaler
type DomainNameNode ¶
type DomainNameNode struct {
// contains filtered or unexported fields
}
DomainNameNode represents a domain name or an alias of a name within the dependency tree As a metadata, if a node represents a zone apex, a DNSSEC indicator is set if there is a DS record for this name.
func NewDomainNameNode ¶
func NewDomainNameNode(domain string, dnssecProtected bool) *DomainNameNode
NewDomainNameNode returns a new DomainNameNode instance and initializes it with the domain name and the DNSSEC indicator
func (*DomainNameNode) DNSSECProtected ¶
func (n *DomainNameNode) DNSSECProtected() bool
func (*DomainNameNode) Domain ¶
func (n *DomainNameNode) Domain() string
func (*DomainNameNode) MarshalJSON ¶
func (n *DomainNameNode) MarshalJSON() ([]byte, error)
Implements json.Marshaler
func (*DomainNameNode) String ¶
func (n *DomainNameNode) String() string
func (*DomainNameNode) UnmarshalJSON ¶
func (n *DomainNameNode) UnmarshalJSON(bstr []byte) error
Implements json.Unmarshaler
type IPNode ¶
type IPNode struct {
// contains filtered or unexported fields
}
func (*IPNode) MarshalJSON ¶
func (*IPNode) UnmarshalJSON ¶
type LeafNode ¶
type LeafNode interface { Node // contains filtered or unexported methods }
A LeafNode is, as the name implies a leaf node in a dependency tree. The only difference with the Node interface is that LeadNode instances can be compared using the similar() method.
type Node ¶
type Node interface { String() string // contains filtered or unexported methods }
A node is an intermediary node (RelationshipNode) or a LeafNode in a dependency graph.
type RelationshipNode ¶
type RelationshipNode struct {
// contains filtered or unexported fields
}
RelationshipNode instances represents intermediary nodes in the dependency graph. RelationshipNode are N-ary trees, not necessarily binary trees. Children of such a node are related following either an "and" or an "or" boolean expression.
func NewRelationshipNode ¶
func NewRelationshipNode(comment string, relation int) *RelationshipNode
NewRelationshipNode returns a new RelationshipNode after initializing it.
comment is a free-form string giving some indication as to why this node exists and what it represents w.r.t. the dependency tree.
relation is either equal to AND_REL or OR_REL
func (*RelationshipNode) AddChild ¶
func (rn *RelationshipNode) AddChild(c Node)
AddChild adds a Node to the children of the receiver. This is the main function used for tree building
func (*RelationshipNode) Analyse ¶
func (rn *RelationshipNode) Analyse(DNSSECOnly bool, tree *iradix.Tree) []CriticalNode
Analyse is the exported version of analyse. It starts the analysis of the tree under the receiver and returns the list of mandatory nodes. IPv4 and IPv6 addresses have normal availability markers (no breakV4/breakV6)
func (*RelationshipNode) AnalyseWithoutV4 ¶
func (rn *RelationshipNode) AnalyseWithoutV4(DNSSECOnly bool, tree *iradix.Tree) ([]CriticalNode, error)
AnalyseWithoutV4 runs the same type of analysis as "Analyse" except all IPv4 addresses are marked as unavailable. This may reveal that some IPv6 are actually SPOFs when IPv4 addresses are not available. AnalyseWithoutV4 may either return the list of mandatory leafNodes or an error if the name cannot be resolved without IPv4 address participation.
func (*RelationshipNode) AnalyseWithoutV6 ¶
func (rn *RelationshipNode) AnalyseWithoutV6(DNSSECOnly bool, tree *iradix.Tree) ([]CriticalNode, error)
AnalyseWithoutV6 runs the same type of analysis as "Analyse" except all IPv6 addresses are marked as unavailable. This may reveal that some IPv4 are actually SPOFs when IPv6 addresses are not available. AnalyseWithoutV6 may either return the list of mandatory leafNodes or an error if the name cannot be resolved without IPv6 address participation.
func (*RelationshipNode) MarshalJSON ¶
func (rn *RelationshipNode) MarshalJSON() ([]byte, error)
Implements json.Marshaler
func (*RelationshipNode) SimplifyGraph ¶
func (rn *RelationshipNode) SimplifyGraph() *RelationshipNode
SimplifyGraph creates a copy of the tree under the receiver, simplifies the radix under the copy, by applying repetitively auxSimplyGraph and simplifyRelWithCycle until the tree is stable. The copy is then returned.
func (*RelationshipNode) String ¶
func (rn *RelationshipNode) String() string
func (*RelationshipNode) UnmarshalJSON ¶
func (rn *RelationshipNode) UnmarshalJSON(b []byte) error
Implements json.Unmarshaler
type WorkerAnalysisResult ¶
type WorkerAnalysisResult struct { Nodes []CriticalNode Err error }
func PerformAnalyseOnResult ¶
func PerformAnalyseOnResult(g *RelationshipNode, reqConf *tools.RequestConfig, tree *iradix.Tree) (allNamesResult, allNamesNo4Result, allNamesNo6Result, dnssecResult, dnssecNo4Result, dnssecNo6Result *WorkerAnalysisResult)