Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
GI.NM.Objects.SettingWireGuard
Contents
Description
WireGuard Settings
Since: 1.16
Synopsis
- newtype SettingWireGuard = SettingWireGuard (ManagedPtr SettingWireGuard)
- class (GObject o, IsDescendantOf SettingWireGuard o) => IsSettingWireGuard o
- toSettingWireGuard :: (MonadIO m, IsSettingWireGuard o) => o -> m SettingWireGuard
- settingWireGuardAppendPeer :: (HasCallStack, MonadIO m, IsSettingWireGuard a) => a -> WireGuardPeer -> m ()
- settingWireGuardClearPeers :: (HasCallStack, MonadIO m, IsSettingWireGuard a) => a -> m Word32
- settingWireGuardGetFwmark :: (HasCallStack, MonadIO m, IsSettingWireGuard a) => a -> m Word32
- settingWireGuardGetIp4AutoDefaultRoute :: (HasCallStack, MonadIO m, IsSettingWireGuard a) => a -> m Ternary
- settingWireGuardGetIp6AutoDefaultRoute :: (HasCallStack, MonadIO m, IsSettingWireGuard a) => a -> m Ternary
- settingWireGuardGetListenPort :: (HasCallStack, MonadIO m, IsSettingWireGuard a) => a -> m Word16
- settingWireGuardGetMtu :: (HasCallStack, MonadIO m, IsSettingWireGuard a) => a -> m Word32
- settingWireGuardGetPeer :: (HasCallStack, MonadIO m, IsSettingWireGuard a) => a -> Word32 -> m WireGuardPeer
- settingWireGuardGetPeerByPublicKey :: (HasCallStack, MonadIO m, IsSettingWireGuard a) => a -> Text -> m (Maybe WireGuardPeer, Word32)
- settingWireGuardGetPeerRoutes :: (HasCallStack, MonadIO m, IsSettingWireGuard a) => a -> m Bool
- settingWireGuardGetPeersLen :: (HasCallStack, MonadIO m, IsSettingWireGuard a) => a -> m Word32
- settingWireGuardGetPrivateKey :: (HasCallStack, MonadIO m, IsSettingWireGuard a) => a -> m Text
- settingWireGuardGetPrivateKeyFlags :: (HasCallStack, MonadIO m, IsSettingWireGuard a) => a -> m [SettingSecretFlags]
- settingWireGuardNew :: (HasCallStack, MonadIO m) => m SettingWireGuard
- settingWireGuardRemovePeer :: (HasCallStack, MonadIO m, IsSettingWireGuard a) => a -> Word32 -> m Bool
- settingWireGuardSetPeer :: (HasCallStack, MonadIO m, IsSettingWireGuard a) => a -> WireGuardPeer -> Word32 -> m ()
- constructSettingWireGuardFwmark :: (IsSettingWireGuard o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getSettingWireGuardFwmark :: (MonadIO m, IsSettingWireGuard o) => o -> m Word32
- setSettingWireGuardFwmark :: (MonadIO m, IsSettingWireGuard o) => o -> Word32 -> m ()
- constructSettingWireGuardIp4AutoDefaultRoute :: (IsSettingWireGuard o, MonadIO m) => Ternary -> m (GValueConstruct o)
- getSettingWireGuardIp4AutoDefaultRoute :: (MonadIO m, IsSettingWireGuard o) => o -> m Ternary
- setSettingWireGuardIp4AutoDefaultRoute :: (MonadIO m, IsSettingWireGuard o) => o -> Ternary -> m ()
- constructSettingWireGuardIp6AutoDefaultRoute :: (IsSettingWireGuard o, MonadIO m) => Ternary -> m (GValueConstruct o)
- getSettingWireGuardIp6AutoDefaultRoute :: (MonadIO m, IsSettingWireGuard o) => o -> m Ternary
- setSettingWireGuardIp6AutoDefaultRoute :: (MonadIO m, IsSettingWireGuard o) => o -> Ternary -> m ()
- constructSettingWireGuardListenPort :: (IsSettingWireGuard o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getSettingWireGuardListenPort :: (MonadIO m, IsSettingWireGuard o) => o -> m Word32
- setSettingWireGuardListenPort :: (MonadIO m, IsSettingWireGuard o) => o -> Word32 -> m ()
- constructSettingWireGuardMtu :: (IsSettingWireGuard o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getSettingWireGuardMtu :: (MonadIO m, IsSettingWireGuard o) => o -> m Word32
- setSettingWireGuardMtu :: (MonadIO m, IsSettingWireGuard o) => o -> Word32 -> m ()
- constructSettingWireGuardPeerRoutes :: (IsSettingWireGuard o, MonadIO m) => Bool -> m (GValueConstruct o)
- getSettingWireGuardPeerRoutes :: (MonadIO m, IsSettingWireGuard o) => o -> m Bool
- setSettingWireGuardPeerRoutes :: (MonadIO m, IsSettingWireGuard o) => o -> Bool -> m ()
- clearSettingWireGuardPrivateKey :: (MonadIO m, IsSettingWireGuard o) => o -> m ()
- constructSettingWireGuardPrivateKey :: (IsSettingWireGuard o, MonadIO m) => Text -> m (GValueConstruct o)
- getSettingWireGuardPrivateKey :: (MonadIO m, IsSettingWireGuard o) => o -> m Text
- setSettingWireGuardPrivateKey :: (MonadIO m, IsSettingWireGuard o) => o -> Text -> m ()
- constructSettingWireGuardPrivateKeyFlags :: (IsSettingWireGuard o, MonadIO m) => [SettingSecretFlags] -> m (GValueConstruct o)
- getSettingWireGuardPrivateKeyFlags :: (MonadIO m, IsSettingWireGuard o) => o -> m [SettingSecretFlags]
- setSettingWireGuardPrivateKeyFlags :: (MonadIO m, IsSettingWireGuard o) => o -> [SettingSecretFlags] -> m ()
Exported types
newtype SettingWireGuard Source #
Memory-managed wrapper type.
Constructors
SettingWireGuard (ManagedPtr SettingWireGuard) |
Instances
Eq SettingWireGuard Source # | |
Defined in GI.NM.Objects.SettingWireGuard Methods (==) :: SettingWireGuard -> SettingWireGuard -> Bool # (/=) :: SettingWireGuard -> SettingWireGuard -> Bool # | |
GObject SettingWireGuard Source # | |
Defined in GI.NM.Objects.SettingWireGuard | |
ManagedPtrNewtype SettingWireGuard Source # | |
Defined in GI.NM.Objects.SettingWireGuard Methods toManagedPtr :: SettingWireGuard -> ManagedPtr SettingWireGuard # | |
TypedObject SettingWireGuard Source # | |
Defined in GI.NM.Objects.SettingWireGuard | |
HasParentTypes SettingWireGuard Source # | |
Defined in GI.NM.Objects.SettingWireGuard | |
IsGValue (Maybe SettingWireGuard) Source # | Convert |
Defined in GI.NM.Objects.SettingWireGuard Methods gvalueGType_ :: IO GType # gvalueSet_ :: Ptr GValue -> Maybe SettingWireGuard -> IO () # gvalueGet_ :: Ptr GValue -> IO (Maybe SettingWireGuard) # | |
type ParentTypes SettingWireGuard Source # | |
Defined in GI.NM.Objects.SettingWireGuard |
class (GObject o, IsDescendantOf SettingWireGuard o) => IsSettingWireGuard o Source #
Type class for types which can be safely cast to SettingWireGuard
, for instance with toSettingWireGuard
.
Instances
(GObject o, IsDescendantOf SettingWireGuard o) => IsSettingWireGuard o Source # | |
Defined in GI.NM.Objects.SettingWireGuard |
toSettingWireGuard :: (MonadIO m, IsSettingWireGuard o) => o -> m SettingWireGuard Source #
Cast to SettingWireGuard
, 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
appendPeer, bindProperty, bindPropertyFull, clearPeers, compare, diff, duplicate, enumerateValues, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, optionClearByName, optionGet, optionGetAllNames, optionGetBoolean, optionGetUint32, optionSet, optionSetBoolean, optionSetUint32, ref, refSink, removePeer, runDispose, stealData, stealQdata, thawNotify, toString, unref, verify, verifySecrets, watchClosure.
Getters
getData, getDbusPropertyType, getFwmark, getIp4AutoDefaultRoute, getIp6AutoDefaultRoute, getListenPort, getMtu, getName, getPeer, getPeerByPublicKey, getPeerRoutes, getPeersLen, getPrivateKey, getPrivateKeyFlags, getProperty, getQdata, getSecretFlags.
Setters
appendPeer
settingWireGuardAppendPeer Source #
Arguments
:: (HasCallStack, MonadIO m, IsSettingWireGuard a) | |
=> a |
|
-> WireGuardPeer |
|
-> m () |
If a peer with the same public-key already exists, that
one is replaced by peer
. The new peer
is always appended
(or moved to) the end, so in case a peer is replaced, the
indexes are shifted and the number of peers stays unchanged.
Since: 1.16
clearPeers
settingWireGuardClearPeers Source #
Arguments
:: (HasCallStack, MonadIO m, IsSettingWireGuard a) | |
=> a |
|
-> m Word32 | Returns: the number of cleared peers. |
No description available in the introspection data.
Since: 1.16
getFwmark
settingWireGuardGetFwmark Source #
Arguments
:: (HasCallStack, MonadIO m, IsSettingWireGuard a) | |
=> a |
|
-> m Word32 | Returns: the set firewall mark. |
No description available in the introspection data.
Since: 1.16
getIp4AutoDefaultRoute
settingWireGuardGetIp4AutoDefaultRoute Source #
Arguments
:: (HasCallStack, MonadIO m, IsSettingWireGuard a) | |
=> a |
|
-> m Ternary | Returns: the "ip4-auto-default-route" property of the setting. |
No description available in the introspection data.
Since: 1.20
getIp6AutoDefaultRoute
settingWireGuardGetIp6AutoDefaultRoute Source #
Arguments
:: (HasCallStack, MonadIO m, IsSettingWireGuard a) | |
=> a |
|
-> m Ternary | Returns: the "ip6-auto-default-route" property of the setting. |
No description available in the introspection data.
Since: 1.20
getListenPort
settingWireGuardGetListenPort Source #
Arguments
:: (HasCallStack, MonadIO m, IsSettingWireGuard a) | |
=> a |
|
-> m Word16 | Returns: the set UDP listen port. |
No description available in the introspection data.
Since: 1.16
getMtu
settingWireGuardGetMtu Source #
Arguments
:: (HasCallStack, MonadIO m, IsSettingWireGuard a) | |
=> a |
|
-> m Word32 | Returns: the MTU of the setting. |
No description available in the introspection data.
Since: 1.16
getPeer
settingWireGuardGetPeer Source #
Arguments
:: (HasCallStack, MonadIO m, IsSettingWireGuard a) | |
=> a |
|
-> Word32 |
|
-> m WireGuardPeer | Returns: the |
No description available in the introspection data.
Since: 1.16
getPeerByPublicKey
settingWireGuardGetPeerByPublicKey Source #
Arguments
:: (HasCallStack, MonadIO m, IsSettingWireGuard a) | |
=> a |
|
-> Text |
|
-> m (Maybe WireGuardPeer, Word32) | Returns: the |
No description available in the introspection data.
Since: 1.16
getPeerRoutes
settingWireGuardGetPeerRoutes Source #
Arguments
:: (HasCallStack, MonadIO m, IsSettingWireGuard a) | |
=> a |
|
-> m Bool | Returns: whether automatically add peer routes. |
No description available in the introspection data.
Since: 1.16
getPeersLen
settingWireGuardGetPeersLen Source #
Arguments
:: (HasCallStack, MonadIO m, IsSettingWireGuard a) | |
=> a |
|
-> m Word32 | Returns: the number of registered peers. |
No description available in the introspection data.
Since: 1.16
getPrivateKey
settingWireGuardGetPrivateKey Source #
Arguments
:: (HasCallStack, MonadIO m, IsSettingWireGuard a) | |
=> a |
|
-> m Text | Returns: the set private-key or |
No description available in the introspection data.
Since: 1.16
getPrivateKeyFlags
settingWireGuardGetPrivateKeyFlags Source #
Arguments
:: (HasCallStack, MonadIO m, IsSettingWireGuard a) | |
=> a |
|
-> m [SettingSecretFlags] | Returns: the secret-flags for SettingWireGuard:privateKey. |
No description available in the introspection data.
Since: 1.16
new
Arguments
:: (HasCallStack, MonadIO m) | |
=> m SettingWireGuard | Returns: the new empty |
Creates a new SettingWireGuard
object with default values.
Since: 1.16
removePeer
settingWireGuardRemovePeer Source #
Arguments
:: (HasCallStack, MonadIO m, IsSettingWireGuard a) | |
=> a |
|
-> Word32 |
|
-> m Bool | Returns: |
No description available in the introspection data.
Since: 1.16
setPeer
settingWireGuardSetPeer Source #
Arguments
:: (HasCallStack, MonadIO m, IsSettingWireGuard a) | |
=> a |
|
-> WireGuardPeer |
|
-> Word32 |
|
-> m () |
If idx
is one past the last peer, the behavior is the same
as settingWireGuardAppendPeer
.
Otherwise, the peer will be at idx
and replace the peer
instance at that index. Note that if a peer with the same
public-key exists on another index, then that peer will also
be replaced. In that case, the number of peers will shrink
by one (because the one at idx
got replace and then one
with the same public-key got removed). This also means,
that the resulting index afterwards may be one less than
idx
(if another peer with a lower index was dropped).
Since: 1.16
Properties
fwmark
The use of fwmark is optional and is by default off. Setting it to 0 disables it. Otherwise, it is a 32-bit fwmark for outgoing packets.
Note that "ip4-auto-default-route" or "ip6-auto-default-route" enabled, implies to automatically choose a fwmark.
Since: 1.16
constructSettingWireGuardFwmark :: (IsSettingWireGuard o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “fwmark
” property. This is rarely needed directly, but it is used by new
.
getSettingWireGuardFwmark :: (MonadIO m, IsSettingWireGuard o) => o -> m Word32 Source #
Get the value of the “fwmark
” property.
When overloading is enabled, this is equivalent to
get
settingWireGuard #fwmark
setSettingWireGuardFwmark :: (MonadIO m, IsSettingWireGuard o) => o -> Word32 -> m () Source #
Set the value of the “fwmark
” property.
When overloading is enabled, this is equivalent to
set
settingWireGuard [ #fwmark:=
value ]
ip4AutoDefaultRoute
Whether to enable special handling of the IPv4 default route. If enabled, the IPv4 default route from wireguard.peer-routes will be placed to a dedicated routing-table and two policy routing rules will be added. The fwmark number is also used as routing-table for the default-route, and if fwmark is zero, an unused fwmark/table is chosen automatically. This corresponds to what wg-quick does with Table=auto and what WireGuard calls "Improved Rule-based Routing".
Note that for this automatism to work, you usually don't want to set ipv4.gateway, because that will result in a conflicting default route.
Leaving this at the default will enable this option automatically if ipv4.never-default is not set and there are any peers that use a default-route as allowed-ips. Since this automatism only makes sense if you also have a peer with an /0 allowed-ips, it is usually not necessary to enable this explicitly. However, you can disable it if you want to configure your own routing and rules.
Since: 1.20
constructSettingWireGuardIp4AutoDefaultRoute :: (IsSettingWireGuard o, MonadIO m) => Ternary -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “ip4-auto-default-route
” property. This is rarely needed directly, but it is used by new
.
getSettingWireGuardIp4AutoDefaultRoute :: (MonadIO m, IsSettingWireGuard o) => o -> m Ternary Source #
Get the value of the “ip4-auto-default-route
” property.
When overloading is enabled, this is equivalent to
get
settingWireGuard #ip4AutoDefaultRoute
setSettingWireGuardIp4AutoDefaultRoute :: (MonadIO m, IsSettingWireGuard o) => o -> Ternary -> m () Source #
Set the value of the “ip4-auto-default-route
” property.
When overloading is enabled, this is equivalent to
set
settingWireGuard [ #ip4AutoDefaultRoute:=
value ]
ip6AutoDefaultRoute
Like ip4-auto-default-route, but for the IPv6 default route.
Since: 1.20
constructSettingWireGuardIp6AutoDefaultRoute :: (IsSettingWireGuard o, MonadIO m) => Ternary -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “ip6-auto-default-route
” property. This is rarely needed directly, but it is used by new
.
getSettingWireGuardIp6AutoDefaultRoute :: (MonadIO m, IsSettingWireGuard o) => o -> m Ternary Source #
Get the value of the “ip6-auto-default-route
” property.
When overloading is enabled, this is equivalent to
get
settingWireGuard #ip6AutoDefaultRoute
setSettingWireGuardIp6AutoDefaultRoute :: (MonadIO m, IsSettingWireGuard o) => o -> Ternary -> m () Source #
Set the value of the “ip6-auto-default-route
” property.
When overloading is enabled, this is equivalent to
set
settingWireGuard [ #ip6AutoDefaultRoute:=
value ]
listenPort
The listen-port. If listen-port is not specified, the port will be chosen randomly when the interface comes up.
Since: 1.16
constructSettingWireGuardListenPort :: (IsSettingWireGuard o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “listen-port
” property. This is rarely needed directly, but it is used by new
.
getSettingWireGuardListenPort :: (MonadIO m, IsSettingWireGuard o) => o -> m Word32 Source #
Get the value of the “listen-port
” property.
When overloading is enabled, this is equivalent to
get
settingWireGuard #listenPort
setSettingWireGuardListenPort :: (MonadIO m, IsSettingWireGuard o) => o -> Word32 -> m () Source #
Set the value of the “listen-port
” property.
When overloading is enabled, this is equivalent to
set
settingWireGuard [ #listenPort:=
value ]
mtu
If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple fragments.
If zero a default MTU is used. Note that contrary to wg-quick's MTU setting, this does not take into account the current routes at the time of activation.
Since: 1.16
constructSettingWireGuardMtu :: (IsSettingWireGuard o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “mtu
” property. This is rarely needed directly, but it is used by new
.
getSettingWireGuardMtu :: (MonadIO m, IsSettingWireGuard o) => o -> m Word32 Source #
Get the value of the “mtu
” property.
When overloading is enabled, this is equivalent to
get
settingWireGuard #mtu
setSettingWireGuardMtu :: (MonadIO m, IsSettingWireGuard o) => o -> Word32 -> m () Source #
Set the value of the “mtu
” property.
When overloading is enabled, this is equivalent to
set
settingWireGuard [ #mtu:=
value ]
peerRoutes
Whether to automatically add routes for the AllowedIPs ranges
of the peers. If True
(the default), NetworkManager will automatically
add routes in the routing tables according to ipv4.route-table and
ipv6.route-table. Usually you want this automatism enabled.
If False
, no such routes are added automatically. In this case, the
user may want to configure static routes in ipv4.routes and ipv6.routes,
respectively.
Note that if the peer's AllowedIPs is "0.0.0.0/0" or "::/0" and the profile's ipv4.never-default or ipv6.never-default setting is enabled, the peer route for this peer won't be added automatically.
Since: 1.16
constructSettingWireGuardPeerRoutes :: (IsSettingWireGuard o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “peer-routes
” property. This is rarely needed directly, but it is used by new
.
getSettingWireGuardPeerRoutes :: (MonadIO m, IsSettingWireGuard o) => o -> m Bool Source #
Get the value of the “peer-routes
” property.
When overloading is enabled, this is equivalent to
get
settingWireGuard #peerRoutes
setSettingWireGuardPeerRoutes :: (MonadIO m, IsSettingWireGuard o) => o -> Bool -> m () Source #
Set the value of the “peer-routes
” property.
When overloading is enabled, this is equivalent to
set
settingWireGuard [ #peerRoutes:=
value ]
privateKey
The 256 bit private-key in base64 encoding.
Since: 1.16
clearSettingWireGuardPrivateKey :: (MonadIO m, IsSettingWireGuard o) => o -> m () Source #
Set the value of the “private-key
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#privateKey
constructSettingWireGuardPrivateKey :: (IsSettingWireGuard o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “private-key
” property. This is rarely needed directly, but it is used by new
.
getSettingWireGuardPrivateKey :: (MonadIO m, IsSettingWireGuard o) => o -> m Text Source #
Get the value of the “private-key
” property.
When overloading is enabled, this is equivalent to
get
settingWireGuard #privateKey
setSettingWireGuardPrivateKey :: (MonadIO m, IsSettingWireGuard o) => o -> Text -> m () Source #
Set the value of the “private-key
” property.
When overloading is enabled, this is equivalent to
set
settingWireGuard [ #privateKey:=
value ]
privateKeyFlags
Flags indicating how to handle the SettingWirelessSecurity
:private-key
property.
Since: 1.16
constructSettingWireGuardPrivateKeyFlags :: (IsSettingWireGuard o, MonadIO m) => [SettingSecretFlags] -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “private-key-flags
” property. This is rarely needed directly, but it is used by new
.
getSettingWireGuardPrivateKeyFlags :: (MonadIO m, IsSettingWireGuard o) => o -> m [SettingSecretFlags] Source #
Get the value of the “private-key-flags
” property.
When overloading is enabled, this is equivalent to
get
settingWireGuard #privateKeyFlags
setSettingWireGuardPrivateKeyFlags :: (MonadIO m, IsSettingWireGuard o) => o -> [SettingSecretFlags] -> m () Source #
Set the value of the “private-key-flags
” property.
When overloading is enabled, this is equivalent to
set
settingWireGuard [ #privateKeyFlags:=
value ]