diff options
author | Peter Wu <peter@lekensteyn.nl> | 2018-09-27 12:58:46 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-09-27 12:18:28 +0000 |
commit | cc69e09981a4bb0c09a7dc546bc71181e1b9b6cc (patch) | |
tree | 0c04ca578530bfeee981583730b7875fc74c8834 /epan/dissectors/packet-http2.c | |
parent | 776b4d5646ee60fe53b8ee71f98970d3593b7c1f (diff) |
HTTP2: allow subdissectors to query the Stream ID
This will be used by the DNS dissector to distinguish different
request/response pairs over the same connection (for DoH).
Change-Id: I53721904b007847861807faa1a2137e696639428
Reviewed-on: https://code.wireshark.org/review/29888
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-http2.c')
-rw-r--r-- | epan/dissectors/packet-http2.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/epan/dissectors/packet-http2.c b/epan/dissectors/packet-http2.c index 2713060c83..654b286a6e 100644 --- a/epan/dissectors/packet-http2.c +++ b/epan/dissectors/packet-http2.c @@ -1105,6 +1105,25 @@ get_http2_session(packet_info *pinfo) return h2session; } +guint32 +http2_get_stream_id(packet_info *pinfo) +{ + conversation_t *conversation; + http2_session_t *h2session; + + conversation = find_conversation_pinfo(pinfo, 0); + if (!conversation) { + return 0; + } + + h2session = (http2_session_t*)conversation_get_proto_data(conversation, proto_http2); + if (!h2session) { + return 0; + } + + return h2session->current_stream_id; +} + #ifdef HAVE_NGHTTP2 static guint32 select_http2_flow_index(packet_info *pinfo, http2_session_t *h2session) |