NftRule

Description

This object was introduced in InCore 2.1.

› Inherits:Object

Properties

connectionStates

› Type:ConnectionStates
› Default:NftRule.AllStates
› Signal:connectionStatesChanged()
› Attributes:Writable

destinationAddress

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

destinationPorts

This property holds the destination ports to apply this rule to. See the sourcePorts property for details on syntax and possible values.

› Type:Variant
› Signal:destinationPortsChanged()
› Attributes:Writable

enabled

This property holds whether the rule is enabled, i.e. it should be included in the corresponding chain.

› Type:Boolean
› Default:true
› Signal:enabledChanged()
› Attributes:Writable

inputInterface

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

nonTerminalStatements

› Type:List<NftStatement>
› Signal:nonTerminalStatementsChanged()
› Attributes:Readonly

outputInterface

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

protocol

› Type:Protocol
› Default:NftRule.AllProtocols
› Signal:protocolChanged()
› Attributes:Writable

sourceAddress

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

sourcePorts

This property holds the source ports to apply this rule to. Syntax and possible values:

  • 80 – only port 80
  • "!= 33-45" – all ports but 33-45
  • [ 80, 443 ] - ports 80 and 443
› Type:Variant
› Signal:sourcePortsChanged()
› Attributes:Writable

statement

› Type:NftStatement
› Signal:statementChanged()
› Attributes:Readonly

Signals

nonTerminalStatementsDataChanged(SignedInteger index)

This signal is emitted whenever the List.dataChanged() signal is emitted, i.e. the item at index in the nonTerminalStatements list itself emitted the dataChanged() signal.

Enumerations

ConnectionStates

Name Value Description
NftRule.New 1
NftRule.Established 2
NftRule.Untracked 8
NftRule.AllStates 15  

Protocol

Name Value Description
NftRule.Tcp 0
NftRule.Udp 1
NftRule.UdpLite 2
NftRule.Icmp 3
NftRule.Icmpv6 4
NftRule.Esp 5
NftRule.Ah 6
NftRule.Sctp 7
NftRule.Dccp 8
NftRule.AllProtocols 9  

Statement

Name Value Description
NftRule.Accept 0
NftRule.Drop 1
NftRule.Queue 2
NftRule.Continue 3
NftRule.Return 4
NftRule.Jump 5
NftRule.GoTo 6
NftRule.Log 7
NftRule.Reject 8
NftRule.Counter 9
NftRule.Limit 10
NftRule.Nat 11  

Example

See NftFirewall example on how to use NftRule.