Wireshark 4.5.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 <[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 <glibconfig.h>
16#include <wsutil/wsgcrypt.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif /* __cplusplus */
21
22
27typedef struct _quic_stream_info {
28 uint64_t stream_id;
29 uint64_t stream_offset;
30 uint32_t offset;
31 uint32_t inorder_offset;
33 bool from_server;
35
36/*
37 * Although the QUIC SCID/DCID length field can store at most 255, v1 limits the
38 * CID length to 20.
39 */
40#define QUIC_MAX_CID_LENGTH 20
41
42typedef struct quic_cid {
43 uint8_t len;
44 uint8_t cid[QUIC_MAX_CID_LENGTH];
45 uint8_t reset_token[16];
46 bool reset_token_set;
47 uint64_t seq_num;
48 uint64_t path_id;
50
55#define QUIC_STREAM_TYPE(stream_id) ((stream_id) & 3U)
56#define QUIC_STREAM_CLIENT_BIDI 0
57#define QUIC_STREAM_SERVER_BIDI 1
58#define QUIC_STREAM_CLIENT_UNI 2
59#define QUIC_STREAM_SERVER_UNI 3
60
64#define QUIC_MP_NO_PATH_ID 1
65#define QUIC_MP_PATH_ID 2
66
69void quic_stream_add_proto_data(struct _packet_info *pinfo, quic_stream_info *stream_info, void *proto_data);
70void *quic_stream_get_proto_data(struct _packet_info *pinfo, quic_stream_info *stream_info);
71
73WS_DLL_PUBLIC uint32_t get_quic_connections_count(void);
74
75typedef struct gquic_info_data {
76 uint8_t version;
77 bool version_valid;
78 bool encoding;
79 uint16_t server_port;
81
82int
83dissect_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);
84uint32_t
85dissect_gquic_tags(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ft_tree, unsigned offset);
86
87void
88quic_add_connection(packet_info *pinfo, quic_cid_t *cid);
89void
90quic_add_loss_bits(packet_info *pinfo, uint64_t value);
91void
92quic_add_stateless_reset_token(packet_info *pinfo, tvbuff_t *tvb, int offset, const quic_cid_t *cid);
93void
94quic_add_multipath(packet_info *pinfo, unsigned version);
95void
96quic_add_grease_quic_bit(packet_info *pinfo);
97void
98quic_proto_tree_add_version(tvbuff_t *tvb, proto_tree *tree, int hfindex, unsigned offset);
99
104WS_DLL_PUBLIC bool
105quic_get_stream_id_le(unsigned streamid, unsigned sub_stream_id, unsigned *sub_stream_id_out);
106
111WS_DLL_PUBLIC bool
112quic_get_stream_id_ge(unsigned streamid, unsigned sub_stream_id, unsigned *sub_stream_id_out);
113
114
118WS_DLL_PUBLIC bool
119quic_conn_data_get_conn_client_dcid_initial(struct _packet_info *pinfo, quic_cid_t *dcid);
120
121#ifdef __cplusplus
122}
123#endif /* __cplusplus */
124
125#endif /* __PACKET_QUIC_H__ */
Definition packet_info.h:43
Definition proto.h:901
Definition packet-quic.h:27
uint32_t inorder_offset
Definition packet-quic.h:31
struct quic_info_data * quic_info
Definition packet-quic.h:32
uint32_t offset
Definition packet-quic.h:30
uint64_t stream_offset
Definition packet-quic.h:29
uint64_t stream_id
Definition packet-quic.h:28
Definition packet-quic.h:75
Definition packet-quic.h:42
Definition packet-quic.c:407
Definition tvbuff-int.h:35