arp

package
v3.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: MIT Imports: 10 Imported by: 0

README

ARP Plugin

This plugin manages IPs and announces them on the local network using ARP.

Environment Variables

  • INTERFACE: Name of the interface where LinK should add and remove IPs.
  • ARP_GRATUITOUS_COUNT: Number of gratuitous ARP packets sent when an IP becomes ACTIVATED.

JSON Configuration

Name Type Optional Description
ip string no IP address to manage using CIDR notation
Example
{
  "ip": "10.20.30.40/32"
}

How do we bind the IPs?

To add an interface, LinK adds the IP to the configured interface and send an unsolicited ARP request on the network (see Gratuitous ARP).

This is the equivalent of:

ip addr add MY_IP dev MY_INTERFACE
arping -B -S MY_IP -I MY_INTERFACE

To unbind an IP, LinK removes it from the interface.

This is the equivalent of:

ip addr del MY_IP dev MY_INTERFACE

Documentation

Index

Constants

View Source
const Name = "arp"

Variables

This section is empty.

Functions

func Register

func Register(ctx context.Context, registry plugin.Registry) error

Types

type Config

type Config struct {
	// Number of gratuitous ARP (GARP) packets sent when the state becomes 'ACTIVATED'
	ARPGratuitousCount int    `envconfig:"ARP_GRATUITOUS_COUNT" default:"3"`
	Interface          string `envconfig:"INTERFACE"`
}

type Factory

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

func (Factory) Create

func (f Factory) Create(ctx context.Context, endpoint models.Endpoint) (plugin.Plugin, error)

func (Factory) Validate

func (f Factory) Validate(_ context.Context, endpoint models.Endpoint) error

type Plugin

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

func (*Plugin) Activate

func (p *Plugin) Activate(ctx context.Context) error

func (*Plugin) Deactivate

func (p *Plugin) Deactivate(ctx context.Context) error

func (*Plugin) ElectionKey

func (p *Plugin) ElectionKey(_ context.Context) string

func (*Plugin) Ensure

func (p *Plugin) Ensure(ctx context.Context) error

type PluginConfig

type PluginConfig struct {
	IP string `json:"ip"`
}

Jump to

Keyboard shortcuts

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