gi-gio-2.0.24: Gio bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (inaki@blueleaf.cc)
Safe HaskellNone
LanguageHaskell2010

GI.Gio.Objects.InetAddressMask

Contents

Description

InetAddressMask represents a range of IPv4 or IPv6 addresses described by a base address and a length indicating how many bits of the base address are relevant for matching purposes. These are often given in string form. Eg, "10.0.0.0/8", or "fe80::/10".

Since: 2.32

Synopsis

Exported types

newtype InetAddressMask Source #

Memory-managed wrapper type.

class (GObject o, IsDescendantOf InetAddressMask o) => IsInetAddressMask o Source #

Type class for types which can be safely cast to InetAddressMask, for instance with toInetAddressMask.

toInetAddressMask :: (MonadIO m, IsInetAddressMask o) => o -> m InetAddressMask Source #

Cast to InetAddressMask, for types for which this is known to be safe. For general casts, use castTo.

Methods

equal

inetAddressMaskEqual Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetAddressMask a, IsInetAddressMask b) 
=> a

mask: a InetAddressMask

-> b

mask2: another InetAddressMask

-> m Bool

Returns: whether mask and mask2 are the same mask

Tests if mask and mask2 are the same mask.

Since: 2.32

getAddress

inetAddressMaskGetAddress Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetAddressMask a) 
=> a

mask: a InetAddressMask

-> m InetAddress

Returns: mask's base address

Gets mask's base address

Since: 2.32

getFamily

inetAddressMaskGetFamily Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetAddressMask a) 
=> a

mask: a InetAddressMask

-> m SocketFamily

Returns: the SocketFamily of mask's address

Gets the SocketFamily of mask's address

Since: 2.32

getLength

inetAddressMaskGetLength Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetAddressMask a) 
=> a

mask: a InetAddressMask

-> m Word32

Returns: mask's length

Gets mask's length

Since: 2.32

matches

inetAddressMaskMatches Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetAddressMask a, IsInetAddress b) 
=> a

mask: a InetAddressMask

-> b

address: a InetAddress

-> m Bool

Returns: whether address falls within the range described by mask.

Tests if address falls within the range described by mask.

Since: 2.32

new

inetAddressMaskNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetAddress a) 
=> a

addr: a InetAddress

-> Word32

length: number of bits of addr to use

-> m InetAddressMask

Returns: a new InetAddressMask, or Nothing on error (Can throw GError)

Creates a new InetAddressMask representing all addresses whose first length bits match addr.

Since: 2.32

newFromString

inetAddressMaskNewFromString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

maskString: an IP address or address/length string

-> m InetAddressMask

Returns: a new InetAddressMask corresponding to string, or Nothing on error. (Can throw GError)

Parses maskString as an IP address and (optional) length, and creates a new InetAddressMask. The length, if present, is delimited by a "/". If it is not present, then the length is assumed to be the full length of the address.

Since: 2.32

toString

inetAddressMaskToString Source #

Arguments

:: (HasCallStack, MonadIO m, IsInetAddressMask a) 
=> a

mask: a InetAddressMask

-> m Text

Returns: a string corresponding to mask.

Converts mask back to its corresponding string form.

Since: 2.32

Properties

address

No description available in the introspection data.

clearInetAddressMaskAddress :: (MonadIO m, IsInetAddressMask o) => o -> m () Source #

Set the value of the “address” property to Nothing. When overloading is enabled, this is equivalent to

clear #address

constructInetAddressMaskAddress :: (IsInetAddressMask o, IsInetAddress a) => a -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “address” property. This is rarely needed directly, but it is used by new.

getInetAddressMaskAddress :: (MonadIO m, IsInetAddressMask o) => o -> m InetAddress Source #

Get the value of the “address” property. When overloading is enabled, this is equivalent to

get inetAddressMask #address

setInetAddressMaskAddress :: (MonadIO m, IsInetAddressMask o, IsInetAddress a) => o -> a -> m () Source #

Set the value of the “address” property. When overloading is enabled, this is equivalent to

set inetAddressMask [ #address := value ]

family

No description available in the introspection data.

getInetAddressMaskFamily :: (MonadIO m, IsInetAddressMask o) => o -> m SocketFamily Source #

Get the value of the “family” property. When overloading is enabled, this is equivalent to

get inetAddressMask #family

length

No description available in the introspection data.

constructInetAddressMaskLength :: IsInetAddressMask o => Word32 -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “length” property. This is rarely needed directly, but it is used by new.

getInetAddressMaskLength :: (MonadIO m, IsInetAddressMask o) => o -> m Word32 Source #

Get the value of the “length” property. When overloading is enabled, this is equivalent to

get inetAddressMask #length

setInetAddressMaskLength :: (MonadIO m, IsInetAddressMask o) => o -> Word32 -> m () Source #

Set the value of the “length” property. When overloading is enabled, this is equivalent to

set inetAddressMask [ #length := value ]