aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ptp.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-06-14 01:56:28 +0000
committerMichael Mann <mmann78@netscape.net>2013-06-14 01:56:28 +0000
commitfa5b45834b3199bc3c47b3d328d54e0504d7b942 (patch)
tree721daa2acddb00e486c5c62923f7b6841b4c13eb /epan/dissectors/packet-ptp.c
parent0f0c111119811cf1c6c9353efdaaef302aca5930 (diff)
Remove check_col() and the occasional tree.
svn path=/trunk/; revision=49921
Diffstat (limited to 'epan/dissectors/packet-ptp.c')
-rw-r--r--epan/dissectors/packet-ptp.c63
1 files changed, 29 insertions, 34 deletions
diff --git a/epan/dissectors/packet-ptp.c b/epan/dissectors/packet-ptp.c
index 0e7e3f8636..59b1ef93ac 100644
--- a/epan/dissectors/packet-ptp.c
+++ b/epan/dissectors/packet-ptp.c
@@ -1633,12 +1633,10 @@ dissect_ptp_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
case PTP_MANAGEMENT_MESSAGE:{
- if (check_col(pinfo->cinfo, COL_INFO)){
- col_add_fstr(pinfo->cinfo, COL_INFO, "Management Message (%s)",
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Management Message (%s)",
val_to_str(ptp_mm_messagekey,
ptp_managementMessageKey_infocolumn_vals,
"Unknown message key %u"));
- }
break;
}
default:{
@@ -2337,41 +2335,38 @@ dissect_ptp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ptp_v2_messageid = 0x0F & tvb_get_guint8 (tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET);
/* Extend Info column with managementId */
- if (check_col(pinfo->cinfo, COL_INFO))
+ /* Create and set the string for "Info" column */
+ if ( ptp_v2_messageid == PTP_V2_MANAGEMENT_MESSAGE )
{
- /* Create and set the string for "Info" column */
- if ( ptp_v2_messageid == PTP_V2_MANAGEMENT_MESSAGE )
- {
- guint16 tlv_type;
- /* Get TLV Type */
- tlv_type = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_TYPE_OFFSET);
- /* For management there are PTP_V2_TLV_TYPE_MANAGEMENT and PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS TLVs */
- switch(tlv_type)
- {
- case PTP_V2_TLV_TYPE_MANAGEMENT:
- /* Get the managementId */
- ptp_v2_mm_managementId = tvb_get_ntohs(tvb, PTP_V2_MM_TLV_MANAGEMENTID_OFFSET);
- ptp_v2_management_action = 0x0F & tvb_get_guint8(tvb, PTP_V2_MM_ACTION_OFFSET);
- col_add_fstr(pinfo->cinfo, COL_INFO, "Management (%s) %s",
- val_to_str(ptp_v2_mm_managementId, ptp_v2_managementID_infocolumn_vals, "Unknown management Id %u"),
- val_to_str(ptp_v2_management_action, ptp_v2_mm_action_vals, "Unknown Action %u"));
- break;
- case PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS:
- /* Get the managementErrorId */
- ptp_v2_mm_managementId = tvb_get_ntohs(tvb, PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET);
- col_add_fstr(pinfo->cinfo, COL_INFO, "Management Error Message (%s)", val_to_str(ptp_v2_mm_managementId,
- ptp2_managementErrorId_vals, "Unknown Error Id %u"));
- break;
- default:
- col_add_str(pinfo->cinfo, COL_INFO, val_to_str(ptp_v2_messageid, ptp_v2_messageid_vals, "Unknown PTP Message (%u)"));
- break;
- }
- }
- else
+ guint16 tlv_type;
+ /* Get TLV Type */
+ tlv_type = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_TYPE_OFFSET);
+ /* For management there are PTP_V2_TLV_TYPE_MANAGEMENT and PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS TLVs */
+ switch(tlv_type)
{
- col_add_str(pinfo->cinfo, COL_INFO, val_to_str(ptp_v2_messageid, ptp_v2_messageid_vals, "Unknown PTP Message (%u)"));
+ case PTP_V2_TLV_TYPE_MANAGEMENT:
+ /* Get the managementId */
+ ptp_v2_mm_managementId = tvb_get_ntohs(tvb, PTP_V2_MM_TLV_MANAGEMENTID_OFFSET);
+ ptp_v2_management_action = 0x0F & tvb_get_guint8(tvb, PTP_V2_MM_ACTION_OFFSET);
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Management (%s) %s",
+ val_to_str(ptp_v2_mm_managementId, ptp_v2_managementID_infocolumn_vals, "Unknown management Id %u"),
+ val_to_str(ptp_v2_management_action, ptp_v2_mm_action_vals, "Unknown Action %u"));
+ break;
+ case PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS:
+ /* Get the managementErrorId */
+ ptp_v2_mm_managementId = tvb_get_ntohs(tvb, PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET);
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Management Error Message (%s)", val_to_str(ptp_v2_mm_managementId,
+ ptp2_managementErrorId_vals, "Unknown Error Id %u"));
+ break;
+ default:
+ col_add_str(pinfo->cinfo, COL_INFO, val_to_str(ptp_v2_messageid, ptp_v2_messageid_vals, "Unknown PTP Message (%u)"));
+ break;
}
}
+ else
+ {
+ col_add_str(pinfo->cinfo, COL_INFO, val_to_str(ptp_v2_messageid, ptp_v2_messageid_vals, "Unknown PTP Message (%u)"));
+ }
if (tree) {