arp

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Announce

type Announce struct {
	sync.RWMutex // protects ips
	// contains filtered or unexported fields
}

Announce is used to "announce" new IPs mapped to the node's MAC address.

func New

func New(ip net.IP) (*Announce, error)

New returns an initialized Announce.

func (*Announce) Acquire

func (a *Announce) Acquire()

Acquire sends out a unsolicited ARP replies for all VIPs that should be announced.

func (*Announce) Announce

func (a *Announce) Announce(ip net.IP) bool

Announce checks if ip should be announced.

func (*Announce) AnnounceName added in v0.3.0

func (a *Announce) AnnounceName(name string) bool

AnnounceName returns true when we have an announcement under name.

func (*Announce) Close

func (a *Announce) Close() error

Close closes the arp client in a.

func (*Announce) DeleteBalancer

func (a *Announce) DeleteBalancer(name string)

DeleteBalancer deletes an address from the set of addresses we should announce.

func (*Announce) Leader

func (a *Announce) Leader() bool

Leader returns true if we are the leader in the daemon set.

func (*Announce) Packets added in v0.3.0

func (a *Announce) Packets() []*arp.Packet

Packets returns a slice of ARP packets that can be send out as unsolicited ARPs.

func (*Announce) Relinquish added in v0.3.0

func (a *Announce) Relinquish()

Relinquish set the leader bit to false and stops the go-routine that sends unsolicited APR replies.

func (*Announce) Run

func (a *Announce) Run()

Run starts the announcer, making it listen on the interface for ARP requests. It only responds to these requests when a.leader is set to true, i.e. we are the current cluster wide leader for sending ARPs.

func (*Announce) SetBalancer

func (a *Announce) SetBalancer(name string, ip net.IP)

SetBalancer adds ip to the set of announced addresses.

func (*Announce) SetLeader

func (a *Announce) SetLeader(b bool)

SetLeader sets the leader boolean to b.

Jump to

Keyboard shortcuts

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