add an expert info if a capture file contains some (yet) undecoded portions

svn path=/trunk/; revision=18534
This commit is contained in:
Ulf Lamping 2006-06-21 18:35:39 +00:00
parent 73e1406b4f
commit 1d51934de2
4 changed files with 78 additions and 21 deletions

View File

@ -38,6 +38,7 @@
#include <epan/packet.h>
#include <epan/emem.h>
#include <epan/dissectors/packet-dcerpc.h>
#include <epan/expert.h>
static int proto_pn_dcp = -1;
@ -415,6 +416,7 @@ dissect_PNDCP_Suboption_IP(tvbuff_t *tvb, int offset, packet_info *pinfo,
guint16 status;
guint16 req_status;
guint32 ip;
proto_item *item;
offset = dissect_pn_uint8 (tvb, offset, pinfo, tree, hf_pn_dcp_suboption_ip, &suboption);
@ -455,8 +457,11 @@ dissect_PNDCP_Suboption_IP(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_item_append_text(block_item, ", Router: %s", ip_to_str((guint8*)&ip));
break;
default:
proto_tree_add_string_format(tree, hf_pn_dcp_data, tvb, offset, block_length, "data",
item = proto_tree_add_string_format(tree, hf_pn_dcp_data, tvb, offset, block_length, "data",
"Block data(0x%x/0x%x): %d bytes", PNDCP_OPTION_IP, suboption, block_length);
expert_add_info_format(pinfo, item, PI_UNDECODED, PI_WARN,
"Undecoded suboption %u, %u bytes",
suboption, block_length);
offset += block_length;
}
@ -479,6 +484,7 @@ dissect_PNDCP_Suboption_Device(tvbuff_t *tvb, int offset, packet_info *pinfo,
guint8* typeofstation;
guint8* nameofstation;
guint16 status=0;
proto_item *item;
offset = dissect_pn_uint8(tvb, offset, pinfo, tree, hf_pn_dcp_suboption_device, &suboption);
offset = dissect_pn_uint16(tvb, offset, pinfo, tree, hf_pn_dcp_block_length, &block_length);
@ -550,8 +556,11 @@ dissect_PNDCP_Suboption_Device(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
break;
default:
proto_tree_add_string_format(tree, hf_pn_dcp_data, tvb, offset, block_length, "data",
item = proto_tree_add_string_format(tree, hf_pn_dcp_data, tvb, offset, block_length, "data",
"Block data(0x%x/0x%x): %d bytes", PNDCP_OPTION_DEVICE, suboption, block_length);
expert_add_info_format(pinfo, item, PI_UNDECODED, PI_WARN,
"Undecoded suboption %u, %u bytes",
suboption, block_length);
offset += block_length;
}
@ -565,11 +574,9 @@ dissect_PNDCP_Suboption_DHCP(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, proto_item *block_item, proto_item *dcp_item,
gboolean is_response _U_)
{
/*guint8 result;*/
guint8 suboption;
guint16 block_length;
/*gchar *info_str;*/
/*guint16 status;*/
proto_item *item;
offset = dissect_pn_uint8(tvb, offset, pinfo, tree, hf_pn_dcp_suboption_dhcp, &suboption);
@ -583,8 +590,11 @@ dissect_PNDCP_Suboption_DHCP(tvbuff_t *tvb, int offset, packet_info *pinfo,
offset += block_length;
break;
default:
proto_tree_add_string_format(tree, hf_pn_dcp_data, tvb, offset, block_length, "data",
item = proto_tree_add_string_format(tree, hf_pn_dcp_data, tvb, offset, block_length, "data",
"Block data(0x%x/0x%x): %d bytes", PNDCP_OPTION_DHCP, suboption, block_length);
expert_add_info_format(pinfo, item, PI_UNDECODED, PI_WARN,
"Undecoded suboption %u, %u bytes",
suboption, block_length);
offset += block_length;
}
@ -598,16 +608,19 @@ dissect_PNDCP_Suboption_LLDP(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, proto_item *block_item, proto_item *dcp_item,
gboolean is_response _U_)
{
/*guint8 result;*/
guint8 suboption;
/*guint16 block_length;*/
/*gchar *info_str;*/
/*guint16 status;*/
guint16 block_length;
proto_item *item;
offset = dissect_pn_uint8(tvb, offset, pinfo, tree, hf_pn_dcp_suboption_lldp, &suboption);
offset = dissect_pn_uint16(tvb, offset, pinfo, tree, hf_pn_dcp_block_length, &block_length);
/* XXX - improve this */
item = proto_tree_add_string_format(tree, hf_pn_dcp_data, tvb, offset, block_length, "data",
"Block data(0x%x/0x%x): %d bytes", PNDCP_OPTION_LLDP, suboption, block_length);
expert_add_info_format(pinfo, item, PI_UNDECODED, PI_WARN,
"Undecoded suboption %u", suboption);
return offset;
}
@ -624,6 +637,7 @@ dissect_PNDCP_Suboption_Control(tvbuff_t *tvb, int offset, packet_info *pinfo,
guint16 block_length;
gchar *info_str;
guint16 status;
proto_item *item;
offset = dissect_pn_uint8(tvb, offset, pinfo, tree, hf_pn_dcp_suboption_control, &suboption);
@ -661,8 +675,11 @@ dissect_PNDCP_Suboption_Control(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_item_append_text(block_item, ", Result: %s", val_to_str(result, pn_dcp_result, "Unknown"));
break;
default:
proto_tree_add_string_format(tree, hf_pn_dcp_data, tvb, offset, block_length, "data",
item = proto_tree_add_string_format(tree, hf_pn_dcp_data, tvb, offset, block_length, "data",
"Block data(0x%x/0x%x): %d bytes", PNDCP_OPTION_CONTROL, suboption, block_length);
expert_add_info_format(pinfo, item, PI_UNDECODED, PI_WARN,
"Undecoded suboption %u, %u bytes",
suboption, block_length);
offset += block_length;
}
@ -678,6 +695,7 @@ dissect_PNDCP_Suboption_All(tvbuff_t *tvb, int offset, packet_info *pinfo,
{
guint8 suboption;
guint16 block_length;
proto_item *item;
offset = dissect_pn_uint8(tvb, offset, pinfo, tree, hf_pn_dcp_suboption_all, &suboption);
offset = dissect_pn_uint16(tvb, offset, pinfo, tree, hf_pn_dcp_block_length, &block_length);
@ -688,8 +706,11 @@ dissect_PNDCP_Suboption_All(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_item_append_text(block_item, "All/All");
break;
default:
proto_tree_add_string_format(tree, hf_pn_dcp_data, tvb, offset, block_length, "data",
item = proto_tree_add_string_format(tree, hf_pn_dcp_data, tvb, offset, block_length, "data",
"Block data(0x%x/0x%x): %d bytes", PNDCP_OPTION_ALLSELECTOR, suboption, block_length);
expert_add_info_format(pinfo, item, PI_UNDECODED, PI_WARN,
"Undecoded suboption %u, %u bytes",
suboption, block_length);
offset += block_length;
}
@ -705,6 +726,7 @@ dissect_PNDCP_Suboption_Manuf(tvbuff_t *tvb, int offset, packet_info *pinfo,
{
guint8 suboption;
guint16 block_length;
proto_item *item;
offset = dissect_pn_uint8(tvb, offset, pinfo, tree, hf_pn_dcp_suboption_manuf, &suboption);
offset = dissect_pn_uint16(tvb, offset, pinfo, tree, hf_pn_dcp_block_length, &block_length);
@ -713,8 +735,11 @@ dissect_PNDCP_Suboption_Manuf(tvbuff_t *tvb, int offset, packet_info *pinfo,
default:
pn_append_info(pinfo, dcp_item, ", Manufacturer Specific");
proto_item_append_text(block_item, "Manufacturer Specific");
proto_tree_add_string_format(tree, hf_pn_dcp_data, tvb, offset, block_length, "data",
item = proto_tree_add_string_format(tree, hf_pn_dcp_data, tvb, offset, block_length, "data",
"Block data: %d bytes", block_length);
expert_add_info_format(pinfo, item, PI_UNDECODED, PI_WARN,
"Undecoded suboption %u, %u bytes",
suboption, block_length);
offset += block_length;
}
@ -790,6 +815,7 @@ dissect_PNDCP_PDU(tvbuff_t *tvb,
int offset = 0;
gchar *xid_str;
gboolean is_response = FALSE;
proto_item *item;
offset = dissect_pn_uint8 (tvb, offset, pinfo, tree, hf_pn_dcp_service_id, &service_id);
@ -815,8 +841,11 @@ dissect_PNDCP_PDU(tvbuff_t *tvb,
pn_append_info(pinfo, dcp_item, "Ident");
break;
default:
proto_tree_add_string_format(tree, hf_pn_dcp_data, tvb, offset, tvb_length_remaining(tvb, offset), "data",
item = proto_tree_add_string_format(tree, hf_pn_dcp_data, tvb, offset, tvb_length_remaining(tvb, offset), "data",
"PN-DCP Unknown service ID %u, Data: %d bytes", service_id, tvb_length_remaining(tvb, offset));
expert_add_info_format(pinfo, item, PI_UNDECODED, PI_WARN,
"Undecoded service ID %u, %u bytes",
service_id, tvb_length_remaining(tvb, offset));
return;
}
@ -835,6 +864,9 @@ dissect_PNDCP_PDU(tvbuff_t *tvb,
default:
proto_tree_add_string_format(tree, hf_pn_dcp_data, tvb, offset, tvb_length_remaining(tvb, offset), "data",
"PN-DCP Unknown service type %u, Data: %d bytes", service_type, tvb_length_remaining(tvb, offset));
expert_add_info_format(pinfo, item, PI_UNDECODED, PI_WARN,
"Undecoded service type %u, %u bytes",
service_type, tvb_length_remaining(tvb, offset));
return;
}

View File

@ -39,6 +39,7 @@
#include <epan/dissectors/packet-dcerpc.h>
#include <epan/oui.h>
#include <epan/etypes.h>
#include <epan/expert.h>
static int proto_pn_mrp = -1;
@ -304,6 +305,7 @@ dissect_PNMRP_PDU(tvbuff_t *tvb, int offset,
guint8 type;
guint8 length;
gint i = 0;
proto_item *unknown_item;
/* MRP_Version */
@ -349,8 +351,11 @@ dissect_PNMRP_PDU(tvbuff_t *tvb, int offset,
offset = dissect_PNMRP_LinkUp(tvb, offset, pinfo, tree, item, length);
break;
default:
proto_tree_add_string_format(tree, hf_pn_mrp_data, tvb, offset, length, "data",
unknown_item = proto_tree_add_string_format(tree, hf_pn_mrp_data, tvb, offset, length, "data",
"PN-MRP Unknown TLVType 0x%x, Data: %d bytes", type, length);
expert_add_info_format(pinfo, unknown_item, PI_UNDECODED, PI_WARN,
"Unknown TLVType 0x%x, %u bytes",
type, length);
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, "Unknown TLVType 0x%x", type);

View File

@ -38,6 +38,7 @@
#include <epan/packet.h>
#include <epan/dissectors/packet-dcerpc.h>
#include <epan/oui.h>
#include <epan/expert.h>
static int proto_pn_mrrt = -1;
@ -149,6 +150,7 @@ dissect_PNMRRT_PDU(tvbuff_t *tvb, int offset,
guint8 type;
guint8 length;
gint i =0;
proto_item *unknown_item;
/* MRRT_Version */
@ -186,8 +188,11 @@ dissect_PNMRRT_PDU(tvbuff_t *tvb, int offset,
offset = dissect_PNMRRT_Test(tvb, offset, pinfo, tree, item, length);
break;
default:
proto_tree_add_string_format(tree, hf_pn_mrrt_data, tvb, offset, length, "data",
unknown_item = proto_tree_add_string_format(tree, hf_pn_mrrt_data, tvb, offset, length, "data",
"PN-MRRT Unknown TLVType 0x%x, Data: %d bytes", type, length);
expert_add_info_format(pinfo, unknown_item, PI_UNDECODED, PI_WARN,
"Unknown TLVType 0x%x, %u bytes",
type, length);
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, "Unknown TLVType 0x%x", type);

View File

@ -38,6 +38,7 @@
#include <epan/packet.h>
#include <epan/dissectors/packet-dcerpc.h>
#include <epan/oui.h>
#include <epan/expert.h>
static int proto_pn_ptcp = -1;
@ -471,6 +472,7 @@ dissect_PNPTCP_Option_PROFINET(tvbuff_t *tvb, int offset,
guint8 subType;
guint8 padding8;
e_uuid_t uuid;
proto_item *unknown_item;
/* OUI already dissected! */
@ -487,8 +489,11 @@ dissect_PNPTCP_Option_PROFINET(tvbuff_t *tvb, int offset,
offset = dissect_pn_uuid(tvb, offset, pinfo, tree, hf_pn_ptcp_irdata_uuid, &uuid);
break;
default:
proto_tree_add_string_format(tree, hf_pn_ptcp_data, tvb, offset, length, "data",
unknown_item = proto_tree_add_string_format(tree, hf_pn_ptcp_data, tvb, offset, length, "data",
"PROFINET Data: %d bytes", length);
expert_add_info_format(pinfo, unknown_item, PI_UNDECODED, PI_WARN,
"Unknown subType %u, %u bytes",
subType, length);
break;
}
@ -502,6 +507,7 @@ dissect_PNPTCP_Option(tvbuff_t *tvb, int offset,
{
guint32 oui;
guint8 subType;
proto_item *unknown_item;
/* verify remaining TLV length */
@ -529,8 +535,10 @@ dissect_PNPTCP_Option(tvbuff_t *tvb, int offset,
/* SubType */
offset = dissect_pn_uint8(tvb, offset, pinfo, tree, hf_pn_ptcp_unknown_subtype, &subType);
length --;
proto_tree_add_string_format(tree, hf_pn_ptcp_data, tvb, offset, length, "data",
unknown_item = proto_tree_add_string_format(tree, hf_pn_ptcp_data, tvb, offset, length, "data",
"Unknown OUI Data: %d bytes", length);
expert_add_info_format(pinfo, unknown_item, PI_UNDECODED, PI_WARN,
"Unknown OUI Data %u bytes", length);
}
return (offset);
@ -549,6 +557,7 @@ dissect_PNPTCP_block(tvbuff_t *tvb, int offset,
proto_item *tlvheader_item;
proto_tree *tlvheader_tree;
guint32 u32SubStart;
proto_item *unknown_item;
*end = FALSE;
@ -596,8 +605,10 @@ dissect_PNPTCP_block(tvbuff_t *tvb, int offset,
dissect_PNPTCP_Option(tvb, offset, pinfo, sub_tree, sub_item, length);
break;
default:
proto_tree_add_string_format(sub_tree, hf_pn_ptcp_data, tvb, offset, length, "data",
unknown_item = proto_tree_add_string_format(sub_tree, hf_pn_ptcp_data, tvb, offset, length, "data",
"PN-PTCP Unknown BlockType 0x%x, Data: %d bytes", type, length);
expert_add_info_format(pinfo, unknown_item, PI_UNDECODED, PI_WARN,
"Unknown BlockType 0x%x, %u bytes", type, length);
}
offset += length;
@ -887,6 +898,7 @@ dissect_PNPTCP_Data_heur(tvbuff_t *tvb,
proto_tree *ptcp_tree = NULL;
int offset = 0;
guint32 u32SubStart;
proto_item *unknown_item = NULL;
/* the tvb will NOT contain the frame_id here, so get it from our private data! */
@ -898,7 +910,7 @@ dissect_PNPTCP_Data_heur(tvbuff_t *tvb,
/* 0xFF00 - 0xFF1F: AnnouncePDU */
/* 0xFF20 - 0xFF3F: FollowUpPDU */
/* 0xFF40 - 0xFF5F: Delay...PDU */
if ( (u16FrameID > 0x0100 && u16FrameID < 0xFF00) || (u16FrameID > 0xFF5F) ) {
if ( (u16FrameID >= 0x0100 && u16FrameID < 0xFF00) || (u16FrameID > 0xFF5F) ) {
/* we are not interested in this packet */
return FALSE;
}
@ -960,8 +972,11 @@ dissect_PNPTCP_Data_heur(tvbuff_t *tvb,
break;
/* 0xFF44 - 0xFF5F reserved */
default:
proto_tree_add_string_format(ptcp_tree, hf_pn_ptcp_data, tvb, offset, tvb_length_remaining(tvb, offset), "data",
unknown_item = proto_tree_add_string_format(ptcp_tree, hf_pn_ptcp_data, tvb, offset, tvb_length_remaining(tvb, offset), "data",
"PN-PTCP Reserved FrameID 0x%04x, Data: %d bytes", u16FrameID, tvb_length_remaining(tvb, offset));
expert_add_info_format(pinfo, unknown_item, PI_UNDECODED, PI_WARN,
"Reserved FrameID 0x%04x, %u bytes", u16FrameID, tvb_length_remaining(tvb, offset));
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, "Reserved FrameID 0x%04x", u16FrameID);