Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
packet-quic.h
1/* packet-quic.h
2 *
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
6 *
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
9
10#ifndef __PACKET_QUIC_H__
11#define __PACKET_QUIC_H__
12
13#include "ws_symbol_export.h"
14
15#include <epan/reassemble.h>
16#include <epan/tap.h>
17#include <wsutil/wsgcrypt.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif /* __cplusplus */
22
23
29typedef struct _quic_stream_info {
30 uint64_t stream_id;
31 uint64_t stream_offset;
32 uint32_t offset;
34 bool from_server;
35 bool fin;
36 bool fin_only;
37} quic_stream_info;
38
43typedef struct _quic_datagram_info {
45 bool from_server;
46} quic_datagram_info;
47
48/*
49 * Although the QUIC SCID/DCID length field can store at most 255, v1 limits the
50 * CID length to 20.
51 */
52#define QUIC_MAX_CID_LENGTH 20
53
54typedef struct quic_cid {
55 uint8_t len;
56 uint8_t cid[QUIC_MAX_CID_LENGTH];
57 uint8_t reset_token[16];
58 bool reset_token_set;
59 uint64_t seq_num;
60 uint64_t path_id;
61} quic_cid_t;
62
67#define QUIC_STREAM_TYPE(stream_id) ((stream_id) & 3U)
68#define QUIC_STREAM_CLIENT_BIDI 0
69#define QUIC_STREAM_SERVER_BIDI 1
70#define QUIC_STREAM_CLIENT_UNI 2
71#define QUIC_STREAM_SERVER_UNI 3
72
76#define QUIC_MP_NO_PATH_ID 1
77#define QUIC_MP_PATH_ID 2
78
80
81void quic_stream_add_proto_data(struct _packet_info *pinfo, quic_stream_info *stream_info, void *proto_data);
82void *quic_stream_get_proto_data(struct _packet_info *pinfo, quic_stream_info *stream_info);
83
85WS_DLL_PUBLIC uint32_t get_quic_connections_count(void);
86
87typedef struct gquic_info_data {
88 uint8_t version;
89 bool version_valid;
90 bool encoding;
91 uint16_t server_port;
92} gquic_info_data_t;
93
94int
95dissect_gquic_frame_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *gquic_tree, unsigned offset, uint8_t len_pkn, gquic_info_data_t *gquic_info);
96uint32_t
97dissect_gquic_tags(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ft_tree, unsigned offset);
98
99void
100quic_add_connection(packet_info *pinfo, quic_cid_t *cid);
101void
102quic_add_loss_bits(packet_info *pinfo, uint64_t value);
103void
104quic_add_stateless_reset_token(packet_info *pinfo, tvbuff_t *tvb, int offset, const quic_cid_t *cid);
105void
106quic_add_multipath(packet_info *pinfo, unsigned version);
107void
108quic_add_grease_quic_bit(packet_info *pinfo);
109void
110quic_proto_tree_add_version(tvbuff_t *tvb, proto_tree *tree, int hfindex, unsigned offset);
111
116WS_DLL_PUBLIC bool
117quic_get_stream_id_le(unsigned streamid, unsigned sub_stream_id, unsigned *sub_stream_id_out);
118
123WS_DLL_PUBLIC bool
124quic_get_stream_id_ge(unsigned streamid, unsigned sub_stream_id, unsigned *sub_stream_id_out);
125
126
130WS_DLL_PUBLIC bool
131quic_conn_data_get_conn_client_dcid_initial(struct _packet_info *pinfo, quic_cid_t *dcid);
132
133extern const reassembly_table_functions quic_reassembly_table_functions;
134
139typedef struct quic_follow_tap_data {
140 tvbuff_t *tvb;
141 uint64_t stream_id;
142 bool from_server;
143} quic_follow_tap_data_t;
144
145extern bool
146quic_get_sub_stream_id(unsigned streamid, unsigned sub_stream_id, bool le, unsigned *sub_stream_id_out);
147
148extern char *
149quic_follow_conv_filter(epan_dissect_t *edt _U_, packet_info *pinfo, unsigned *stream, unsigned *sub_stream);
150
151extern char *
152quic_follow_index_filter(unsigned stream, unsigned sub_stream);
153
155follow_quic_tap_listener(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data, tap_flags_t flags _U_);
156
157#ifdef __cplusplus
158}
159#endif /* __cplusplus */
160
161#endif /* __PACKET_QUIC_H__ */
struct epan_dissect epan_dissect_t
Opaque type representing a single packet dissection context.
Definition epan.h:62
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43
Definition packet-quic.h:43
struct quic_info_data * quic_info
Definition packet-quic.h:44
Definition packet-quic.h:29
struct quic_info_data * quic_info
Definition packet-quic.h:33
uint32_t offset
Definition packet-quic.h:32
uint64_t stream_offset
Definition packet-quic.h:31
uint64_t stream_id
Definition packet-quic.h:30
bool fin
Definition packet-quic.h:35
bool fin_only
Definition packet-quic.h:36
Definition packet-quic.h:87
Definition packet-quic.h:54
Definition packet-quic.h:139
Definition packet-quic.c:412
Table of functions for a reassembly table.
Definition reassemble.h:151
Definition stream.c:41
tap_packet_status
Definition tap.h:22