2001-01-11 06:30:54 +00:00
|
|
|
/* packet-http.h
|
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2001-01-11 06:30:54 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2018-02-12 11:23:27 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2001-01-11 06:30:54 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __PACKET_HTTP_H__
|
|
|
|
#define __PACKET_HTTP_H__
|
2003-09-02 23:09:11 +00:00
|
|
|
|
2003-09-02 22:47:59 +00:00
|
|
|
#include <epan/packet.h>
|
2013-03-01 23:53:11 +00:00
|
|
|
#include "ws_symbol_export.h"
|
2001-01-11 06:30:54 +00:00
|
|
|
|
2020-01-24 21:22:40 +00:00
|
|
|
WS_DLL_PUBLIC const value_string vals_http_status_code[];
|
2015-10-22 17:40:54 +00:00
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2016-04-17 02:31:22 +00:00
|
|
|
void http_tcp_dissector_add(guint32 port, dissector_handle_t handle);
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2016-10-07 20:25:01 +00:00
|
|
|
void http_tcp_dissector_delete(guint32 port);
|
|
|
|
WS_DLL_PUBLIC
|
2016-04-17 02:31:22 +00:00
|
|
|
void http_tcp_port_add(guint32 port);
|
2001-01-11 06:30:54 +00:00
|
|
|
|
2007-03-13 20:42:04 +00:00
|
|
|
/* Used for HTTP statistics */
|
|
|
|
typedef struct _http_info_value_t {
|
|
|
|
guint32 framenum;
|
2012-04-20 15:31:15 +00:00
|
|
|
gchar *request_method;
|
2003-09-02 23:09:11 +00:00
|
|
|
guint response_code;
|
2005-02-28 22:27:24 +00:00
|
|
|
gchar *http_host;
|
2012-12-26 05:57:06 +00:00
|
|
|
const gchar *request_uri;
|
2018-01-15 01:19:06 +00:00
|
|
|
const gchar *referer_uri;
|
|
|
|
const gchar *full_uri;
|
2018-03-29 02:58:29 +00:00
|
|
|
const gchar *location_base_uri;
|
|
|
|
const gchar *location_target;
|
2007-03-13 20:42:04 +00:00
|
|
|
} http_info_value_t;
|
|
|
|
|
2020-01-24 21:22:40 +00:00
|
|
|
|
2013-02-16 14:59:00 +00:00
|
|
|
/** information about a request and response on a HTTP conversation. */
|
|
|
|
typedef struct _http_req_res_t {
|
|
|
|
/** the running number on the conversation */
|
|
|
|
guint32 number;
|
|
|
|
/** frame number of the request */
|
|
|
|
guint32 req_framenum;
|
|
|
|
/** frame number of the corresponding response */
|
|
|
|
guint32 res_framenum;
|
|
|
|
/** timestamp of the request */
|
|
|
|
nstime_t req_ts;
|
|
|
|
/** pointer to the next element in the linked list, NULL for the tail node */
|
|
|
|
struct _http_req_res_t *next;
|
|
|
|
/** pointer to the previous element in the linked list, NULL for the head node */
|
|
|
|
struct _http_req_res_t *prev;
|
|
|
|
} http_req_res_t;
|
|
|
|
|
|
|
|
/** Conversation data of a HTTP connection. */
|
2007-03-13 20:42:04 +00:00
|
|
|
typedef struct _http_conv_t {
|
|
|
|
guint response_code;
|
2018-08-12 15:38:54 +00:00
|
|
|
guint32 req_res_num; /**< The number of requests in the conversation. */
|
2007-03-13 20:42:04 +00:00
|
|
|
gchar *http_host;
|
|
|
|
gchar *request_method;
|
|
|
|
gchar *request_uri;
|
2018-03-29 02:58:29 +00:00
|
|
|
gchar *full_uri;
|
2018-08-12 15:38:54 +00:00
|
|
|
|
|
|
|
/* Fields related to proxied/tunneled/Upgraded connections. */
|
|
|
|
guint32 startframe; /* First frame of proxied connection */
|
|
|
|
int startoffset; /* Offset within the frame where the new protocol begins. */
|
2018-08-12 16:51:10 +00:00
|
|
|
dissector_handle_t next_handle; /* New protocol */
|
2018-08-12 15:38:54 +00:00
|
|
|
|
2016-03-26 21:44:50 +00:00
|
|
|
gchar *websocket_protocol; /* Negotiated WebSocket protocol */
|
2017-09-12 12:48:43 +00:00
|
|
|
gchar *websocket_extensions; /* Negotiated WebSocket extensions */
|
2014-04-27 08:39:23 +00:00
|
|
|
/* Server address and port, known after first server response */
|
|
|
|
guint16 server_port;
|
2014-04-27 19:28:08 +00:00
|
|
|
address server_addr;
|
2013-02-16 14:59:00 +00:00
|
|
|
/** the tail node of req_res */
|
|
|
|
http_req_res_t *req_res_tail;
|
2007-03-13 20:42:04 +00:00
|
|
|
} http_conv_t;
|
2003-09-02 23:09:11 +00:00
|
|
|
|
2016-08-22 06:33:23 +00:00
|
|
|
typedef enum _http_type {
|
|
|
|
HTTP_REQUEST,
|
|
|
|
HTTP_RESPONSE,
|
|
|
|
HTTP_NOTIFICATION,
|
2018-11-29 09:48:46 +00:00
|
|
|
HTTP_OTHERS,
|
|
|
|
SIP_DATA /* If the content is from the SIP dissector*/
|
2016-08-22 06:33:23 +00:00
|
|
|
} http_type_t;
|
|
|
|
|
|
|
|
/** Passed to dissectors called by the HTTP dissector. */
|
|
|
|
typedef struct _http_message_info_t {
|
2018-11-29 09:48:46 +00:00
|
|
|
http_type_t type; /**< Message type; may be HTTP_OTHERS if not called by HTTP */
|
|
|
|
const char *media_str; /**< Content-Type parameters */
|
2019-01-21 15:41:53 +00:00
|
|
|
const char *content_id; /**< Content-ID parameter */
|
2018-11-29 09:48:46 +00:00
|
|
|
void *data; /**< The http_type is used to indicate the data transported */
|
2016-08-22 06:33:23 +00:00
|
|
|
} http_message_info_t;
|
|
|
|
|
2007-03-13 20:42:04 +00:00
|
|
|
#endif /* __PACKET_HTTP_H__ */
|