NMSettingWireGuard: libnm Reference Manual

## NMSettingWireGuard

NMSettingWireGuard

## Functions

NMWireGuardPeer * | nm_wireguard_peer_new ()
NMWireGuardPeer * | nm_wireguard_peer_new_clone ()
NMWireGuardPeer * | nm_wireguard_peer_ref ()
void | nm_wireguard_peer_unref ()
void | nm_wireguard_peer_seal ()
gboolean | nm_wireguard_peer_is_sealed ()
const char * | nm_wireguard_peer_get_public_key ()
gboolean | nm_wireguard_peer_set_public_key ()
const char * | nm_wireguard_peer_get_preshared_key ()
gboolean | nm_wireguard_peer_set_preshared_key ()
NMSettingSecretFlags | nm_wireguard_peer_get_preshared_key_flags ()
void | nm_wireguard_peer_set_preshared_key_flags ()
guint16 | nm_wireguard_peer_get_persistent_keepalive ()
void | nm_wireguard_peer_set_persistent_keepalive ()
const char * | nm_wireguard_peer_get_endpoint ()
gboolean | nm_wireguard_peer_set_endpoint ()
guint | nm_wireguard_peer_get_allowed_ips_len ()
const char * | nm_wireguard_peer_get_allowed_ip ()
void | nm_wireguard_peer_clear_allowed_ips ()
gboolean | nm_wireguard_peer_append_allowed_ip ()
gboolean | nm_wireguard_peer_remove_allowed_ip ()
gboolean | nm_wireguard_peer_is_valid ()
int | nm_wireguard_peer_cmp ()
NMSetting * | nm_setting_wireguard_new ()
const char * | nm_setting_wireguard_get_private_key ()
NMSettingSecretFlags | nm_setting_wireguard_get_private_key_flags ()
guint16 | nm_setting_wireguard_get_listen_port ()
guint32 | nm_setting_wireguard_get_fwmark ()
guint | nm_setting_wireguard_get_peers_len ()
NMWireGuardPeer * | nm_setting_wireguard_get_peer ()
NMWireGuardPeer * | nm_setting_wireguard_get_peer_by_public_key ()
void | nm_setting_wireguard_set_peer ()
void | nm_setting_wireguard_append_peer ()
gboolean | nm_setting_wireguard_remove_peer ()
guint | nm_setting_wireguard_clear_peers ()
gboolean | nm_setting_wireguard_get_peer_routes ()
guint32 | nm_setting_wireguard_get_mtu ()
NMTernary | nm_setting_wireguard_get_ip4_auto_default_route ()
NMTernary | nm_setting_wireguard_get_ip6_auto_default_route ()

## Types and Values

#define | NM_WIREGUARD_PUBLIC_KEY_LEN
#define | NM_WIREGUARD_SYMMETRIC_KEY_LEN
#define | NM_SETTING_WIREGUARD_SETTING_NAME
#define | NM_SETTING_WIREGUARD_FWMARK
#define | NM_SETTING_WIREGUARD_LISTEN_PORT
#define | NM_SETTING_WIREGUARD_PRIVATE_KEY
#define | NM_SETTING_WIREGUARD_PRIVATE_KEY_FLAGS
#define | NM_SETTING_WIREGUARD_PEERS
#define | NM_SETTING_WIREGUARD_MTU
#define | NM_SETTING_WIREGUARD_PEER_ROUTES
#define | NM_SETTING_WIREGUARD_IP4_AUTO_DEFAULT_ROUTE
#define | NM_SETTING_WIREGUARD_IP6_AUTO_DEFAULT_ROUTE
#define | NM_WIREGUARD_PEER_ATTR_ALLOWED_IPS
#define | NM_WIREGUARD_PEER_ATTR_ENDPOINT
#define | NM_WIREGUARD_PEER_ATTR_PERSISTENT_KEEPALIVE
#define | NM_WIREGUARD_PEER_ATTR_PRESHARED_KEY
#define | NM_WIREGUARD_PEER_ATTR_PRESHARED_KEY_FLAGS
#define | NM_WIREGUARD_PEER_ATTR_PUBLIC_KEY

## Object Hierarchy

        GBoxed
        ╰── NMWireGuardPeer

## Description

## Functions

### nm_wireguard_peer_new ()

    NMWireGuardPeer *
    nm_wireguard_peer_new (void);

### nm_wireguard_peer_new_clone ()

    NMWireGuardPeer *
    nm_wireguard_peer_new_clone (const NMWireGuardPeer *self,
                                 gboolean with_secrets);

### nm_wireguard_peer_ref ()

    NMWireGuardPeer *
    nm_wireguard_peer_ref (NMWireGuardPeer *self);

### nm_wireguard_peer_unref ()

    void
    nm_wireguard_peer_unref (NMWireGuardPeer *self);

### nm_wireguard_peer_seal ()

    void
    nm_wireguard_peer_seal (NMWireGuardPeer *self);

### nm_wireguard_peer_is_sealed ()

    gboolean
    nm_wireguard_peer_is_sealed (const NMWireGuardPeer *self);

### nm_wireguard_peer_get_public_key ()

    const char *
    nm_wireguard_peer_get_public_key (const NMWireGuardPeer *self);

### nm_wireguard_peer_set_public_key ()

    gboolean
    nm_wireguard_peer_set_public_key (NMWireGuardPeer *self,
                                      const char *public_key,
                                      gboolean accept_invalid);

### nm_wireguard_peer_get_preshared_key ()

    const char *
    nm_wireguard_peer_get_preshared_key (const NMWireGuardPeer *self);

### nm_wireguard_peer_set_preshared_key ()

    gboolean
    nm_wireguard_peer_set_preshared_key (NMWireGuardPeer *self,
                                         const char *preshared_key,
                                         gboolean accept_invalid);

### nm_wireguard_peer_get_preshared_key_flags ()

    NMSettingSecretFlags
    nm_wireguard_peer_get_preshared_key_flags
                                   (const NMWireGuardPeer *self);

### nm_wireguard_peer_set_preshared_key_flags ()

    void
    nm_wireguard_peer_set_preshared_key_flags
                                   (NMWireGuardPeer *self,
                                    NMSettingSecretFlags preshared_key_flags);

### nm_wireguard_peer_get_persistent_keepalive ()

    guint16
    nm_wireguard_peer_get_persistent_keepalive
                                   (const NMWireGuardPeer *self);

### nm_wireguard_peer_set_persistent_keepalive ()

    void
    nm_wireguard_peer_set_persistent_keepalive
                                   (NMWireGuardPeer *self,
                                    guint16 persistent_keepalive);

### nm_wireguard_peer_get_endpoint ()

    const char *
    nm_wireguard_peer_get_endpoint (const NMWireGuardPeer *self);

### nm_wireguard_peer_set_endpoint ()

    gboolean
    nm_wireguard_peer_set_endpoint (NMWireGuardPeer *self,
                                    const char *endpoint,
                                    gboolean allow_invalid);

### nm_wireguard_peer_get_allowed_ips_len ()

    guint
    nm_wireguard_peer_get_allowed_ips_len (const NMWireGuardPeer *self);

### nm_wireguard_peer_get_allowed_ip ()

    const char *
    nm_wireguard_peer_get_allowed_ip (const NMWireGuardPeer *self,
                                      guint idx,
                                      gboolean *out_is_valid);

### nm_wireguard_peer_clear_allowed_ips ()

    void
    nm_wireguard_peer_clear_allowed_ips (NMWireGuardPeer *self);

### nm_wireguard_peer_append_allowed_ip ()

    gboolean
    nm_wireguard_peer_append_allowed_ip (NMWireGuardPeer *self,
                                         const char *allowed_ip,
                                         gboolean accept_invalid);

### nm_wireguard_peer_remove_allowed_ip ()

    gboolean
    nm_wireguard_peer_remove_allowed_ip (NMWireGuardPeer *self,
                                         guint idx);

### nm_wireguard_peer_is_valid ()

    gboolean
    nm_wireguard_peer_is_valid (const NMWireGuardPeer *self,
                                gboolean check_non_secrets,
                                gboolean check_secrets,
                                GError **error);

### nm_wireguard_peer_cmp ()

    int
    nm_wireguard_peer_cmp (const NMWireGuardPeer *a,
                           const NMWireGuardPeer *b,
                           NMSettingCompareFlags compare_flags);

### nm_setting_wireguard_new ()

    NMSetting *
    nm_setting_wireguard_new (void);

### nm_setting_wireguard_get_private_key ()

    const char *
    nm_setting_wireguard_get_private_key (NMSettingWireGuard *self);

### nm_setting_wireguard_get_private_key_flags ()

    NMSettingSecretFlags
    nm_setting_wireguard_get_private_key_flags
                                   (NMSettingWireGuard *self);

### nm_setting_wireguard_get_listen_port ()

    guint16
    nm_setting_wireguard_get_listen_port (NMSettingWireGuard *self);

### nm_setting_wireguard_get_fwmark ()

    guint32
    nm_setting_wireguard_get_fwmark (NMSettingWireGuard *self);

### nm_setting_wireguard_get_peers_len ()

    guint
    nm_setting_wireguard_get_peers_len (NMSettingWireGuard *self);

### nm_setting_wireguard_get_peer ()

    NMWireGuardPeer *
    nm_setting_wireguard_get_peer (NMSettingWireGuard *self,
                                   guint idx);

### nm_setting_wireguard_get_peer_by_public_key ()

    NMWireGuardPeer *
    nm_setting_wireguard_get_peer_by_public_key
                                   (NMSettingWireGuard *self,
                                    const char *public_key,
                                    guint *out_idx);

### nm_setting_wireguard_set_peer ()

    void
    nm_setting_wireguard_set_peer (NMSettingWireGuard *self,
                                   NMWireGuardPeer *peer,
                                   guint idx);

### nm_setting_wireguard_append_peer ()

    void
    nm_setting_wireguard_append_peer (NMSettingWireGuard *self,
                                      NMWireGuardPeer *peer);

### nm_setting_wireguard_remove_peer ()

    gboolean
    nm_setting_wireguard_remove_peer (NMSettingWireGuard *self,
                                      guint idx);

### nm_setting_wireguard_clear_peers ()

    guint
    nm_setting_wireguard_clear_peers (NMSettingWireGuard *self);

### nm_setting_wireguard_get_peer_routes ()

    gboolean
    nm_setting_wireguard_get_peer_routes (NMSettingWireGuard *self);

### nm_setting_wireguard_get_mtu ()

    guint32
    nm_setting_wireguard_get_mtu (NMSettingWireGuard *self);

### nm_setting_wireguard_get_ip4_auto_default_route ()

    NMTernary
    nm_setting_wireguard_get_ip4_auto_default_route
                                   (NMSettingWireGuard *self);

### nm_setting_wireguard_get_ip6_auto_default_route ()

    NMTernary
    nm_setting_wireguard_get_ip6_auto_default_route
                                   (NMSettingWireGuard *self);

## Types and Values

### NM_WIREGUARD_PUBLIC_KEY_LEN

    #define NM_WIREGUARD_PUBLIC_KEY_LEN    32

### NM_WIREGUARD_SYMMETRIC_KEY_LEN

    #define NM_WIREGUARD_SYMMETRIC_KEY_LEN 32

### NM_SETTING_WIREGUARD_SETTING_NAME

    #define NM_SETTING_WIREGUARD_SETTING_NAME "wireguard"

### NM_SETTING_WIREGUARD_FWMARK

    #define NM_SETTING_WIREGUARD_FWMARK            "fwmark"

### NM_SETTING_WIREGUARD_LISTEN_PORT

    #define NM_SETTING_WIREGUARD_LISTEN_PORT       "listen-port"

### NM_SETTING_WIREGUARD_PRIVATE_KEY

    #define NM_SETTING_WIREGUARD_PRIVATE_KEY       "private-key"

### NM_SETTING_WIREGUARD_PRIVATE_KEY_FLAGS

    #define NM_SETTING_WIREGUARD_PRIVATE_KEY_FLAGS "private-key-flags"

### NM_SETTING_WIREGUARD_PEERS

    #define NM_SETTING_WIREGUARD_PEERS "peers"

### NM_SETTING_WIREGUARD_MTU

    #define NM_SETTING_WIREGUARD_MTU                    "mtu"

### NM_SETTING_WIREGUARD_PEER_ROUTES

    #define NM_SETTING_WIREGUARD_PEER_ROUTES            "peer-routes"

### NM_SETTING_WIREGUARD_IP4_AUTO_DEFAULT_ROUTE

    #define NM_SETTING_WIREGUARD_IP4_AUTO_DEFAULT_ROUTE "ip4-auto-default-route"

### NM_SETTING_WIREGUARD_IP6_AUTO_DEFAULT_ROUTE

    #define NM_SETTING_WIREGUARD_IP6_AUTO_DEFAULT_ROUTE "ip6-auto-default-route"

### NM_WIREGUARD_PEER_ATTR_ALLOWED_IPS

    #define NM_WIREGUARD_PEER_ATTR_ALLOWED_IPS          "allowed-ips"

### NM_WIREGUARD_PEER_ATTR_ENDPOINT

    #define NM_WIREGUARD_PEER_ATTR_ENDPOINT             "endpoint"

### NM_WIREGUARD_PEER_ATTR_PERSISTENT_KEEPALIVE

    #define NM_WIREGUARD_PEER_ATTR_PERSISTENT_KEEPALIVE "persistent-keepalive"

### NM_WIREGUARD_PEER_ATTR_PRESHARED_KEY

    #define NM_WIREGUARD_PEER_ATTR_PRESHARED_KEY        "preshared-key"

### NM_WIREGUARD_PEER_ATTR_PRESHARED_KEY_FLAGS

    #define NM_WIREGUARD_PEER_ATTR_PRESHARED_KEY_FLAGS  "preshared-key-flags"

### NM_WIREGUARD_PEER_ATTR_PUBLIC_KEY

    #define NM_WIREGUARD_PEER_ATTR_PUBLIC_KEY           "public-key"