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

Description

The settings of one WireGuard peer.

Since: 1.16

Synopsis

Exported types

Methods

appendAllowedIp

wireGuardPeerAppendAllowedIp Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> WireGuardPeer

self: the unsealed WireGuardPeer instance

-> Text

allowedIp: the allowed-ip entry to set.

-> Bool

acceptInvalid: if True, also invalid allowedIp value will be appended. Otherwise, the function does nothing in face of invalid values and returns False.

-> m Bool

Returns: True if the value is a valid allowed-ips value, False otherwise. Depending on acceptInvalid, also invalid values are added.

Appends allowedIp setting to the list. This does not check for duplicates and always appends allowedIp to the end of the list. If allowedIp is valid, it will be normalized and a modified for might be appended. If allowedIp is invalid, it will still be appended, but later verification will fail.

It is a bug trying to modify a sealed WireGuardPeer instance.

Since: 1.16

clearAllowedIps

wireGuardPeerClearAllowedIps Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> WireGuardPeer

self: the unsealed WireGuardPeer instance

-> m () 

Removes all allowed-ip entries.

It is a bug trying to modify a sealed WireGuardPeer instance.

Since: 1.16

cmp

wireGuardPeerCmp Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe WireGuardPeer

a: the WireGuardPeer to compare.

-> Maybe WireGuardPeer

b: the other WireGuardPeer to compare.

-> SettingCompareFlags

compareFlags: SettingCompareFlags to affect the comparison.

-> m Int32

Returns: zero of the two instances are equivalent or a non-zero integer otherwise. This defines a total ordering over the peers. Whether a peer is sealed or not, does not affect the comparison.

No description available in the introspection data.

Since: 1.16

getAllowedIp

wireGuardPeerGetAllowedIp Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> WireGuardPeer

self: the WireGuardPeer instance

-> Word32

idx: the index from zero to (allowed-ips-len - 1) to retrieve.

-> Bool

outIsValid: True if the returned value is a valid allowed-ip setting. This parameter is wrongly not marked as (out) argument, it is thus not accessible via introspection. This cannot be fixed without breaking API for introspection users.

-> m (Maybe Text)

Returns: the allowed-ip setting at index idx. If idx is out of range, Nothing will be returned.

No description available in the introspection data.

Since: 1.16

getAllowedIpsLen

wireGuardPeerGetAllowedIpsLen Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> WireGuardPeer

self: the WireGuardPeer instance

-> m Word32

Returns: the number of allowed-ips entries.

No description available in the introspection data.

Since: 1.16

getEndpoint

wireGuardPeerGetEndpoint Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> WireGuardPeer

self: the WireGuardPeer instance

-> m Text

Returns: the endpoint or Nothing if none was set.

No description available in the introspection data.

Since: 1.16

getPersistentKeepalive

wireGuardPeerGetPersistentKeepalive Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> WireGuardPeer

self: the WireGuardPeer instance

-> m Word16

Returns: get the persistent-keepalive setting in seconds. Set to zero to disable keep-alive.

No description available in the introspection data.

Since: 1.16

getPresharedKey

wireGuardPeerGetPresharedKey Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> WireGuardPeer

self: the WireGuardPeer instance

-> m Text

Returns: the preshared key or Nothing if unset.

No description available in the introspection data.

Since: 1.16

getPresharedKeyFlags

wireGuardPeerGetPresharedKeyFlags Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> WireGuardPeer

self: the WireGuardPeer instance

-> m [SettingSecretFlags]

Returns: get the secret flags for the preshared-key.

No description available in the introspection data.

Since: 1.16

getPublicKey

wireGuardPeerGetPublicKey Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> WireGuardPeer

self: the WireGuardPeer instance

-> m Text

Returns: the public key or Nothing if unset.

No description available in the introspection data.

Since: 1.16

isSealed

wireGuardPeerIsSealed Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> WireGuardPeer

self: the WireGuardPeer instance

-> m Bool

Returns: whether self is sealed or not.

No description available in the introspection data.

Since: 1.16

isValid

wireGuardPeerIsValid Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> WireGuardPeer

self: the WireGuardPeer instance

-> Bool

checkNonSecrets: if True, secret properties are validated. Otherwise, they are ignored for this purpose.

-> Bool

checkSecrets: if True, non-secret properties are validated. Otherwise, they are ignored for this purpose.

-> m ()

(Can throw GError)

No description available in the introspection data.

Since: 1.16

new

wireGuardPeerNew Source #

Arguments

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

Returns: a new, default, unsealed WireGuardPeer instance.

No description available in the introspection data.

Since: 1.16

newClone

wireGuardPeerNewClone Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> WireGuardPeer

self: the WireGuardPeer instance to copy.

-> Bool

withSecrets: if True, the preshared-key secrets are copied as well. Otherwise, they will be removed.

-> m WireGuardPeer

Returns: a clone of self. This instance is always unsealed.

No description available in the introspection data.

Since: 1.16

ref

wireGuardPeerRef Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe WireGuardPeer

self: the WireGuardPeer instance

-> m WireGuardPeer

Returns: returns the input argument self after incrementing the reference count.

Since 1.42, ref-counting of WireGuardPeer is thread-safe.

No description available in the introspection data.

Since: 1.16

removeAllowedIp

wireGuardPeerRemoveAllowedIp Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> WireGuardPeer

self: the unsealed WireGuardPeer instance

-> Word32

idx: the index from zero to (allowed-ips-len - 1) to retrieve. If the index is out of range, False is returned and nothing is done.

-> m Bool

Returns: True if idx was valid and the allowed-ip was removed. False otherwise, and the peer will not be changed.

Removes the allowed-ip at the given idx. This shifts all following entries one index down.

It is a bug trying to modify a sealed WireGuardPeer instance.

Since: 1.16

seal

wireGuardPeerSeal Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> WireGuardPeer

self: the WireGuardPeer instance

-> m () 

Seal the WireGuardPeer instance. Afterwards, it is a bug to call all functions that modify the instance (except ref/unref). A sealed instance cannot be unsealed again, but you can create an unsealed copy with wireGuardPeerNewClone.

Since: 1.16

setEndpoint

wireGuardPeerSetEndpoint Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> WireGuardPeer

self: the unsealed WireGuardPeer instance

-> Text

endpoint: the socket address endpoint to set or Nothing.

-> Bool

allowInvalid: if True, also invalid values are set. If False, the function does nothing for invalid endpoint arguments.

-> m Bool

Returns: True if the endpoint is Nothing or valid. For an invalid endpoint argument, False is returned. Depending on allowInvalid, the instance will be modified.

Sets or clears the endpoint of self.

It is a bug trying to modify a sealed WireGuardPeer instance.

Since: 1.16

setPersistentKeepalive

wireGuardPeerSetPersistentKeepalive Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> WireGuardPeer

self: the unsealed WireGuardPeer instance

-> Word16

persistentKeepalive: the keep-alive value to set.

-> m () 

It is a bug trying to modify a sealed WireGuardPeer instance.

Since: 1.16

setPresharedKey

wireGuardPeerSetPresharedKey Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> WireGuardPeer

self: the unsealed WireGuardPeer instance

-> Maybe Text

presharedKey: the new preshared key or Nothing to clear the preshared key.

-> Bool

acceptInvalid: whether to allow setting the key to an invalid value. If False, self is unchanged if the key is invalid and if False is returned.

-> m Bool

Returns: True if the preshared-key is valid, otherwise False. Nothing is considered a valid value. If the key is invalid, it depends on acceptInvalid whether the previous value was reset.

Reset the preshared key. Note that if the preshared key is valid, it will be normalized (which may or may not modify the set value).

Note that the preshared-key is a secret and consequently has corresponding preshared-key-flags property. This is so that secrets can be optional and requested on demand from a secret-agent. Also, an invalid preshared-key may optionally cause wireGuardPeerIsValid to fail or it may be accepted.

It is a bug trying to modify a sealed WireGuardPeer instance.

Since: 1.16

setPresharedKeyFlags

wireGuardPeerSetPresharedKeyFlags Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> WireGuardPeer

self: the unsealed WireGuardPeer instance

-> [SettingSecretFlags]

presharedKeyFlags: the secret flags to set.

-> m () 

It is a bug trying to modify a sealed WireGuardPeer instance.

Since: 1.16

setPublicKey

wireGuardPeerSetPublicKey Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> WireGuardPeer

self: the unsealed WireGuardPeer instance

-> Maybe Text

publicKey: the new public key or Nothing to clear the public key.

-> Bool

acceptInvalid: if True and publicKey is not Nothing and invalid, then do not modify the instance.

-> m Bool

Returns: True if the key was valid or Nothing. Returns False for invalid keys. Depending on acceptInvalid will an invalid key be set or not.

Reset the public key. Note that if the public key is valid, it will be normalized (which may or may not modify the set value).

It is a bug trying to modify a sealed WireGuardPeer instance.

Since: 1.16

unref

wireGuardPeerUnref Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe WireGuardPeer

self: the WireGuardPeer instance

-> m () 

Drop a reference to self. If the last reference is dropped, the instance is freed and all associate data released.

Since 1.42, ref-counting of WireGuardPeer is thread-safe.

Since: 1.16