lsquic_qlog.h revision 5392f7a3
155cd0b38SDmitri Tikhonov/* Copyright (c) 2017 - 2019 LiteSpeed Technologies Inc.  See LICENSE. */
255cd0b38SDmitri Tikhonov/*
355cd0b38SDmitri Tikhonov * lsquic_qlog.h -- QLOG Event logger
455cd0b38SDmitri Tikhonov */
555cd0b38SDmitri Tikhonov
655cd0b38SDmitri Tikhonov#ifndef LSQUIC_QLOG_H
755cd0b38SDmitri Tikhonov#define LSQUIC_QLOG_H 1
855cd0b38SDmitri Tikhonov
955cd0b38SDmitri Tikhonov#include "lsquic_int_types.h"
1055cd0b38SDmitri Tikhonov#include "lsquic_packet_common.h"
1155cd0b38SDmitri Tikhonov#include "lsquic_str.h"
1255cd0b38SDmitri Tikhonov
1355cd0b38SDmitri Tikhonov/*
1455cd0b38SDmitri TikhonovEventCategory
1555cd0b38SDmitri Tikhonov    CONNECTIVITY
1655cd0b38SDmitri Tikhonov    SECURITY
1755cd0b38SDmitri Tikhonov    TRANSPORT
1855cd0b38SDmitri Tikhonov    RECOVERY
1955cd0b38SDmitri Tikhonov
2055cd0b38SDmitri TikhonovEventType
2155cd0b38SDmitri Tikhonov  CONNECTIVITY
2255cd0b38SDmitri Tikhonov    NEW_CONNECTION
2355cd0b38SDmitri Tikhonov+   VERNEG
2455cd0b38SDmitri Tikhonov+   HANDSHAKE
2555cd0b38SDmitri Tikhonov  SECURITY
2655cd0b38SDmitri Tikhonov+   CHECK_CERT
2755cd0b38SDmitri Tikhonov    KEY_UPDATE
2855cd0b38SDmitri Tikhonov  TRANSPORT
2955cd0b38SDmitri Tikhonov+   PACKET_RX
3055cd0b38SDmitri Tikhonov    STREAM_NEW
3155cd0b38SDmitri Tikhonov    ACK_NEW
3255cd0b38SDmitri Tikhonov    MAXDATA_NEW
3355cd0b38SDmitri Tikhonov    MAXSTREAMDATA_NEW
3455cd0b38SDmitri Tikhonov  RECOVERY
3555cd0b38SDmitri Tikhonov    LOSS_DETECTION_ARMED
3655cd0b38SDmitri Tikhonov    LOSS_DETECTION_POSTPONED
3755cd0b38SDmitri Tikhonov    LOSS_DETECTION_TRIGGERED
3855cd0b38SDmitri Tikhonov    BYTES_IN_FLIGHT_UPDATE
3955cd0b38SDmitri Tikhonov    CWND_UPDATE
4055cd0b38SDmitri Tikhonov    RTT_UPDATE
4155cd0b38SDmitri Tikhonov
4255cd0b38SDmitri TikhonovEventTrigger
4355cd0b38SDmitri Tikhonov  CONNECTIVITY
4455cd0b38SDmitri Tikhonov    LINE
4555cd0b38SDmitri Tikhonov+   PACKET_RX
4655cd0b38SDmitri Tikhonov  SECURITY
4755cd0b38SDmitri Tikhonov+   CERTLOG
4855cd0b38SDmitri Tikhonov    KEYLOG
4955cd0b38SDmitri Tikhonov  TRANSPORT
5055cd0b38SDmitri Tikhonov    LINE
5155cd0b38SDmitri Tikhonov    PACKET_TX
5255cd0b38SDmitri Tikhonov    PACKET_RX
5355cd0b38SDmitri Tikhonov  RECOVERY
5455cd0b38SDmitri Tikhonov    ACK_RX
5555cd0b38SDmitri Tikhonov    PACKET_RX
5655cd0b38SDmitri Tikhonov    UNKNOWN
5755cd0b38SDmitri Tikhonov
5855cd0b38SDmitri TikhonovEventData
5955cd0b38SDmitri Tikhonov  EventNewConnection
6055cd0b38SDmitri Tikhonov  EventKeyUpdate
6155cd0b38SDmitri Tikhonov  EventPacketRX
6255cd0b38SDmitri Tikhonov*/
6355cd0b38SDmitri Tikhonov
6455cd0b38SDmitri Tikhonovvoid
655392f7a3SLiteSpeed Techlsquic_qlog_create_connection (const lsquic_cid_t *, const struct sockaddr *,
6655cd0b38SDmitri Tikhonov                                                    const struct sockaddr *);
6755cd0b38SDmitri Tikhonov
6855cd0b38SDmitri Tikhonovvoid
695392f7a3SLiteSpeed Techlsquic_qlog_packet_rx (const lsquic_cid_t * cid, const struct lsquic_packet_in *,
7055cd0b38SDmitri Tikhonov                                                const unsigned char *, size_t);
7155cd0b38SDmitri Tikhonov
7255cd0b38SDmitri Tikhonov#define QLOG_PACKET_RX(...) do {                                            \
7355cd0b38SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_QLOG))                     \
7455cd0b38SDmitri Tikhonov        lsquic_qlog_packet_rx(__VA_ARGS__);                                 \
7555cd0b38SDmitri Tikhonov} while (0)
7655cd0b38SDmitri Tikhonov
7755cd0b38SDmitri Tikhonovvoid
785392f7a3SLiteSpeed Techlsquic_qlog_hsk_completed (const lsquic_cid_t *);
7955cd0b38SDmitri Tikhonov
8055cd0b38SDmitri Tikhonovvoid
815392f7a3SLiteSpeed Techlsquic_qlog_zero_rtt (const lsquic_cid_t *);
8255cd0b38SDmitri Tikhonov
8355cd0b38SDmitri Tikhonovvoid
845392f7a3SLiteSpeed Techlsquic_qlog_check_certs (const lsquic_cid_t *, const lsquic_str_t **, size_t);
8555cd0b38SDmitri Tikhonov
8655cd0b38SDmitri Tikhonovvoid
875392f7a3SLiteSpeed Techlsquic_qlog_version_negotiation (const lsquic_cid_t *, const char *, const char *);
8855cd0b38SDmitri Tikhonov
895392f7a3SLiteSpeed Tech#endif
90