|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
18 #ifndef __included_wg_cookie_h__
19 #define __included_wg_cookie_h__
31 #define COOKIE_MAC_SIZE 16
32 #define COOKIE_KEY_SIZE 32
33 #define COOKIE_NONCE_SIZE 24
34 #define COOKIE_COOKIE_SIZE 16
35 #define COOKIE_SECRET_SIZE 32
36 #define COOKIE_INPUT_SIZE 32
37 #define COOKIE_ENCRYPTED_SIZE (COOKIE_COOKIE_SIZE + COOKIE_MAC_SIZE)
39 #define COOKIE_MAC1_KEY_LABEL "mac1----"
40 #define COOKIE_COOKIE_KEY_LABEL "cookie--"
41 #define COOKIE_SECRET_MAX_AGE 120
42 #define COOKIE_SECRET_LATENCY 5
45 #define RATELIMIT_SIZE (1 << 13)
46 #define RATELIMIT_SIZE_MAX (RATELIMIT_SIZE * 8)
47 #define NSEC_PER_SEC 1000000000LL
48 #define INITIATIONS_PER_SECOND 20
49 #define INITIATIONS_BURSTABLE 5
50 #define INITIATION_COST (NSEC_PER_SEC / INITIATIONS_PER_SECOND)
51 #define TOKEN_MAX (INITIATION_COST * INITIATIONS_BURSTABLE)
52 #define ELEMENT_TIMEOUT 1
53 #define IPV4_MASK_SIZE 4
54 #define IPV6_MASK_SIZE 8
uint8_t cp_cookie_key[COOKIE_KEY_SIZE]
struct cookie_checker cookie_checker_t
uint8_t mac1[COOKIE_MAC_SIZE]
uint8_t mac2[COOKIE_MAC_SIZE]
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
void cookie_checker_update(cookie_checker_t *, uint8_t[COOKIE_INPUT_SIZE])
struct cookie_maker cookie_maker_t
@ VALID_MAC_BUT_NO_COOKIE
uint8_t cp_cookie[COOKIE_COOKIE_SIZE]
uint8_t cc_mac1_key[COOKIE_KEY_SIZE]
struct cookie_macs message_macs_t
uint8_t cc_secret[COOKIE_SECRET_SIZE]
uint8_t cp_mac1_key[COOKIE_KEY_SIZE]
#define COOKIE_COOKIE_SIZE
uint8_t cp_mac1_last[COOKIE_MAC_SIZE]
#define COOKIE_INPUT_SIZE
enum cookie_mac_state cookie_checker_validate_macs(vlib_main_t *vm, cookie_checker_t *, message_macs_t *, void *, size_t, bool, ip4_address_t ip4, u16 udp_port)
void cookie_maker_mac(cookie_maker_t *, message_macs_t *, void *, size_t)
void cookie_maker_init(cookie_maker_t *, const uint8_t[COOKIE_INPUT_SIZE])
#define COOKIE_SECRET_SIZE
uint8_t cc_cookie_key[COOKIE_KEY_SIZE]