Class (GI Struct)

NM-1.0NMIPRoute

Index

Constructors

  • Parameters

    • family: number
    • dest: string
    • prefix: number
    • next_hop: string
    • metric: number

    Returns IPRoute

Properties

$gtype: GType<IPRoute>

Methods

  • Creates a copy of route

    Returns IPRoute

    a copy of route This API was part of public headers before 1.32.0 but was erroneously not exported in the ABI. It is thus only usable since 1.32.0.

  • Determines if two NM.IPRoute objects contain the same destination, prefix, next hop, and metric. (Attributes are not compared.)

    Parameters

    Returns boolean

    true if the objects contain the same values, false if they do not.

  • Determines if two NM.IPRoute objects contain the same destination, prefix, next hop, and metric.

    Parameters

    • other: IPRoute

      the NM.IPRoute to compare route to.

    • cmp_flags: number

      tune how to compare attributes. Currently, only NM_IP_ROUTE_EQUAL_CMP_FLAGS_NONE (0) and NM_IP_ROUTE_EQUAL_CMP_FLAGS_WITH_ATTRS (1) is supported.

    Returns boolean

    true if the objects contain the same values, false if they do not.

  • Gets the value of the attribute with name name on route

    Parameters

    • name: string

      the name of an route attribute

    Returns GLib.Variant

    the value of the attribute with name name on route, or null if route has no such attribute.

  • Gets an array of attribute names defined on route.

    Returns string[]

    a null-terminated array of attribute names

  • Gets the IP destination address property of this route object.

    Returns string

    the IP address of the route's destination

  • Gets the IP address family (eg, AF_INET) property of this route object.

    Returns number

    the IP address family

  • Gets the route metric property of this route object; lower values indicate "better" or more preferred routes; -1 indicates "default" (meaning NetworkManager will set it appropriately).

    Returns number

    the route metric

  • Gets the IP address of the next hop of this route; this will be null if the route has no next hop.

    Returns string

    the IP address of the next hop, or null if this is a device route.

  • Gets the IP prefix (ie "24" or "30" etc) of this route.

    Returns number

    the IP prefix

  • Sets the named attribute on route to the given value.

    Parameters

    • name: string

      the name of a route attribute

    • Optionalvalue: GLib.Variant<any>

      the value

    Returns void

  • Sets the destination property of this route object.

    dest must be a valid address of route's family. If you aren't sure you have a valid address, use nm_inet_is_valid() to check it.

    Parameters

    • dest: string

      the route's destination, as a string

    Returns void

  • Sets the metric property of this route object.

    Parameters

    • metric: number

      the route metric (or -1 for "default")

    Returns void

  • Sets the next-hop property of this route object.

    next_hop (if non-null) must be a valid address of route's family. If you aren't sure you have a valid address, use nm_utils_ipaddr_valid() to check it.

    Parameters

    • Optionalnext_hop: string

      the route's next hop, as a string

    Returns void

  • Sets the prefix property of this route object.

    Parameters

    • prefix: number

      the route prefix

    Returns void

  • Decreases the reference count of the object. If the reference count reaches zero, the object will be destroyed.

    Returns void

  • Validates a route attribute, i.e. checks that the attribute is a known one and the value is of the correct type and well-formed.

    Parameters

    • name: string

      the attribute name

    • value: GLib.Variant

      the attribute value

    • family: number

      IP address family of the route

    Returns [boolean, boolean]

  • Parameters

    • family: number
    • dest: string
    • prefix: number
    • next_hop: string
    • metric: number

    Returns IPRoute

  • Parameters

    • family: number
    • dest: any
    • prefix: number
    • next_hop: any
    • metric: number

    Returns IPRoute