vppcalls

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package vppcalls contains wrappers over VPP binary APIs for NAT configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNatHandlerVersion

func AddNatHandlerVersion(version vpp.Version, msgs []govppapi.Message,
	h func(ch govppapi.Channel, ifIdx ifaceidx.IfaceMetadataIndex, dhcpIdx idxmap.NamedMapping, log logging.Logger) NatVppAPI,
)

Types

type NatVppAPI

type NatVppAPI interface {
	NatVppRead

	// SetNat44Forwarding configures NAT44 forwarding.
	SetNat44Forwarding(enableFwd bool) error
	// EnableNat44Interface enables NAT44 feature for provided interface
	EnableNat44Interface(iface string, isInside, isOutput bool) error
	// DisableNat44Interface disables NAT feature for provided interface
	DisableNat44Interface(iface string, isInside, isOutput bool) error
	// AddNat44AddressPool adds new IPV4 address pool into the NAT pools.
	AddNat44AddressPool(vrf uint32, firstIP, lastIP string, twiceNat bool) error
	// DelNat44AddressPool removes existing IPv4 address pool from the NAT pools.
	DelNat44AddressPool(vrf uint32, firstIP, lastIP string, twiceNat bool) error
	// SetVirtualReassemblyIPv4 configures NAT virtual reassembly for IPv4 packets.
	SetVirtualReassemblyIPv4(vrCfg *nat.VirtualReassembly) error
	// SetVirtualReassemblyIPv6 configures NAT virtual reassembly for IPv6 packets.
	SetVirtualReassemblyIPv6(vrCfg *nat.VirtualReassembly) error
	// AddNat44IdentityMapping adds new NAT44 identity mapping
	AddNat44IdentityMapping(mapping *nat.DNat44_IdentityMapping, dnatLabel string) error
	// DelNat44IdentityMapping removes NAT44 identity mapping
	DelNat44IdentityMapping(mapping *nat.DNat44_IdentityMapping, dnatLabel string) error
	// AddNat44StaticMapping creates new NAT44 static mapping entry.
	AddNat44StaticMapping(mapping *nat.DNat44_StaticMapping, dnatLabel string) error
	// DelNat44StaticMapping removes existing NAT44 static mapping entry.
	DelNat44StaticMapping(mapping *nat.DNat44_StaticMapping, dnatLabel string) error
}

NatVppAPI provides methods for managing VPP NAT configuration.

func CompatibleNatVppHandler

func CompatibleNatVppHandler(c vpp.Client, ifIdx ifaceidx.IfaceMetadataIndex, dhcpIdx idxmap.NamedMapping, log logging.Logger) NatVppAPI

type NatVppRead

type NatVppRead interface {
	// DefaultNat44GlobalConfig returns default global configuration.
	DefaultNat44GlobalConfig() *nat.Nat44Global
	// Nat44GlobalConfigDump dumps global NAT44 config in NB format.
	// If dumpDeprecated is true, dumps deprecated NAT44 global config as well.
	Nat44GlobalConfigDump(dumpDeprecated bool) (*nat.Nat44Global, error)
	// DNat44Dump dumps all configured DNAT-44 configurations ordered by label.
	DNat44Dump() ([]*nat.DNat44, error)
	// Nat44InterfacesDump dumps NAT44 config of all NAT44-enabled interfaces.
	Nat44InterfacesDump() ([]*nat.Nat44Interface, error)
	// Nat44AddressPoolsDump dumps all configured NAT44 address pools.
	Nat44AddressPoolsDump() ([]*nat.Nat44AddressPool, error)
}

NatVppRead provides read methods for VPP NAT configuration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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