vpp2001

package
v2.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2019 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package vppcalls contains wrappers over VPP binary APIs for all supported interface types and for dumping all interfaces configured in VPP.

Index

Constants

View Source
const (
	TapFlagGSO uint32 = 1 << iota
)

TapFlags definitions from https://github.com/FDio/vpp/blob/stable/2001/src/vnet/devices/tap/tap.h#L33

Variables

View Source
var InterfaceEventTimeout = time.Second

Functions

func IPToAddress

func IPToAddress(ipStr string) (addr vpp_ip.Address, err error)

IPToAddress converts string type IP address to VPP ip.api address representation

func ParseMAC

func ParseMAC(mac string) (parsedMac [6]uint8, err error)

parse mac string to uint8 array with len=6

Types

type InterfaceVppHandler

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

InterfaceVppHandler is accessor for interface-related vppcalls methods

func NewInterfaceVppHandler

func NewInterfaceVppHandler(ch govppapi.Channel, log logging.Logger) *InterfaceVppHandler

NewInterfaceVppHandler returns new InterfaceVppHandler.

func (*InterfaceVppHandler) AddAfPacketInterface

func (h *InterfaceVppHandler) AddAfPacketInterface(ifName string, hwAddr string, afPacketIntf *ifs.AfpacketLink) (swIndex uint32, err error)

AddAfPacketInterface implements AfPacket handler.

func (*InterfaceVppHandler) AddBondInterface

func (h *InterfaceVppHandler) AddBondInterface(ifName string, mac string, bondLink *ifs.BondLink) (uint32, error)

func (*InterfaceVppHandler) AddContainerIP

func (h *InterfaceVppHandler) AddContainerIP(ifIdx uint32, addr string) error

func (*InterfaceVppHandler) AddGreTunnel

func (h *InterfaceVppHandler) AddGreTunnel(ifName string, greLink *ifs.GreLink) (uint32, error)

AddGreTunnel adds new GRE interface.

func (*InterfaceVppHandler) AddIPSecTunnelInterface

func (h *InterfaceVppHandler) AddIPSecTunnelInterface(ifName string, ipSecLink *ifs.IPSecLink) (uint32, error)

AddIPSecTunnelInterface adds a new IPSec tunnel interface.

func (*InterfaceVppHandler) AddInterfaceIP

func (h *InterfaceVppHandler) AddInterfaceIP(ifIdx uint32, addr *net.IPNet) error

func (*InterfaceVppHandler) AddLoopbackInterface

func (h *InterfaceVppHandler) AddLoopbackInterface(ifName string) (swIndex uint32, err error)

func (*InterfaceVppHandler) AddMemifInterface

func (h *InterfaceVppHandler) AddMemifInterface(ifName string, memIface *ifs.MemifLink, socketID uint32) (swIdx uint32, err error)

func (*InterfaceVppHandler) AddSpan

func (h *InterfaceVppHandler) AddSpan(ifIdxFrom, ifIdxTo uint32, direction, isL2 uint8) error

AddSpan enables SPAN on interface

func (*InterfaceVppHandler) AddTapInterface

func (h *InterfaceVppHandler) AddTapInterface(ifName string, tapIf *ifs.TapLink) (swIfIdx uint32, err error)

func (*InterfaceVppHandler) AddVmxNet3

func (h *InterfaceVppHandler) AddVmxNet3(ifName string, vmxNet3 *ifs.VmxNet3Link) (swIdx uint32, err error)

func (*InterfaceVppHandler) AddVxLanGpeTunnel

func (h *InterfaceVppHandler) AddVxLanGpeTunnel(ifName string, vrf, multicastIf uint32, vxLan *ifs.VxlanLink) (uint32, error)

AddVxLanGpeTunnel adds new VxLAN-GPE interface.

func (*InterfaceVppHandler) AddVxLanTunnel

func (h *InterfaceVppHandler) AddVxLanTunnel(ifName string, vrf, multicastIf uint32, vxLan *ifs.VxlanLink) (swIndex uint32, err error)

AddVxLanTunnel implements VxLan handler.

func (*InterfaceVppHandler) AttachInterfaceToBond

func (h *InterfaceVppHandler) AttachInterfaceToBond(ifIdx, bondIfIdx uint32, isPassive, isLongTimeout bool) error

func (*InterfaceVppHandler) CreateSubif

func (h *InterfaceVppHandler) CreateSubif(ifIdx, vlanID uint32) (uint32, error)

CreateSubif creates sub interface.

func (*InterfaceVppHandler) DelContainerIP

func (h *InterfaceVppHandler) DelContainerIP(ifIdx uint32, addr string) error

func (*InterfaceVppHandler) DelGreTunnel

func (h *InterfaceVppHandler) DelGreTunnel(ifName string, greLink *ifs.GreLink) (uint32, error)

DelGreTunnel removes GRE interface.

func (*InterfaceVppHandler) DelInterfaceIP

func (h *InterfaceVppHandler) DelInterfaceIP(ifIdx uint32, addr *net.IPNet) error

func (*InterfaceVppHandler) DelSpan

func (h *InterfaceVppHandler) DelSpan(ifIdxFrom, ifIdxTo uint32, isL2 uint8) error

DelSpan disables SPAN on interface

func (*InterfaceVppHandler) DeleteAfPacketInterface

func (h *InterfaceVppHandler) DeleteAfPacketInterface(ifName string, idx uint32, afPacketIntf *ifs.AfpacketLink) error

DeleteAfPacketInterface implements AfPacket handler.

func (*InterfaceVppHandler) DeleteBondInterface

func (h *InterfaceVppHandler) DeleteBondInterface(ifName string, ifIdx uint32) error

func (*InterfaceVppHandler) DeleteIPSecTunnelInterface

func (h *InterfaceVppHandler) DeleteIPSecTunnelInterface(ifName string, ipSecLink *ifs.IPSecLink) error

DeleteIPSecTunnelInterface removes existing IPSec tunnel interface.

func (*InterfaceVppHandler) DeleteLoopbackInterface

func (h *InterfaceVppHandler) DeleteLoopbackInterface(ifName string, idx uint32) error

func (*InterfaceVppHandler) DeleteMemifInterface

func (h *InterfaceVppHandler) DeleteMemifInterface(ifName string, idx uint32) error

func (*InterfaceVppHandler) DeleteSubif

func (h *InterfaceVppHandler) DeleteSubif(ifIdx uint32) error

DeleteSubif deletes sub interface.

func (*InterfaceVppHandler) DeleteTapInterface

func (h *InterfaceVppHandler) DeleteTapInterface(ifName string, idx uint32, version uint32) error

func (*InterfaceVppHandler) DeleteVmxNet3

func (h *InterfaceVppHandler) DeleteVmxNet3(ifName string, ifIdx uint32) error

func (*InterfaceVppHandler) DeleteVxLanGpeTunnel

func (h *InterfaceVppHandler) DeleteVxLanGpeTunnel(ifName string, vxLan *ifs.VxlanLink) error

DeleteVxLanGpeTunnel removes VxLAN-GPE interface.

func (*InterfaceVppHandler) DeleteVxLanTunnel

func (h *InterfaceVppHandler) DeleteVxLanTunnel(ifName string, idx, vrf uint32, vxLan *ifs.VxlanLink) error

DeleteVxLanTunnel implements VxLan handler.

func (*InterfaceVppHandler) DetachInterfaceFromBond

func (h *InterfaceVppHandler) DetachInterfaceFromBond(ifIdx uint32) error

func (*InterfaceVppHandler) DumpDhcpClients

func (h *InterfaceVppHandler) DumpDhcpClients() (map[uint32]*vppcalls.Dhcp, error)

DumpDhcpClients returns a slice of DhcpMeta with all interfaces and other DHCP-related information available

func (*InterfaceVppHandler) DumpInterfaceStates

func (h *InterfaceVppHandler) DumpInterfaceStates(ifIdxs ...uint32) (map[uint32]*vppcalls.InterfaceState, error)

DumpInterfaceStates dumps link and administrative state of every interface.

func (*InterfaceVppHandler) DumpInterfaces

func (h *InterfaceVppHandler) DumpInterfaces() (map[uint32]*vppcalls.InterfaceDetails, error)

func (*InterfaceVppHandler) DumpInterfacesByType

func (h *InterfaceVppHandler) DumpInterfacesByType(reqType ifs.Interface_Type) (map[uint32]*vppcalls.InterfaceDetails, error)

func (*InterfaceVppHandler) DumpMemifSocketDetails

func (h *InterfaceVppHandler) DumpMemifSocketDetails() (map[string]uint32, error)

func (*InterfaceVppHandler) DumpSpan

DumpSpan dumps all SPAN table

func (*InterfaceVppHandler) GetInterfaceVrf

func (h *InterfaceVppHandler) GetInterfaceVrf(ifIdx uint32) (vrfID uint32, err error)

func (*InterfaceVppHandler) GetInterfaceVrfIPv6

func (h *InterfaceVppHandler) GetInterfaceVrfIPv6(ifIdx uint32) (vrfID uint32, err error)

func (*InterfaceVppHandler) InterfaceAdminDown

func (h *InterfaceVppHandler) InterfaceAdminDown(ifIdx uint32) error

func (*InterfaceVppHandler) InterfaceAdminUp

func (h *InterfaceVppHandler) InterfaceAdminUp(ifIdx uint32) error

func (*InterfaceVppHandler) RegisterMemifSocketFilename

func (h *InterfaceVppHandler) RegisterMemifSocketFilename(filename []byte, id uint32) error

func (*InterfaceVppHandler) RemoveInterfaceTag

func (h *InterfaceVppHandler) RemoveInterfaceTag(tag string, ifIdx uint32) error

func (*InterfaceVppHandler) SetInterfaceAsDHCPClient

func (h *InterfaceVppHandler) SetInterfaceAsDHCPClient(ifIdx uint32, hostName string) error

func (*InterfaceVppHandler) SetInterfaceMac

func (h *InterfaceVppHandler) SetInterfaceMac(ifIdx uint32, macAddress string) error

func (*InterfaceVppHandler) SetInterfaceMtu

func (h *InterfaceVppHandler) SetInterfaceMtu(ifIdx uint32, mtu uint32) error

func (*InterfaceVppHandler) SetInterfaceTag

func (h *InterfaceVppHandler) SetInterfaceTag(tag string, ifIdx uint32) error

func (*InterfaceVppHandler) SetInterfaceVrf

func (h *InterfaceVppHandler) SetInterfaceVrf(ifIdx, vrfID uint32) error

func (*InterfaceVppHandler) SetInterfaceVrfIPv6

func (h *InterfaceVppHandler) SetInterfaceVrfIPv6(ifIdx, vrfID uint32) error

func (*InterfaceVppHandler) SetRxMode

func (h *InterfaceVppHandler) SetRxMode(ifIdx uint32, rxMode *ifs.Interface_RxMode) error

func (*InterfaceVppHandler) SetRxPlacement

func (h *InterfaceVppHandler) SetRxPlacement(ifIdx uint32, rxPlacement *ifs.Interface_RxPlacement) error

func (*InterfaceVppHandler) SetUnnumberedIP

func (h *InterfaceVppHandler) SetUnnumberedIP(uIfIdx uint32, ifIdxWithIP uint32) error

func (*InterfaceVppHandler) SetVLanTagRewrite

func (h *InterfaceVppHandler) SetVLanTagRewrite(ifIdx uint32, subIf *ifs.SubInterface) error

SetInterfaceTagRewrite sets an interface tag rewrite

func (*InterfaceVppHandler) UnsetInterfaceAsDHCPClient

func (h *InterfaceVppHandler) UnsetInterfaceAsDHCPClient(ifIdx uint32, hostName string) error

func (*InterfaceVppHandler) UnsetUnnumberedIP

func (h *InterfaceVppHandler) UnsetUnnumberedIP(uIfIdx uint32) error

func (*InterfaceVppHandler) WatchDHCPLeases

func (h *InterfaceVppHandler) WatchDHCPLeases(leasesCh chan<- *vppcalls.Lease) error

func (*InterfaceVppHandler) WatchInterfaceEvents

func (h *InterfaceVppHandler) WatchInterfaceEvents(events chan<- *vppcalls.InterfaceEvent) error

Jump to

Keyboard shortcuts

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