Skip to content

Struct SYN_WG

ClassList > SYN_WG

WireGuard client context — caller-owned. More...

  • #include <syn_wg.h>

Public Attributes

Type Name
SYN_WgConfig config
uint8_t hs_chaining_key
uint8_t hs_ephemeral_priv
uint8_t hs_hash
uint32_t last_handshake_ms
uint32_t last_recv_ms
uint32_t last_sent_ms
void(* on_recv
Callback for decrypted IP packets received from the tunnel.
uint8_t public_key
uint8_t * rx_buf
size_t rx_buf_size
SYN_WgSession session
SYN_SNTP * sntp
SYN_WgState state
uint8_t * tx_buf
size_t tx_buf_size
SYN_Socket udp_sock
void * user_ctx

Detailed Description

Contains config, session state, handshake scratch, timers, and buffer pointers. Approximately ~350 bytes + buffer pointers.

Public Attributes Documentation

variable config

SYN_WgConfig SYN_WG::config;

Peer configuration


variable hs_chaining_key

uint8_t SYN_WG::hs_chaining_key[32];

Noise chaining key (CK)


variable hs_ephemeral_priv

uint8_t SYN_WG::hs_ephemeral_priv[32];

Ephemeral private key


variable hs_hash

uint8_t SYN_WG::hs_hash[32];

Noise handshake hash (H)


variable last_handshake_ms

uint32_t SYN_WG::last_handshake_ms;

Tick of last handshake initiation


variable last_recv_ms

uint32_t SYN_WG::last_recv_ms;

Tick of last data received


variable last_sent_ms

uint32_t SYN_WG::last_sent_ms;

Tick of last data sent


variable on_recv

Callback for decrypted IP packets received from the tunnel.

void(* SYN_WG::on_recv) (const uint8_t *ip_packet, size_t len, void *ctx);

Parameters:

  • ip_packet Raw IP packet data.
  • len Packet length.
  • ctx User context pointer.

variable public_key

uint8_t SYN_WG::public_key[32];

Our public key (from private)


variable rx_buf

uint8_t* SYN_WG::rx_buf;

Receive buffer


variable rx_buf_size

size_t SYN_WG::rx_buf_size;

Receive buffer capacity


variable session

SYN_WgSession SYN_WG::session;

Currently active transport session


variable sntp

SYN_SNTP* SYN_WG::sntp;

NTP time source (for TAI64N)


variable state

SYN_WgState SYN_WG::state;

Connection state


variable tx_buf

uint8_t* SYN_WG::tx_buf;

Transmit buffer


variable tx_buf_size

size_t SYN_WG::tx_buf_size;

Transmit buffer capacity


variable udp_sock

SYN_Socket SYN_WG::udp_sock;

UDP socket to the server


variable user_ctx

void* SYN_WG::user_ctx;

User context for on_recv



The documentation for this class was generated from the following file src/syntropic/net/syn_wg.h