FD.io VPP  v21.01.1
Vector Packet Processing
wireguard_messages.h File Reference
+ Include dependency graph for wireguard_messages.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  message_header
 
struct  message_handshake_initiation
 
struct  message_handshake_response
 
struct  message_handshake_cookie
 
struct  message_data
 

Macros

#define WG_TICK   0.01
 WG tick period (s) More...
 
#define WHZ   (u32) (1/WG_TICK)
 WG tick frequency. More...
 
#define NOISE_KEY_LEN_BASE64   ((((NOISE_PUBLIC_KEY_LEN) + 2) / 3) * 4 + 1)
 
#define noise_encrypted_len(plain_len)   ((plain_len) + NOISE_AUTHTAG_LEN)
 
#define foreach_wg_message_type
 
#define message_data_len(plain_len)   (noise_encrypted_len(plain_len) + sizeof(message_data_t))
 

Typedefs

typedef enum message_type message_type_t
 
typedef struct message_header message_header_t
 
typedef struct message_handshake_initiation message_handshake_initiation_t
 
typedef struct message_handshake_response message_handshake_response_t
 
typedef struct message_handshake_cookie message_handshake_cookie_t
 
typedef struct message_data message_data_t
 

Enumerations

enum  limits {
  REKEY_TIMEOUT = 5, REKEY_TIMEOUT_JITTER = WHZ / 3, KEEPALIVE_TIMEOUT = 10, MAX_TIMER_HANDSHAKES = 90 / REKEY_TIMEOUT,
  MAX_PEERS = 1U << 20
}
 
enum  message_type { foreach_wg_message_type }
 

Macro Definition Documentation

◆ foreach_wg_message_type

#define foreach_wg_message_type
Value:
_(INVALID, "Invalid") \
_(HANDSHAKE_INITIATION, "Handshake initiation") \
_(HANDSHAKE_RESPONSE, "Handshake response") \
_(HANDSHAKE_COOKIE, "Handshake cookie") \
_(DATA, "Data") \

Definition at line 38 of file wireguard_messages.h.

◆ message_data_len

#define message_data_len (   plain_len)    (noise_encrypted_len(plain_len) + sizeof(message_data_t))

Definition at line 93 of file wireguard_messages.h.

◆ noise_encrypted_len

#define noise_encrypted_len (   plain_len)    ((plain_len) + NOISE_AUTHTAG_LEN)

Definition at line 27 of file wireguard_messages.h.

◆ NOISE_KEY_LEN_BASE64

#define NOISE_KEY_LEN_BASE64   ((((NOISE_PUBLIC_KEY_LEN) + 2) / 3) * 4 + 1)

Definition at line 26 of file wireguard_messages.h.

◆ WG_TICK

#define WG_TICK   0.01

WG tick period (s)

Definition at line 23 of file wireguard_messages.h.

◆ WHZ

#define WHZ   (u32) (1/WG_TICK)

WG tick frequency.

Definition at line 24 of file wireguard_messages.h.

Typedef Documentation

◆ message_data_t

typedef struct message_data message_data_t

◆ message_handshake_cookie_t

◆ message_handshake_initiation_t

◆ message_handshake_response_t

◆ message_header_t

◆ message_type_t

Enumeration Type Documentation

◆ limits

enum limits
Enumerator
REKEY_TIMEOUT 
REKEY_TIMEOUT_JITTER 
KEEPALIVE_TIMEOUT 
MAX_TIMER_HANDSHAKES 
MAX_PEERS 

Definition at line 29 of file wireguard_messages.h.

◆ message_type

Enumerator
foreach_wg_message_type 

Definition at line 45 of file wireguard_messages.h.