Documentation ¶
Overview ¶
Package vpp2210 contains wrappers over VPP binary APIs for all supported interface types and for dumping all interfaces configured in VPP.
Index ¶
- Variables
- func IPToAddress(ipStr string) (addr ip_types.Address, err error)
- func NewInterfaceVppHandler(c vpp.Client, log logging.Logger) vppcalls.InterfaceVppAPI
- func ParseMAC(mac string) (parsedMac [6]uint8, err error)
- type InterfaceVppHandler
- func (h *InterfaceVppHandler) AddAfPacketInterface(ifName, hwAddr, targetHostIfName string) (swIndex uint32, err error)
- func (h *InterfaceVppHandler) AddBondInterface(ifName string, mac string, bondLink *ifs.BondLink) (uint32, error)
- func (h *InterfaceVppHandler) AddContainerIP(ifIdx uint32, addr string) error
- func (h *InterfaceVppHandler) AddGreTunnel(ifName string, greLink *ifs.GreLink) (uint32, error)
- func (h *InterfaceVppHandler) AddGtpuTunnel(ifName string, gtpuLink *interfaces.GtpuLink, multicastIf uint32) (uint32, error)
- func (h *InterfaceVppHandler) AddIPSecTunnelInterface(ctx context.Context, ifName string, ipSecLink *ifs.IPSecLink) (uint32, error)
- func (h *InterfaceVppHandler) AddInterfaceIP(ifIdx uint32, addr *net.IPNet) error
- func (h *InterfaceVppHandler) AddIpipTunnel(ifName string, vrf uint32, ipipLink *interfaces.IPIPLink) (uint32, error)
- func (h *InterfaceVppHandler) AddLoopbackInterface(ifName string) (swIndex uint32, err error)
- func (h *InterfaceVppHandler) AddMemifInterface(ctx context.Context, ifName string, memIface *ifs.MemifLink, socketID uint32) (swIdx uint32, err error)
- func (h *InterfaceVppHandler) AddRdmaInterface(ctx context.Context, ifName string, rdmaLink *interfaces.RDMALink) (swIdx uint32, err error)
- func (h *InterfaceVppHandler) AddSpan(ifIdxFrom, ifIdxTo uint32, direction uint8, isL2 bool) error
- func (h *InterfaceVppHandler) AddTapInterface(ifName string, tapIf *ifs.TapLink) (swIfIdx uint32, err error)
- func (h *InterfaceVppHandler) AddVmxNet3(ifName string, vmxNet3 *ifs.VmxNet3Link) (swIdx uint32, err error)
- func (h *InterfaceVppHandler) AddVxLanGpeTunnel(ifName string, vrf, multicastIf uint32, vxLan *ifs.VxlanLink) (uint32, error)
- func (h *InterfaceVppHandler) AddVxLanTunnel(ifName string, vrf, multicastIf uint32, vxLan *ifs.VxlanLink) (swIndex uint32, err error)
- func (h *InterfaceVppHandler) AddWireguardTunnel(ifName string, wireguardLink *interfaces.WireguardLink) (uint32, 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) DelGreTunnel(ifName string, greLink *ifs.GreLink) (uint32, error)
- func (h *InterfaceVppHandler) DelGtpuTunnel(ifName string, gtpuLink *interfaces.GtpuLink) error
- func (h *InterfaceVppHandler) DelInterfaceIP(ifIdx uint32, addr *net.IPNet) error
- func (h *InterfaceVppHandler) DelIpipTunnel(ifName string, ifIdx uint32) error
- func (h *InterfaceVppHandler) DelSpan(ifIdxFrom, ifIdxTo uint32, isL2 bool) error
- func (h *InterfaceVppHandler) DeleteAfPacketInterface(ifName string, idx uint32, targetHostIfName string) error
- func (h *InterfaceVppHandler) DeleteBondInterface(ifName string, ifIdx uint32) error
- func (h *InterfaceVppHandler) DeleteIPSecTunnelInterface(ctx context.Context, ifName string, idx uint32, ipSecLink *ifs.IPSecLink) error
- func (h *InterfaceVppHandler) DeleteLoopbackInterface(ifName string, idx uint32) error
- func (h *InterfaceVppHandler) DeleteMemifInterface(ctx context.Context, ifName string, idx uint32) error
- func (h *InterfaceVppHandler) DeleteRdmaInterface(ctx context.Context, ifName string, ifIdx 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) DeleteVxLanGpeTunnel(ifName string, vxLan *ifs.VxlanLink) error
- func (h *InterfaceVppHandler) DeleteVxLanTunnel(ifName string, idx, vrf uint32, vxLan *ifs.VxlanLink) error
- func (h *InterfaceVppHandler) DeleteWireguardTunnel(ifName string, ifIdx uint32) error
- func (h *InterfaceVppHandler) DetachInterfaceFromBond(ifIdx uint32) error
- func (h *InterfaceVppHandler) DumpDhcpClients() (map[uint32]*vppcalls.Dhcp, error)
- func (h *InterfaceVppHandler) DumpInterfaceStates(ifIdxs ...uint32) (map[uint32]*vppcalls.InterfaceState, error)
- func (h *InterfaceVppHandler) DumpInterfaces(ctx context.Context) (map[uint32]*vppcalls.InterfaceDetails, error)
- func (h *InterfaceVppHandler) DumpInterfacesByType(ctx context.Context, reqType ifs.Interface_Type) (map[uint32]*vppcalls.InterfaceDetails, error)
- func (h *InterfaceVppHandler) DumpMemifSocketDetails(ctx context.Context) (map[string]uint32, error)
- func (h *InterfaceVppHandler) DumpSpan() ([]*vppcalls.InterfaceSpanDetails, 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(ctx context.Context, ifIdx uint32) error
- func (h *InterfaceVppHandler) InterfaceAdminUp(ctx context.Context, ifIdx uint32) error
- func (h *InterfaceVppHandler) RegisterMemifSocketFilename(ctx context.Context, filename string, id uint32) error
- func (h *InterfaceVppHandler) RemoveInterfaceTag(tag string, ifIdx uint32) error
- func (h *InterfaceVppHandler) SetIP6ndAutoconfig(ctx context.Context, ifIdx uint32, enable, installDefaultRoutes bool) 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, rxMode *ifs.Interface_RxMode) error
- func (h *InterfaceVppHandler) SetRxPlacement(ifIdx uint32, rxPlacement *ifs.Interface_RxPlacement) error
- func (h *InterfaceVppHandler) SetUnnumberedIP(ctx context.Context, uIfIdx uint32, ifIdxWithIP uint32) error
- func (h *InterfaceVppHandler) SetVLanTagRewrite(ifIdx uint32, subIf *ifs.SubInterface) error
- func (h *InterfaceVppHandler) UnsetInterfaceAsDHCPClient(ifIdx uint32, hostName string) error
- func (h *InterfaceVppHandler) UnsetUnnumberedIP(ctx context.Context, uIfIdx uint32) error
- func (h *InterfaceVppHandler) WatchDHCPLeases(ctx context.Context, leasesCh chan<- *vppcalls.Lease) error
- func (h *InterfaceVppHandler) WatchInterfaceEvents(ctx context.Context, eventsCh chan<- *vppcalls.InterfaceEvent) error
Constants ¶
This section is empty.
Variables ¶
var ( // EventDeliverTimeout defines maximum time to deliver event upstream. EventDeliverTimeout = time.Second // NotifChanBufferSize defines size of notification channel buffer. NotifChanBufferSize = 10 )
var HandlerVersion = vpp.HandlerVersion{ Version: vpp2210.Version, Check: func(c vpp.Client) error { msgs := vpp.Messages( af_packet.AllMessages, bond.AllMessages, dhcp.AllMessages, interfaces.AllMessages, ip.AllMessages, ipsec.AllMessages, gre.AllMessages, l2.AllMessages, span.AllMessages, tapv2.AllMessages, vxlan.AllMessages, ) if c.IsPluginLoaded(gtpu.APIFile) { msgs.Add(gtpu.AllMessages) } if c.IsPluginLoaded(memif.APIFile) { msgs.Add(memif.AllMessages) } if c.IsPluginLoaded(vmxnet3.APIFile) { msgs.Add(vmxnet3.AllMessages) } if c.IsPluginLoaded(wireguard.APIFile) { msgs.Add(wireguard.AllMessages) } if c.IsPluginLoaded(rdma.APIFile) { msgs.Add(rdma.AllMessages) } return c.CheckCompatiblity(msgs.AllMessages()...) }, NewHandler: func(c vpp.Client, a ...interface{}) vpp.HandlerAPI { return NewInterfaceVppHandler(c, a[0].(logging.Logger)) }, }
Functions ¶
func IPToAddress ¶
IPToAddress converts string type IP address to VPP ip.api address representation
func NewInterfaceVppHandler ¶
NewInterfaceVppHandler returns new InterfaceVppHandler.
Types ¶
type InterfaceVppHandler ¶
type InterfaceVppHandler struct {
// contains filtered or unexported fields
}
InterfaceVppHandler is accessor for interface-related vppcalls methods
func (*InterfaceVppHandler) AddAfPacketInterface ¶
func (h *InterfaceVppHandler) AddAfPacketInterface(ifName, hwAddr, targetHostIfName string) (swIndex uint32, err error)
AddAfPacketInterface implements AfPacket handler.
func (*InterfaceVppHandler) AddBondInterface ¶
func (*InterfaceVppHandler) AddContainerIP ¶
func (h *InterfaceVppHandler) AddContainerIP(ifIdx uint32, addr string) error
func (*InterfaceVppHandler) AddGreTunnel ¶
AddGreTunnel adds new GRE interface.
func (*InterfaceVppHandler) AddGtpuTunnel ¶
func (h *InterfaceVppHandler) AddGtpuTunnel(ifName string, gtpuLink *interfaces.GtpuLink, multicastIf uint32) (uint32, error)
AddGtpuTunnel adds new GTPU interface.
func (*InterfaceVppHandler) AddIPSecTunnelInterface ¶
func (h *InterfaceVppHandler) AddIPSecTunnelInterface(ctx context.Context, 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) AddIpipTunnel ¶
func (h *InterfaceVppHandler) AddIpipTunnel(ifName string, vrf uint32, ipipLink *interfaces.IPIPLink) (uint32, error)
AddIpipTunnel adds new IPIP tunnel interface.
func (*InterfaceVppHandler) AddLoopbackInterface ¶
func (h *InterfaceVppHandler) AddLoopbackInterface(ifName string) (swIndex uint32, err error)
func (*InterfaceVppHandler) AddMemifInterface ¶
func (*InterfaceVppHandler) AddRdmaInterface ¶
func (h *InterfaceVppHandler) AddRdmaInterface(ctx context.Context, ifName string, rdmaLink *interfaces.RDMALink) (swIdx uint32, err error)
AddRdmaInterface adds new interface with RDMA driver.
func (*InterfaceVppHandler) AddSpan ¶
func (h *InterfaceVppHandler) AddSpan(ifIdxFrom, ifIdxTo uint32, direction uint8, isL2 bool) error
AddSpan enables SPAN on interface
func (*InterfaceVppHandler) AddTapInterface ¶
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) AddWireguardTunnel ¶
func (h *InterfaceVppHandler) AddWireguardTunnel(ifName string, wireguardLink *interfaces.WireguardLink) (uint32, error)
AddWireguardTunnel adds a new wireguard tunnel interface.
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 ¶
DelGreTunnel removes GRE interface.
func (*InterfaceVppHandler) DelGtpuTunnel ¶
func (h *InterfaceVppHandler) DelGtpuTunnel(ifName string, gtpuLink *interfaces.GtpuLink) error
DelGtpuTunnel removes GTPU interface.
func (*InterfaceVppHandler) DelInterfaceIP ¶
func (h *InterfaceVppHandler) DelInterfaceIP(ifIdx uint32, addr *net.IPNet) error
func (*InterfaceVppHandler) DelIpipTunnel ¶
func (h *InterfaceVppHandler) DelIpipTunnel(ifName string, ifIdx uint32) error
DelIpipTunnel removes IPIP tunnel interface.
func (*InterfaceVppHandler) DelSpan ¶
func (h *InterfaceVppHandler) DelSpan(ifIdxFrom, ifIdxTo uint32, isL2 bool) error
DelSpan disables SPAN on interface
func (*InterfaceVppHandler) DeleteAfPacketInterface ¶
func (h *InterfaceVppHandler) DeleteAfPacketInterface(ifName string, idx uint32, targetHostIfName string) error
DeleteAfPacketInterface implements AfPacket handler.
func (*InterfaceVppHandler) DeleteBondInterface ¶
func (h *InterfaceVppHandler) DeleteBondInterface(ifName string, ifIdx uint32) error
func (*InterfaceVppHandler) DeleteIPSecTunnelInterface ¶
func (h *InterfaceVppHandler) DeleteIPSecTunnelInterface(ctx context.Context, ifName string, idx uint32, 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 (*InterfaceVppHandler) DeleteRdmaInterface ¶
func (h *InterfaceVppHandler) DeleteRdmaInterface(ctx context.Context, ifName string, ifIdx uint32) error
DeleteRdmaInterface removes interface with RDMA driver.
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) DeleteWireguardTunnel ¶
func (h *InterfaceVppHandler) DeleteWireguardTunnel(ifName string, ifIdx uint32) error
DeleteWireguardTunnel removes wireguard tunnel interface.
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(ctx context.Context) (map[uint32]*vppcalls.InterfaceDetails, error)
func (*InterfaceVppHandler) DumpInterfacesByType ¶
func (h *InterfaceVppHandler) DumpInterfacesByType(ctx context.Context, reqType ifs.Interface_Type) (map[uint32]*vppcalls.InterfaceDetails, error)
func (*InterfaceVppHandler) DumpMemifSocketDetails ¶
func (*InterfaceVppHandler) DumpSpan ¶
func (h *InterfaceVppHandler) DumpSpan() ([]*vppcalls.InterfaceSpanDetails, error)
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(ctx context.Context, ifIdx uint32) error
func (*InterfaceVppHandler) InterfaceAdminUp ¶
func (h *InterfaceVppHandler) InterfaceAdminUp(ctx context.Context, ifIdx uint32) error
func (*InterfaceVppHandler) RegisterMemifSocketFilename ¶
func (*InterfaceVppHandler) RemoveInterfaceTag ¶
func (h *InterfaceVppHandler) RemoveInterfaceTag(tag string, ifIdx uint32) error
func (*InterfaceVppHandler) SetIP6ndAutoconfig ¶
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 (*InterfaceVppHandler) SetVLanTagRewrite ¶
func (h *InterfaceVppHandler) SetVLanTagRewrite(ifIdx uint32, subIf *ifs.SubInterface) error
SetVLanTagRewrite sets an interface tag rewrite
func (*InterfaceVppHandler) UnsetInterfaceAsDHCPClient ¶
func (h *InterfaceVppHandler) UnsetInterfaceAsDHCPClient(ifIdx uint32, hostName string) error
func (*InterfaceVppHandler) UnsetUnnumberedIP ¶
func (h *InterfaceVppHandler) UnsetUnnumberedIP(ctx context.Context, uIfIdx uint32) error
func (*InterfaceVppHandler) WatchDHCPLeases ¶
func (*InterfaceVppHandler) WatchInterfaceEvents ¶
func (h *InterfaceVppHandler) WatchInterfaceEvents(ctx context.Context, eventsCh chan<- *vppcalls.InterfaceEvent) error
Source Files ¶
- admin_vppcalls.go
- afpacket_vppcalls.go
- bond_vppcalls.go
- dhcp_vppcalls.go
- doc.go
- dump_interface_vppcalls.go
- gre_vppcalls.go
- gtpu_vppcalls.go
- helpers.go
- ip6nd_vppcalls.go
- ip_container_vppcalls.go
- ip_vppcalls.go
- ipip_vppcalls.go
- ipsec_vppcalls.go
- l2_vppcalls.go
- loopback_vppcalls.go
- mac_vppcalls.go
- memif_vppcalls.go
- mtu_vppcalls.go
- rdma_vppcalls.go
- rx_mode_vppcalls.go
- rx_placement_vppcalls.go
- span_vppcalls.go
- subif_vppcalls.go
- tap_vppcalls.go
- vmxnet3_vppcalls.go
- vppcalls_handler.go
- vrf_vppcalls.go
- vxlan_gpe_vppcalls.go
- vxlan_vppcalls.go
- watch_vppcalls.go
- wireguard_vppcalls.go