Documentation ¶
Index ¶
- Constants
- func FilterUpdates(ctx context.Context, routeOutC chan<- netlink.RouteUpdate, ...)
- func IsInterfacePresent(name string) bool
- func LinkIsOperUp(link netlink.Link) bool
- type AddrStateCallback
- type Config
- type InSyncCallback
- type InterfaceMonitor
- type InterfaceStateCallback
- type State
- type UpdateFilterOp
Constants ¶
View Source
const FlapDampingDelay = 100 * time.Millisecond
Variables ¶
This section is empty.
Functions ¶
func FilterUpdates ¶
func FilterUpdates(ctx context.Context, routeOutC chan<- netlink.RouteUpdate, routeInC <-chan netlink.RouteUpdate, linkOutC chan<- netlink.LinkUpdate, linkInC <-chan netlink.LinkUpdate, options ...UpdateFilterOp, )
FilterUpdates filters out updates that occur when IPs are quickly removed and re-added. Some DHCP clients flap the IP during an IP renewal, for example.
Algorithm: * Maintain a queue of link and address updates per interface. * When we see a potential flap (i.e. an IP deletion), defer processing the queue for a while. * If the flap resolves itself (i.e. the IP is added back), suppress the IP deletion.
func IsInterfacePresent ¶
func LinkIsOperUp ¶
Types ¶
type InSyncCallback ¶
type InSyncCallback func()
type InterfaceMonitor ¶
type InterfaceMonitor struct { Config StateCallback InterfaceStateCallback AddrCallback AddrStateCallback InSyncCallback InSyncCallback // contains filtered or unexported fields }
func New ¶
func New(config Config, featureDetector environment.FeatureDetectorIface, fatalErrCallback func(error), ) *InterfaceMonitor
func NewWithStubs ¶
func NewWithStubs(config Config, netlinkStub netlinkStub, resyncC <-chan time.Time, fatalErrCallback func(error)) *InterfaceMonitor
func (*InterfaceMonitor) MonitorInterfaces ¶
func (m *InterfaceMonitor) MonitorInterfaces()
type InterfaceStateCallback ¶
type UpdateFilterOp ¶
type UpdateFilterOp func(filter *updateFilter)
func WithTimeShim ¶
func WithTimeShim(t timeshim.Interface) UpdateFilterOp
Click to show internal directories.
Click to hide internal directories.