lsquic_tokgen.h revision 5392f7a3
15392f7a3SLiteSpeed Tech/* Copyright (c) 2017 - 2019 LiteSpeed Technologies Inc. See LICENSE. */ 25392f7a3SLiteSpeed Tech#ifndef LSQUIC_TOKEN_H 35392f7a3SLiteSpeed Tech#define LSQUIC_TOKEN_H 1 45392f7a3SLiteSpeed Tech 55392f7a3SLiteSpeed Techstruct lsquic_engine_public; 65392f7a3SLiteSpeed Techstruct sockaddr; 75392f7a3SLiteSpeed Techstruct lsquic_packet_in; 85392f7a3SLiteSpeed Techstruct lsquic_cid; 95392f7a3SLiteSpeed Tech 105392f7a3SLiteSpeed Techenum token_type { TOKEN_RETRY, TOKEN_RESUME, N_TOKEN_TYPES, }; 115392f7a3SLiteSpeed Tech 125392f7a3SLiteSpeed Techstruct token_generator; 135392f7a3SLiteSpeed Tech 145392f7a3SLiteSpeed Techstruct token_generator * 155392f7a3SLiteSpeed Techlsquic_tg_new (struct lsquic_engine_public *); 165392f7a3SLiteSpeed Tech 175392f7a3SLiteSpeed Techvoid 185392f7a3SLiteSpeed Techlsquic_tg_destroy (struct token_generator *); 195392f7a3SLiteSpeed Tech 205392f7a3SLiteSpeed Tech/* `reset_token' must be IQUIC_SRESET_TOKEN_SZ bytes in length */ 215392f7a3SLiteSpeed Techvoid 225392f7a3SLiteSpeed Techlsquic_tg_generate_sreset (struct token_generator *, 235392f7a3SLiteSpeed Tech const struct lsquic_cid *cid, unsigned char *reset_token); 245392f7a3SLiteSpeed Tech 255392f7a3SLiteSpeed Tech#endif 26