NftAddressTranslation

Description

This object was introduced in InCore 2.1.

› Inherits:NftFlow

Properties

error

This property holds the most recently occurred error or NftAddressTranslation.NoError if no error occurred. If the same error occurs multiple times this property does not change. Use the errorOccurred() signal to detect multiple occurrences of the same error.

› Type:Error
› Signal:errorChanged()
› Attributes:Readonly

errorString

This property holds the current human readable error string corresponding to the current value in the error property. It may include additional information such as failure reasons or locations.

› Type:String
› Signal:errorStringChanged()
› Attributes:Readonly

masquerade

This property holds whether to masquerade connections. If enabled, the NftFlow.outputInterface property has to be set.

› Type:Boolean
› Default:false
› Signal:masqueradeChanged()
› Attributes:Writable

natDestinationAddress

This property holds the address to use for rewriting the destination address of packets.

› Type:String
› Signal:natDestinationAddressChanged()
› Attributes:Writable

natSourceAddress

This property holds the address to use for rewriting the source address of packets.

› Type:String
› Signal:natSourceAddressChanged()
› Attributes:Writable

Signals

errorOccurred()

This signal is emitted whenever an error has occurred, regardless of whether the error property has changed or not. In contrast to the change notification signal of the error property this signal is also emitted several times if a certain error occurs several times in succession.

Enumerations

Error

This enumeration describes all errors which can occur in NftAddressTranslation objects. The most recently occurred error is stored in the error property.

Name Value Description
NftAddressTranslation.NoError 0 No error occurred or was detected.
NftAddressTranslation.MasqueradingWithoutOutputInterface 1 Masquerading enabled but output interface not set.

Example

import InCore.Foundation 2.5

NftFirewall {
    NftAddressTranslation {
        inputInterface: "usb0"
        destinationAddress: "192.168.123.1"
        natSourceAddress: "192.168.19.1"
        natDestinationAddress: "192.168.19.2"
    }

    onRulesetChanged: console.log(ruleset)
}