Documentation
¶
Overview ¶
Package server provides the Mason application used for network discovery and management
Index ¶
- func HasCapabilities() bool
- func SetCapabilities() error
- type Mason
- func (m *Mason) AddNetwork(network network.Network) error
- func (m *Mason) AddNetworkByName(name string, prefix string, scannow bool) error
- func (m Mason) ArpPing(ctx context.Context, target string, timeout time.Duration) (net.HardwareAddr, error)
- func (m Mason) CheckDNS(ctx context.Context, target string) (map[string]map[string][]netip.Addr, error)
- func (m *Mason) CountDevices() int
- func (m *Mason) CountNetworks() int
- func (m Mason) FetchSNMPInfo(ctx context.Context, target string) (info nettools.SnmpInfo, err error)
- func (m Mason) FetchSNMPInfoAddr(ctx context.Context, target netip.Addr) (info nettools.SnmpInfo, err error)
- func (m Mason) FetchTLSInfo(ctx context.Context, target string) (nettools.TLS, error)
- func (m Mason) GetConfig() config.Config
- func (m *Mason) GetDeviceByAddr(addr netip.Addr) (device.Device, error)
- func (m Mason) GetExternalAddr(ctx context.Context) (netip.Addr, error)
- func (m *Mason) GetInternalsSnapshot() MasonInternalsView
- func (m Mason) GetNetworkStats() []network.NetworkStats
- func (m Mason) GetUserAgent() string
- func (m Mason) IcmpPing(ctx context.Context, target string, count int, timeout time.Duration) (stats nettools.Icmp4EchoResponseStatistics, err error)
- func (m Mason) IcmpPingAddr(ctx context.Context, addr netip.Addr, count int, timeout time.Duration) (nettools.Icmp4EchoResponseStatistics, error)
- func (m *Mason) ListDevices() []device.Device
- func (m *Mason) ListNetworks() []network.Network
- func (m Mason) OuiLookup(mac net.HardwareAddr) (string, error)
- func (m Mason) PingFailures() []device.Device
- func (m Mason) Portscan(ctx context.Context, target string, cfg *config.PortScannerConfig) ([]int, error)
- func (m *Mason) ReadTimeseriesPoints(ctx context.Context, device device.Device, duration time.Duration, ...) ([]pinger.TimeseriesPoint, error)
- func (m *Mason) Run(ctx context.Context)
- func (m Mason) ServerDevices() []device.Device
- func (m Mason) StringToAddr(str string) (netip.Addr, error)
- func (m Mason) Traceroute(ctx context.Context, target string) (stat []nettools.Icmp4EchoResponseStatistics, err error)
- func (m Mason) TracerouteAddr(ctx context.Context, target netip.Addr) (stats []nettools.Icmp4EchoResponseStatistics, err error)
- type MasonInternalsView
- type MasonNetworker
- type MasonReader
- type MasonReaderWriter
- type MasonWriter
- type StoreAll
- type StoreDevice
- type StoreNetwork
- type StoreTimeseries
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasCapabilities ¶
func HasCapabilities() bool
func SetCapabilities ¶
func SetCapabilities() error
Types ¶
type Mason ¶
type Mason struct {
// contains filtered or unexported fields
}
func NewTool ¶
func NewTool() *Mason
NewTool returns a Mason instance meant for network tool usage (ping, traceroute, etc..) and not persisting data or operating as a server
func (*Mason) AddNetworkByName ¶
AddNetwork is a helper function to introduce a new network into the system
func (*Mason) CountDevices ¶
func (*Mason) CountNetworks ¶
func (Mason) FetchSNMPInfo ¶
func (Mason) FetchSNMPInfoAddr ¶
func (Mason) FetchTLSInfo ¶
func (*Mason) GetDeviceByAddr ¶
func (Mason) GetExternalAddr ¶
func (*Mason) GetInternalsSnapshot ¶
func (m *Mason) GetInternalsSnapshot() MasonInternalsView
func (Mason) GetNetworkStats ¶
func (m Mason) GetNetworkStats() []network.NetworkStats
func (Mason) GetUserAgent ¶
func (Mason) IcmpPingAddr ¶
func (*Mason) ListDevices ¶
func (*Mason) ListNetworks ¶
func (Mason) PingFailures ¶
func (*Mason) ReadTimeseriesPoints ¶
func (Mason) ServerDevices ¶
func (Mason) Traceroute ¶
func (Mason) TracerouteAddr ¶
type MasonInternalsView ¶
type MasonInternalsView struct {
NumberOfGoProcs int
NetworkStoreCount int
DeviceStoreCount int
NetworkScanMaxWorkers int
DiscoveryMaxWorkers int
EnrichmentMaxWorkers int
PortScanMaxWorkers int
PingerMaxWorkers int
AddressScanActive int
DeviceEnrichActive int
PerfPingActive int
NetworkScanActive int
CurrentNetworkScan string
Events []bus.HistoricalEvent
Errors []bus.HistoricalError
Memstats runtime.MemStats
Buildinfo debug.BuildInfo
}
type MasonNetworker ¶
type MasonNetworker interface {
StringToAddr(string) (netip.Addr, error)
IcmpPingAddr(
context.Context,
netip.Addr,
int,
time.Duration,
) (nettools.Icmp4EchoResponseStatistics, error)
IcmpPing(
context.Context,
string,
int,
time.Duration,
) (nettools.Icmp4EchoResponseStatistics, error)
ArpPing(context.Context, string, time.Duration) (net.HardwareAddr, error)
Portscan(context.Context, string, *config.PortScannerConfig) ([]int, error)
GetExternalAddr(ctx context.Context) (netip.Addr, error)
Traceroute(context.Context, string) ([]nettools.Icmp4EchoResponseStatistics, error)
TracerouteAddr(context.Context, netip.Addr) ([]nettools.Icmp4EchoResponseStatistics, error)
FetchTLSInfo(context.Context, string) (nettools.TLS, error)
FetchSNMPInfo(context.Context, string) (nettools.SnmpInfo, error)
FetchSNMPInfoAddr(context.Context, netip.Addr) (nettools.SnmpInfo, error)
}
type MasonReader ¶
type MasonReader interface {
ListNetworks() []network.Network
CountNetworks() int
ListDevices() []device.Device
CountDevices() int
GetDeviceByAddr(netip.Addr) (device.Device, error)
ReadTimeseriesPoints(
context.Context,
device.Device,
time.Duration,
pinger.TimeseriesPoint,
) ([]pinger.TimeseriesPoint, error)
GetConfig() config.Config
GetInternalsSnapshot() MasonInternalsView
GetUserAgent() string
OuiLookup(mac net.HardwareAddr) (string, error)
GetNetworkStats() []network.NetworkStats
PingFailures() []device.Device
ServerDevices() []device.Device
}
type MasonReaderWriter ¶
type MasonReaderWriter interface {
MasonReader
MasonWriter
MasonNetworker
}
type MasonWriter ¶
type StoreAll ¶
type StoreAll interface {
StoreNetwork
StoreDevice
StoreTimeseries
}
StoreAll is a complete implementation of all objects which need to be managed
type StoreDevice ¶
type StoreDevice interface {
AddDevice(device.Device) error
RemoveDeviceByAddr(netip.Addr) error
UpdateDevice(device.Device) error
GetDeviceByAddr(netip.Addr) (device.Device, error)
GetFilteredDevices(device.DeviceFilter) []device.Device
ListDevices() []device.Device
CountDevices() int
}
StoreDevice allows for the saving and fetching of device definitions.
type StoreNetwork ¶
type StoreNetwork interface {
AddNetwork(n network.Network) error
RemoveNetworkByName(name string) error
UpdateNetwork(network.Network) error
UpsertNetwork(network.Network) error
GetNetworkByName(name string) (network.Network, error)
GetFilteredNetworks(network.NetworkFilter) []network.Network
ListNetworks() []network.Network
CountNetworks() int
}
StoreNetwork allows for the saving and fetching of network definitions.
type StoreTimeseries ¶
type StoreTimeseries interface {
WriteTimeseriesPoint(
context.Context,
time.Time,
device.Device,
...pinger.TimeseriesPoint,
) error
ReadTimeseriesPoints(
context.Context,
device.Device,
time.Duration,
pinger.TimeseriesPoint,
) ([]pinger.TimeseriesPoint, error)
}
StoreTimeseries allows for the saving and fetching of timeseries data.
Click to show internal directories.
Click to hide internal directories.