aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-http.c
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2016-03-26 22:44:50 +0100
committerMichael Mann <mmann78@netscape.net>2016-03-27 14:07:26 +0000
commitaab206c4e9cf038adca583cfa3744d3013210215 (patch)
treefdd2f0060d0d488ae41dbf26cc6c48c93f8984e4 /epan/dissectors/packet-http.c
parentdd6a74894f5cac1c3b2a3706e1e2e219b3440c0c (diff)
Add dissector table for negotiated WebSocket protocol
This adds the possibility to filter on the negotiated WebSocket protocol from the upgrade response as well as on a specific TCP port Bug: 12298 Change-Id: I8e0b785cec0b8c71ec558b74ac07c81194268b38 Signed-off-by: Gregor Jasny <gjasny@googlemail.com> Reviewed-on: https://code.wireshark.org/review/14645 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-http.c')
-rw-r--r--epan/dissectors/packet-http.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index ba44f06f8b..695d970a6e 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -2328,6 +2328,7 @@ typedef struct {
#define HDR_HOST 7
#define HDR_UPGRADE 8
#define HDR_COOKIE 9
+#define HDR_WEBSOCKET_PROTOCOL 10
static const header_info headers[] = {
{ "Authorization", &hf_http_authorization, HDR_AUTHORIZATION },
@@ -2354,7 +2355,7 @@ static const header_info headers[] = {
{ "Sec-WebSocket-Accept", &hf_http_sec_websocket_accept, HDR_NO_SPECIAL },
{ "Sec-WebSocket-Extensions", &hf_http_sec_websocket_extensions, HDR_NO_SPECIAL },
{ "Sec-WebSocket-Key", &hf_http_sec_websocket_key, HDR_NO_SPECIAL },
- { "Sec-WebSocket-Protocol", &hf_http_sec_websocket_protocol, HDR_NO_SPECIAL },
+ { "Sec-WebSocket-Protocol", &hf_http_sec_websocket_protocol, HDR_WEBSOCKET_PROTOCOL },
{ "Sec-WebSocket-Version", &hf_http_sec_websocket_version, HDR_NO_SPECIAL },
{ "Set-Cookie", &hf_http_set_cookie, HDR_NO_SPECIAL },
{ "Last-Modified", &hf_http_last_modified, HDR_NO_SPECIAL },
@@ -2796,6 +2797,12 @@ process_header(tvbuff_t *tvb, int offset, int next_offset,
}
break;
+ case HDR_WEBSOCKET_PROTOCOL:
+ if (http_type == HTTP_RESPONSE) {
+ conv_data->websocket_protocol = wmem_strndup(wmem_file_scope(), value, value_len);
+ }
+ break;
+
}
}
}