topology

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package topology provides network topology discovery from packet captures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder builds network topology from observed traffic.

func NewBuilder

func NewBuilder() *Builder

NewBuilder creates a new topology builder.

func (*Builder) AddTraffic

func (b *Builder) AddTraffic(srcIP, dstIP, protocol string, srcPort, dstPort int, bytes int64)

AddTraffic adds observed traffic to the topology.

func (*Builder) Build

func (b *Builder) Build() *Topology

Build returns the completed topology.

type Link struct {
	Source   string `json:"source"`
	Target   string `json:"target"`
	Protocol string `json:"protocol"`
	Packets  int    `json:"packets"`
	Bytes    int64  `json:"bytes"`
}

Link represents a connection between two nodes.

type Node

type Node struct {
	ID       string            `json:"id"`
	Type     string            `json:"type"` // "host", "router", "switch", "server"
	MAC      string            `json:"mac,omitempty"`
	IP       string            `json:"ip,omitempty"`
	Ports    []int             `json:"ports,omitempty"`
	Services []string          `json:"services,omitempty"`
	Meta     map[string]string `json:"meta,omitempty"`
}

Node represents a network node.

type Topology

type Topology struct {
	Nodes []Node `json:"nodes"`
	Links []Link `json:"links"`
}

Topology represents a discovered network topology.

func (*Topology) ToMermaid

func (t *Topology) ToMermaid() string

ToMermaid generates a Mermaid graph from the topology.

Jump to

Keyboard shortcuts

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