NM.IPRoutingRule¶
Fields¶
None
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class NM.IPRoutingRule¶
- classmethod from_string(str, to_string_flags, extra_args)¶
- Parameters:
str (
str
) – the string representation to convert to anNM.IPRoutingRule
to_string_flags (
NM.IPRoutingRuleAsStringFlags
) –NM.IPRoutingRuleAsStringFlags
for controlling the string conversion.extra_args ({
object
:object
} orNone
) – extra arguments for controlling the string conversion. Currently, not extra arguments are supported.
- Raises:
- Returns:
the new
NM.IPRoutingRule
orNone
on error.- Return type:
New in version 1.18.
- classmethod new(addr_family)¶
- Parameters:
addr_family (
int
) – the address family of the routing rule. Must be either %AF_INET (2) or %AF_INET6 (10).- Returns:
a newly created rule instance with the provided address family. The instance is unsealed.
- Return type:
New in version 1.18.
- cmp(other)¶
- Parameters:
other (
NM.IPRoutingRule
orNone
) – the otherNM.IPRoutingRule
instance to compare- Returns:
zero, a positive, or a negative integer to indicate equality or how the arguments compare.
- Return type:
New in version 1.18.
- get_addr_family()¶
- Returns:
the address family of the rule. Either %AF_INET or %AF_INET6.
- Return type:
New in version 1.18.
- get_destination_port_end()¶
- Returns:
the destination port end setting.
- Return type:
New in version 1.18.
- get_destination_port_start()¶
- Returns:
the destination port start setting.
- Return type:
New in version 1.18.
- get_from()¶
-
New in version 1.18.
- get_from_len()¶
- Returns:
the set prefix length for the from/src parameter.
- Return type:
New in version 1.18.
- get_priority()¶
- Returns:
the priority. A valid priority is in the range from 0 to
GObject.G_MAXUINT32
. If unset, -1 is returned.- Return type:
New in version 1.18.
- get_source_port_start()¶
- Returns:
the source port start setting.
- Return type:
New in version 1.18.
- get_suppress_prefixlength()¶
- Returns:
the suppress_prefixlength of the rule. -1 means that the value is unset.
- Return type:
New in version 1.20.
- get_to()¶
-
New in version 1.18.
- get_to_len()¶
- Returns:
the set prefix length for the to/dst parameter.
- Return type:
New in version 1.18.
- get_uid_range()¶
- Returns:
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.
- out_range_start:
returns the start of the range or 0 if the range is not set.
- out_range_end:
returns the end of the range or 0 if the range is not set.
- Return type:
New in version 1.34.
- is_sealed()¶
- Returns:
whether self is sealed. Once sealed, an instance cannot be modified nor unsealed.
- Return type:
New in version 1.18.
- new_clone()¶
- Returns:
a newly created rule instance with the same settings as self. Note that the instance will always be unsealed.
- Return type:
Since 1.42, ref-counting of
NM.IPRoutingRule
is thread-safe.New in version 1.18.
- ref()¶
- Returns:
the self argument with incremented reference count.
Since 1.42, ref-counting of
NM.IPRoutingRule
is thread-safe.- Return type:
Increases the reference count of the instance.
New in version 1.18.
- seal()¶
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.
New in version 1.18.
- set_action(action)¶
- Parameters:
action (
int
) – the action to set
Note that currently only certain actions are allowed.
NM.IPRoutingRule.validate
() will reject unsupported actions as invalid.New in version 1.18.
- set_destination_port(start, end)¶
-
New in version 1.18.
- set_from(from_, len)¶
- Parameters:
Setting invalid values is accepted, but will later fail during
NM.IPRoutingRule.validate
().New in version 1.18.
- set_fwmark(fwmark, fwmask)¶
-
New in version 1.18.
- set_iifname(iifname)¶
-
The name supports C backslash escaping for non-UTF-8 characters. Note that
NM.IPRoutingRule.from_string
() too uses backslash escaping when tokenizing the words by whitespace. So, in string representation you’d get double backslashes.New in version 1.18.
- set_oifname(oifname)¶
-
The name supports C backslash escaping for non-UTF-8 characters. Note that
NM.IPRoutingRule.from_string
() too uses backslash escaping when tokenizing the words by whitespace. So, in string representation you’d get double backslashes.New in version 1.18.
- set_priority(priority)¶
- Parameters:
priority (
int
) – the priority to set
A valid priority ranges from 0 to
GObject.G_MAXUINT32
. “-1” is also allowed to reset the priority. It is a bug calling this function with any other value.New in version 1.18.
- set_source_port(start, end)¶
-
New in version 1.18.
- set_suppress_prefixlength(suppress_prefixlength)¶
- Parameters:
suppress_prefixlength (
int
) – the suppress_prefixlength to set. The value -1 means unset.
New in version 1.20.
- set_to(to, len)¶
- Parameters:
Setting invalid values is accepted, but will later fail during
NM.IPRoutingRule.validate
().New in version 1.18.
- set_uid_range(uid_range_start, uid_range_end)¶
- Parameters:
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.
New in version 1.34.
- to_string(to_string_flags, extra_args)¶
- Parameters:
to_string_flags (
NM.IPRoutingRuleAsStringFlags
) –NM.IPRoutingRuleAsStringFlags
for controlling the string conversion.extra_args ({
object
:object
} orNone
) – extra arguments for controlling the string conversion. Currently, not extra arguments are supported.
- Raises:
- Returns:
the string representation or
None
on error.- Return type:
New in version 1.18.
- unref()¶
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.New in version 1.18.