diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-02-24 00:00:03 +0000 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2020-09-14 07:53:09 +0000 |
commit | 7cc0cd365b7e86704dfa774f6ab1c46a3095a6f0 (patch) | |
tree | ade97bbfe511fb14af8c2dd99800318fc3f2245f | |
parent | 1f93fef89bb52038559a8ac9c9b09431d3207275 (diff) | |
download | wireshark-7cc0cd365b7e86704dfa774f6ab1c46a3095a6f0.tar.gz wireshark-7cc0cd365b7e86704dfa774f6ab1c46a3095a6f0.tar.bz2 wireshark-7cc0cd365b7e86704dfa774f6ab1c46a3095a6f0.zip |
Put back the NCP Group Type item for LIP Echo packets.
Change-Id: Ifc26e939ed204ec55eb508f26d0f47c4a6f38484
Reviewed-on: https://code.wireshark.org/review/32179
Reviewed-by: Guy Harris <guy@alum.mit.edu>
(cherry picked from commit 95bf9f5e0acac09f35cd8e8467cb6d93fb5a0d78)
-rw-r--r-- | epan/dissectors/packet-ncp-int.h | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-ncp.c | 23 | ||||
-rw-r--r-- | epan/dissectors/packet-ncp2222.inc | 13 |
3 files changed, 21 insertions, 17 deletions
diff --git a/epan/dissectors/packet-ncp-int.h b/epan/dissectors/packet-ncp-int.h index 645138a265..1e3c840999 100644 --- a/epan/dissectors/packet-ncp-int.h +++ b/epan/dissectors/packet-ncp-int.h @@ -122,7 +122,7 @@ WS_DLL_PUBLIC const value_string nmas_subverb_enum[]; WS_DLL_PUBLIC const value_string ncp_nds_verb_vals[]; void dissect_ncp_request(tvbuff_t*, packet_info*, guint32, - guint8, guint16, proto_tree *volatile); + guint8, guint16, gboolean, proto_tree *volatile); void dissect_ncp_reply(tvbuff_t *, packet_info*, guint32, guint8, guint16, proto_tree*, struct novell_tap*); diff --git a/epan/dissectors/packet-ncp.c b/epan/dissectors/packet-ncp.c index 543fa44d32..aba0f7c2e3 100644 --- a/epan/dissectors/packet-ncp.c +++ b/epan/dissectors/packet-ncp.c @@ -777,7 +777,7 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *ti; struct ncp_ip_header ncpiph; struct ncp_ip_rqhdr ncpiphrq; - gboolean is_lip_echo = FALSE; + gboolean is_lip_echo_allocate_slot = FALSE; guint16 ncp_burst_seqno, ncp_ack_seqno; guint16 flags = 0; proto_tree *flags_tree = NULL; @@ -1130,8 +1130,8 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (length_remaining >= LIP_ECHO_MAGIC_LEN && tvb_memeql(tvb, commhdr+4, lip_echo_magic, LIP_ECHO_MAGIC_LEN) == 0) { /* This is a LIP Echo. */ - is_lip_echo = TRUE; - col_add_str(pinfo->cinfo, COL_INFO, "LIP Echo"); + is_lip_echo_allocate_slot = TRUE; + col_set_str(pinfo->cinfo, COL_INFO, "LIP Echo"); } /* fall through */ @@ -1144,7 +1144,7 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree_add_uint(ncp_tree, hf_ncp_seq, tvb, commhdr + 2, 1, header.sequence); /* XXX - what's at commhdr + 3 in a LIP Echo packet? commhdr + 4 on is the LIP echo magic number and data. */ - if (!is_lip_echo) { + if (!is_lip_echo_allocate_slot) { proto_tree_add_uint(ncp_tree, hf_ncp_connection,tvb, commhdr + 3, 3, nw_connection); proto_tree_add_item(ncp_tree, hf_ncp_task, tvb, commhdr + 4, 1, ENC_BIG_ENDIAN); } @@ -1157,22 +1157,21 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, switch (header.type) { case NCP_ALLOCATE_SLOT: /* Allocate Slot Request */ - if (is_lip_echo) { + if (is_lip_echo_allocate_slot) { length_remaining = tvb_reported_length_remaining(tvb, commhdr + 4); proto_tree_add_item(ncp_tree, hf_lip_echo_magic, tvb, commhdr + 4, LIP_ECHO_MAGIC_LEN, ENC_ASCII|ENC_NA); if (length_remaining > LIP_ECHO_MAGIC_LEN) proto_tree_add_item(ncp_tree, hf_lip_echo_payload, tvb, commhdr+4+LIP_ECHO_MAGIC_LEN, length_remaining - LIP_ECHO_MAGIC_LEN, ENC_NA); - } else { - next_tvb = tvb_new_subset_remaining(tvb, commhdr); - dissect_ncp_request(next_tvb, pinfo, nw_connection, - header.sequence, header.type, ncp_tree); } + next_tvb = tvb_new_subset_remaining(tvb, commhdr); + dissect_ncp_request(next_tvb, pinfo, nw_connection, + header.sequence, header.type, is_lip_echo_allocate_slot, ncp_tree); break; case NCP_DEALLOCATE_SLOT: /* Deallocate Slot Request */ next_tvb = tvb_new_subset_remaining(tvb, commhdr); dissect_ncp_request(next_tvb, pinfo, nw_connection, - header.sequence, header.type, ncp_tree); + header.sequence, header.type, FALSE, ncp_tree); break; case NCP_SERVICE_REQUEST: /* Server NCP Request */ @@ -1197,12 +1196,12 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, default: dissect_ncp_request(next_tvb, pinfo, nw_connection, header.sequence, - header.type, ncp_tree); + header.type, FALSE, ncp_tree); break; } } else { dissect_ncp_request(next_tvb, pinfo, nw_connection, - header.sequence, header.type, ncp_tree); + header.sequence, header.type, FALSE, ncp_tree); } break; diff --git a/epan/dissectors/packet-ncp2222.inc b/epan/dissectors/packet-ncp2222.inc index c9bba6ff83..4e9178d63b 100644 --- a/epan/dissectors/packet-ncp2222.inc +++ b/epan/dissectors/packet-ncp2222.inc @@ -6984,7 +6984,8 @@ ncp2222_compile_dfilters(void) void dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo, guint32 nw_connection, guint8 sequence, - guint16 type, proto_tree *volatile ncp_tree) + guint16 type, gboolean is_lip_echo_allocate_slot, + proto_tree *volatile ncp_tree) { volatile guint8 func=0; volatile guint8 subfunc = 0; @@ -7013,9 +7014,13 @@ dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo, /* Determine which ncp_record to use. */ switch (type) { case NCP_ALLOCATE_SLOT: - ncp_rec = &ncp1111_request; - if (ncp_echo_conn) { - expert_add_info(pinfo, NULL, &ei_ncp_connection_request); + if (is_lip_echo_allocate_slot) { + ncp_rec = &ncplip_echo; + } else { + ncp_rec = &ncp1111_request; + if (ncp_echo_conn) { + expert_add_info(pinfo, NULL, &ei_ncp_connection_request); + } } break; case NCP_SERVICE_REQUEST: |