aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-02-23 16:00:03 -0800
committerGuy Harris <guy@alum.mit.edu>2019-02-24 00:00:43 +0000
commit95bf9f5e0acac09f35cd8e8467cb6d93fb5a0d78 (patch)
tree1c5756c8c4a15e63dc5182c16c2a68f93d0ab925
parentd99cd2ed739277f714cb7e67c60264269d73c755 (diff)
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>
-rw-r--r--epan/dissectors/packet-ncp-int.h2
-rw-r--r--epan/dissectors/packet-ncp.c23
-rw-r--r--epan/dissectors/packet-ncp2222.inc13
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 ba4eb57bac..b62e9b31f1 100644
--- a/epan/dissectors/packet-ncp.c
+++ b/epan/dissectors/packet-ncp.c
@@ -784,7 +784,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;
@@ -1137,8 +1137,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 */
@@ -1151,7 +1151,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);
}
@@ -1164,22 +1164,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 */
@@ -1204,12 +1203,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 e386c63502..fd6bc81ed0 100644
--- a/epan/dissectors/packet-ncp2222.inc
+++ b/epan/dissectors/packet-ncp2222.inc
@@ -6982,7 +6982,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;
@@ -7011,9 +7012,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: