Documentation ¶
Overview ¶
Package corerad implements package main logic for the CoreRAD server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advertiser ¶
type Advertiser struct { // OnInconsistentRA is an optional hook that fires when a router advertisement // is received that is inconsistent with the configuration being served by // this Advertiser, resulting in potential problems for clients. ours is // the RA generated by this Advertiser, and theirs is the RA received from // a remote router. If OnInconsistentRA is nil, the hook is not fired. OnInconsistentRA func(ours, theirs *ndp.RouterAdvertisement) // contains filtered or unexported fields }
An Advertiser sends NDP router advertisements.
func NewAdvertiser ¶
NewAdvertiser creates an Advertiser for the specified interface. If ll is nil, logs are discarded. If mm is nil, metrics are discarded.
func (*Advertiser) Advertise ¶
Advertise initializes the configured interface and begins router solicitation and advertisement handling. Advertise will block until ctx is canceled or an error occurs.
Before calling Advertise, call Events and ensure that the returned channel is being drained, or Advertiser will stop processing.
type Metrics ¶ added in v0.2.3
type Metrics struct { // General server metrics. Info metricslite.Gauge Time metricslite.Gauge // Per-advertiser metrics. LastMulticastTime metricslite.Gauge MessagesReceivedTotal metricslite.Counter MessagesReceivedInvalidTotal metricslite.Counter RouterAdvertisementInconsistenciesTotal metricslite.Counter RouterAdvertisementsTotal metricslite.Counter ErrorsTotal metricslite.Counter // contains filtered or unexported fields }
Metrics contains metrics for a CoreRAD instance.
func NewMetrics ¶ added in v0.2.3
NewMetrics produces a Metrics structure which will register its metrics to the specified metricslite.Interface. If m is nil, metrics are discarded.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
A Server coordinates the goroutines that handle various pieces of the CoreRAD server.
func NewServer ¶
NewServer creates a Server with the input configuration and logger. If ll is nil, logs are discarded.