Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-http.h
blobedd025e541aba6913bf68593adb685a98cef7b36
1 /* packet-http.h
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
8 */
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[];
18 WS_DLL_PUBLIC
19 void http_tcp_dissector_add(uint32_t port, dissector_handle_t handle);
20 WS_DLL_PUBLIC
21 void http_tcp_dissector_delete(uint32_t port);
22 WS_DLL_PUBLIC
23 void http_tcp_port_add(uint32_t port);
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);
28 /* Used for HTTP statistics */
29 typedef struct _http_info_value_t {
30 uint32_t framenum;
31 char *request_method;
32 unsigned response_code;
33 char *http_host;
34 const char *request_uri;
35 const char *referer_uri;
36 const char *full_uri;
37 const char *location_base_uri;
38 const char *location_target;
39 } http_info_value_t;
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 */
47 uint32_t number;
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 */
53 nstime_t req_ts;
54 unsigned response_code;
55 char *request_method;
56 char *http_host;
57 char *request_uri;
58 char *full_uri;
59 bool req_has_range;
60 bool resp_has_range;
62 /** private data used by http dissector */
63 void* private_data;
64 } http_req_res_t;
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 */
81 uint16_t server_port;
82 address server_addr;
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.
94 bool message_ended;
96 /* Used for req/res matching */
97 GSList *req_list;
98 wmem_map_t *matches_table;
100 } http_conv_t;
102 /* Used for HTTP Export Object feature */
103 typedef struct _http_eo_t {
104 char *hostname;
105 char *filename;
106 char *content_type;
107 tvbuff_t *payload;
108 } http_eo_t;
110 #endif /* __PACKET_HTTP_H__ */