Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
GInetAddressMask
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. For example, 10.0.0.0/8
, or fe80::/10
.
Since: 2.32
Synopsis
- newtype InetAddressMask = InetAddressMask (ManagedPtr InetAddressMask)
- class (GObject o, IsDescendantOf InetAddressMask o) => IsInetAddressMask o
- toInetAddressMask :: (MonadIO m, IsInetAddressMask o) => o -> m InetAddressMask
- inetAddressMaskEqual :: (HasCallStack, MonadIO m, IsInetAddressMask a, IsInetAddressMask b) => a -> b -> m Bool
- inetAddressMaskGetAddress :: (HasCallStack, MonadIO m, IsInetAddressMask a) => a -> m InetAddress
- inetAddressMaskGetFamily :: (HasCallStack, MonadIO m, IsInetAddressMask a) => a -> m SocketFamily
- inetAddressMaskGetLength :: (HasCallStack, MonadIO m, IsInetAddressMask a) => a -> m Word32
- inetAddressMaskMatches :: (HasCallStack, MonadIO m, IsInetAddressMask a, IsInetAddress b) => a -> b -> m Bool
- inetAddressMaskNew :: (HasCallStack, MonadIO m, IsInetAddress a) => a -> Word32 -> m InetAddressMask
- inetAddressMaskNewFromString :: (HasCallStack, MonadIO m) => Text -> m InetAddressMask
- inetAddressMaskToString :: (HasCallStack, MonadIO m, IsInetAddressMask a) => a -> m Text
- clearInetAddressMaskAddress :: (MonadIO m, IsInetAddressMask o) => o -> m ()
- constructInetAddressMaskAddress :: (IsInetAddressMask o, MonadIO m, IsInetAddress a) => a -> m (GValueConstruct o)
- getInetAddressMaskAddress :: (MonadIO m, IsInetAddressMask o) => o -> m InetAddress
- setInetAddressMaskAddress :: (MonadIO m, IsInetAddressMask o, IsInetAddress a) => o -> a -> m ()
- getInetAddressMaskFamily :: (MonadIO m, IsInetAddressMask o) => o -> m SocketFamily
- constructInetAddressMaskLength :: (IsInetAddressMask o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getInetAddressMaskLength :: (MonadIO m, IsInetAddressMask o) => o -> m Word32
- setInetAddressMaskLength :: (MonadIO m, IsInetAddressMask o) => o -> Word32 -> m ()
Exported types
newtype InetAddressMask Source #
Memory-managed wrapper type.
Instances
Eq InetAddressMask Source # | |
Defined in GI.Gio.Objects.InetAddressMask (==) :: InetAddressMask -> InetAddressMask -> Bool # (/=) :: InetAddressMask -> InetAddressMask -> Bool # | |
GObject InetAddressMask Source # | |
Defined in GI.Gio.Objects.InetAddressMask | |
ManagedPtrNewtype InetAddressMask Source # | |
Defined in GI.Gio.Objects.InetAddressMask | |
TypedObject InetAddressMask Source # | |
Defined in GI.Gio.Objects.InetAddressMask | |
HasParentTypes InetAddressMask Source # | |
Defined in GI.Gio.Objects.InetAddressMask | |
IsGValue (Maybe InetAddressMask) Source # | Convert |
Defined in GI.Gio.Objects.InetAddressMask gvalueGType_ :: IO GType # gvalueSet_ :: Ptr GValue -> Maybe InetAddressMask -> IO () # gvalueGet_ :: Ptr GValue -> IO (Maybe InetAddressMask) # | |
type ParentTypes InetAddressMask Source # | |
Defined in GI.Gio.Objects.InetAddressMask |
class (GObject o, IsDescendantOf InetAddressMask o) => IsInetAddressMask o Source #
Type class for types which can be safely cast to InetAddressMask
, for instance with toInetAddressMask
.
Instances
(GObject o, IsDescendantOf InetAddressMask o) => IsInetAddressMask o Source # | |
Defined in GI.Gio.Objects.InetAddressMask |
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
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, equal, forceFloating, freezeNotify, getv, init, isFloating, matches, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, toString, unref, watchClosure.
Getters
getAddress, getData, getFamily, getLength, getProperty, getQdata.
Setters
equal
:: (HasCallStack, MonadIO m, IsInetAddressMask a, IsInetAddressMask b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: whether |
Tests if mask
and mask2
are the same mask.
Since: 2.32
getAddress
inetAddressMaskGetAddress Source #
:: (HasCallStack, MonadIO m, IsInetAddressMask a) | |
=> a |
|
-> m InetAddress | Returns: |
Gets mask
's base address
Since: 2.32
getFamily
inetAddressMaskGetFamily Source #
:: (HasCallStack, MonadIO m, IsInetAddressMask a) | |
=> a |
|
-> m SocketFamily | Returns: the |
Gets the SocketFamily
of mask
's address
Since: 2.32
getLength
inetAddressMaskGetLength Source #
:: (HasCallStack, MonadIO m, IsInetAddressMask a) | |
=> a |
|
-> m Word32 | Returns: |
Gets mask
's length
Since: 2.32
matches
inetAddressMaskMatches Source #
:: (HasCallStack, MonadIO m, IsInetAddressMask a, IsInetAddress b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: whether |
Tests if address
falls within the range described by mask
.
Since: 2.32
new
:: (HasCallStack, MonadIO m, IsInetAddress a) | |
=> a |
|
-> Word32 |
|
-> m InetAddressMask | Returns: a new |
Creates a new InetAddressMask
representing all addresses whose
first length
bits match addr
.
Since: 2.32
newFromString
inetAddressMaskNewFromString Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m InetAddressMask | Returns: a new |
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 #
:: (HasCallStack, MonadIO m, IsInetAddressMask a) | |
=> a |
|
-> m Text | Returns: a string corresponding to |
Converts mask
back to its corresponding string form.
Since: 2.32
Properties
address
The base address.
Since: 2.32
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, MonadIO m, IsInetAddress a) => a -> m (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
The address family (IPv4 or IPv6).
Since: 2.32
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
The prefix length, in bytes.
Since: 2.32
constructInetAddressMaskLength :: (IsInetAddressMask o, MonadIO m) => Word32 -> m (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 ]