ngtcp2_decode_transport_params_new
Synopsis
#include <ngtcp2/ngtcp2.h>
-
int ngtcp2_decode_transport_params_new(ngtcp2_transport_params **pparams, uint32_t flags, ngtcp2_transport_params_type exttype, const uint8_t *data, size_t datalen, const ngtcp2_mem *mem)
ngtcp2_decode_transport_params_new()decodes transport parameters in data of length datalen, and stores the result in the object allocated dynamically. The pointer to the allocated object is assigned to *pparams. Unlikengtcp2_decode_transport_params(), all direct and indirect fields are also allocated dynamically if needed.flags is bitwise OR of zero or more of
NGTCP2_TRANSPORT_PARAMS_DECODE_FLAG_*. IfNGTCP2_TRANSPORT_PARAMS_DECODE_FLAG_IGNORE_MISSING_REQUIRED_FIELDSis set, this function does not check the missing required fields, andNGTCP2_ERR_REQUIRED_TRANSPORT_PARAMwill not be returned.mem is a memory allocator to allocate memory. If mem is
NULL, the memory allocator returned byngtcp2_mem_default()is used.If the optional parameters are missing, the default value is assigned.
ngtcp2_transport_params_del()frees the memory allocated by this function.This function returns 0 if it succeeds, or one of the following negative error codes:
NGTCP2_ERR_REQUIRED_TRANSPORT_PARAMThe required parameter is missing.
NGTCP2_ERR_MALFORMED_TRANSPORT_PARAMThe input is malformed.
NGTCP2_ERR_NOMEMOut of memory.