gi-nm-1.0.1: NM bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.NM.Structs.IPRoute

Description

No description available in the introspection data.

Synopsis

Exported types

newtype IPRoute Source #

Memory-managed wrapper type.

Constructors

IPRoute (ManagedPtr IPRoute) 

Instances

Instances details
Eq IPRoute Source # 
Instance details

Defined in GI.NM.Structs.IPRoute

Methods

(==) :: IPRoute -> IPRoute -> Bool #

(/=) :: IPRoute -> IPRoute -> Bool #

GBoxed IPRoute Source # 
Instance details

Defined in GI.NM.Structs.IPRoute

ManagedPtrNewtype IPRoute Source # 
Instance details

Defined in GI.NM.Structs.IPRoute

TypedObject IPRoute Source # 
Instance details

Defined in GI.NM.Structs.IPRoute

Methods

glibType :: IO GType #

HasParentTypes IPRoute Source # 
Instance details

Defined in GI.NM.Structs.IPRoute

IsGValue (Maybe IPRoute) Source #

Convert IPRoute to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.NM.Structs.IPRoute

type ParentTypes IPRoute Source # 
Instance details

Defined in GI.NM.Structs.IPRoute

type ParentTypes IPRoute = '[] :: [Type]

Methods

Click to display all available methods, including inherited ones

Expand

Methods

dup, equal, equalFull, ref, unref.

Getters

getAttribute, getAttributeNames, getDest, getFamily, getMetric, getNextHop, getPrefix.

Setters

setAttribute, setDest, setMetric, setNextHop, setPrefix.

attributeValidate

iPRouteAttributeValidate Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

name: the attribute name

-> GVariant

value: the attribute value

-> Int32

family: IP address family of the route

-> m Bool

(Can throw GError)

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.

Since: 1.8

dup

iPRouteDup Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> IPRoute

route: the IPRoute

-> m IPRoute

Returns: 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.

Creates a copy of route

Since: 1.32

equal

iPRouteEqual Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> IPRoute

route: the IPRoute

-> IPRoute

other: the IPRoute to compare route to.

-> m Bool

Returns: True if the objects contain the same values, False if they do not.

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

equalFull

iPRouteEqualFull Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> IPRoute

route: the IPRoute

-> IPRoute

other: the IPRoute to compare route to.

-> Word32

cmpFlags: 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.

-> m Bool

Returns: True if the objects contain the same values, False if they do not.

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

Since: 1.10

getAttribute

iPRouteGetAttribute Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> IPRoute

route: the IPRoute

-> Text

name: the name of an route attribute

-> m GVariant

Returns: the value of the attribute with name name on route, or Nothing if route has no such attribute.

Gets the value of the attribute with name name on route

getAttributeNames

iPRouteGetAttributeNames Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> IPRoute

route: the IPRoute

-> m [Text]

Returns: a Nothing-terminated array of attribute names

Gets an array of attribute names defined on route.

getDest

iPRouteGetDest Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> IPRoute

route: the IPRoute

-> m Text

Returns: the IP address of the route's destination

Gets the IP destination address property of this route object.

getFamily

iPRouteGetFamily Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> IPRoute

route: the IPRoute

-> m Int32

Returns: the IP address family

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

getMetric

iPRouteGetMetric Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> IPRoute

route: the IPRoute

-> m Int64

Returns: the route metric

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).

getNextHop

iPRouteGetNextHop Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> IPRoute

route: the IPRoute

-> m Text

Returns: the IP address of the next hop, or Nothing if this is a device route.

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

getPrefix

iPRouteGetPrefix Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> IPRoute

route: the IPRoute

-> m Word32

Returns: the IP prefix

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

getVariantAttributeSpec

iPRouteGetVariantAttributeSpec Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m VariantAttributeSpec

Returns: the specifiers for route attributes

No description available in the introspection data.

Since: 1.8

new

iPRouteNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

family: the IP address family (<literal>AF_INET</literal> or <literal>AF_INET6</literal>)

-> Text

dest: the IP address of the route's destination

-> Word32

prefix: the address prefix length

-> Maybe Text

nextHop: the IP address of the next hop (or Nothing)

-> Int64

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

-> m IPRoute

Returns: the new IPRoute object, or Nothing on error (Can throw GError)

Creates a new IPRoute object.

newBinary

iPRouteNewBinary Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

family: the IP address family (<literal>AF_INET</literal> or <literal>AF_INET6</literal>)

-> Ptr ()

dest: the IP address of the route's destination

-> Word32

prefix: the address prefix length

-> Ptr ()

nextHop: the IP address of the next hop (or Nothing)

-> Int64

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

-> m IPRoute

Returns: the new IPRoute object, or Nothing on error (Can throw GError)

Creates a new IPRoute object. dest and nextHop (if non-Nothing) must point to buffers of the correct size for family.

ref

iPRouteRef Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> IPRoute

route: the IPRoute

-> m () 

Increases the reference count of the object.

setAttribute

iPRouteSetAttribute Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> IPRoute

route: the IPRoute

-> Text

name: the name of a route attribute

-> Maybe GVariant

value: the value

-> m () 

Sets the named attribute on route to the given value.

setDest

iPRouteSetDest Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> IPRoute

route: the IPRoute

-> Text

dest: the route's destination, as a string

-> m () 

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.

setMetric

iPRouteSetMetric Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> IPRoute

route: the IPRoute

-> Int64

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

-> m () 

Sets the metric property of this route object.

setNextHop

iPRouteSetNextHop Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> IPRoute

route: the IPRoute

-> Maybe Text

nextHop: the route's next hop, as a string

-> m () 

Sets the next-hop property of this route object.

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

setPrefix

iPRouteSetPrefix Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> IPRoute

route: the IPRoute

-> Word32

prefix: the route prefix

-> m () 

Sets the prefix property of this route object.

unref

iPRouteUnref Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> IPRoute

route: the IPRoute

-> m () 

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