29 u32 lookup_node_index =
63 const u8 * packet,
u32 packet_len,
u32 * bi)
105 packet.
header.
type = MESSAGE_HANDSHAKE_INITIATION;
147 .peer_idx = peer_idx,
148 .is_retry = is_retry,
152 (
u8 *) & a,
sizeof (a));
218 packet.
header.
type = MESSAGE_HANDSHAKE_RESPONSE;
231 sizeof (packet), &bi0))
wg_per_thread_data_t * per_thread_data
u8 encrypted_static[noise_encrypted_len(NOISE_PUBLIC_KEY_LEN)]
bool noise_create_initiation(vlib_main_t *vm, noise_remote_t *r, uint32_t *s_idx, uint8_t ue[NOISE_PUBLIC_KEY_LEN], uint8_t es[NOISE_PUBLIC_KEY_LEN+NOISE_AUTHTAG_LEN], uint8_t ets[NOISE_TIMESTAMP_LEN+NOISE_AUTHTAG_LEN])
enum noise_state_crypt noise_remote_encrypt(vlib_main_t *vm, noise_remote_t *r, uint32_t *r_idx, uint64_t *nonce, uint8_t *src, size_t srclen, uint8_t *dst)
static f64 vlib_time_now(vlib_main_t *vm)
u16 current_length
Nbytes between current data and the end of this buffer.
void wg_timers_any_authenticated_packet_traversal(wg_peer_t *peer)
static void wg_buffer_prepend_rewrite(vlib_buffer_t *b0, const wg_peer_t *peer)
vlib_node_registration_t ip4_lookup_node
(constructor) VLIB_REGISTER_NODE (ip4_lookup_node)
#define clib_memcpy(d, s, n)
bool noise_remote_begin_session(vlib_main_t *vm, noise_remote_t *r)
bool wg_send_handshake_response(vlib_main_t *vm, wg_peer_t *peer)
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
void vl_api_rpc_call_main_thread(void *fp, u8 *data, u32 data_length)
bool noise_create_response(vlib_main_t *vm, noise_remote_t *r, uint32_t *s_idx, uint32_t *r_idx, uint8_t ue[NOISE_PUBLIC_KEY_LEN], uint8_t en[0+NOISE_AUTHTAG_LEN])
void wg_send_handshake_from_mt(u32 peer_idx, bool is_retry)
static int ip46_enqueue_packet(vlib_main_t *vm, u32 bi0, int is_ip6)
u8 encrypted_nothing[noise_encrypted_len(0)]
static __clib_warn_unused_result u32 vlib_buffer_alloc(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Allocate buffers into supplied array.
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static bool wg_birthdate_has_expired(f64 birthday_seconds, f64 expiration_seconds)
#define message_data_len(plain_len)
void wg_timers_any_authenticated_packet_sent(wg_peer_t *peer)
u8 data[WG_DEFAULT_DATA_SIZE]
cookie_maker_t cookie_maker
vlib_node_registration_t ip6_lookup_node
(constructor) VLIB_REGISTER_NODE (ip6_lookup_node)
u8 encrypted_timestamp[noise_encrypted_len(NOISE_TIMESTAMP_LEN)]
void cookie_maker_mac(cookie_maker_t *cp, message_macs_t *cm, void *buf, size_t len)
u8 unencrypted_ephemeral[NOISE_PUBLIC_KEY_LEN]
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
noise_keypair_t * r_current
void wg_timers_session_derived(wg_peer_t *peer)
static void ip4_header_set_len_w_chksum(ip4_header_t *ip4, u16 len)
bool wg_send_keepalive(vlib_main_t *vm, wg_peer_t *peer)
vl_api_dhcp_client_state_t state
static bool wg_create_buffer(vlib_main_t *vm, const wg_peer_t *peer, const u8 *packet, u32 packet_len, u32 *bi)
static void * wg_send_handshake_thread_fn(void *arg)
u8 unencrypted_ephemeral[NOISE_PUBLIC_KEY_LEN]
void wg_timers_handshake_initiated(wg_peer_t *peer)
static wg_peer_t * wg_peer_get(index_t peeri)
u32 timer_handshake_attempts
bool wg_send_handshake(vlib_main_t *vm, wg_peer_t *peer, bool is_retry)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.