Documentation ¶
Index ¶
- Constants
- Variables
- type WgPeerDescriptor
- func (d *WgPeerDescriptor) Create(key string, peer *wg.Peer) (metadata *wgidx.WgMetadata, err error)
- func (d *WgPeerDescriptor) Delete(key string, peer *wg.Peer, metadata *wgidx.WgMetadata) error
- func (d *WgPeerDescriptor) EquivalentWgPeers(key string, oldPeer, newPeer *wg.Peer) bool
- func (d *WgPeerDescriptor) GetDescriptor() *adapter.PeerDescriptor
- func (d *WgPeerDescriptor) Retrieve(correlate []adapter.PeerKVWithMetadata) (dump []adapter.PeerKVWithMetadata, err error)
- func (d *WgPeerDescriptor) Validate(key string, peer *wg.Peer) (err error)
Constants ¶
View Source
const ( // PeerDescriptorName is the name of the descriptor for VPP wg peer. PeerDescriptorName = "vpp-wg-peer" // Length of wireguard public-key in base64. It should be equal 32 in binary PeerKeyLen = 44 // MaxU16 MaxU16 = 0xFFFF )
Variables ¶
View Source
var ( // ErrWgPeerKeyLen is returned when public-key length has wrong size. ErrWgPeerKeyLen = errors.New("Invalid wireguard peer public-key length") // ErrWgPeerWithoutInterface is returned when wireguard interface name is empty. ErrWgPeerWithoutInterface = errors.New("Wireguard interface is not defined") // ErrWgPeerPKeepalive is returned when persistent keepalive exceeds max value. ErrWgPeerPKeepalive = errors.New("Persistent keepalive exceeds the limits") // ErrWgPeerPort is returned when udp-port exceeds max value. ErrWgPeerPort = errors.New("Invalid wireguard peer port") // ErrWgPeerEndpointMissing is returned when endpoint address was not set or set to an empty string. ErrWgPeerEndpointMissing = errors.Errorf("Missing endpoint address for wireguard peer") // ErrWgSrcAddrBad is returned when endpoint address was not set to valid IP address. ErrWgPeerEndpointBad = errors.New("Invalid wireguard peer endpoint") // ErrWgPeerAllowedIPs is returned when one of allowedIp address was not set to valid IP address. ErrWgPeerAllowedIPs = errors.New("Invalid wireguard peer allowedIps") )
A list of errors:
Functions ¶
This section is empty.
Types ¶
type WgPeerDescriptor ¶
type WgPeerDescriptor struct {
// contains filtered or unexported fields
}
WgPeerDescriptor teaches KVScheduler how to configure VPP wg peer.
func NewWgPeerDescriptor ¶
func NewWgPeerDescriptor(wgHandler vppcalls.WgVppAPI, log logging.PluginLogger) *WgPeerDescriptor
NewWgPeerDescriptor creates a new instance of the wireguard interface descriptor.
func (*WgPeerDescriptor) Create ¶
func (d *WgPeerDescriptor) Create(key string, peer *wg.Peer) (metadata *wgidx.WgMetadata, err error)
Create adds a new wireguard peer.
func (*WgPeerDescriptor) Delete ¶
func (d *WgPeerDescriptor) Delete(key string, peer *wg.Peer, metadata *wgidx.WgMetadata) error
Delete removes VPP wg peers.
func (*WgPeerDescriptor) EquivalentWgPeers ¶
func (d *WgPeerDescriptor) EquivalentWgPeers(key string, oldPeer, newPeer *wg.Peer) bool
func (*WgPeerDescriptor) GetDescriptor ¶
func (d *WgPeerDescriptor) GetDescriptor() *adapter.PeerDescriptor
GetDescriptor returns descriptor suitable for registration (via adapter) with the KVScheduler.
func (*WgPeerDescriptor) Retrieve ¶
func (d *WgPeerDescriptor) Retrieve(correlate []adapter.PeerKVWithMetadata) (dump []adapter.PeerKVWithMetadata, err error)
Retrieve returns all wg peers.
Click to show internal directories.
Click to hide internal directories.