6#include "platform/net/net_address.h"
22uint64_t sipHash24(uint64_t k0, uint64_t k1,
const uint8_t* data,
size_t size);
39 NetJoinCookie() =
default;
40 ~NetJoinCookie() =
default;
42 NetJoinCookie(
const NetJoinCookie& other) =
default;
43 NetJoinCookie& operator=(
const NetJoinCookie& other) =
default;
45 NetJoinCookie(NetJoinCookie && other) =
default;
46 NetJoinCookie& operator=(NetJoinCookie && other) =
default;
72 uint64_t forWindow(
const NetAddress& address, uint64_t window)
const;
void rekey()
Draw a new key from the operating system. Every token given before is void.
bool accepts(const NetAddress &from, uint64_t token, double now) const
Whether token is one issue() gave from, this window or the last.
static constexpr double WINDOW_SECONDS
How long one window lasts, in seconds; a token is good for one to two of them.
Definition join_cookie.h:36
uint64_t issue(const NetAddress &to, double now) const
The token for to, as of now.
Where a datagram came from, or is going to: an IPv4 host and a port.
Definition net_address.h:13