Gjsify LogoGjsify Logo

The settings of one WireGuard peer.

record

Hierarchy

  • WireGuardPeer

Index

Constructors

Properties

name: string

Methods

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

    It is a bug trying to modify a sealed #NMWireGuardPeer instance.

    Parameters

    • allowedIp: string

      the allowed-ip entry to set.

    • acceptInvalid: boolean

      if %TRUE, also invalid allowed_ip value will be appended. Otherwise, the function does nothing in face of invalid values and returns %FALSE.

    Returns boolean

  • clearAllowedIps(): void
  • Removes all allowed-ip entries.

    It is a bug trying to modify a sealed #NMWireGuardPeer instance.

    Returns void

  • getAllowedIp(idx: number, outIsValid: boolean): string
  • getAllowedIpsLen(): number
  • getEndpoint(): string
  • getPersistentKeepalive(): number
  • getPresharedKey(): string
  • getPublicKey(): string
  • isSealed(): boolean
  • isValid(checkNonSecrets: boolean, checkSecrets: boolean): boolean
  • Parameters

    • checkNonSecrets: boolean
    • checkSecrets: boolean

    Returns boolean

  • removeAllowedIp(idx: number): boolean
  • 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 #NMWireGuardPeer instance.

    Parameters

    • idx: number

      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.

    Returns boolean

  • seal(): void
  • Seal the #NMWireGuardPeer 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 nm_wireguard_peer_new_clone().

    Returns void

  • setEndpoint(endpoint: string, allowInvalid: boolean): boolean
  • Sets or clears the endpoint of self.

    It is a bug trying to modify a sealed #NMWireGuardPeer instance.

    Parameters

    • endpoint: string

      the socket address endpoint to set or %NULL.

    • allowInvalid: boolean

      if %TRUE, also invalid values are set. If %FALSE, the function does nothing for invalid endpoint arguments.

    Returns boolean

  • setPersistentKeepalive(persistentKeepalive: number): void
  • It is a bug trying to modify a sealed #NMWireGuardPeer instance.

    Parameters

    • persistentKeepalive: number

      the keep-alive value to set.

    Returns void

  • setPresharedKey(presharedKey: string, acceptInvalid: boolean): boolean
  • 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 nm_wireguard_peer_is_valid() to fail or it may be accepted.

    It is a bug trying to modify a sealed #NMWireGuardPeer instance.

    Parameters

    • presharedKey: string

      the new preshared key or %NULL to clear the preshared key.

    • acceptInvalid: boolean

      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.

    Returns boolean

  • setPublicKey(publicKey: string, acceptInvalid: boolean): boolean
  • 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 #NMWireGuardPeer instance.

    Parameters

    • publicKey: string

      the new public key or %NULL to clear the public key.

    • acceptInvalid: boolean

      if %TRUE and public_key is not %NULL and invalid, then do not modify the instance.

    Returns boolean

  • unref(): void
  • Drop a reference to self. If the last reference is dropped, the instance is freed and all associate data released.

    This is not thread-safe.

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method