netmap

package module
v0.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2023 License: Apache-2.0 Imports: 21 Imported by: 21 modules, 53 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

netmap

GitHub Test Status GoDoc License Go Report CodeFactor Codecov Follow on Twitter

Graphing package for mapping and visualizing the Internet.

Installation Go Version

go get -v -u github.com/caffix/netmap

This package is currently in development.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Graph

type Graph struct {
	DB *db.AssetDB
	// contains filtered or unexported fields
}

Graph is the object for managing a network infrastructure link graph.

func NewGraph

func NewGraph(system, path string, options string) *Graph

NewGraph returns an intialized Graph object.

func (*Graph) IsCNAMENode

func (g *Graph) IsCNAMENode(ctx context.Context, fqdn string, since time.Time) bool

IsCNAMENode returns true if the FQDN has a CNAME edge to another FQDN in the graph.

func (*Graph) IsMXNode

func (g *Graph) IsMXNode(ctx context.Context, fqdn string, since time.Time) bool

IsMXNode returns true if the FQDN has a MX edge pointing to it in the graph.

func (*Graph) IsNSNode

func (g *Graph) IsNSNode(ctx context.Context, fqdn string, since time.Time) bool

IsNSNode returns true if the FQDN has a NS edge pointing to it in the graph.

func (*Graph) IsPTRNode

func (g *Graph) IsPTRNode(ctx context.Context, fqdn string, since time.Time) bool

IsPTRNode returns true if the FQDN has a PTR edge to another FQDN in the graph.

func (*Graph) NamesToAddrs

func (g *Graph) NamesToAddrs(ctx context.Context, since time.Time, names ...string) ([]*NameAddrPair, error)

NamesToAddrs returns a NameAddrPair for each name / address combination discovered in the graph.

func (*Graph) ReadASDescription

func (g *Graph) ReadASDescription(ctx context.Context, asn int, since time.Time) string

ReadASDescription the description property of an autonomous system in the graph.

func (*Graph) ReadASPrefixes

func (g *Graph) ReadASPrefixes(ctx context.Context, asn int, since time.Time) []string

func (*Graph) Remove added in v0.2.0

func (g *Graph) Remove()

func (*Graph) UpsertA

func (g *Graph) UpsertA(ctx context.Context, fqdn, addr string) error

UpsertA creates FQDN, IP address and A record edge in the graph and associates them with a source and event.

func (*Graph) UpsertAAAA

func (g *Graph) UpsertAAAA(ctx context.Context, fqdn, addr string) error

UpsertAAAA creates FQDN, IP address and AAAA record edge in the graph and associates them with a source and event.

func (*Graph) UpsertAS

func (g *Graph) UpsertAS(ctx context.Context, asn int, desc string) (*types.Asset, error)

UpsertAS adds/updates an autonomous system in the graph.

func (*Graph) UpsertAddress

func (g *Graph) UpsertAddress(ctx context.Context, addr string) (*types.Asset, error)

UpsertAddress creates an IP address in the graph.

func (*Graph) UpsertCNAME

func (g *Graph) UpsertCNAME(ctx context.Context, fqdn, target string) error

UpsertCNAME adds the FQDNs and CNAME record between them to the graph.

func (*Graph) UpsertFQDN

func (g *Graph) UpsertFQDN(ctx context.Context, name string) (*types.Asset, error)

UpsertFQDN adds a fully qualified domain name to the graph.

func (*Graph) UpsertInfrastructure

func (g *Graph) UpsertInfrastructure(ctx context.Context, asn int, desc, addr, cidr string) error

UpsertInfrastructure adds/updates an associated IP address, netblock and autonomous system in the graph.

func (*Graph) UpsertMX

func (g *Graph) UpsertMX(ctx context.Context, fqdn, target string) error

UpsertMX adds the FQDNs and MX record between them to the graph.

func (*Graph) UpsertNS

func (g *Graph) UpsertNS(ctx context.Context, fqdn, target string) error

UpsertNS adds the FQDNs and NS record between them to the graph.

func (*Graph) UpsertNetblock

func (g *Graph) UpsertNetblock(ctx context.Context, cidr string) (*types.Asset, error)

UpsertNetblock adds a netblock/CIDR to the graph.

func (*Graph) UpsertPTR

func (g *Graph) UpsertPTR(ctx context.Context, fqdn, target string) error

UpsertPTR adds the FQDNs and PTR record between them to the graph.

func (*Graph) UpsertSRV

func (g *Graph) UpsertSRV(ctx context.Context, service, target string) error

UpsertSRV adds the FQDNs and SRV record between them to the graph.

type NameAddrPair

type NameAddrPair struct {
	FQDN *domain.FQDN
	Addr *network.IPAddress
}

NameAddrPair represents a relationship between a DNS name and an IP address it eventually resolves to.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址