Documentation
¶
Overview ¶
Package server provides the Mason application used for network discovery and management
Package server provides the Mason application used for network discovery and management
Index ¶
- func HasCapabilities(cfg *Config) bool
- func SetCapabilities() error
- func SetFlags(fs *pflag.FlagSet, cfg *Config)
- type AsnStorer
- type Config
- type DeviceStorer
- type Mason
- func (m *Mason) AddNetwork(ctx context.Context, network model.Network) error
- func (m *Mason) AddNetworkByName(ctx context.Context, name string, prefix string, scannow bool) error
- func (m *Mason) ArpPing(ctx context.Context, target string, timeout time.Duration) (model.MAC, error)
- func (m *Mason) CheckDNS(ctx context.Context, target string) (map[string]map[string][]netip.Addr, error)
- func (m *Mason) CountDevices(ctx context.Context) int
- func (m *Mason) CountNetworks(ctx context.Context) int
- func (m *Mason) FetchSNMPInfo(ctx context.Context, target string) (info nettools.SnmpInfo, err error)
- func (m *Mason) FetchSNMPInfoAddr(ctx context.Context, target model.Addr) (info nettools.SnmpInfo, err error)
- func (m *Mason) FetchTLSInfo(ctx context.Context, target string) (nettools.TLS, error)
- func (m *Mason) FlowSummaryByCountry(ctx context.Context, addr model.Addr) ([]model.FlowSummaryForAddrByCountry, error)
- func (m *Mason) FlowSummaryByIP(ctx context.Context, addr model.Addr) ([]model.FlowSummaryForAddrByIP, error)
- func (m *Mason) FlowSummaryByName(ctx context.Context, addr model.Addr) ([]model.FlowSummaryForAddrByName, error)
- func (m *Mason) GetAsn(ctx context.Context, asn string) (model.Asn, error)
- func (m *Mason) GetConfig() *Config
- func (m *Mason) GetDeviceByAddr(ctx context.Context, addr model.Addr) (model.Device, error)
- func (m *Mason) GetExternalAddr(ctx context.Context) (model.Addr, error)
- func (m *Mason) GetInternalsSnapshot(ctx context.Context) MasonInternalsView
- func (m *Mason) GetNetworkStats(ctx context.Context) []model.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 model.Addr, count int, timeout time.Duration, ...) (nettools.Icmp4EchoResponseStatistics, error)
- func (m *Mason) ListDevices(ctx context.Context) []model.Device
- func (m *Mason) ListNetworks(ctx context.Context) []model.Network
- func (m *Mason) LookupIP(addr model.Addr) string
- func (m *Mason) OuiLookup(mac net.HardwareAddr) string
- func (m *Mason) PingFailures(ctx context.Context) []model.Device
- func (m *Mason) Portscan(ctx context.Context, target string, cfg *enrichment.PortScanConfig) ([]int, error)
- func (m *Mason) ReadPerformancePings(ctx context.Context, device model.Device, duration time.Duration) ([]pinger.Point, error)
- func (m *Mason) Run(ctx context.Context)
- func (m *Mason) ServerDevices(ctx context.Context) []model.Device
- func (m *Mason) StringToAddr(str string) (model.Addr, error)
- func (m *Mason) Traceroute(ctx context.Context, target string) (stat []nettools.Icmp4EchoResponseStatistics, err error)
- func (m *Mason) TracerouteAddr(ctx context.Context, target model.Addr) (stats []nettools.Icmp4EchoResponseStatistics, err error)
- type MasonInternalsView
- type NetflowStorer
- type NetworkStorer
- type Option
- type Options
- type PerformancePingStorer
- type Store
- type Storer
- type TuiConfig
- type WuiConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasCapabilities ¶
func SetCapabilities ¶
func SetCapabilities() error
Types ¶
type Config ¶ added in v0.2.0
type DeviceStorer ¶ added in v0.2.0
type DeviceStorer interface {
AddDevice(context.Context, model.Device) error
RemoveDeviceByAddr(context.Context, model.Addr) error
UpdateDevice(context.Context, model.Device) (bool, error)
GetDeviceByAddr(context.Context, model.Addr) (model.Device, error)
GetFilteredDevices(context.Context, model.DeviceFilter) []model.Device
ListDevices(context.Context) []model.Device
CountDevices(context.Context) int
}
DeviceStorer allows for the saving and fetching of device definitions.
type Mason ¶
type Mason struct {
// contains filtered or unexported fields
}
func (*Mason) AddNetwork ¶
func (*Mason) AddNetworkByName ¶
func (m *Mason) AddNetworkByName( ctx context.Context, name string, prefix string, scannow bool, ) error
AddNetwork is a helper function to introduce a new network into the system
func (*Mason) FetchSNMPInfo ¶
func (*Mason) FetchSNMPInfoAddr ¶
func (*Mason) FetchTLSInfo ¶
func (*Mason) FlowSummaryByCountry ¶ added in v0.2.0
func (*Mason) FlowSummaryByIP ¶ added in v0.2.0
func (*Mason) FlowSummaryByName ¶ added in v0.2.0
func (*Mason) GetDeviceByAddr ¶
func (*Mason) GetExternalAddr ¶
func (*Mason) GetInternalsSnapshot ¶
func (m *Mason) GetInternalsSnapshot(ctx context.Context) MasonInternalsView
func (*Mason) GetNetworkStats ¶
func (m *Mason) GetNetworkStats(ctx context.Context) []model.NetworkStats
func (*Mason) GetUserAgent ¶
func (*Mason) IcmpPingAddr ¶
func (*Mason) Portscan ¶
func (m *Mason) Portscan( ctx context.Context, target string, cfg *enrichment.PortScanConfig, ) ([]int, error)
func (*Mason) ReadPerformancePings ¶ added in v0.2.0
func (*Mason) Traceroute ¶
func (*Mason) TracerouteAddr ¶
type MasonInternalsView ¶
type MasonInternalsView struct {
NumberOfGoProcs int
NetworkStoreCount int
DeviceStoreCount int
DiscoveryMaxWorkers int
EnrichmentMaxWorkers int
EnrichmentBackPressure int
PortScanMaxWorkers int
PingerMaxWorkers int
AddressScanActive int
DeviceEnrichActive int
PerfPingActive int
NetworkScanActive int
BusBackPressure int
CurrentNetworkScan string
Events []bus.HistoricalEvent
Errors []bus.HistoricalError
Memstats runtime.MemStats
Buildinfo debug.BuildInfo
}
type NetflowStorer ¶ added in v0.2.0
type NetflowStorer interface {
AsnStorer
AddNetflows(context.Context, []model.IpFlow) error
GetNetflows(context.Context, model.Addr) ([]model.IpFlow, error)
FlowSummaryByIP(context.Context, model.Addr) ([]model.FlowSummaryForAddrByIP, error)
FlowSummaryByName(context.Context, model.Addr) ([]model.FlowSummaryForAddrByName, error)
FlowSummaryByCountry(
context.Context,
model.Addr,
) ([]model.FlowSummaryForAddrByCountry, error)
}
type NetworkStorer ¶ added in v0.2.0
type NetworkStorer interface {
AddNetwork(context.Context, model.Network) error
RemoveNetworkByName(context.Context, string) error
UpdateNetwork(context.Context, model.Network) error
GetNetworkByName(context.Context, string) (model.Network, error)
GetFilteredNetworks(context.Context, model.NetworkFilter) []model.Network
ListNetworks(context.Context) []model.Network
CountNetworks(context.Context) int
}
NetworkStorer allows for the saving and fetching of network definitions.
type Option ¶ added in v0.2.0
type Option func(*Options)
func WithConfig ¶ added in v0.2.0
func WithNetflowStorer ¶ added in v0.2.0
func WithNetflowStorer(x NetflowStorer) Option
type PerformancePingStorer ¶ added in v0.2.0
type PerformancePingStorer interface {
WritePerformancePing(
context.Context,
time.Time,
model.Device,
nettools.Icmp4EchoResponseStatistics,
) error
ReadPerformancePings(
context.Context,
model.Device,
time.Duration,
) ([]pinger.Point, error)
}
PerformancePingStorer allows for the saving and fetching of timeseries data.
type Store ¶ added in v0.2.0
type Store struct {
Combo *combostore.Config
Sqlite *sqlitestore.Config
}
type Storer ¶ added in v0.2.0
type Storer interface {
NetworkStorer
DeviceStorer
PerformancePingStorer
Close() error
}
Storeer is a complete implementation of all objects which need to be managed
Click to show internal directories.
Click to hide internal directories.