gneigh

package
v1.19.6 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	L2PodAnnouncementsInterfacePattern = "l2-pod-announcements-interface-pattern"

	EnableL2PodAnnouncements = "enable-l2-pod-announcements"
)

Variables

View Source
var Cell = cell.Module(
	"l2-pod-announcements-gneigh",
	"Gneigh processor sends gratuitous ARP and NDP packets for local pods",

	cell.Provide(
		newSender,
		func(c Config) L2PodAnnouncementConfig {
			return c
		}),

	cell.Config(defaultConfig),

	cell.Invoke(newGNeighProcessor),
)

Cell processes k8s pod events for the local node and determines if a Gratuitous ARP|ND packet needs to be sent.

Functions

This section is empty.

Types

type ArpSender

type ArpSender interface {
	// Send a Gratuitous ARP packet for a given IP, mapping it to a given source hardware
	// address.
	Send(ip netip.Addr, srcHW net.HardwareAddr) error

	// Close the connection.
	Close() error
}

type Config

type Config struct {
	L2PodAnnouncementsInterfacePattern string
	EnableL2PodAnnouncements           bool
}

Config contains the configuration for the Gneigh cell.

func (Config) Enabled

func (def Config) Enabled() bool

func (Config) Flags

func (def Config) Flags(flags *pflag.FlagSet)

type EndpointIPs

type EndpointIPs struct {
	IPv4 netip.Addr
	IPv6 netip.Addr
}

type Interface

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

func InterfaceFromNetInterface

func InterfaceFromNetInterface(iface *net.Interface) Interface

InterfaceFromNetInterface constructs an Interface from the given *net.Interface.

func (Interface) HardwareAddr

func (i Interface) HardwareAddr() net.HardwareAddr

HardwareAddr returns the interface hardware address.

func (Interface) Name

func (i Interface) Name() string

Name returns the interface name.

type L2PodAnnouncementConfig

type L2PodAnnouncementConfig interface {
	Enabled() bool
}

type NdSender

type NdSender interface {
	// Send a Gratuitous ND packet for a given IP, mapping it to a given source hardware
	// address.
	Send(ip netip.Addr, srcHW net.HardwareAddr) error

	// Close the connection.
	Close() error
}

type Sender

type Sender interface {
	// Send a Gratuitous ARP packet for a given IP, mapping it to a given source hardware
	// address.
	SendArp(iface Interface, ip netip.Addr, srcHW net.HardwareAddr) error

	// Send a Gratuitous ND packet for a given IP, mapping it to a given source hardware
	// address.
	SendNd(iface Interface, ip netip.Addr, srcHW net.HardwareAddr) error

	// NewArpSender returns a new client bound to a given interface that can
	// be used to send multiple Gratuitous ARP packets, for efficiency reasons.
	// It must be closed when no longer used.
	NewArpSender(iface Interface) (ArpSender, error)

	// NewNdSender returns a new client bound to a given interface that can
	// be used to send multiple Gratuitous ND packets, for efficiency reasons.
	// It must be closed when no longer used.
	NewNdSender(iface Interface) (NdSender, error)

	// InterfaceByIndex get Interface by ifindex
	InterfaceByIndex(idx int) (Interface, error)
}

Jump to

Keyboard shortcuts

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