Class (GI Struct)

NM-1.0NMIPRoutingRule

Index

Constructors

Properties

Methods

  • Returns number

    the address family of the rule. Either AF_INET or AF_INET6.

  • Returns number

    the destination port start setting.

  • Returns string

    the set from/src parameter or null, if no value is set.

  • Returns number

    the set prefix length for the from/src parameter.

  • Returns number

    the priority. A valid priority is in the range from 0 to G_MAXUINT32. If unset, -1 is returned.

  • Returns number

    the suppress_prefixlength of the rule. -1 means that the value is unset.

  • Returns [boolean, number, number]

    true if a uid range is set. This API was wrongly introduced in the header files for 1.32, but the symbols were not exported. The API only works since 1.34 and newer.

  • Returns boolean

    whether self is sealed. Once sealed, an instance cannot be modified nor unsealed.

  • Seals the routing rule. Afterwards, the instance can no longer be modified, and it is a bug to call any of the accessors that would modify the rule. If self was already sealed, this has no effect.

    Returns void

  • Note that currently only certain actions are allowed. nm_ip_routing_rule_validate() will reject unsupported actions as invalid.

    Parameters

    • action: number

      the action to set

    Returns void

  • Parameters

    • start: number

      the start port to set.

    • end: number

      the end port to set.

    Returns void

  • Setting invalid values is accepted, but will later fail during nm_ip_routing_rule_validate().

    Parameters

    • from: string

      the from/src address to set. The address family must match.

    • len: number

      the corresponding prefix length of the address.

    Returns void

  • Parameters

    • fwmark: number

      the fwmark

    • fwmask: number

      the fwmask

    Returns void

  • The name supports C backslash escaping for non-UTF-8 characters. Note that nm_ip_routing_rule_from_string() too uses backslash escaping when tokenizing the words by whitespace. So, in string representation you'd get double backslashes.

    Parameters

    • Optionaliifname: string

      the iifname to set or null to unset.

    Returns void

  • Parameters

    • invert: boolean

      the new value to set

    Returns void

  • Parameters

    • ipproto: number

      the ipproto to set

    Returns void

  • The name supports C backslash escaping for non-UTF-8 characters. Note that nm_ip_routing_rule_from_string() too uses backslash escaping when tokenizing the words by whitespace. So, in string representation you'd get double backslashes.

    Parameters

    • Optionaloifname: string

      the oifname to set or null to unset.

    Returns void

  • A valid priority ranges from 0 to G_MAXUINT32. "-1" is also allowed to reset the priority. It is a bug calling this function with any other value.

    Parameters

    • priority: number

      the priority to set

    Returns void

  • Parameters

    • start: number

      the start port to set.

    • end: number

      the end port to set.

    Returns void

  • Parameters

    • suppress_prefixlength: number

      the suppress_prefixlength to set. The value -1 means unset.

    Returns void

  • Setting invalid values is accepted, but will later fail during nm_ip_routing_rule_validate().

    Parameters

    • to: string

      the to/dst address to set. The address family must match.

    • len: number

      the corresponding prefix length of the address. If to is null, this valid is ignored.

    Returns void

  • For a valid range, start must be less or equal to end. If set to an invalid range, the range gets unset.

    This API was wrongly introduced in the header files for 1.32, but the symbols were not exported. The API only works since 1.34 and newer.

    Parameters

    • uid_range_start: number

      the uid_range start to set.

    • uid_range_end: number

      the uid_range start to set.

    Returns void

  • Decreases the reference count of the instance and destroys the instance if the reference count reaches zero.

    Since 1.42, ref-counting of NM.IPRoutingRule is thread-safe.

    Returns void