Wireshark 4.7.3
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 <[email protected]>
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} quic_stream_info;
37
42typedef struct _quic_datagram_info {
44 bool from_server;
45} quic_datagram_info;
46
47/*
48 * Although the QUIC SCID/DCID length field can store at most 255, v1 limits the
49 * CID length to 20.
50 */
51#define QUIC_MAX_CID_LENGTH 20
52
53typedef struct quic_cid {
54 uint8_t len;
55 uint8_t cid[QUIC_MAX_CID_LENGTH];
56 uint8_t reset_token[16];
57 bool reset_token_set;
58 uint64_t seq_num;
59 uint64_t path_id;
60} quic_cid_t;
61
66#define QUIC_STREAM_TYPE(stream_id) ((stream_id) & 3U)
67#define QUIC_STREAM_CLIENT_BIDI 0
68#define QUIC_STREAM_SERVER_BIDI 1
69#define QUIC_STREAM_CLIENT_UNI 2
70#define QUIC_STREAM_SERVER_UNI 3
71
75#define QUIC_MP_NO_PATH_ID 1
76#define QUIC_MP_PATH_ID 2
77
79
80void quic_stream_add_proto_data(struct _packet_info *pinfo, quic_stream_info *stream_info, void *proto_data);
81void *quic_stream_get_proto_data(struct _packet_info *pinfo, quic_stream_info *stream_info);
82
84WS_DLL_PUBLIC uint32_t get_quic_connections_count(void);
85
86typedef struct gquic_info_data {
87 uint8_t version;
88 bool version_valid;
89 bool encoding;
90 uint16_t server_port;
91} gquic_info_data_t;
92
93int
94dissect_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);
95uint32_t
96dissect_gquic_tags(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ft_tree, unsigned offset);
97
98void
99quic_add_connection(packet_info *pinfo, quic_cid_t *cid);
100void
101quic_add_loss_bits(packet_info *pinfo, uint64_t value);
102void
103quic_add_stateless_reset_token(packet_info *pinfo, tvbuff_t *tvb, int offset, const quic_cid_t *cid);
104void
105quic_add_multipath(packet_info *pinfo, unsigned version);
106void
107quic_add_grease_quic_bit(packet_info *pinfo);
108void
109quic_proto_tree_add_version(tvbuff_t *tvb, proto_tree *tree, int hfindex, unsigned offset);
110
115WS_DLL_PUBLIC bool
116quic_get_stream_id_le(unsigned streamid, unsigned sub_stream_id, unsigned *sub_stream_id_out);
117
122WS_DLL_PUBLIC bool
123quic_get_stream_id_ge(unsigned streamid, unsigned sub_stream_id, unsigned *sub_stream_id_out);
124
125
129WS_DLL_PUBLIC bool
130quic_conn_data_get_conn_client_dcid_initial(struct _packet_info *pinfo, quic_cid_t *dcid);
131
132extern const reassembly_table_functions quic_reassembly_table_functions;
133
138typedef struct quic_follow_tap_data {
139 tvbuff_t *tvb;
140 uint64_t stream_id;
141 bool from_server;
142} quic_follow_tap_data_t;
143
144extern bool
145quic_get_sub_stream_id(unsigned streamid, unsigned sub_stream_id, bool le, unsigned *sub_stream_id_out);
146
147extern char *
148quic_follow_conv_filter(epan_dissect_t *edt _U_, packet_info *pinfo, unsigned *stream, unsigned *sub_stream);
149
150extern char *
151quic_follow_index_filter(unsigned stream, unsigned sub_stream);
152
154follow_quic_tap_listener(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data, tap_flags_t flags _U_);
155
156#ifdef __cplusplus
157}
158#endif /* __cplusplus */
159
160#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:42
struct quic_info_data * quic_info
Definition packet-quic.h:43
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
Definition packet-quic.h:86
Definition packet-quic.h:53
Definition packet-quic.h:138
Definition packet-quic.c:411
Table of functions for a reassembly table.
Definition reassemble.h:151
Definition stream.c:41
tap_packet_status
Definition tap.h:22