2020-01-09 16:52:25 +00:00
|
|
|
/* Copyright (c) 2017 - 2020 LiteSpeed Technologies Inc. See LICENSE. */
|
2017-09-22 21:00:03 +00:00
|
|
|
#include <assert.h>
|
|
|
|
#include <stdlib.h>
|
2018-08-28 13:59:47 +00:00
|
|
|
#include <string.h>
|
2017-09-22 21:00:03 +00:00
|
|
|
|
|
|
|
#include "lsquic.h"
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
main (void)
|
|
|
|
{
|
|
|
|
struct lsquic_engine_settings settings;
|
|
|
|
lsquic_engine_t *engine;
|
|
|
|
unsigned versions;
|
|
|
|
const unsigned flags = LSENG_SERVER;
|
|
|
|
|
|
|
|
lsquic_engine_init_settings(&settings, flags);
|
|
|
|
|
2018-08-28 13:59:47 +00:00
|
|
|
struct lsquic_engine_api api;
|
|
|
|
memset(&api, 0, sizeof(api));
|
|
|
|
api.ea_settings = &settings;
|
|
|
|
api.ea_packets_out = (void *) (uintptr_t) 1;
|
2020-02-20 22:01:15 +00:00
|
|
|
api.ea_stream_if = (void *) (uintptr_t) 2;
|
2017-09-22 21:00:03 +00:00
|
|
|
|
|
|
|
engine = lsquic_engine_new(flags, &api);
|
|
|
|
assert(engine);
|
|
|
|
versions = lsquic_engine_quic_versions(engine);
|
|
|
|
assert(versions == settings.es_versions);
|
|
|
|
lsquic_engine_destroy(engine);
|
|
|
|
|
|
|
|
settings.es_versions |= (1 << N_LSQVER /* Invalid value by definition */);
|
|
|
|
engine = lsquic_engine_new(flags, &api);
|
|
|
|
assert(!engine);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|