Documentation ¶
Overview ¶
Package vppcalls contains wrappers over VPP binary APIs for all supported interface types.
Index ¶
- Constants
- func AddAfPacketInterface(ifName string, hwAddr string, afPacketIntf *intf.Interfaces_Interface_Afpacket, ...) (swIndex uint32, err error)
- func AddBfdEchoFunction(bfdInput *bfd.SingleHopBFD_EchoFunction, swIfIndexes ifaceidx.SwIfIndex, ...) (err error)
- func AddBfdUDPSession(bfdSess *bfd.SingleHopBFD_Session, ifIdx uint32, ...) error
- func AddBfdUDPSessionFromDetails(bfdSess *bfd_api.BfdUDPSessionDetails, bfdKeyIndexes idxvpp.NameToIdx, ...) error
- func AddContainerIP(ifIdx uint32, addr string, vppChan govppapi.Channel, ...) error
- func AddInterfaceIP(ifIdx uint32, addr *net.IPNet, vppChan govppapi.Channel, ...) error
- func AddLoopbackInterface(ifName string, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) (swIndex uint32, err error)
- func AddMemifInterface(ifName string, memIface *intf.Interfaces_Interface_Memif, socketID uint32, ...) (swIdx uint32, err error)
- func AddNat44AddressPool(first, last []byte, vrf uint32, twiceNat bool, vppChan govppapi.Channel, ...) error
- func AddNat44IdentityMapping(ctx *IdentityMappingContext, vppChan govppapi.Channel, ...) error
- func AddNat44StaticMapping(ctx *StaticMappingContext, vppChan govppapi.Channel, ...) error
- func AddNat44StaticMappingLb(ctx *StaticMappingLbContext, vppChan govppapi.Channel, ...) error
- func AddStnRule(ifIdx uint32, addr *net.IP, vppChan govppapi.Channel, ...) error
- func AddTapInterface(ifName string, tapIf *interfaces.Interfaces_Interface_Tap, ...) (swIfIdx uint32, err error)
- func AddVxlanTunnel(ifName string, vxlanIntf *intf.Interfaces_Interface_Vxlan, ...) (swIndex uint32, err error)
- func CheckMsgCompatibilityForBfd(vppChan govppapi.Channel) error
- func CheckMsgCompatibilityForInterface(log logging.Logger, vppChan govppapi.Channel) error
- func CheckMsgCompatibilityForNat(vppChan govppapi.Channel) error
- func CheckMsgCompatibilityForStn(vppChan govppapi.Channel) error
- func CreateVrfIfNeeded(vrfID uint32, vppChan govppapi.Channel) error
- func DelContainerIP(ifIdx uint32, addr string, vppChan govppapi.Channel, ...) error
- func DelInterfaceIP(ifIdx uint32, addr *net.IPNet, vppChan govppapi.Channel, ...) error
- func DelNat44AddressPool(first, last []byte, vrf uint32, twiceNat bool, vppChan govppapi.Channel, ...) error
- func DelNat44IdentityMapping(ctx *IdentityMappingContext, vppChan govppapi.Channel, ...) error
- func DelNat44StaticMapping(ctx *StaticMappingContext, vppChan govppapi.Channel, ...) error
- func DelNat44StaticMappingLb(ctx *StaticMappingLbContext, vppChan govppapi.Channel, ...) error
- func DelStnRule(ifIdx uint32, addr *net.IP, vppChan govppapi.Channel, ...) error
- func DeleteAfPacketInterface(ifName string, idx uint32, afPacketIntf *intf.Interfaces_Interface_Afpacket, ...) error
- func DeleteBfdEchoFunction(vppChan govppapi.Channel, stopwatch *measure.Stopwatch) (err error)
- func DeleteBfdUDPAuthenticationKey(bfdKey *bfd.SingleHopBFD_Key, vppChan govppapi.Channel, ...) (err error)
- func DeleteBfdUDPSession(ifIndex uint32, sourceAddress string, destAddress string, ...) error
- func DeleteLoopbackInterface(ifName string, idx uint32, vppChan govppapi.Channel, ...) error
- func DeleteMemifInterface(ifName string, idx uint32, vppChan govppapi.Channel, ...) error
- func DeleteTapInterface(ifName string, idx uint32, version uint32, vppChan govppapi.Channel, ...) error
- func DeleteVxlanTunnel(ifName string, idx uint32, vxlanIntf *intf.Interfaces_Interface_Vxlan, ...) error
- func DisableNat44Interface(ifIdx uint32, isInside bool, vppChan govppapi.Channel, ...) error
- func DisableNat44InterfaceOutput(ifIdx uint32, isInside bool, vppChan govppapi.Channel, ...) error
- func DumpBfdKeys(vppChan govppapi.Channel, stopwatch *measure.Stopwatch) (keys []*bfd_api.BfdAuthKeysDetails, err error)
- func DumpBfdUDPSessions(vppChan govppapi.Channel, stopwatch *measure.Stopwatch) ([]*bfd_api.BfdUDPSessionDetails, error)
- func DumpBfdUDPSessionsWithID(authKeyIndex uint32, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) ([]*bfd_api.BfdUDPSessionDetails, error)
- func EnableNat44Interface(ifIdx uint32, isInside bool, vppChan govppapi.Channel, ...) error
- func EnableNat44InterfaceOutput(ifIdx uint32, isInside bool, vppChan govppapi.Channel, ...) error
- func GetInterfaceVRF(ifIdx uint32, log logging.Logger, vppChan govppapi.Channel) (vrfID uint32, err error)
- func InterfaceAdminDown(ifIdx uint32, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
- func InterfaceAdminUp(ifIdx uint32, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
- func ModifyBfdUDPSession(bfdSess *bfd.SingleHopBFD_Session, swIfIndexes ifaceidx.SwIfIndex, ...) (err error)
- func RegisterMemifSocketFilename(filename []byte, id uint32, vppChan govppapi.Channel, ...) error
- func RemoveInterfaceTag(tag string, ifIdx uint32, vppChan govppapi.Channel, ...) error
- func SetBfdUDPAuthenticationKey(bfdKey *bfd.SingleHopBFD_Key, log logging.Logger, vppChan govppapi.Channel, ...) (err error)
- func SetInterfaceAsDHCPClient(ifIdx uint32, hostName string, vppChan govppapi.Channel, ...) (err error)
- func SetInterfaceMac(ifIdx uint32, macAddress string, vppChan govppapi.Channel, ...) error
- func SetInterfaceMtu(ifIdx uint32, mtu uint32, vppChan govppapi.Channel, ...) error
- func SetInterfaceTag(tag string, ifIdx uint32, vppChan govppapi.Channel, ...) error
- func SetInterfaceVRF(ifaceIndex, vrfID uint32, log logging.Logger, vppChan govppapi.Channel) error
- func SetNat44Forwarding(enableFwd bool, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
- func SetRxMode(ifIdx uint32, rxModeSettings *intf.Interfaces_Interface_RxModeSettings, ...) error
- func SetRxPlacement(vppInternalName string, ...) error
- func SetUnnumberedIP(uIfIdx uint32, ifIdxWithIP uint32, vppChan govppapi.Channel, ...) error
- func UnsetInterfaceAsDHCPClient(ifIdx uint32, hostName string, vppChan govppapi.Channel, ...) (err error)
- func UnsetUnnumberedIP(uIfIdx uint32, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
- type IdentityMappingContext
- type LocalLbAddress
- type StaticMappingContext
- type StaticMappingLbContext
- type StnRule
Constants ¶
const ( ICMP uint8 = 1 TCP uint8 = 6 UDP uint8 = 17 )
Num protocol representation
const NoInterface uint32 = 0xffffffff
NoInterface is sw-if-idx which means 'no interface'
Variables ¶
This section is empty.
Functions ¶
func AddAfPacketInterface ¶
func AddAfPacketInterface(ifName string, hwAddr string, afPacketIntf *intf.Interfaces_Interface_Afpacket, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) (swIndex uint32, err error)
AddAfPacketInterface calls AfPacketCreate VPP binary API.
func AddBfdEchoFunction ¶
func AddBfdEchoFunction(bfdInput *bfd.SingleHopBFD_EchoFunction, swIfIndexes ifaceidx.SwIfIndex, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) (err error)
AddBfdEchoFunction sets up an echo function for the interface.
func AddBfdUDPSession ¶
func AddBfdUDPSession(bfdSess *bfd.SingleHopBFD_Session, ifIdx uint32, bfdKeyIndexes idxvpp.NameToIdx, log logging.Logger, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
AddBfdUDPSession adds new BFD session with authentication if available.
func AddBfdUDPSessionFromDetails ¶
func AddBfdUDPSessionFromDetails(bfdSess *bfd_api.BfdUDPSessionDetails, bfdKeyIndexes idxvpp.NameToIdx, log logging.Logger, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
AddBfdUDPSessionFromDetails adds new BFD session with authentication if available.
func AddContainerIP ¶
func AddContainerIP(ifIdx uint32, addr string, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
AddContainerIP calls IPContainerProxyAddDel VPP API with IsAdd=1
func AddInterfaceIP ¶
func AddInterfaceIP(ifIdx uint32, addr *net.IPNet, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
AddInterfaceIP calls SwInterfaceAddDelAddress bin API with IsAdd=1.
func AddLoopbackInterface ¶
func AddLoopbackInterface(ifName string, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) (swIndex uint32, err error)
AddLoopbackInterface calls CreateLoopback bin API.
func AddMemifInterface ¶
func AddMemifInterface(ifName string, memIface *intf.Interfaces_Interface_Memif, socketID uint32, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) (swIdx uint32, err error)
AddMemifInterface calls MemifCreate bin API.
func AddNat44AddressPool ¶
func AddNat44AddressPool(first, last []byte, vrf uint32, twiceNat bool, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
AddNat44AddressPool sets new NAT address pool
func AddNat44IdentityMapping ¶
func AddNat44IdentityMapping(ctx *IdentityMappingContext, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
AddNat44IdentityMapping sets new NAT address pool
func AddNat44StaticMapping ¶
func AddNat44StaticMapping(ctx *StaticMappingContext, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
AddNat44StaticMapping creates new static mapping entry (considering address only or both, address and port depending on the context)
func AddNat44StaticMappingLb ¶
func AddNat44StaticMappingLb(ctx *StaticMappingLbContext, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
AddNat44StaticMappingLb creates new static mapping entry with load balancer
func AddStnRule ¶
func AddStnRule(ifIdx uint32, addr *net.IP, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
AddStnRule calls StnAddDelRule bin API with IsAdd=1
func AddTapInterface ¶
func AddTapInterface(ifName string, tapIf *interfaces.Interfaces_Interface_Tap, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) (swIfIdx uint32, err error)
AddTapInterface calls TapConnect bin API.
func AddVxlanTunnel ¶
func AddVxlanTunnel(ifName string, vxlanIntf *intf.Interfaces_Interface_Vxlan, encapVrf, multicastIf uint32, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) (swIndex uint32, err error)
AddVxlanTunnel calls AddDelVxlanTunnelReq with flag add=1.
func CheckMsgCompatibilityForBfd ¶
CheckMsgCompatibilityForBfd checks if bfd CRSs are compatible with VPP in runtime.
func CheckMsgCompatibilityForInterface ¶
CheckMsgCompatibilityForInterface checks if interface CRSs are compatible with VPP in runtime.
func CheckMsgCompatibilityForNat ¶
CheckMsgCompatibilityForNat verifies compatibility of used binary API calls
func CheckMsgCompatibilityForStn ¶
CheckMsgCompatibilityForStn verifies compatibility of used binary API calls
func CreateVrfIfNeeded ¶
CreateVrfIfNeeded checks if VRF exists and creates it if not
func DelContainerIP ¶
func DelContainerIP(ifIdx uint32, addr string, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
DelContainerIP calls IPContainerProxyAddDel VPP API with IsAdd=0
func DelInterfaceIP ¶
func DelInterfaceIP(ifIdx uint32, addr *net.IPNet, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
DelInterfaceIP calls SwInterfaceAddDelAddress bin API with IsAdd=00.
func DelNat44AddressPool ¶
func DelNat44AddressPool(first, last []byte, vrf uint32, twiceNat bool, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
DelNat44AddressPool removes existing NAT address pool
func DelNat44IdentityMapping ¶
func DelNat44IdentityMapping(ctx *IdentityMappingContext, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
DelNat44IdentityMapping sets new NAT address pool
func DelNat44StaticMapping ¶
func DelNat44StaticMapping(ctx *StaticMappingContext, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
DelNat44StaticMapping removes existing static mapping entry
func DelNat44StaticMappingLb ¶
func DelNat44StaticMappingLb(ctx *StaticMappingLbContext, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
DelNat44StaticMappingLb removes existing static mapping entry with load balancer
func DelStnRule ¶
func DelStnRule(ifIdx uint32, addr *net.IP, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
DelStnRule calls StnAddDelRule bin API with IsAdd=0
func DeleteAfPacketInterface ¶
func DeleteAfPacketInterface(ifName string, idx uint32, afPacketIntf *intf.Interfaces_Interface_Afpacket, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
DeleteAfPacketInterface calls AfPacketDelete VPP binary API.
func DeleteBfdEchoFunction ¶
DeleteBfdEchoFunction removes an echo function.
func DeleteBfdUDPAuthenticationKey ¶
func DeleteBfdUDPAuthenticationKey(bfdKey *bfd.SingleHopBFD_Key, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) (err error)
DeleteBfdUDPAuthenticationKey removes the authentication key.
func DeleteBfdUDPSession ¶
func DeleteBfdUDPSession(ifIndex uint32, sourceAddress string, destAddress string, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
DeleteBfdUDPSession removes an existing BFD session.
func DeleteLoopbackInterface ¶
func DeleteLoopbackInterface(ifName string, idx uint32, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
DeleteLoopbackInterface calls DeleteLoopback bin API.
func DeleteMemifInterface ¶
func DeleteMemifInterface(ifName string, idx uint32, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
DeleteMemifInterface calls MemifDelete bin API.
func DeleteTapInterface ¶
func DeleteTapInterface(ifName string, idx uint32, version uint32, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
DeleteTapInterface calls TapDelete bin API.
func DeleteVxlanTunnel ¶
func DeleteVxlanTunnel(ifName string, idx uint32, vxlanIntf *intf.Interfaces_Interface_Vxlan, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
DeleteVxlanTunnel calls AddDelVxlanTunnelReq with flag add=0.
func DisableNat44Interface ¶
func DisableNat44Interface(ifIdx uint32, isInside bool, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
DisableNat44Interface enables NAT feature for provided interface
func DisableNat44InterfaceOutput ¶
func DisableNat44InterfaceOutput(ifIdx uint32, isInside bool, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
DisableNat44InterfaceOutput disables NAT output feature for provided interface
func DumpBfdKeys ¶
func DumpBfdKeys(vppChan govppapi.Channel, stopwatch *measure.Stopwatch) (keys []*bfd_api.BfdAuthKeysDetails, err error)
DumpBfdKeys looks up all BFD auth keys and saves their name-to-index mapping
func DumpBfdUDPSessions ¶
func DumpBfdUDPSessions(vppChan govppapi.Channel, stopwatch *measure.Stopwatch) ([]*bfd_api.BfdUDPSessionDetails, error)
DumpBfdUDPSessions returns a list of BFD session's metadata
func DumpBfdUDPSessionsWithID ¶
func DumpBfdUDPSessionsWithID(authKeyIndex uint32, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) ([]*bfd_api.BfdUDPSessionDetails, error)
DumpBfdUDPSessionsWithID returns a list of BFD session's metadata filtered according to provided authentication key
func EnableNat44Interface ¶
func EnableNat44Interface(ifIdx uint32, isInside bool, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
EnableNat44Interface enables NAT feature for provided interface
func EnableNat44InterfaceOutput ¶
func EnableNat44InterfaceOutput(ifIdx uint32, isInside bool, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
EnableNat44InterfaceOutput enables NAT output feature for provided interface
func GetInterfaceVRF ¶
func GetInterfaceVRF(ifIdx uint32, log logging.Logger, vppChan govppapi.Channel) (vrfID uint32, err error)
GetInterfaceVRF assigns VRF table to interface
func InterfaceAdminDown ¶
InterfaceAdminDown calls binary API SwInterfaceSetFlagsReply with AdminUpDown=0.
func InterfaceAdminUp ¶
InterfaceAdminUp calls binary API SwInterfaceSetFlagsReply with AdminUpDown=1.
func ModifyBfdUDPSession ¶
func ModifyBfdUDPSession(bfdSess *bfd.SingleHopBFD_Session, swIfIndexes ifaceidx.SwIfIndex, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) (err error)
ModifyBfdUDPSession modifies existing BFD session excluding authentication which cannot be changed this way.
func RegisterMemifSocketFilename ¶
func RegisterMemifSocketFilename(filename []byte, id uint32, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
RegisterMemifSocketFilename registers new socket file name with provided ID.
func RemoveInterfaceTag ¶
func RemoveInterfaceTag(tag string, ifIdx uint32, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
RemoveInterfaceTag un-registers new interface index/tag pair
func SetBfdUDPAuthenticationKey ¶
func SetBfdUDPAuthenticationKey(bfdKey *bfd.SingleHopBFD_Key, log logging.Logger, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) (err error)
SetBfdUDPAuthenticationKey creates new authentication key.
func SetInterfaceAsDHCPClient ¶
func SetInterfaceAsDHCPClient(ifIdx uint32, hostName string, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) (err error)
SetInterfaceAsDHCPClient sets provided interface as a DHCP client
func SetInterfaceMac ¶
func SetInterfaceMac(ifIdx uint32, macAddress string, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
SetInterfaceMac calls SwInterfaceSetMacAddress bin API.
func SetInterfaceMtu ¶
func SetInterfaceMtu(ifIdx uint32, mtu uint32, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
SetInterfaceMtu calls HwInterfaceSetMtu bin API with desired MTU value.
func SetInterfaceTag ¶
func SetInterfaceTag(tag string, ifIdx uint32, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
SetInterfaceTag registers new interface index/tag pair
func SetInterfaceVRF ¶
SetInterfaceVRF retrieves VRF table from interface
func SetNat44Forwarding ¶
func SetNat44Forwarding(enableFwd bool, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
SetNat44Forwarding configures global forwarding setup for NAT44
func SetRxMode ¶
func SetRxMode(ifIdx uint32, rxModeSettings *intf.Interfaces_Interface_RxModeSettings, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
SetRxMode calls SwInterfaceSetRxMode bin
func SetRxPlacement ¶
func SetRxPlacement(vppInternalName string, rxPlacement *intf.Interfaces_Interface_RxPlacementSettings, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
SetRxPlacement
func SetUnnumberedIP ¶
func SetUnnumberedIP(uIfIdx uint32, ifIdxWithIP uint32, vppChan govppapi.Channel, stopwatch *measure.Stopwatch) error
SetUnnumberedIP sets interface as un-numbered, linking IP address of the another interface (ifIdxWithIP)
Types ¶
type IdentityMappingContext ¶
type IdentityMappingContext struct { Tag string IPAddress []byte Protocol uint8 Port uint16 IfIdx uint32 Vrf uint32 }
IdentityMappingContext groups common fields required for identity mapping
type LocalLbAddress ¶
LocalLbAddress represents one local IP and address entry
type StaticMappingContext ¶
type StaticMappingContext struct { Tag string AddressOnly bool LocalIP []byte LocalPort uint16 ExternalIP []byte ExternalPort uint16 ExternalIfIdx uint32 Protocol uint8 Vrf uint32 TwiceNat bool SelfTwiceNat bool }
StaticMappingContext groups common fields required for static mapping
type StaticMappingLbContext ¶
type StaticMappingLbContext struct { Tag string LocalIPs []*LocalLbAddress ExternalIP []byte ExternalPort uint16 Protocol uint8 Vrf uint32 TwiceNat bool SelfTwiceNat bool }
StaticMappingLbContext groups common fields required for static mapping with load balancer
Source Files ¶
- admin_vppcalls.go
- afpacket_vppcalls.go
- bfd_vppcalls.go
- compat_vppcalls.go
- dhcp_vppcalls.go
- doc.go
- ip_container_vppcalls.go
- ip_vppcalls.go
- loopback_vppcalls.go
- mac_vppcalls.go
- memif_vppcalls.go
- mtu_vppcalls.go
- nat_vppcalls.go
- rx_mode_vppcalls.go
- rx_placement_vppcalls.go
- stn_vppcalls.go
- tap_vppcalls.go
- vrf_vppcalls.go
- vxlan_vppcalls.go