clientinfo

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 26 Imported by: 0 modules, 0 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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	IP       netip.Addr
	Mac      string
	Hostname string
	Source   map[string]struct{}
}

type HostnameByIpResolver

type HostnameByIpResolver interface {
	// LookupHostnameByIP returns hostname of the given ip.
	LookupHostnameByIP(ip string) string
}

HostnameByIpResolver is the interface for retrieving hostname from IP.

type HostnameByMacResolver

type HostnameByMacResolver interface {
	// LookupHostnameByMac returns hostname of the device with given mac.
	LookupHostnameByMac(mac string) string
}

HostnameByMacResolver is the interface for retrieving hostname from Mac.

type HostnameResolver

type HostnameResolver interface {
	fmt.Stringer
	HostnameByIpResolver
	HostnameByMacResolver
}

HostnameResolver is the interface for retrieving hostname from either IP or Mac.

type IpResolver

type IpResolver interface {
	fmt.Stringer
	// LookupIP returns ip of the device with given mac.
	LookupIP(mac string) string
}

IpResolver is the interface for retrieving IP from Mac.

type MacResolver

type MacResolver interface {
	fmt.Stringer
	// LookupMac returns mac of the device with given ip.
	LookupMac(ip string) string
}

MacResolver is the interface for retrieving Mac from IP.

type Table

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

func NewTable

func NewTable(cfg *ctrld.Config, selfIP, cdUID string) *Table

func (*Table) AddLeaseFile

func (t *Table) AddLeaseFile(name string, format ctrld.LeaseFileFormat)

func (*Table) Init

func (t *Table) Init()

func (*Table) ListClients

func (t *Table) ListClients() []*Client

ListClients returns list of clients discovered by ctrld.

func (*Table) LookupHostname

func (t *Table) LookupHostname(ip, mac string) string

func (*Table) LookupIP

func (t *Table) LookupIP(mac string) string

func (*Table) LookupMac

func (t *Table) LookupMac(ip string) string

func (*Table) RefreshLoop

func (t *Table) RefreshLoop(stopCh chan struct{})

func (*Table) StoreVPNClient added in v1.3.1

func (t *Table) StoreVPNClient(ci *ctrld.ClientInfo)

StoreVPNClient stores client info for VPN clients.

Jump to

Keyboard shortcuts

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