1a74702c6SGeorge Wang/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc.  See LICENSE. */
250aadb33SDmitri Tikhonov/*
350aadb33SDmitri Tikhonov * lsquic_ev_log.h -- Event logger
450aadb33SDmitri Tikhonov */
550aadb33SDmitri Tikhonov
650aadb33SDmitri Tikhonov#ifndef LSQUIC_EV_LOG_H
750aadb33SDmitri Tikhonov#define LSQUIC_EV_LOG_H 1
850aadb33SDmitri Tikhonov
950aadb33SDmitri Tikhonov#include "lsquic_int_types.h"
1055cd0b38SDmitri Tikhonov#include "lsquic_qlog.h"
1150aadb33SDmitri Tikhonov
1250aadb33SDmitri Tikhonovstruct ack_info;
1350aadb33SDmitri Tikhonovstruct http_prio_frame;
1450aadb33SDmitri Tikhonovstruct lsquic_http_headers;
1550aadb33SDmitri Tikhonovstruct lsquic_packet_in;
1650aadb33SDmitri Tikhonovstruct lsquic_packet_out;
1750aadb33SDmitri Tikhonovstruct parse_funcs;
1850aadb33SDmitri Tikhonovstruct stream_frame;
1950aadb33SDmitri Tikhonovstruct uncompressed_headers;
20b55a5117SDmitri Tikhonovstruct stack_st_X509;
2150aadb33SDmitri Tikhonov
2250aadb33SDmitri Tikhonov
2350aadb33SDmitri Tikhonov/* Log a generic event not tied to any particular connection */
24b93f59beSBob Perper#define EV_LOG_GENERIC_EVENT(...) do {                                      \
2550aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
26b93f59beSBob Perper        lsquic_logger_log1(LSQ_LOG_DEBUG, LSQLM_EVENT, __VA_ARGS__);        \
2750aadb33SDmitri Tikhonov} while (0)
2850aadb33SDmitri Tikhonov
2950aadb33SDmitri Tikhonov/* Log a generic event associated with connection `cid' */
30b93f59beSBob Perper#define EV_LOG_CONN_EVENT(cid, ...) do {                                    \
3150aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
32b93f59beSBob Perper        lsquic_logger_log2(LSQ_LOG_DEBUG, LSQLM_EVENT, cid, __VA_ARGS__);   \
3350aadb33SDmitri Tikhonov} while (0)
3450aadb33SDmitri Tikhonov
3550aadb33SDmitri Tikhonovvoid
365392f7a3SLiteSpeed Techlsquic_ev_log_packet_in (const lsquic_cid_t *, const struct lsquic_packet_in *);
3750aadb33SDmitri Tikhonov
38b93f59beSBob Perper#define EV_LOG_PACKET_IN(...) do {                                          \
3950aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
40b93f59beSBob Perper        lsquic_ev_log_packet_in(__VA_ARGS__);                               \
4150aadb33SDmitri Tikhonov} while (0)
4250aadb33SDmitri Tikhonov
4350aadb33SDmitri Tikhonovvoid
445392f7a3SLiteSpeed Techlsquic_ev_log_ack_frame_in (const lsquic_cid_t *, const struct ack_info *);
4550aadb33SDmitri Tikhonov
46b93f59beSBob Perper#define EV_LOG_ACK_FRAME_IN(...) do {                                       \
4750aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
48b93f59beSBob Perper        lsquic_ev_log_ack_frame_in(__VA_ARGS__);                            \
4950aadb33SDmitri Tikhonov} while (0)
5050aadb33SDmitri Tikhonov
5150aadb33SDmitri Tikhonovvoid
525392f7a3SLiteSpeed Techlsquic_ev_log_stream_frame_in (const lsquic_cid_t *,
535392f7a3SLiteSpeed Tech                                                const struct stream_frame *);
5450aadb33SDmitri Tikhonov
55b93f59beSBob Perper#define EV_LOG_STREAM_FRAME_IN(...) do {                                    \
5650aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
57b93f59beSBob Perper        lsquic_ev_log_stream_frame_in(__VA_ARGS__);                         \
5850aadb33SDmitri Tikhonov} while (0)
5950aadb33SDmitri Tikhonov
6050aadb33SDmitri Tikhonovvoid
615392f7a3SLiteSpeed Techlsquic_ev_log_crypto_frame_in (const lsquic_cid_t *,
625392f7a3SLiteSpeed Tech                            const struct stream_frame *, unsigned enc_level);
635392f7a3SLiteSpeed Tech
645392f7a3SLiteSpeed Tech#define EV_LOG_CRYPTO_FRAME_IN(...) do {                                    \
655392f7a3SLiteSpeed Tech    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
665392f7a3SLiteSpeed Tech        lsquic_ev_log_crypto_frame_in(__VA_ARGS__);                         \
675392f7a3SLiteSpeed Tech} while (0)
685392f7a3SLiteSpeed Tech
695392f7a3SLiteSpeed Techvoid
705392f7a3SLiteSpeed Techlsquic_ev_log_window_update_frame_in (const lsquic_cid_t *, lsquic_stream_id_t,
7150aadb33SDmitri Tikhonov                                                            uint64_t offset);
7250aadb33SDmitri Tikhonov
73b93f59beSBob Perper#define EV_LOG_WINDOW_UPDATE_FRAME_IN(...) do {                             \
7450aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
75b93f59beSBob Perper        lsquic_ev_log_window_update_frame_in(__VA_ARGS__);                  \
7650aadb33SDmitri Tikhonov} while (0)
7750aadb33SDmitri Tikhonov
7850aadb33SDmitri Tikhonovvoid
795392f7a3SLiteSpeed Techlsquic_ev_log_blocked_frame_in (const lsquic_cid_t *, lsquic_stream_id_t);
8050aadb33SDmitri Tikhonov
81b93f59beSBob Perper#define EV_LOG_BLOCKED_FRAME_IN(...) do {                                   \
8250aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
83b93f59beSBob Perper        lsquic_ev_log_blocked_frame_in(__VA_ARGS__);                        \
8450aadb33SDmitri Tikhonov} while (0)
8550aadb33SDmitri Tikhonov
8650aadb33SDmitri Tikhonovvoid
875392f7a3SLiteSpeed Techlsquic_ev_log_stop_waiting_frame_in (const lsquic_cid_t *, lsquic_packno_t);
8850aadb33SDmitri Tikhonov
89b93f59beSBob Perper#define EV_LOG_STOP_WAITING_FRAME_IN(...) do {                              \
9050aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
91b93f59beSBob Perper        lsquic_ev_log_stop_waiting_frame_in(__VA_ARGS__);                   \
9250aadb33SDmitri Tikhonov} while (0)
9350aadb33SDmitri Tikhonov
9450aadb33SDmitri Tikhonovvoid
955392f7a3SLiteSpeed Techlsquic_ev_log_connection_close_frame_in (const lsquic_cid_t *,
965392f7a3SLiteSpeed Tech                    uint64_t error_code, int reason_len, const char *reason);
9750aadb33SDmitri Tikhonov
98b93f59beSBob Perper#define EV_LOG_CONNECTION_CLOSE_FRAME_IN(...) do {                          \
9950aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
100b93f59beSBob Perper        lsquic_ev_log_connection_close_frame_in(__VA_ARGS__);               \
10150aadb33SDmitri Tikhonov} while (0)
10250aadb33SDmitri Tikhonov
10350aadb33SDmitri Tikhonovvoid
1045392f7a3SLiteSpeed Techlsquic_ev_log_goaway_frame_in (const lsquic_cid_t *, uint32_t error_code,
1055392f7a3SLiteSpeed Tech                lsquic_stream_id_t, int reason_len, const char *reason);
10650aadb33SDmitri Tikhonov
107b93f59beSBob Perper#define EV_LOG_GOAWAY_FRAME_IN(...) do {                                    \
10850aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
109b93f59beSBob Perper        lsquic_ev_log_goaway_frame_in(__VA_ARGS__);                         \
11050aadb33SDmitri Tikhonov} while (0)
11150aadb33SDmitri Tikhonov
11250aadb33SDmitri Tikhonovvoid
1135392f7a3SLiteSpeed Techlsquic_ev_log_rst_stream_frame_in (const lsquic_cid_t *, lsquic_stream_id_t,
1145392f7a3SLiteSpeed Tech                                        uint64_t offset, uint64_t error_code);
11550aadb33SDmitri Tikhonov
116b93f59beSBob Perper#define EV_LOG_RST_STREAM_FRAME_IN(...) do {                                \
11750aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
118b93f59beSBob Perper        lsquic_ev_log_rst_stream_frame_in(__VA_ARGS__);                     \
11950aadb33SDmitri Tikhonov} while (0)
12050aadb33SDmitri Tikhonov
12150aadb33SDmitri Tikhonovvoid
1225392f7a3SLiteSpeed Techlsquic_ev_log_stop_sending_frame_in (const lsquic_cid_t *,lsquic_stream_id_t,
1235392f7a3SLiteSpeed Tech                                                        uint64_t error_code);
1245392f7a3SLiteSpeed Tech
1255392f7a3SLiteSpeed Tech#define EV_LOG_STOP_SENDING_FRAME_IN(...) do {                              \
1265392f7a3SLiteSpeed Tech    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
1275392f7a3SLiteSpeed Tech        lsquic_ev_log_stop_sending_frame_in(__VA_ARGS__);                   \
1285392f7a3SLiteSpeed Tech} while (0)
1295392f7a3SLiteSpeed Tech
1305392f7a3SLiteSpeed Techvoid
1315392f7a3SLiteSpeed Techlsquic_ev_log_padding_frame_in (const lsquic_cid_t *, size_t len);
13250aadb33SDmitri Tikhonov
133b93f59beSBob Perper#define EV_LOG_PADDING_FRAME_IN(...) do {                                   \
13450aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
135b93f59beSBob Perper        lsquic_ev_log_padding_frame_in(__VA_ARGS__);                        \
13650aadb33SDmitri Tikhonov} while (0)
13750aadb33SDmitri Tikhonov
13850aadb33SDmitri Tikhonovvoid
1395392f7a3SLiteSpeed Techlsquic_ev_log_ping_frame_in (const lsquic_cid_t *);
14050aadb33SDmitri Tikhonov
141b93f59beSBob Perper#define EV_LOG_PING_FRAME_IN(...) do {                                      \
14250aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
143b93f59beSBob Perper        lsquic_ev_log_ping_frame_in(__VA_ARGS__);                           \
14450aadb33SDmitri Tikhonov} while (0)
14550aadb33SDmitri Tikhonov
14650aadb33SDmitri Tikhonovvoid
1475392f7a3SLiteSpeed Techlsquic_ev_log_packet_created (const lsquic_cid_t *,
1485392f7a3SLiteSpeed Tech                                            const struct lsquic_packet_out *);
14950aadb33SDmitri Tikhonov
150b93f59beSBob Perper#define EV_LOG_PACKET_CREATED(...) do {                                     \
15150aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
152b93f59beSBob Perper        lsquic_ev_log_packet_created(__VA_ARGS__);                          \
15350aadb33SDmitri Tikhonov} while (0)
15450aadb33SDmitri Tikhonov
15550aadb33SDmitri Tikhonovvoid
1565392f7a3SLiteSpeed Techlsquic_ev_log_packet_sent (const lsquic_cid_t *,
1575392f7a3SLiteSpeed Tech                                            const struct lsquic_packet_out *);
15850aadb33SDmitri Tikhonov
159b93f59beSBob Perper#define EV_LOG_PACKET_SENT(...) do {                                        \
16050aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
161b93f59beSBob Perper        lsquic_ev_log_packet_sent(__VA_ARGS__);                             \
16250aadb33SDmitri Tikhonov} while (0)
16350aadb33SDmitri Tikhonov
16450aadb33SDmitri Tikhonovvoid
1655392f7a3SLiteSpeed Techlsquic_ev_log_packet_not_sent (const lsquic_cid_t *,
1665392f7a3SLiteSpeed Tech                                            const struct lsquic_packet_out *);
16750aadb33SDmitri Tikhonov
168b93f59beSBob Perper#define EV_LOG_PACKET_NOT_SENT(...) do {                                    \
16950aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
170b93f59beSBob Perper        lsquic_ev_log_packet_not_sent(__VA_ARGS__);                         \
17150aadb33SDmitri Tikhonov} while (0)
17250aadb33SDmitri Tikhonov
17350aadb33SDmitri Tikhonovvoid
1745392f7a3SLiteSpeed Techlsquic_ev_log_http_headers_in (const lsquic_cid_t *, int is_server,
17550aadb33SDmitri Tikhonov                                        const struct uncompressed_headers *);
17650aadb33SDmitri Tikhonov
177b93f59beSBob Perper#define EV_LOG_HTTP_HEADERS_IN(...) do {                                    \
17850aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
179b93f59beSBob Perper        lsquic_ev_log_http_headers_in(__VA_ARGS__);                         \
18050aadb33SDmitri Tikhonov} while (0)
18150aadb33SDmitri Tikhonov
18250aadb33SDmitri Tikhonovvoid
1835392f7a3SLiteSpeed Techlsquic_ev_log_action_stream_frame (const lsquic_cid_t *,
1845392f7a3SLiteSpeed Tech                       const struct parse_funcs *pf,
185c51ce338SDmitri Tikhonov                       const unsigned char *, size_t len, const char *action);
18650aadb33SDmitri Tikhonov
187b93f59beSBob Perper#define EV_LOG_GENERATED_STREAM_FRAME(...) do {                             \
18850aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
189b93f59beSBob Perper        lsquic_ev_log_action_stream_frame(__VA_ARGS__, "generated");        \
190c51ce338SDmitri Tikhonov} while (0)
191c51ce338SDmitri Tikhonov
192b93f59beSBob Perper#define EV_LOG_UPDATED_STREAM_FRAME(...) do {                               \
193c51ce338SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
194b93f59beSBob Perper        lsquic_ev_log_action_stream_frame(__VA_ARGS__, "updated");          \
19550aadb33SDmitri Tikhonov} while (0)
19650aadb33SDmitri Tikhonov
19750aadb33SDmitri Tikhonovvoid
1985392f7a3SLiteSpeed Techlsquic_ev_log_generated_crypto_frame (const lsquic_cid_t *,
1995392f7a3SLiteSpeed Tech                       const struct parse_funcs *pf,
2005392f7a3SLiteSpeed Tech                       const unsigned char *, size_t len);
2015392f7a3SLiteSpeed Tech
2025392f7a3SLiteSpeed Tech#define EV_LOG_GENERATED_CRYPTO_FRAME(...) do {                             \
2035392f7a3SLiteSpeed Tech    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
2045392f7a3SLiteSpeed Tech        lsquic_ev_log_generated_crypto_frame(__VA_ARGS__);                  \
2055392f7a3SLiteSpeed Tech} while (0)
2065392f7a3SLiteSpeed Tech
2075392f7a3SLiteSpeed Techvoid
2085392f7a3SLiteSpeed Techlsquic_ev_log_generated_ack_frame (const lsquic_cid_t *,
2095392f7a3SLiteSpeed Tech                const struct parse_funcs *, const unsigned char *, size_t len);
21050aadb33SDmitri Tikhonov
211b93f59beSBob Perper#define EV_LOG_GENERATED_ACK_FRAME(...) do {                                \
21250aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
213b93f59beSBob Perper        lsquic_ev_log_generated_ack_frame(__VA_ARGS__);                     \
21450aadb33SDmitri Tikhonov} while (0)
21550aadb33SDmitri Tikhonov
21650aadb33SDmitri Tikhonovvoid
2175392f7a3SLiteSpeed Techlsquic_ev_log_generated_new_token_frame (const lsquic_cid_t *,
2185392f7a3SLiteSpeed Tech                const struct parse_funcs *, const unsigned char *, size_t len);
2195392f7a3SLiteSpeed Tech
2205392f7a3SLiteSpeed Tech#define EV_LOG_GENERATED_NEW_TOKEN_FRAME(...) do {                          \
2215392f7a3SLiteSpeed Tech    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
2225392f7a3SLiteSpeed Tech        lsquic_ev_log_generated_new_token_frame(__VA_ARGS__);               \
2235392f7a3SLiteSpeed Tech} while (0)
2245392f7a3SLiteSpeed Tech
2255392f7a3SLiteSpeed Techvoid
2265392f7a3SLiteSpeed Techlsquic_ev_log_generated_path_chal_frame (const lsquic_cid_t *,
2275392f7a3SLiteSpeed Tech                const struct parse_funcs *, const unsigned char *, size_t len);
2285392f7a3SLiteSpeed Tech
2295392f7a3SLiteSpeed Tech#define EV_LOG_GENERATED_PATH_CHAL_FRAME(...) do {                          \
2305392f7a3SLiteSpeed Tech    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
2315392f7a3SLiteSpeed Tech        lsquic_ev_log_generated_path_chal_frame(__VA_ARGS__);               \
2325392f7a3SLiteSpeed Tech} while (0)
2335392f7a3SLiteSpeed Tech
2345392f7a3SLiteSpeed Techvoid
2355392f7a3SLiteSpeed Techlsquic_ev_log_generated_path_resp_frame (const lsquic_cid_t *,
2365392f7a3SLiteSpeed Tech                const struct parse_funcs *, const unsigned char *, size_t len);
2375392f7a3SLiteSpeed Tech
2385392f7a3SLiteSpeed Tech#define EV_LOG_GENERATED_PATH_RESP_FRAME(...) do {                          \
2395392f7a3SLiteSpeed Tech    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
2405392f7a3SLiteSpeed Tech        lsquic_ev_log_generated_path_resp_frame(__VA_ARGS__);               \
2415392f7a3SLiteSpeed Tech} while (0)
2425392f7a3SLiteSpeed Tech
2435392f7a3SLiteSpeed Techvoid
2445392f7a3SLiteSpeed Techlsquic_ev_log_generated_new_connection_id_frame (const lsquic_cid_t *,
2455392f7a3SLiteSpeed Tech                const struct parse_funcs *, const unsigned char *, size_t len);
2465392f7a3SLiteSpeed Tech
2475392f7a3SLiteSpeed Tech#define EV_LOG_GENERATED_NEW_CONNECTION_ID_FRAME(...) do {                  \
2485392f7a3SLiteSpeed Tech    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
2495392f7a3SLiteSpeed Tech        lsquic_ev_log_generated_new_connection_id_frame(__VA_ARGS__);       \
2505392f7a3SLiteSpeed Tech} while (0)
2515392f7a3SLiteSpeed Tech
2525392f7a3SLiteSpeed Techvoid
2535392f7a3SLiteSpeed Techlsquic_ev_log_generated_stop_waiting_frame (const lsquic_cid_t *,
2545392f7a3SLiteSpeed Tech                                                            lsquic_packno_t);
25550aadb33SDmitri Tikhonov
256b93f59beSBob Perper#define EV_LOG_GENERATED_STOP_WAITING_FRAME(...) do {                       \
25750aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
258b93f59beSBob Perper        lsquic_ev_log_generated_stop_waiting_frame(__VA_ARGS__);            \
25950aadb33SDmitri Tikhonov} while (0)
26050aadb33SDmitri Tikhonov
26150aadb33SDmitri Tikhonovvoid
2625392f7a3SLiteSpeed Techlsquic_ev_log_generated_stop_sending_frame (const lsquic_cid_t *,
2635392f7a3SLiteSpeed Tech                                                lsquic_stream_id_t, uint16_t);
2645392f7a3SLiteSpeed Tech
2655392f7a3SLiteSpeed Tech#define EV_LOG_GENERATED_STOP_SENDING_FRAME(...) do {                       \
2665392f7a3SLiteSpeed Tech    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
2675392f7a3SLiteSpeed Tech        lsquic_ev_log_generated_stop_sending_frame(__VA_ARGS__);            \
2685392f7a3SLiteSpeed Tech} while (0)
2695392f7a3SLiteSpeed Tech
2705392f7a3SLiteSpeed Techvoid
2715392f7a3SLiteSpeed Techlsquic_ev_log_generated_http_headers (const lsquic_cid_t *, lsquic_stream_id_t,
27250aadb33SDmitri Tikhonov                            int is_server, const struct http_prio_frame *,
27350aadb33SDmitri Tikhonov                            const struct lsquic_http_headers *);
27450aadb33SDmitri Tikhonov
27550aadb33SDmitri Tikhonov
276b93f59beSBob Perper#define EV_LOG_GENERATED_HTTP_HEADERS(...) do {                             \
27750aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
278b93f59beSBob Perper        lsquic_ev_log_generated_http_headers(__VA_ARGS__);                  \
27950aadb33SDmitri Tikhonov} while (0)
28050aadb33SDmitri Tikhonov
28150aadb33SDmitri Tikhonovvoid
2825392f7a3SLiteSpeed Techlsquic_ev_log_generated_http_push_promise (const lsquic_cid_t *,
2835392f7a3SLiteSpeed Tech        lsquic_stream_id_t stream_id, lsquic_stream_id_t promised_stream_id,
28455613f44SDmitri Tikhonov        const struct lsquic_http_headers *headers);
28550aadb33SDmitri Tikhonov
286b93f59beSBob Perper#define EV_LOG_GENERATED_HTTP_PUSH_PROMISE(...) do {                        \
28750aadb33SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
288b93f59beSBob Perper        lsquic_ev_log_generated_http_push_promise(__VA_ARGS__);             \
28950aadb33SDmitri Tikhonov} while (0)
29050aadb33SDmitri Tikhonov
29155cd0b38SDmitri Tikhonovvoid
2925392f7a3SLiteSpeed Techlsquic_ev_log_create_connection (const lsquic_cid_t *, const struct sockaddr *,
29355cd0b38SDmitri Tikhonov                                                    const struct sockaddr *);
29455cd0b38SDmitri Tikhonov
29555cd0b38SDmitri Tikhonov#define EV_LOG_CREATE_CONN(...) do {                                        \
29655cd0b38SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
29755cd0b38SDmitri Tikhonov        lsquic_ev_log_create_connection(__VA_ARGS__);                       \
29855cd0b38SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_QLOG))                     \
29955cd0b38SDmitri Tikhonov        lsquic_qlog_create_connection(__VA_ARGS__);                         \
30055cd0b38SDmitri Tikhonov} while (0)
30155cd0b38SDmitri Tikhonov
30255cd0b38SDmitri Tikhonovvoid
3035392f7a3SLiteSpeed Techlsquic_ev_log_hsk_completed (const lsquic_cid_t *);
30455cd0b38SDmitri Tikhonov
30555cd0b38SDmitri Tikhonov#define EV_LOG_HSK_COMPLETED(...) do {                                      \
30655cd0b38SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
30755cd0b38SDmitri Tikhonov        lsquic_ev_log_hsk_completed(__VA_ARGS__);                           \
30855cd0b38SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_QLOG))                     \
30955cd0b38SDmitri Tikhonov        lsquic_qlog_hsk_completed(__VA_ARGS__);                             \
31055cd0b38SDmitri Tikhonov} while (0)
31155cd0b38SDmitri Tikhonov
31255cd0b38SDmitri Tikhonov
31355cd0b38SDmitri Tikhonovvoid
3147483dee0SDmitri Tikhonovlsquic_ev_log_sess_resume (const lsquic_cid_t *);
31555cd0b38SDmitri Tikhonov
3167483dee0SDmitri Tikhonov#define EV_LOG_SESSION_RESUMPTION(...) do {                                           \
31755cd0b38SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
3187483dee0SDmitri Tikhonov        lsquic_ev_log_sess_resume(__VA_ARGS__);                                \
31955cd0b38SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_QLOG))                     \
3207483dee0SDmitri Tikhonov        lsquic_qlog_sess_resume(__VA_ARGS__);                                  \
32155cd0b38SDmitri Tikhonov} while (0)
32255cd0b38SDmitri Tikhonov
32355cd0b38SDmitri Tikhonovvoid
3245392f7a3SLiteSpeed Techlsquic_ev_log_check_certs (const lsquic_cid_t *, const lsquic_str_t **, size_t);
32555cd0b38SDmitri Tikhonov
32655cd0b38SDmitri Tikhonov#define EV_LOG_CHECK_CERTS(...) do {                                        \
32755cd0b38SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
32855cd0b38SDmitri Tikhonov        lsquic_ev_log_check_certs(__VA_ARGS__);                             \
32955cd0b38SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_QLOG))                     \
33055cd0b38SDmitri Tikhonov        lsquic_qlog_check_certs(__VA_ARGS__);                               \
33155cd0b38SDmitri Tikhonov} while (0)
33255cd0b38SDmitri Tikhonov
33355cd0b38SDmitri Tikhonovvoid
334b55a5117SDmitri Tikhonovlsquic_ev_log_cert_chain (const lsquic_cid_t *, struct stack_st_X509 *);
335b55a5117SDmitri Tikhonov
336b55a5117SDmitri Tikhonov#define EV_LOG_CERT_CHAIN(...) do {                                         \
337b55a5117SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
338b55a5117SDmitri Tikhonov        lsquic_ev_log_cert_chain(__VA_ARGS__);                              \
339b55a5117SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_QLOG))                     \
340b55a5117SDmitri Tikhonov        lsquic_qlog_cert_chain(__VA_ARGS__);                                \
341b55a5117SDmitri Tikhonov} while (0)
342b55a5117SDmitri Tikhonov
343b55a5117SDmitri Tikhonovvoid
3445392f7a3SLiteSpeed Techlsquic_ev_log_version_negotiation (const lsquic_cid_t *, const char *, const char *);
34555cd0b38SDmitri Tikhonov
34655cd0b38SDmitri Tikhonov#define EV_LOG_VER_NEG(...) do {                                            \
34755cd0b38SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT))                    \
34855cd0b38SDmitri Tikhonov        lsquic_ev_log_version_negotiation(__VA_ARGS__);                     \
34955cd0b38SDmitri Tikhonov    if (LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_QLOG))                     \
35055cd0b38SDmitri Tikhonov        lsquic_qlog_version_negotiation(__VA_ARGS__);                       \
35155cd0b38SDmitri Tikhonov} while (0)
35255cd0b38SDmitri Tikhonov
35350aadb33SDmitri Tikhonov#endif
354