ngtcp2_accept

Synopsis

#include <ngtcp2/ngtcp2.h>

int ngtcp2_accept(ngtcp2_pkt_hd *dest, const uint8_t *pkt, size_t pktlen)

ngtcp2_accept() is used by server implementation, and decides whether packet pkt of length pktlen from client is acceptable for the very first packet to a connection.

If dest is not NULL and the function returns 0, the decoded packet header is stored in the object pointed by dest.

This function returns 0 if it succeeds, or one of the following negative error codes:

NGTCP2_ERR_INVALID_ARGUMENT

The packet is not acceptable for the very first packet to a new connection; or the function failed to parse the packet header.