2020-01-09 16:52:25 +00:00
|
|
|
/* Copyright (c) 2017 - 2020 LiteSpeed Technologies Inc. See LICENSE. */
|
2019-04-12 14:50:45 +00:00
|
|
|
#include <assert.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2019-09-11 15:27:58 +00:00
|
|
|
#include <sys/queue.h>
|
2019-04-12 14:50:45 +00:00
|
|
|
|
|
|
|
#include "lsquic.h"
|
|
|
|
#include "lsquic_int_types.h"
|
2019-09-11 15:27:58 +00:00
|
|
|
#include "lsquic_hash.h"
|
2019-04-12 14:50:45 +00:00
|
|
|
#include "lsquic_conn.h"
|
|
|
|
|
|
|
|
#include "lsquic_qlog.h"
|
|
|
|
|
|
|
|
#define LSQUIC_LOGGER_MODULE LSQLM_NOMODULE
|
|
|
|
#include "lsquic_logger.h"
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
main (void)
|
|
|
|
{
|
2019-04-12 17:44:40 +00:00
|
|
|
lsquic_global_init(LSQUIC_GLOBAL_CLIENT | LSQUIC_GLOBAL_CLIENT);
|
2019-04-12 14:50:45 +00:00
|
|
|
lsquic_log_to_fstream(stderr, LLTS_HHMMSSMS);
|
|
|
|
lsquic_set_log_level("debug");
|
|
|
|
|
|
|
|
lsquic_qlog_create_connection(0, NULL, NULL);
|
|
|
|
struct in_addr local_addr = {.s_addr = htonl(0x0a000001),};
|
|
|
|
struct sockaddr_in local =
|
|
|
|
{
|
|
|
|
.sin_family = AF_INET,
|
|
|
|
.sin_port = htons(12345),
|
|
|
|
.sin_addr = local_addr,
|
|
|
|
};
|
|
|
|
struct in_addr peer_addr = {.s_addr = htonl(0x0a000002),};
|
|
|
|
struct sockaddr_in peer =
|
|
|
|
{
|
|
|
|
.sin_family = AF_INET,
|
|
|
|
.sin_port = htons(443),
|
|
|
|
.sin_addr = peer_addr,
|
|
|
|
};
|
2020-06-03 04:13:30 +00:00
|
|
|
lsquic_cid_t cid; memset(&cid, 0, sizeof(cid));
|
2019-09-11 15:27:58 +00:00
|
|
|
lsquic_qlog_create_connection(&cid, (const struct sockaddr *)&local,
|
2019-04-12 14:50:45 +00:00
|
|
|
(const struct sockaddr *)&peer);
|
|
|
|
|
2019-09-11 15:27:58 +00:00
|
|
|
lsquic_qlog_packet_rx(&cid, NULL, NULL, 0);
|
|
|
|
lsquic_qlog_hsk_completed(&cid);
|
2020-07-06 21:35:21 +00:00
|
|
|
lsquic_qlog_sess_resume(&cid);
|
2019-09-11 15:27:58 +00:00
|
|
|
lsquic_qlog_check_certs(&cid, NULL, 0);
|
|
|
|
|
|
|
|
lsquic_qlog_version_negotiation(&cid, NULL, NULL);
|
|
|
|
lsquic_qlog_version_negotiation(&cid, "proposed", NULL);
|
|
|
|
lsquic_qlog_version_negotiation(&cid, "proposed", "Q035");
|
|
|
|
lsquic_qlog_version_negotiation(&cid, "proposed", "Q046");
|
|
|
|
lsquic_qlog_version_negotiation(&cid, "agreed", "Q044");
|
|
|
|
lsquic_qlog_version_negotiation(&cid, "agreed", "Q098");
|
|
|
|
lsquic_qlog_version_negotiation(&cid, "something else", "Q098");
|
2019-04-12 14:50:45 +00:00
|
|
|
return 0;
|
|
|
|
}
|