3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
10 #ifndef __PACKET_HTTP_H__
11 #define __PACKET_HTTP_H__
13 #include <epan/packet.h>
14 #include "ws_symbol_export.h"
16 WS_DLL_PUBLIC
const value_string vals_http_status_code
[];
19 void http_tcp_dissector_add(uint32_t port
, dissector_handle_t handle
);
21 void http_tcp_dissector_delete(uint32_t port
);
23 void http_tcp_port_add(uint32_t port
);
26 void http_add_path_components_to_tree(tvbuff_t
* tvb
, packet_info
* pinfo _U_
, proto_item
* item
, int offset
, int length
);
28 /* Used for HTTP statistics */
29 typedef struct _http_info_value_t
{
32 unsigned response_code
;
34 const char *request_uri
;
35 const char *referer_uri
;
37 const char *location_base_uri
;
38 const char *location_target
;
41 #define HTTP_PROTO_DATA_REQRES 0
42 #define HTTP_PROTO_DATA_INFO 1
44 /** information about a request and response on a HTTP conversation. */
45 typedef struct _http_req_res_t
{
46 /** the running number on the conversation */
48 /** frame number of the request */
49 uint32_t req_framenum
;
50 /** frame number of the corresponding response */
51 uint32_t res_framenum
;
52 /** timestamp of the request */
54 unsigned response_code
;
62 /** private data used by http dissector */
66 /** Conversation data of a HTTP connection. */
67 typedef struct _http_conv_t
{
69 /* Used to speed up desegmenting of chunked Transfer-Encoding. */
70 wmem_map_t
*chunk_offsets_fwd
;
71 wmem_map_t
*chunk_offsets_rev
;
73 /* Fields related to proxied/tunneled/Upgraded connections. */
74 uint32_t 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 */
78 char *websocket_protocol
; /* Negotiated WebSocket protocol */
79 char *websocket_extensions
; /* Negotiated WebSocket extensions */
80 /* Server address and port, known after first server response */
83 /** the tail node of req_res */
84 http_req_res_t
*req_res_tail
;
85 /** Information from the last request or response can
86 * be found in the tail node. It is only sensible to look
87 * at on the first (sequential) pass, or after startframe /
88 * startoffset on connections that have proxied/tunneled/Upgraded.
91 /* true means current message is chunked streaming, and not ended yet.
92 * This is only meaningful during the first scan.
96 /* Used for req/res matching */
98 wmem_map_t
*matches_table
;
102 /* Used for HTTP Export Object feature */
103 typedef struct _http_eo_t
{
110 #endif /* __PACKET_HTTP_H__ */