Gjsify LogoGjsify Logo

The settings of one WireGuard peer.

record

Hierarchy

  • WireGuardPeer

Index

Constructors

Properties

name: string

Methods

  • append_allowed_ip(allowed_ip: string, accept_invalid: 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

    • allowed_ip: string

      the allowed-ip entry to set.

    • accept_invalid: 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

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

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

    Returns void

  • get_allowed_ip(idx: number, out_is_valid: boolean): string
  • get_allowed_ips_len(): number
  • get_endpoint(): string
  • get_persistent_keepalive(): number
  • get_preshared_key(): string
  • get_public_key(): string
  • is_sealed(): boolean
  • is_valid(check_non_secrets: boolean, check_secrets: boolean): boolean
  • remove_allowed_ip(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

  • set_endpoint(endpoint: string, allow_invalid: 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.

    • allow_invalid: boolean

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

    Returns boolean

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

    Parameters

    • persistent_keepalive: number

      the keep-alive value to set.

    Returns void

  • set_preshared_key(preshared_key: string, accept_invalid: 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

    • preshared_key: string

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

    • accept_invalid: 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

  • set_public_key(public_key: string, accept_invalid: 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

    • public_key: string

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

    • accept_invalid: 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