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
- Variables
- func IPToAddress(ipstr string) (addr ip.Address, err error)
- type InterfaceVppHandler
- func (h *InterfaceVppHandler) AddAfPacketInterface(ifName string, hwAddr string, afPacketIntf *interfaces.AfpacketLink) (swIndex uint32, err error)
- func (h *InterfaceVppHandler) AddBondInterface(ifName string, mac string, bondLink *if_model.BondLink) (uint32, error)
- func (h *InterfaceVppHandler) AddContainerIP(ifIdx uint32, addr string) error
- func (h *InterfaceVppHandler) AddIPSecTunnelInterface(ifName string, ipSecLink *interfaces.IPSecLink) (uint32, error)
- func (h *InterfaceVppHandler) AddInterfaceIP(ifIdx uint32, addr *net.IPNet) error
- func (h *InterfaceVppHandler) AddLoopbackInterface(ifName string) (swIndex uint32, err error)
- func (h *InterfaceVppHandler) AddMemifInterface(ifName string, memIface *interfaces.MemifLink, socketID uint32) (swIdx uint32, err error)
- func (h *InterfaceVppHandler) AddTapInterface(ifName string, tapIf *interfaces.TapLink) (swIfIdx uint32, err error)
- func (h *InterfaceVppHandler) AddVmxNet3(ifName string, vmxNet3 *interfaces.VmxNet3Link) (swIdx uint32, err error)
- func (h *InterfaceVppHandler) AddVxLanTunnel(ifName string, vrf, multicastIf uint32, vxLan *interfaces.VxlanLink) (swIndex uint32, err error)
- func (h *InterfaceVppHandler) AttachInterfaceToBond(ifIdx, bondIfIdx uint32, isPassive, isLongTimeout bool) error
- func (h *InterfaceVppHandler) CreateSubif(ifIdx, vlanID uint32) (uint32, error)
- func (h *InterfaceVppHandler) DelContainerIP(ifIdx uint32, addr string) error
- func (h *InterfaceVppHandler) DelInterfaceIP(ifIdx uint32, addr *net.IPNet) error
- func (h *InterfaceVppHandler) DeleteAfPacketInterface(ifName string, idx uint32, afPacketIntf *interfaces.AfpacketLink) error
- func (h *InterfaceVppHandler) DeleteBondInterface(ifName string, ifIdx uint32) error
- func (h *InterfaceVppHandler) DeleteIPSecTunnelInterface(ifName string, ipSecLink *interfaces.IPSecLink) error
- func (h *InterfaceVppHandler) DeleteLoopbackInterface(ifName string, idx uint32) error
- func (h *InterfaceVppHandler) DeleteMemifInterface(ifName string, idx uint32) error
- func (h *InterfaceVppHandler) DeleteSubif(ifIdx uint32) error
- func (h *InterfaceVppHandler) DeleteTapInterface(ifName string, idx uint32, version uint32) error
- func (h *InterfaceVppHandler) DeleteVmxNet3(ifName string, ifIdx uint32) error
- func (h *InterfaceVppHandler) DeleteVxLanTunnel(ifName string, idx, vrf uint32, vxLan *interfaces.VxlanLink) error
- func (h *InterfaceVppHandler) DetachInterfaceFromBond(ifIdx uint32) error
- func (h *InterfaceVppHandler) DumpDhcpClients() (map[uint32]*vppcalls.Dhcp, error)
- func (h *InterfaceVppHandler) DumpInterfaces() (map[uint32]*vppcalls.InterfaceDetails, error)
- func (h *InterfaceVppHandler) DumpInterfacesByType(reqType interfaces.Interface_Type) (map[uint32]*vppcalls.InterfaceDetails, error)
- func (h *InterfaceVppHandler) DumpMemifSocketDetails() (map[string]uint32, error)
- func (h *InterfaceVppHandler) GetInterfaceVrf(ifIdx uint32) (vrfID uint32, err error)
- func (h *InterfaceVppHandler) GetInterfaceVrfIPv6(ifIdx uint32) (vrfID uint32, err error)
- func (h *InterfaceVppHandler) InterfaceAdminDown(ifIdx uint32) error
- func (h *InterfaceVppHandler) InterfaceAdminUp(ifIdx uint32) error
- func (h *InterfaceVppHandler) RegisterMemifSocketFilename(filename []byte, id uint32) error
- func (h *InterfaceVppHandler) RemoveInterfaceTag(tag string, ifIdx uint32) error
- func (h *InterfaceVppHandler) SetInterfaceAsDHCPClient(ifIdx uint32, hostName string) error
- func (h *InterfaceVppHandler) SetInterfaceMac(ifIdx uint32, macAddress string) error
- func (h *InterfaceVppHandler) SetInterfaceMtu(ifIdx uint32, mtu uint32) error
- func (h *InterfaceVppHandler) SetInterfaceTag(tag string, ifIdx uint32) error
- func (h *InterfaceVppHandler) SetInterfaceVrf(ifIdx, vrfID uint32) error
- func (h *InterfaceVppHandler) SetInterfaceVrfIPv6(ifIdx, vrfID uint32) error
- func (h *InterfaceVppHandler) SetRxMode(ifIdx uint32, rxModeSettings *interfaces.Interface_RxModeSettings) error
- func (h *InterfaceVppHandler) SetRxPlacement(ifIdx uint32, rxPlacement *interfaces.Interface_RxPlacementSettings) error
- func (h *InterfaceVppHandler) SetUnnumberedIP(uIfIdx uint32, ifIdxWithIP uint32) error
- func (h *InterfaceVppHandler) SetVLanTagRewrite(ifIdx uint32, subIf *interfaces.SubInterface) error
- func (h *InterfaceVppHandler) UnsetInterfaceAsDHCPClient(ifIdx uint32, hostName string) error
- func (h *InterfaceVppHandler) UnsetUnnumberedIP(uIfIdx uint32) error
- func (h *InterfaceVppHandler) WatchDHCPLeases(leasesCh chan<- *vppcalls.Lease) error
- func (h *InterfaceVppHandler) WatchInterfaceEvents(events chan<- *vppcalls.InterfaceEvent) error
Constants ¶
const (
TapFlagGSO uint32 = 1 << iota
)
TapFlags definitions from https://github.com/FDio/vpp/blob/stable/1904/src/vnet/devices/tap/tap.h#L33
Variables ¶
var InterfaceEventTimeout = time.Second
Functions ¶
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 *interfaces.AfpacketLink) (swIndex uint32, err error)
AddAfPacketInterface implements AfPacket handler.
func (*InterfaceVppHandler) AddBondInterface ¶
func (h *InterfaceVppHandler) AddBondInterface(ifName string, mac string, bondLink *if_model.BondLink) (uint32, error)
AddBondInterface implements interface handler.
func (*InterfaceVppHandler) AddContainerIP ¶
func (h *InterfaceVppHandler) AddContainerIP(ifIdx uint32, addr string) error
AddContainerIP implements interface handler.
func (*InterfaceVppHandler) AddIPSecTunnelInterface ¶
func (h *InterfaceVppHandler) AddIPSecTunnelInterface(ifName string, ipSecLink *interfaces.IPSecLink) (uint32, error)
AddIPSecTunnelInterface adds a new IPSec tunnel interface.
func (*InterfaceVppHandler) AddInterfaceIP ¶
func (h *InterfaceVppHandler) AddInterfaceIP(ifIdx uint32, addr *net.IPNet) error
AddInterfaceIP implements interface handler.
func (*InterfaceVppHandler) AddLoopbackInterface ¶
func (h *InterfaceVppHandler) AddLoopbackInterface(ifName string) (swIndex uint32, err error)
AddLoopbackInterface implements interface handler.
func (*InterfaceVppHandler) AddMemifInterface ¶
func (h *InterfaceVppHandler) AddMemifInterface(ifName string, memIface *interfaces.MemifLink, socketID uint32) (swIdx uint32, err error)
AddMemifInterface implements interface handler.
func (*InterfaceVppHandler) AddTapInterface ¶
func (h *InterfaceVppHandler) AddTapInterface(ifName string, tapIf *interfaces.TapLink) (swIfIdx uint32, err error)
AddTapInterface implements interface handler.
func (*InterfaceVppHandler) AddVmxNet3 ¶
func (h *InterfaceVppHandler) AddVmxNet3(ifName string, vmxNet3 *interfaces.VmxNet3Link) (swIdx uint32, err error)
AddVmxNet3 implements interface handler
func (*InterfaceVppHandler) AddVxLanTunnel ¶
func (h *InterfaceVppHandler) AddVxLanTunnel(ifName string, vrf, multicastIf uint32, vxLan *interfaces.VxlanLink) (swIndex uint32, err error)
AddVxLanTunnel implements VxLan handler.
func (*InterfaceVppHandler) AttachInterfaceToBond ¶
func (h *InterfaceVppHandler) AttachInterfaceToBond(ifIdx, bondIfIdx uint32, isPassive, isLongTimeout bool) error
AttachInterfaceToBond implements interface handler.
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
DelContainerIP implements interface handler.
func (*InterfaceVppHandler) DelInterfaceIP ¶
func (h *InterfaceVppHandler) DelInterfaceIP(ifIdx uint32, addr *net.IPNet) error
DelInterfaceIP implements interface handler.
func (*InterfaceVppHandler) DeleteAfPacketInterface ¶
func (h *InterfaceVppHandler) DeleteAfPacketInterface(ifName string, idx uint32, afPacketIntf *interfaces.AfpacketLink) error
DeleteAfPacketInterface implements AfPacket handler.
func (*InterfaceVppHandler) DeleteBondInterface ¶
func (h *InterfaceVppHandler) DeleteBondInterface(ifName string, ifIdx uint32) error
DeleteBondInterface implements interface handler.
func (*InterfaceVppHandler) DeleteIPSecTunnelInterface ¶
func (h *InterfaceVppHandler) DeleteIPSecTunnelInterface(ifName string, ipSecLink *interfaces.IPSecLink) error
DeleteIPSecTunnelInterface removes existing IPSec tunnel interface.
func (*InterfaceVppHandler) DeleteLoopbackInterface ¶
func (h *InterfaceVppHandler) DeleteLoopbackInterface(ifName string, idx uint32) error
DeleteLoopbackInterface implements interface handler.
func (*InterfaceVppHandler) DeleteMemifInterface ¶
func (h *InterfaceVppHandler) DeleteMemifInterface(ifName string, idx uint32) error
DeleteMemifInterface implements interface handler.
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
DeleteTapInterface implements interface handler.
func (*InterfaceVppHandler) DeleteVmxNet3 ¶
func (h *InterfaceVppHandler) DeleteVmxNet3(ifName string, ifIdx uint32) error
DeleteVmxNet3 implements interface handler
func (*InterfaceVppHandler) DeleteVxLanTunnel ¶
func (h *InterfaceVppHandler) DeleteVxLanTunnel(ifName string, idx, vrf uint32, vxLan *interfaces.VxlanLink) error
DeleteVxLanTunnel implements VxLan handler.
func (*InterfaceVppHandler) DetachInterfaceFromBond ¶
func (h *InterfaceVppHandler) DetachInterfaceFromBond(ifIdx uint32) error
DetachInterfaceFromBond implements interface handler
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) DumpInterfaces ¶
func (h *InterfaceVppHandler) DumpInterfaces() (map[uint32]*vppcalls.InterfaceDetails, error)
DumpInterfaces implements interface handler.
func (*InterfaceVppHandler) DumpInterfacesByType ¶
func (h *InterfaceVppHandler) DumpInterfacesByType(reqType interfaces.Interface_Type) (map[uint32]*vppcalls.InterfaceDetails, error)
DumpInterfacesByType implements interface handler.
func (*InterfaceVppHandler) DumpMemifSocketDetails ¶
func (h *InterfaceVppHandler) DumpMemifSocketDetails() (map[string]uint32, error)
DumpMemifSocketDetails implements interface handler.
func (*InterfaceVppHandler) GetInterfaceVrf ¶
func (h *InterfaceVppHandler) GetInterfaceVrf(ifIdx uint32) (vrfID uint32, err error)
GetInterfaceVrf implements interface handler.
func (*InterfaceVppHandler) GetInterfaceVrfIPv6 ¶
func (h *InterfaceVppHandler) GetInterfaceVrfIPv6(ifIdx uint32) (vrfID uint32, err error)
GetInterfaceVrfIPv6 implements interface handler.
func (*InterfaceVppHandler) InterfaceAdminDown ¶
func (h *InterfaceVppHandler) InterfaceAdminDown(ifIdx uint32) error
InterfaceAdminDown implements interface handler.
func (*InterfaceVppHandler) InterfaceAdminUp ¶
func (h *InterfaceVppHandler) InterfaceAdminUp(ifIdx uint32) error
InterfaceAdminUp implements interface handler.
func (*InterfaceVppHandler) RegisterMemifSocketFilename ¶
func (h *InterfaceVppHandler) RegisterMemifSocketFilename(filename []byte, id uint32) error
RegisterMemifSocketFilename implements interface handler.
func (*InterfaceVppHandler) RemoveInterfaceTag ¶
func (h *InterfaceVppHandler) RemoveInterfaceTag(tag string, ifIdx uint32) error
RemoveInterfaceTag implements interface handler.
func (*InterfaceVppHandler) SetInterfaceAsDHCPClient ¶
func (h *InterfaceVppHandler) SetInterfaceAsDHCPClient(ifIdx uint32, hostName string) error
SetInterfaceAsDHCPClient implements interface handler.
func (*InterfaceVppHandler) SetInterfaceMac ¶
func (h *InterfaceVppHandler) SetInterfaceMac(ifIdx uint32, macAddress string) error
SetInterfaceMac implements interface handler.
func (*InterfaceVppHandler) SetInterfaceMtu ¶
func (h *InterfaceVppHandler) SetInterfaceMtu(ifIdx uint32, mtu uint32) error
SetInterfaceMtu implements interface handler.
func (*InterfaceVppHandler) SetInterfaceTag ¶
func (h *InterfaceVppHandler) SetInterfaceTag(tag string, ifIdx uint32) error
SetInterfaceTag implements interface handler.
func (*InterfaceVppHandler) SetInterfaceVrf ¶
func (h *InterfaceVppHandler) SetInterfaceVrf(ifIdx, vrfID uint32) error
SetInterfaceVrf implements interface handler.
func (*InterfaceVppHandler) SetInterfaceVrfIPv6 ¶
func (h *InterfaceVppHandler) SetInterfaceVrfIPv6(ifIdx, vrfID uint32) error
SetInterfaceVrfIPv6 implements interface handler.
func (*InterfaceVppHandler) SetRxMode ¶
func (h *InterfaceVppHandler) SetRxMode(ifIdx uint32, rxModeSettings *interfaces.Interface_RxModeSettings) error
SetRxMode implements interface handler.
func (*InterfaceVppHandler) SetRxPlacement ¶
func (h *InterfaceVppHandler) SetRxPlacement(ifIdx uint32, rxPlacement *interfaces.Interface_RxPlacementSettings) error
SetRxPlacement implements interface handler.
func (*InterfaceVppHandler) SetUnnumberedIP ¶
func (h *InterfaceVppHandler) SetUnnumberedIP(uIfIdx uint32, ifIdxWithIP uint32) error
SetUnnumberedIP implements interface handler.
func (*InterfaceVppHandler) SetVLanTagRewrite ¶
func (h *InterfaceVppHandler) SetVLanTagRewrite(ifIdx uint32, subIf *interfaces.SubInterface) error
SetInterfaceTagRewrite sets an interface tag rewrite
func (*InterfaceVppHandler) UnsetInterfaceAsDHCPClient ¶
func (h *InterfaceVppHandler) UnsetInterfaceAsDHCPClient(ifIdx uint32, hostName string) error
UnsetInterfaceAsDHCPClient implements interface handler.
func (*InterfaceVppHandler) UnsetUnnumberedIP ¶
func (h *InterfaceVppHandler) UnsetUnnumberedIP(uIfIdx uint32) error
UnsetUnnumberedIP implements interface handler.
func (*InterfaceVppHandler) WatchDHCPLeases ¶
func (h *InterfaceVppHandler) WatchDHCPLeases(leasesCh chan<- *vppcalls.Lease) error
func (*InterfaceVppHandler) WatchInterfaceEvents ¶
func (h *InterfaceVppHandler) WatchInterfaceEvents(events chan<- *vppcalls.InterfaceEvent) error
Source Files ¶
- admin_vppcalls.go
- afpacket_vppcalls.go
- bond_vppcalls.go
- dhcp_vppcalls.go
- doc.go
- dump_interface_vppcalls.go
- ip_container_vppcalls.go
- ip_vppcalls.go
- ipsec_vppcalls.go
- l2_vppcalls.go
- loopback_vppcalls.go
- mac_vppcalls.go
- memif_vppcalls.go
- mtu_vppcalls.go
- rx_mode_vppcalls.go
- rx_placement_vppcalls.go
- subif_vppcalls.go
- tap_vppcalls.go
- vmxnet3_vppcalls.go
- vppcalls_handler.go
- vrf_vppcalls.go
- vxlan_vppcalls.go
- watch_vppcalls.go