nat

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2019 License: ISC Imports: 5 Imported by: 4

Documentation

Overview

Package nat is the client.Policies.Nat namespace.

Normalized object: Entry

Index

Constants

View Source
const (
	DynamicIpAndPort = "dynamic-ip-and-port"
	DynamicIp        = "dynamic-ip"
	StaticIp         = "static-ip"
)

Values for Entry.SatType.

View Source
const (
	InterfaceAddress  = "interface-address"
	TranslatedAddress = "translated-address"
)

Values for Entry.SatAddressType.

View Source
const (
	Ip         = "ip"
	FloatingIp = "floating"
)

These are the valid settings for Entry.SatFallbackIpType.

View Source
const (
	DatTypeStatic  = "destination-translation"
	DatTypeDynamic = "dynamic-destination-translation"
)

These are valid settings for DatType.

View Source
const (
	TypeIpv4  = "ipv4"
	TypeNat64 = "nat64"
	TypeNptv6 = "nptv6"
)

Valid values for the Type value.

View Source
const None = "none"

None is a valid value for both Entry.SatType and Entry.SatAddressType.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Name                           string
	Description                    string
	Type                           string
	SourceZones                    []string // unordered
	DestinationZone                string
	ToInterface                    string
	Service                        string
	SourceAddresses                []string // unordered
	DestinationAddresses           []string // unordered
	SatType                        string
	SatAddressType                 string
	SatTranslatedAddresses         []string // unordered
	SatInterface                   string
	SatIpAddress                   string
	SatFallbackType                string
	SatFallbackTranslatedAddresses []string // unordered
	SatFallbackInterface           string
	SatFallbackIpType              string
	SatFallbackIpAddress           string
	SatStaticTranslatedAddress     string
	SatStaticBiDirectional         bool
	DatType                        string
	DatAddress                     string
	DatPort                        int
	DatDynamicDistribution         string // 8.1+
	Disabled                       bool
	Targets                        map[string][]string
	NegateTarget                   bool
	Tags                           []string // ordered
}

Entry is a normalized, version independent representation of a NAT policy. The prefix "Sat" stands for "Source Address Translation" while the prefix "Dat" stands for "Destination Address Translation".

Targets is a map where the key is the serial number of the target device and the value is a list of specific vsys on that device. The list of vsys is nil if all vsys on that device should be included or if the device is a virtual firewall (and thus only has vsys1).

The following Sat params are linked:

SatType = nat.DynamicIpAndPort && SatAddressType = nat.TranslatedAddress:

  • SatTranslatedAddresses

SatType = nat.DynamicIpAndPort && SatAddressType = nat.InterfaceAddress:

  • SatInterface
  • SatIpAddress

For ALL SatType = nat.DynamicIp:

  • SatTranslatedAddresses

For ALL SatType = nat.DynamicIp and SatFallbackType = nat.InterfaceAddress:

  • SatFallbackInterface

SatType = nat.DynamicIp && SatFallbackType = nat.InterfaceAddress && SatFallbackIpType = nat.Ip:

  • SatFallbackIpAddress

SatType = nat.DynamicIp && SatFallbackType = nat.InterfaceAddress && SatFallbackIpType = nat.FloatingIp:

  • SatFallbackIpAddress

SatType = nat.DynamicIp and SatFallbackType = nat.TranslatedAddress:

  • SatFallbackTranslatedAddresses

SatType = nat.StaticIp:

  • SatStaticTranslatedAddress
  • SatStaticBiDirectional

If both DatAddress and DatPort are unintialized, then no destination address translation will be enabled; setting DatType by itself is not good enough.

func (*Entry) Copy

func (o *Entry) Copy(s Entry)

Copy copies the information from source Entry `s` to this object. As the Name field relates to the XPATH of this object, this field is not copied.

func (*Entry) Defaults

func (o *Entry) Defaults()

Defaults sets params with uninitialized values to their GUI default setting.

The defaults are as follows:

  • Type: "ipv4"
  • ToInterface: "any"
  • Service: "any"
  • SourceAddresses: ["any"]
  • DestinationAddresses: ["any"]
  • SatType: None
  • DatType: DatTypeStatic

type FwNat

type FwNat struct {
	// contains filtered or unexported fields
}

FwNat is the client.Policies.Nat namespace.

func (*FwNat) Delete

func (c *FwNat) Delete(vsys string, e ...interface{}) error

Delete removes the given NAT policies.

NAT policies can be either a string or an Entry object.

func (*FwNat) Edit

func (c *FwNat) Edit(vsys string, e Entry) error

Edit performs EDIT to create / update a NAT policy.

func (*FwNat) Get

func (c *FwNat) Get(vsys, name string) (Entry, error)

Get performs GET to retrieve information for the given NAT policy.

func (*FwNat) GetList

func (c *FwNat) GetList(vsys string) ([]string, error)

GetList performs GET to retrieve a list of NAT policies.

func (*FwNat) Initialize

func (c *FwNat) Initialize(con util.XapiClient)

Initialize is invoed by client.Initialize().

func (*FwNat) MoveGroup

func (c *FwNat) MoveGroup(vsys string, mvt int, rule string, e ...Entry) error

MoveGroup moves a logical group of NAT rules somewhere in relation to another rule.

func (*FwNat) Set

func (c *FwNat) Set(vsys string, e ...Entry) error

Set performs SET to create / update one or more NAT policies.

func (*FwNat) Show

func (c *FwNat) Show(vsys, name string) (Entry, error)

Get performs SHOW to retrieve information for the given NAT policy.

func (*FwNat) ShowList

func (c *FwNat) ShowList(vsys string) ([]string, error)

ShowList performs SHOW to retrieve a list of NAT policies.

type PanoNat

type PanoNat struct {
	// contains filtered or unexported fields
}

PanoNat is the client.Policies.Nat namespace.

func (*PanoNat) Delete

func (c *PanoNat) Delete(dg, base string, e ...interface{}) error

Delete removes the given NAT policies.

NAT policies can be either a string or an Entry object.

func (*PanoNat) Edit

func (c *PanoNat) Edit(dg, base string, e Entry) error

Edit performs EDIT to create / update a NAT policy.

func (*PanoNat) Get

func (c *PanoNat) Get(dg, base, name string) (Entry, error)

Get performs GET to retrieve information for the given NAT policy.

func (*PanoNat) GetList

func (c *PanoNat) GetList(dg, base string) ([]string, error)

GetList performs GET to retrieve a list of NAT policies.

func (*PanoNat) Initialize

func (c *PanoNat) Initialize(con util.XapiClient)

Initialize is invoed by client.Initialize().

func (*PanoNat) MoveGroup

func (c *PanoNat) MoveGroup(dg, base string, mvt int, rule string, e ...Entry) error

MoveGroup moves a logical group of NAT rules somewhere in relation to another rule.

func (*PanoNat) Set

func (c *PanoNat) Set(dg, base string, e ...Entry) error

Set performs SET to create / update one or more NAT policies.

func (*PanoNat) Show

func (c *PanoNat) Show(dg, base, name string) (Entry, error)

Get performs SHOW to retrieve information for the given NAT policy.

func (*PanoNat) ShowList

func (c *PanoNat) ShowList(dg, base string) ([]string, error)

ShowList performs SHOW to retrieve a list of NAT policies.

Jump to

Keyboard shortcuts

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