vpplink

package
v0.8.1-calicov3.15.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnyInterface = ^uint32(0)
)
View Source
const (
	INVALID_SW_IF_INDEX = ^uint32(0)
)
View Source
const InvalidID = ^uint32(0)

Variables

This section is empty.

Functions

func BoolToU8

func BoolToU8(b bool) uint8

func IsIP4

func IsIP4(ip net.IP) bool

func IsIP6

func IsIP6(ip net.IP) bool

Types

type IKEv2AuthMethod

type IKEv2AuthMethod uint8
const (
	IKEv2AuthMethodRSASig       IKEv2AuthMethod = 1
	IKEv2AuthMethodSharedKeyMic IKEv2AuthMethod = 2
)

type IKEv2DHGroup

type IKEv2DHGroup uint32
const (
	IKEv2DHGroupNone          IKEv2DHGroup = 0
	IKEv2DHGroupMODP_768      IKEv2DHGroup = 1
	IKEv2DHGroupMODP_1024     IKEv2DHGroup = 2
	IKEv2DHGroupMODP_1536     IKEv2DHGroup = 5
	IKEv2DHGroupMODP_2048     IKEv2DHGroup = 14
	IKEv2DHGroupMODP_3072     IKEv2DHGroup = 15
	IKEv2DHGroupMODP_4096     IKEv2DHGroup = 16
	IKEv2DHGroupMODP_6144     IKEv2DHGroup = 17
	IKEv2DHGroupMODP_8192     IKEv2DHGroup = 18
	IKEv2DHGroupECP_256       IKEv2DHGroup = 19
	IKEv2DHGroupECP_384       IKEv2DHGroup = 20
	IKEv2DHGroupECP_521       IKEv2DHGroup = 21
	IKEv2DHGroupMODP_1024_160 IKEv2DHGroup = 22
	IKEv2DHGroupMODP_2048_224 IKEv2DHGroup = 23
	IKEv2DHGroupMODP_2048_256 IKEv2DHGroup = 24
	IKEv2DHGroupECP_192       IKEv2DHGroup = 25
	IKEv2DHGroupECP_224       IKEv2DHGroup = 26
	IKEv2DHGroupBRAINPOOL_224 IKEv2DHGroup = 27
	IKEv2DHGroupBRAINPOOL_256 IKEv2DHGroup = 28
	IKEv2DHGroupBRAINPOOL_384 IKEv2DHGroup = 29
	IKEv2DHGroupBRAINPOOL_512 IKEv2DHGroup = 30
)

type IKEv2EncryptionAlgorithm

type IKEv2EncryptionAlgorithm uint32
const (
	IKEv2EncryptionAlgorithmDES_IV64   IKEv2EncryptionAlgorithm = 1
	IKEv2EncryptionAlgorithmDES        IKEv2EncryptionAlgorithm = 2
	IKEv2EncryptionAlgorithm3DES       IKEv2EncryptionAlgorithm = 3
	IKEv2EncryptionAlgorithmRC5        IKEv2EncryptionAlgorithm = 4
	IKEv2EncryptionAlgorithmIDEA       IKEv2EncryptionAlgorithm = 5
	IKEv2EncryptionAlgorithmCAST       IKEv2EncryptionAlgorithm = 6
	IKEv2EncryptionAlgorithmBLOWFISH   IKEv2EncryptionAlgorithm = 7
	IKEv2EncryptionAlgorithm3IDEA      IKEv2EncryptionAlgorithm = 8
	IKEv2EncryptionAlgorithmDES_IV32   IKEv2EncryptionAlgorithm = 9
	IKEv2EncryptionAlgorithmNULL       IKEv2EncryptionAlgorithm = 11
	IKEv2EncryptionAlgorithmAES_CBC    IKEv2EncryptionAlgorithm = 12
	IKEv2EncryptionAlgorithmAES_CTR    IKEv2EncryptionAlgorithm = 13
	IKEv2EncryptionAlgorithmAES_GCM_16 IKEv2EncryptionAlgorithm = 20
)

type IKEv2IDType

type IKEv2IDType uint8
const (
	IKEv2IDTypeIPv4Addr   IKEv2IDType = 1
	IKEv2IDTypeFQDN       IKEv2IDType = 2
	IKEv2IDTypeRFC822Addr IKEv2IDType = 3
	IKEv2IDTypeIPv6Addr   IKEv2IDType = 5
	IKEv2IDTypeDerAsn1Dn  IKEv2IDType = 9
	IKEv2IDTypeDerAsn1Gn  IKEv2IDType = 10
	IKEv2IDTypeKeyID      IKEv2IDType = 11
)

type IKEv2IntegrityAlgorithm

type IKEv2IntegrityAlgorithm uint32
const (
	IKEv2IntegrityAlgorithmNone                   IKEv2IntegrityAlgorithm = 0
	IKEv2IntegrityAlgorithmAUTH_HMAC_MD5_96       IKEv2IntegrityAlgorithm = 1
	IKEv2IntegrityAlgorithmAUTH_HMAC_SHA1_96      IKEv2IntegrityAlgorithm = 2
	IKEv2IntegrityAlgorithmAUTH_DES_MAC           IKEv2IntegrityAlgorithm = 3
	IKEv2IntegrityAlgorithmAUTH_KPDK_MD5          IKEv2IntegrityAlgorithm = 4
	IKEv2IntegrityAlgorithmAUTH_AES_XCBC_96       IKEv2IntegrityAlgorithm = 5
	IKEv2IntegrityAlgorithmAUTH_HMAC_MD5_128      IKEv2IntegrityAlgorithm = 6
	IKEv2IntegrityAlgorithmAUTH_HMAC_SHA1_160     IKEv2IntegrityAlgorithm = 7
	IKEv2IntegrityAlgorithmAUTH_AES_CMAC_96       IKEv2IntegrityAlgorithm = 8
	IKEv2IntegrityAlgorithmAUTH_AES_128_GMAC      IKEv2IntegrityAlgorithm = 9
	IKEv2IntegrityAlgorithmAUTH_AES_192_GMAC      IKEv2IntegrityAlgorithm = 10
	IKEv2IntegrityAlgorithmAUTH_AES_256_GMAC      IKEv2IntegrityAlgorithm = 11
	IKEv2IntegrityAlgorithmAUTH_HMAC_SHA2_256_128 IKEv2IntegrityAlgorithm = 12
	IKEv2IntegrityAlgorithmAUTH_HMAC_SHA2_384_192 IKEv2IntegrityAlgorithm = 13
	IKEv2IntegrityAlgorithmAUTH_HMAC_SHA2_512_256 IKEv2IntegrityAlgorithm = 14
)

type NamespaceNotFound

type NamespaceNotFound error
type VppLink struct {
	// contains filtered or unexported fields
}
func NewVppLink(socket string, logger *logrus.Entry) (*VppLink, error)

func (*VppLink) AddIKEv2Profile

func (v *VppLink) AddIKEv2Profile(name string) (err error)

func (*VppLink) AddInterfaceAddress

func (v *VppLink) AddInterfaceAddress(swIfIndex uint32, addr *net.IPNet) error

func (*VppLink) AddIpipTunnel

func (v *VppLink) AddIpipTunnel(src net.IP, dst net.IP, tableID uint32) (SwIfIndex uint32, err error)

func (*VppLink) AddNat44Address

func (v *VppLink) AddNat44Address(address net.IP) error

func (*VppLink) AddNat44InsideInterface

func (v *VppLink) AddNat44InsideInterface(swIfIndex uint32) error

func (*VppLink) AddNat44InterfaceAddress

func (v *VppLink) AddNat44InterfaceAddress(swIfIndex uint32, flags types.NatFlags) error

func (*VppLink) AddNat44LB

func (v *VppLink) AddNat44LB(entry *types.Nat44Entry) error

func (*VppLink) AddNat44LBStaticMapping

func (v *VppLink) AddNat44LBStaticMapping(entry *types.Nat44Entry) error

func (*VppLink) AddNat44OutsideInterface

func (v *VppLink) AddNat44OutsideInterface(swIfIndex uint32) error

func (*VppLink) AddNat44StaticMapping

func (v *VppLink) AddNat44StaticMapping(entry *types.Nat44Entry) error

func (*VppLink) AddNeighbor

func (v *VppLink) AddNeighbor(neighbor *types.Neighbor) error

func (*VppLink) AddNodeNext

func (v *VppLink) AddNodeNext(name, next string) (nodeIndex uint32, err error)

func (*VppLink) AddVXLanTunnel

func (v *VppLink) AddVXLanTunnel(tunnel *types.VXLanTunnel) (swIfIndex uint32, err error)

func (*VppLink) AddrList

func (v *VppLink) AddrList(swIfIndex uint32, isv6 bool) (addresses []types.IfAddress, err error)

func (*VppLink) Close

func (v *VppLink) Close()

func (*VppLink) CnatAddDelSnatPrefix

func (v *VppLink) CnatAddDelSnatPrefix(prefix *net.IPNet, isAdd bool) (err error)

func (*VppLink) CnatAddSnatPrefix

func (v *VppLink) CnatAddSnatPrefix(prefix *net.IPNet) error

func (*VppLink) CnatDelSnatPrefix

func (v *VppLink) CnatDelSnatPrefix(prefix *net.IPNet) error

func (*VppLink) CnatSetSnatAddresses

func (v *VppLink) CnatSetSnatAddresses(v4, v6 net.IP) (err error)

func (*VppLink) CnatTranslateAdd

func (v *VppLink) CnatTranslateAdd(tr *types.CnatTranslateEntry) (id uint32, err error)

func (*VppLink) CnatTranslateDel

func (v *VppLink) CnatTranslateDel(id uint32) (err error)

func (*VppLink) CreateAfPacket

func (v *VppLink) CreateAfPacket(ifName string, hardwareAddr *net.HardwareAddr) (swIfIndex uint32, err error)

func (*VppLink) CreateAfXDP

func (v *VppLink) CreateAfXDP(intf *types.VppXDPInterface) (err error)

func (*VppLink) CreateOrAttachTapV2

func (v *VppLink) CreateOrAttachTapV2(tap *types.TapV2) (swIfIndex uint32, err error)

func (*VppLink) CreateTapV2

func (v *VppLink) CreateTapV2(tap *types.TapV2) (swIfIndex uint32, err error)

func (*VppLink) DelInterfaceAddress

func (v *VppLink) DelInterfaceAddress(swIfIndex uint32, addr *net.IPNet) error

func (*VppLink) DelIpipTunnel

func (v *VppLink) DelIpipTunnel(swIfIndex uint32) (err error)

func (*VppLink) DelNat44Address

func (v *VppLink) DelNat44Address(address net.IP) error

func (*VppLink) DelNat44InsideInterface

func (v *VppLink) DelNat44InsideInterface(swIfIndex uint32) error

func (*VppLink) DelNat44InterfaceAddress

func (v *VppLink) DelNat44InterfaceAddress(swIfIndex uint32, flags types.NatFlags) error

func (*VppLink) DelNat44LB

func (v *VppLink) DelNat44LB(entry *types.Nat44Entry) error

func (*VppLink) DelNat44LBStaticMapping

func (v *VppLink) DelNat44LBStaticMapping(entry *types.Nat44Entry) error

func (*VppLink) DelNat44OutsideInterface

func (v *VppLink) DelNat44OutsideInterface(swIfIndex uint32) error

func (*VppLink) DelNat44StaticMapping

func (v *VppLink) DelNat44StaticMapping(entry *types.Nat44Entry) error

func (*VppLink) DelNeighbor

func (v *VppLink) DelNeighbor(neighbor *types.Neighbor) error

func (*VppLink) DelTap

func (v *VppLink) DelTap(swIfIndex uint32) error

func (*VppLink) DelVXLanTunnel

func (v *VppLink) DelVXLanTunnel(tunnel *types.VXLanTunnel) (err error)

func (*VppLink) DeleteAfPacket

func (v *VppLink) DeleteAfPacket(ifName string) error

func (*VppLink) DeleteAfXDP

func (v *VppLink) DeleteAfXDP(intf *types.VppXDPInterface) error

func (*VppLink) DisableCalicoSNAT

func (v *VppLink) DisableCalicoSNAT(swIfIndex uint32, isIp6 bool) (err error)

func (*VppLink) DisableGSOFeature

func (v *VppLink) DisableGSOFeature(swIfIndex uint32) error

func (*VppLink) DisableIP6RouterAdvertisements

func (v *VppLink) DisableIP6RouterAdvertisements(swIfIndex uint32) (err error)

func (*VppLink) DisableInterfaceIP6

func (v *VppLink) DisableInterfaceIP6(swIfIndex uint32) error

func (*VppLink) DisableSNATArc

func (v *VppLink) DisableSNATArc(swIfIndex uint32, isIp6 bool) (err error)

func (*VppLink) EnableCalicoSNAT

func (v *VppLink) EnableCalicoSNAT(swIfIndex uint32, isIp6 bool) (err error)

func (*VppLink) EnableGSOFeature

func (v *VppLink) EnableGSOFeature(swIfIndex uint32) error

func (*VppLink) EnableInterfaceIP6

func (v *VppLink) EnableInterfaceIP6(swIfIndex uint32) error

func (*VppLink) EnableNatForwarding

func (v *VppLink) EnableNatForwarding() (err error)

func (*VppLink) EnableSNATArc

func (v *VppLink) EnableSNATArc(swIfIndex uint32, isIp6 bool) (err error)

func (*VppLink) GetChannel

func (v *VppLink) GetChannel() (vppapi.Channel, error)

func (*VppLink) GetIPsecTunnelProtection

func (v *VppLink) GetIPsecTunnelProtection(tunnelInterface uint32) (protections []types.IPsecTunnelProtection, err error)

func (*VppLink) GetInterfaceDetails

func (v *VppLink) GetInterfaceDetails(swIfIndex uint32) (i *types.VppInterfaceDetails, err error)

func (*VppLink) GetInterfaceNeighbors

func (v *VppLink) GetInterfaceNeighbors(swIfIndex uint32, isIPv6 bool) (err error, neighbors []types.Neighbor)

func (*VppLink) GetNodeIndex

func (v *VppLink) GetNodeIndex(name string) (nodeIndex uint32, err error)

func (*VppLink) GetRoutes

func (v *VppLink) GetRoutes(tableID uint32, isIPv6 bool) (routes []types.Route, err error)

func (*VppLink) IKEv2Initiate

func (v *VppLink) IKEv2Initiate(profile string) (err error)

func (*VppLink) InterfaceAdminDown

func (v *VppLink) InterfaceAdminDown(swIfIndex uint32) error

func (*VppLink) InterfaceAdminUp

func (v *VppLink) InterfaceAdminUp(swIfIndex uint32) error

func (*VppLink) InterfaceSetUnnumbered

func (v *VppLink) InterfaceSetUnnumbered(unnumberedSwIfIndex uint32, swIfIndex uint32) error

func (*VppLink) InterfaceUnsetUnnumbered

func (v *VppLink) InterfaceUnsetUnnumbered(unnumberedSwIfIndex uint32, swIfIndex uint32) error

func (*VppLink) PuntAllL4

func (v *VppLink) PuntAllL4(isIPv6 bool) (err error)

func (*VppLink) PuntL4

func (v *VppLink) PuntL4(proto types.IPProto, port uint16, isIPv6 bool) error

PuntL4 configures L4 punt for a given address family and protocol. port = ~0 means all ports

func (*VppLink) PuntRedirect

func (v *VppLink) PuntRedirect(sourceSwIfIndex, destSwIfIndex uint32, nh net.IP) error

func (*VppLink) Reconnect

func (v *VppLink) Reconnect() (err error)

func (*VppLink) Retry

func (v *VppLink) Retry(sleepBtwRetries time.Duration, retries int, f interface{}, args ...interface{}) (err error)

func (*VppLink) RouteAdd

func (v *VppLink) RouteAdd(route *types.Route) error

func (*VppLink) RouteDel

func (v *VppLink) RouteDel(route *types.Route) error

func (*VppLink) SearchInterfaceWithName

func (v *VppLink) SearchInterfaceWithName(name string) (err error, swIfIndex uint32)

func (*VppLink) SearchInterfaceWithTag

func (v *VppLink) SearchInterfaceWithTag(tag string) (err error, swIfIndex uint32)

func (*VppLink) SetIKEv2DefaultTransforms

func (v *VppLink) SetIKEv2DefaultTransforms(profile string) (err error)

func (*VppLink) SetIKEv2ESPTransforms

func (v *VppLink) SetIKEv2ESPTransforms(
	profile string,
	cryptoAlg IKEv2EncryptionAlgorithm,
	cryptoKeySize uint32,
	integAlg IKEv2IntegrityAlgorithm,
) (err error)

func (*VppLink) SetIKEv2IKETransforms

func (v *VppLink) SetIKEv2IKETransforms(
	profile string,
	cryptoAlg IKEv2EncryptionAlgorithm,
	cryptoKeySize uint32,
	integAlg IKEv2IntegrityAlgorithm,
	dhGroup IKEv2DHGroup,
) (err error)

func (*VppLink) SetIKEv2LocalIDAddress

func (v *VppLink) SetIKEv2LocalIDAddress(profile string, localAddr net.IP) (err error)

func (*VppLink) SetIKEv2PSKAuth

func (v *VppLink) SetIKEv2PSKAuth(profile, psk string) (err error)

func (*VppLink) SetIKEv2PermissiveTrafficSelectors

func (v *VppLink) SetIKEv2PermissiveTrafficSelectors(profile string) (err error)

func (*VppLink) SetIKEv2RemoteIDAddress

func (v *VppLink) SetIKEv2RemoteIDAddress(profile string, rmtAddr net.IP) (err error)

func (*VppLink) SetIKEv2Responder

func (v *VppLink) SetIKEv2Responder(profile string, swIfIndex uint32, address net.IP) (err error)

func (*VppLink) SetIKEv2TrafficSelector

func (v *VppLink) SetIKEv2TrafficSelector(
	profile string,
	isLocal bool,
	proto uint8,
	startPort uint16,
	endPort uint16,
	startAddr net.IP,
	endAddr net.IP,
) (err error)

func (*VppLink) SetIKEv2TunnelInterface

func (v *VppLink) SetIKEv2TunnelInterface(profile string, swIfIndex uint32) (err error)

func (*VppLink) SetIPFlowHash

func (v *VppLink) SetIPFlowHash(vrfID uint32, isIPv6 bool, src bool, dst bool, sport bool, dport bool, proto bool, reverse bool, symmetric bool) error

func (*VppLink) SetInterfaceRxMode

func (v *VppLink) SetInterfaceRxMode(swIfIndex uint32, queueID uint32, mode types.RxMode) error

func (*VppLink) SetInterfaceRxPlacement

func (v *VppLink) SetInterfaceRxPlacement(swIfIndex, queue, worker uint32, main bool) error

Directories

Path Synopsis
binapi
vppapi/af_packet
Package af_packet contains generated bindings for API file af_packet.api.
Package af_packet contains generated bindings for API file af_packet.api.
vppapi/af_xdp
Package af_xdp contains generated bindings for API file af_xdp.api.
Package af_xdp contains generated bindings for API file af_xdp.api.
vppapi/calico
Package calico contains generated bindings for API file calico.api.
Package calico contains generated bindings for API file calico.api.
vppapi/cnat
Package cnat contains generated bindings for API file cnat.api.
Package cnat contains generated bindings for API file cnat.api.
vppapi/ethernet_types
Package ethernet_types contains generated bindings for API file ethernet_types.api.
Package ethernet_types contains generated bindings for API file ethernet_types.api.
vppapi/feature
Package feature contains generated bindings for API file feature.api.
Package feature contains generated bindings for API file feature.api.
vppapi/fib_types
Package fib_types contains generated bindings for API file fib_types.api.
Package fib_types contains generated bindings for API file fib_types.api.
vppapi/gso
Package gso contains generated bindings for API file gso.api.
Package gso contains generated bindings for API file gso.api.
vppapi/ikev2
Package ikev2 contains generated bindings for API file ikev2.api.
Package ikev2 contains generated bindings for API file ikev2.api.
vppapi/ikev2_types
Package ikev2_types contains generated bindings for API file ikev2_types.api.
Package ikev2_types contains generated bindings for API file ikev2_types.api.
vppapi/interface
Package interfaces contains generated bindings for API file interface.api.
Package interfaces contains generated bindings for API file interface.api.
vppapi/interface_types
Package interface_types contains generated bindings for API file interface_types.api.
Package interface_types contains generated bindings for API file interface_types.api.
vppapi/ip
Package ip contains generated bindings for API file ip.api.
Package ip contains generated bindings for API file ip.api.
vppapi/ip6_nd
Package ip6_nd contains generated bindings for API file ip6_nd.api.
Package ip6_nd contains generated bindings for API file ip6_nd.api.
vppapi/ip_neighbor
Package ip_neighbor contains generated bindings for API file ip_neighbor.api.
Package ip_neighbor contains generated bindings for API file ip_neighbor.api.
vppapi/ip_types
Package ip_types contains generated bindings for API file ip_types.api.
Package ip_types contains generated bindings for API file ip_types.api.
vppapi/ipip
Package ipip contains generated bindings for API file ipip.api.
Package ipip contains generated bindings for API file ipip.api.
vppapi/ipsec
Package ipsec contains generated bindings for API file ipsec.api.
Package ipsec contains generated bindings for API file ipsec.api.
vppapi/ipsec_types
Package ipsec_types contains generated bindings for API file ipsec_types.api.
Package ipsec_types contains generated bindings for API file ipsec_types.api.
vppapi/mfib_types
Package mfib_types contains generated bindings for API file mfib_types.api.
Package mfib_types contains generated bindings for API file mfib_types.api.
vppapi/nat
Package nat contains generated bindings for API file nat.api.
Package nat contains generated bindings for API file nat.api.
vppapi/nat_types
Package nat_types contains generated bindings for API file nat_types.api.
Package nat_types contains generated bindings for API file nat_types.api.
vppapi/punt
Package punt contains generated bindings for API file punt.api.
Package punt contains generated bindings for API file punt.api.
vppapi/tapv2
Package tapv2 contains generated bindings for API file tapv2.api.
Package tapv2 contains generated bindings for API file tapv2.api.
vppapi/tunnel_types
Package tunnel_types contains generated bindings for API file tunnel_types.api.
Package tunnel_types contains generated bindings for API file tunnel_types.api.
vppapi/vpe
Package vpe contains generated bindings for API file vpe.api.
Package vpe contains generated bindings for API file vpe.api.
vppapi/vpe_types
Package vpe_types contains generated bindings for API file vpe_types.api.
Package vpe_types contains generated bindings for API file vpe_types.api.
vppapi/vxlan
Package vxlan contains generated bindings for API file vxlan.api.
Package vxlan contains generated bindings for API file vxlan.api.

Jump to

Keyboard shortcuts

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