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 
43 typedef struct _http_req_res_t {
45  guint32 number;
47  guint32 req_framenum;
49  guint32 res_framenum;
52  guint response_code;
53  gchar *request_method;
54  gchar *http_host;
55  gchar *request_uri;
56  gchar *full_uri;
62  void* private_data;
64 
66 typedef struct _http_conv_t {
67  guint32 req_res_num;
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 } http_conv_t;
97 
98 /* Used for HTTP Export Object feature */
99 typedef struct _http_eo_t {
100  gchar *hostname;
101  gchar *filename;
102  gchar *content_type;
103  tvbuff_t *payload;
104 } http_eo_t;
105 
106 #endif /* __PACKET_HTTP_H__ */
Definition: address.h:55
Definition: packet-http.h:66
guint32 req_res_num
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:99
Definition: packet-http.h:29
Definition: packet-http.h:43
nstime_t req_ts
Definition: packet-http.h:51
struct _http_req_res_t * prev
Definition: packet-http.h:60
guint32 req_framenum
Definition: packet-http.h:47
void * private_data
Definition: packet-http.h:62
struct _http_req_res_t * next
Definition: packet-http.h:58
guint32 number
Definition: packet-http.h:45
guint32 res_framenum
Definition: packet-http.h:49
Definition: packet_info.h:44
Definition: proto.h:897
Definition: value_string.h:26
Definition: wmem_map.c:44
Definition: packet.c:762
Definition: nstime.h:26
Definition: tvbuff-int.h:35