whois: add query string to info column.

Keep track of it in the conversation to reuse the string in the
answer as well.

Bug: 16291
Change-Id: I1be6efe4456867b9e33ba15ca06d039a6fb9fed0
Reviewed-on: https://code.wireshark.org/review/35551
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Dario Lombardo 2019-12-22 17:04:52 +01:00 committed by Michael Mann
parent 87ef6cea34
commit e306618d56
1 changed files with 10 additions and 0 deletions

View File

@ -34,6 +34,7 @@ typedef struct _whois_transaction_t {
guint32 req_frame;
guint32 rep_frame;
nstime_t req_time;
guint8* query;
} whois_transaction_t;
static int
@ -60,10 +61,19 @@ dissect_whois(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
conversation = find_or_create_conversation(pinfo);
whois_trans = (whois_transaction_t *)conversation_get_proto_data(conversation, proto_whois);
if (whois_trans == NULL) {
gint newline;
whois_trans = wmem_new0(wmem_file_scope(), whois_transaction_t);
newline = tvb_find_guint8(tvb, 0, -1, '\n');
if (newline != -1)
whois_trans->query = (guint8*)tvb_memdup(wmem_file_scope(), tvb, 0, newline);
conversation_add_proto_data(conversation, proto_whois, whois_trans);
}
if (whois_trans->query) {
col_append_str(pinfo->cinfo, COL_INFO, ": ");
col_append_str(pinfo->cinfo, COL_INFO, whois_trans->query);
}
len = tvb_reported_length(tvb);
if (!PINFO_FD_VISITED(pinfo)) {
if (pinfo->can_desegment) {