Wireshark  4.3.0
The Wireshark network protocol analyzer
packet-http.h
1 /* packet-http.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_HTTP_H__
11 #define __PACKET_HTTP_H__
12 
13 #include <epan/packet.h>
14 #include "ws_symbol_export.h"
15 
16 WS_DLL_PUBLIC const value_string vals_http_status_code[];
17 
18 WS_DLL_PUBLIC
19 void http_tcp_dissector_add(guint32 port, dissector_handle_t handle);
20 WS_DLL_PUBLIC
21 void http_tcp_dissector_delete(guint32 port);
22 WS_DLL_PUBLIC
23 void http_tcp_port_add(guint32 port);
24 
25 WS_DLL_PUBLIC
26 void http_add_path_components_to_tree(tvbuff_t* tvb, packet_info* pinfo _U_, proto_item* item, int offset, int length);
27 
28 /* Used for HTTP statistics */
29 typedef struct _http_info_value_t {
30  guint32 framenum;
31  gchar *request_method;
32  guint response_code;
33  gchar *http_host;
34  const gchar *request_uri;
35  const gchar *referer_uri;
36  const gchar *full_uri;
37  const gchar *location_base_uri;
38  const gchar *location_target;
40 
41 #define HTTP_PROTO_DATA_REQRES 0
42 #define HTTP_PROTO_DATA_INFO 1
43 
45 typedef struct _http_req_res_t {
47  guint32 number;
49  guint32 req_framenum;
51  guint32 res_framenum;
54  guint response_code;
55  gchar *request_method;
56  gchar *http_host;
57  gchar *request_uri;
58  gchar *full_uri;
59  gboolean req_has_range;
60  gboolean resp_has_range;
61 
63  void* private_data;
65 
67 typedef struct _http_conv_t {
68 
69  /* Used to speed up desegmenting of chunked Transfer-Encoding. */
70  wmem_map_t *chunk_offsets_fwd;
71  wmem_map_t *chunk_offsets_rev;
72 
73  /* Fields related to proxied/tunneled/Upgraded connections. */
74  guint32 startframe; /* First frame of proxied connection */
75  int startoffset; /* Offset within the frame where the new protocol begins. */
76  dissector_handle_t next_handle; /* New protocol */
77 
78  gchar *websocket_protocol; /* Negotiated WebSocket protocol */
79  gchar *websocket_extensions; /* Negotiated WebSocket extensions */
80  /* Server address and port, known after first server response */
81  guint16 server_port;
82  address server_addr;
91  /* TRUE means current message is chunked streaming, and not ended yet.
92  * This is only meaningful during the first scan.
93  */
94  gboolean message_ended;
95 
96  /* Used for req/res matching */
97  GSList *req_list;
98  wmem_map_t *matches_table;
99 
100 } http_conv_t;
101 
102 /* Used for HTTP Export Object feature */
103 typedef struct _http_eo_t {
104  gchar *hostname;
105  gchar *filename;
106  gchar *content_type;
107  tvbuff_t *payload;
108 } http_eo_t;
109 
110 #endif /* __PACKET_HTTP_H__ */
Definition: address.h:56
Definition: packet-http.h:67
http_req_res_t * req_res_tail
Definition: packet-http.h:84
gboolean message_ended
Definition: packet-http.h:94
Definition: packet-http.h:103
Definition: packet-http.h:29
Definition: packet-http.h:45
nstime_t req_ts
Definition: packet-http.h:53
guint32 req_framenum
Definition: packet-http.h:49
void * private_data
Definition: packet-http.h:63
guint32 number
Definition: packet-http.h:47
guint32 res_framenum
Definition: packet-http.h:51
Definition: packet_info.h:44
Definition: proto.h:904
Definition: value_string.h:26
Definition: wmem_map.c:44
Definition: packet.c:763
Definition: nstime.h:26
Definition: tvbuff-int.h:35