diff options
41 files changed, 314 insertions, 580 deletions
diff --git a/plugins/asn1/packet-asn1.c b/plugins/asn1/packet-asn1.c index d729081097..77a8fc6021 100644 --- a/plugins/asn1/packet-asn1.c +++ b/plugins/asn1/packet-asn1.c @@ -728,9 +728,7 @@ dissect_asn1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { } /* Set the protocol column */ - if(check_col(pinfo->cinfo, COL_PROTOCOL)){ - col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "ASN.1 %s", current_pduname); - } + col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "ASN.1 %s", current_pduname); col_clear(pinfo->cinfo, COL_INFO); @@ -780,9 +778,7 @@ dissect_asn1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { } /* Set the info column */ - if(check_col(pinfo->cinfo, COL_INFO)){ - col_add_str(pinfo->cinfo, COL_INFO, headstr ); - } + col_add_str(pinfo->cinfo, COL_INFO, headstr ); /* * If we have a non-null tree (ie we are building the proto_tree @@ -892,8 +888,7 @@ dissect_asn1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (ti2 && PDUerrcount && asn1_debug) /* show error counts only when in debug mode.... */ proto_item_append_text(ti2," (%d error%s)", PDUerrcount, (PDUerrcount>1)?"s":empty); } - if(check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, "[%d msg%s]", i, (i>1)?"s":empty); + col_append_fstr(pinfo->cinfo, COL_INFO, "[%d msg%s]", i, (i>1)?"s":empty); if (ti) proto_item_append_text(ti, ", %d msg%s", i, (i>1)?"s":empty); } @@ -901,8 +896,7 @@ dissect_asn1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { RETHROW; } CATCH(ReportedBoundsError) { - if(check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, "[%d+1 msg%s]", i, (i>0)?"s":empty); + col_append_fstr(pinfo->cinfo, COL_INFO, "[%d+1 msg%s]", i, (i>0)?"s":empty); if (ti) proto_item_append_text(ti, ", %d+1 msg%s", i, (i>1)?"s":empty); if (ti2) diff --git a/plugins/docsis/packet-bintrngreq.c b/plugins/docsis/packet-bintrngreq.c index 9dab27ed81..531c3f8ed7 100644 --- a/plugins/docsis/packet-bintrngreq.c +++ b/plugins/docsis/packet-bintrngreq.c @@ -53,12 +53,9 @@ dissect_bintrngreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) md_ds_sg_id = tvb_get_ntohs (tvb, 0); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_clear (pinfo->cinfo, COL_INFO); - col_add_fstr (pinfo->cinfo, COL_INFO, "Bonded Ranging Request: MD-DS-SG-ID = %u (0x%X)", + col_clear (pinfo->cinfo, COL_INFO); + col_add_fstr (pinfo->cinfo, COL_INFO, "Bonded Ranging Request: MD-DS-SG-ID = %u (0x%X)", md_ds_sg_id, md_ds_sg_id ); - } if (tree) { diff --git a/plugins/docsis/packet-bpkmreq.c b/plugins/docsis/packet-bpkmreq.c index 53ab538b7d..73cc1c10ea 100644 --- a/plugins/docsis/packet-bpkmreq.c +++ b/plugins/docsis/packet-bpkmreq.c @@ -74,11 +74,8 @@ dissect_bpkmreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) code = tvb_get_guint8 (tvb, 0); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_add_fstr (pinfo->cinfo, COL_INFO, "BPKM Request (%s)", - val_to_str (code, code_field_vals, "%s")); - } + col_add_fstr (pinfo->cinfo, COL_INFO, "BPKM Request (%s)", + val_to_str (code, code_field_vals, "%s")); if (tree) { diff --git a/plugins/docsis/packet-bpkmrsp.c b/plugins/docsis/packet-bpkmrsp.c index bd39bf14f0..14d89f0deb 100644 --- a/plugins/docsis/packet-bpkmrsp.c +++ b/plugins/docsis/packet-bpkmrsp.c @@ -75,11 +75,8 @@ dissect_bpkmrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) code = tvb_get_guint8 (tvb, 0); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_add_fstr (pinfo->cinfo, COL_INFO, "BPKM Response (%s)", - val_to_str (code, code_field_vals, "%s")); - } + col_add_fstr (pinfo->cinfo, COL_INFO, "BPKM Response (%s)", + val_to_str (code, code_field_vals, "%s")); if (tree) { diff --git a/plugins/docsis/packet-docsis.c b/plugins/docsis/packet-docsis.c index 2e74657ff3..e69e8801ef 100644 --- a/plugins/docsis/packet-docsis.c +++ b/plugins/docsis/packet-docsis.c @@ -367,10 +367,8 @@ dissect_docsis (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) /* Make entries in Protocol column and Info column on summary display */ col_set_str (pinfo->cinfo, COL_PROTOCOL, "DOCSIS"); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_clear (pinfo->cinfo, COL_INFO); - switch (fctype) + col_clear (pinfo->cinfo, COL_INFO); + switch (fctype) { case FCTYPE_PACKET: col_set_str (pinfo->cinfo, COL_INFO, "Packet PDU"); @@ -392,7 +390,6 @@ dissect_docsis (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) col_set_str (pinfo->cinfo, COL_INFO, "Mac Specific"); break; } /* switch */ - } /* if */ /* In the interest of speed, if "tree" is NULL, don't do any work not necessary to generate protocol tree items. */ diff --git a/plugins/docsis/packet-dsaack.c b/plugins/docsis/packet-dsaack.c index 8ee2149ccd..0f67bd4eb8 100644 --- a/plugins/docsis/packet-dsaack.c +++ b/plugins/docsis/packet-dsaack.c @@ -56,12 +56,9 @@ dissect_dsaack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) transid = tvb_get_ntohs (tvb, 0); response = tvb_get_guint8 (tvb, 2); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_add_fstr (pinfo->cinfo, COL_INFO, - "Dynamic Service Add Ack ID = %u (%s)", transid, - val_to_str (response, docsis_conf_code, "%s")); - } + col_add_fstr (pinfo->cinfo, COL_INFO, + "Dynamic Service Add Ack ID = %u (%s)", transid, + val_to_str (response, docsis_conf_code, "%s")); if (tree) { diff --git a/plugins/docsis/packet-dsareq.c b/plugins/docsis/packet-dsareq.c index acdd0c5deb..e5490cd042 100644 --- a/plugins/docsis/packet-dsareq.c +++ b/plugins/docsis/packet-dsareq.c @@ -51,12 +51,9 @@ dissect_dsareq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) transid = tvb_get_ntohs (tvb, 0); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_clear (pinfo->cinfo, COL_INFO); - col_add_fstr (pinfo->cinfo, COL_INFO, - "Dynamic Service Addition Request Tran-id = %u", transid); - } + col_clear (pinfo->cinfo, COL_INFO); + col_add_fstr (pinfo->cinfo, COL_INFO, + "Dynamic Service Addition Request Tran-id = %u", transid); if (tree) { diff --git a/plugins/docsis/packet-dsarsp.c b/plugins/docsis/packet-dsarsp.c index 49e81f89e7..3ae4d172f0 100644 --- a/plugins/docsis/packet-dsarsp.c +++ b/plugins/docsis/packet-dsarsp.c @@ -56,12 +56,9 @@ dissect_dsarsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) transid = tvb_get_ntohs (tvb, 0); response = tvb_get_guint8 (tvb, 2); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_add_fstr (pinfo->cinfo, COL_INFO, - "Dynamic Service Add Response ID = %u (%s)", transid, - val_to_str (response, docsis_conf_code, "%s")); - } + col_add_fstr (pinfo->cinfo, COL_INFO, + "Dynamic Service Add Response ID = %u (%s)", transid, + val_to_str (response, docsis_conf_code, "%s")); if (tree) { diff --git a/plugins/docsis/packet-dscack.c b/plugins/docsis/packet-dscack.c index 51cdf80405..2c844ddbcf 100644 --- a/plugins/docsis/packet-dscack.c +++ b/plugins/docsis/packet-dscack.c @@ -56,12 +56,9 @@ dissect_dscack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) transid = tvb_get_ntohs (tvb, 0); response = tvb_get_guint8 (tvb, 2); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_add_fstr (pinfo->cinfo, COL_INFO, - "Dynamic Service Change Ack ID = %u (%s)", transid, - val_to_str (response, docsis_conf_code, "%s")); - } + col_add_fstr (pinfo->cinfo, COL_INFO, + "Dynamic Service Change Ack ID = %u (%s)", transid, + val_to_str (response, docsis_conf_code, "%s")); if (tree) { diff --git a/plugins/docsis/packet-dscreq.c b/plugins/docsis/packet-dscreq.c index 9bbcc54b41..ddd342cfa4 100644 --- a/plugins/docsis/packet-dscreq.c +++ b/plugins/docsis/packet-dscreq.c @@ -52,12 +52,9 @@ dissect_dscreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) transid = tvb_get_ntohs (tvb, 0); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_clear (pinfo->cinfo, COL_INFO); - col_add_fstr (pinfo->cinfo, COL_INFO, - "Dynamic Service Change Request Tran-id = %u", transid); - } + col_clear (pinfo->cinfo, COL_INFO); + col_add_fstr (pinfo->cinfo, COL_INFO, + "Dynamic Service Change Request Tran-id = %u", transid); if (tree) { diff --git a/plugins/docsis/packet-dscrsp.c b/plugins/docsis/packet-dscrsp.c index 6e701a8e8d..13620e4968 100644 --- a/plugins/docsis/packet-dscrsp.c +++ b/plugins/docsis/packet-dscrsp.c @@ -57,12 +57,9 @@ dissect_dscrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) transid = tvb_get_ntohs (tvb, 0); response = tvb_get_guint8 (tvb, 2); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_add_fstr (pinfo->cinfo, COL_INFO, - "Dynamic Service Change Response ID = %u (%s)", transid, - val_to_str (response, docsis_conf_code, "%s")); - } + col_add_fstr (pinfo->cinfo, COL_INFO, + "Dynamic Service Change Response ID = %u (%s)", transid, + val_to_str (response, docsis_conf_code, "%s")); if (tree) { diff --git a/plugins/docsis/packet-dsdreq.c b/plugins/docsis/packet-dsdreq.c index 50cb7258a7..741da85296 100644 --- a/plugins/docsis/packet-dsdreq.c +++ b/plugins/docsis/packet-dsdreq.c @@ -54,12 +54,9 @@ dissect_dsdreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) transid = tvb_get_ntohs (tvb, 0); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_clear (pinfo->cinfo, COL_INFO); - col_add_fstr (pinfo->cinfo, COL_INFO, - "Dynamic Service Delete Request Tran-id = %u", transid); - } + col_clear (pinfo->cinfo, COL_INFO); + col_add_fstr (pinfo->cinfo, COL_INFO, + "Dynamic Service Delete Request Tran-id = %u", transid); if (tree) { it = diff --git a/plugins/docsis/packet-dsdrsp.c b/plugins/docsis/packet-dsdrsp.c index 0a989ea539..7364c796de 100644 --- a/plugins/docsis/packet-dsdrsp.c +++ b/plugins/docsis/packet-dsdrsp.c @@ -54,12 +54,9 @@ dissect_dsdrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) tranid = tvb_get_ntohs (tvb, 0); confcode = tvb_get_guint8 (tvb, 2); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_add_fstr (pinfo->cinfo, COL_INFO, - "Dynamic Service Delete Response Tran id = %u (%s)", - tranid, val_to_str (confcode, docsis_conf_code, "%s")); - } + col_add_fstr (pinfo->cinfo, COL_INFO, + "Dynamic Service Delete Response Tran id = %u (%s)", + tranid, val_to_str (confcode, docsis_conf_code, "%s")); if (tree) { diff --git a/plugins/docsis/packet-intrngreq.c b/plugins/docsis/packet-intrngreq.c index a0adc34769..4743b5251a 100644 --- a/plugins/docsis/packet-intrngreq.c +++ b/plugins/docsis/packet-intrngreq.c @@ -51,11 +51,8 @@ dissect_intrngreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) sid = tvb_get_ntohs (tvb, 0); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_clear (pinfo->cinfo, COL_INFO); - col_add_fstr (pinfo->cinfo, COL_INFO, "Ranging Request: SID = %u",sid); - } + col_clear (pinfo->cinfo, COL_INFO); + col_add_fstr (pinfo->cinfo, COL_INFO, "Ranging Request: SID = %u",sid); if (tree) { diff --git a/plugins/docsis/packet-map.c b/plugins/docsis/packet-map.c index 54329897d1..2b9ef13a55 100644 --- a/plugins/docsis/packet-map.c +++ b/plugins/docsis/packet-map.c @@ -87,18 +87,15 @@ dissect_map (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) upchid = tvb_get_guint8 (tvb, 0); ucd_count = tvb_get_guint8 (tvb, 1); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_clear (pinfo->cinfo, COL_INFO); - if (upchid > 0) + col_clear (pinfo->cinfo, COL_INFO); + if (upchid > 0) col_add_fstr (pinfo->cinfo, COL_INFO, "Map Message: Channel ID = %u (U%u), UCD Count = %u, # IE's = %u", upchid, upchid - 1, ucd_count, numie); - else + else col_add_fstr (pinfo->cinfo, COL_INFO, "Map Message: Channel ID = %u (Telephony Return), UCD Count = %u, # IE's = %u", upchid, ucd_count, numie); - } if (tree) { diff --git a/plugins/docsis/packet-regack.c b/plugins/docsis/packet-regack.c index 0b0f9da245..d428b09da7 100644 --- a/plugins/docsis/packet-regack.c +++ b/plugins/docsis/packet-regack.c @@ -56,12 +56,9 @@ dissect_regack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) sid = tvb_get_ntohs (tvb, 0); response = tvb_get_guint8 (tvb, 2); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_add_fstr (pinfo->cinfo, COL_INFO, - "Registration Acknowledge SID = %u (%s)", sid, - val_to_str (response, docsis_conf_code, "%s")); - } + col_add_fstr (pinfo->cinfo, COL_INFO, + "Registration Acknowledge SID = %u (%s)", sid, + val_to_str (response, docsis_conf_code, "%s")); if (tree) { it = diff --git a/plugins/docsis/packet-regreq.c b/plugins/docsis/packet-regreq.c index 246f385ed7..f84fc37d4d 100644 --- a/plugins/docsis/packet-regreq.c +++ b/plugins/docsis/packet-regreq.c @@ -52,12 +52,9 @@ dissect_regreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) sid = tvb_get_ntohs (tvb, 0); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_clear (pinfo->cinfo, COL_INFO); - col_add_fstr (pinfo->cinfo, COL_INFO, "Registration Request SID = %u", - sid); - } + col_clear (pinfo->cinfo, COL_INFO); + col_add_fstr (pinfo->cinfo, COL_INFO, "Registration Request SID = %u", + sid); if (tree) { diff --git a/plugins/docsis/packet-regrsp.c b/plugins/docsis/packet-regrsp.c index b98636293c..a0c87cdc6b 100644 --- a/plugins/docsis/packet-regrsp.c +++ b/plugins/docsis/packet-regrsp.c @@ -57,12 +57,9 @@ dissect_regrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) sid = tvb_get_ntohs (tvb, 0); response = tvb_get_guint8 (tvb, 2); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_add_fstr (pinfo->cinfo, COL_INFO, - "Registration Response SID = %u (%s)", sid, - val_to_str (response, docsis_conf_code, "%s")); - } + col_add_fstr (pinfo->cinfo, COL_INFO, + "Registration Response SID = %u (%s)", sid, + val_to_str (response, docsis_conf_code, "%s")); if (tree) { diff --git a/plugins/docsis/packet-rngreq.c b/plugins/docsis/packet-rngreq.c index c11a92e6a8..ad5ed59d47 100644 --- a/plugins/docsis/packet-rngreq.c +++ b/plugins/docsis/packet-rngreq.c @@ -51,15 +51,12 @@ dissect_rngreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) sid = tvb_get_ntohs (tvb, 0); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_clear (pinfo->cinfo, COL_INFO); - if (sid > 0) + col_clear (pinfo->cinfo, COL_INFO); + if (sid > 0) col_add_fstr (pinfo->cinfo, COL_INFO, "Ranging Request: SID = %u", sid); - else + else col_set_str(pinfo->cinfo, COL_INFO, "Initial Ranging Request SID = 0"); - } if (tree) { diff --git a/plugins/docsis/packet-rngrsp.c b/plugins/docsis/packet-rngrsp.c index d3661764ed..11553d11b1 100644 --- a/plugins/docsis/packet-rngrsp.c +++ b/plugins/docsis/packet-rngrsp.c @@ -77,18 +77,15 @@ dissect_rngrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) sid = tvb_get_ntohs (tvb, 0); upchid = tvb_get_guint8 (tvb, 2); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_clear (pinfo->cinfo, COL_INFO); - if (upchid > 0) + col_clear (pinfo->cinfo, COL_INFO); + if (upchid > 0) col_add_fstr (pinfo->cinfo, COL_INFO, "Ranging Response: SID = %u, Upstream Channel = %u (U%u)", sid, upchid, upchid - 1); - else + else col_add_fstr (pinfo->cinfo, COL_INFO, "Ranging Response: SID = %u, Telephony Return", sid); - } if (tree) { diff --git a/plugins/docsis/packet-type29ucd.c b/plugins/docsis/packet-type29ucd.c index f98f82cb39..c33032fc9d 100644 --- a/plugins/docsis/packet-type29ucd.c +++ b/plugins/docsis/packet-type29ucd.c @@ -206,18 +206,15 @@ dissect_type29ucd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) upchid = tvb_get_guint8 (tvb, 0); /* if the upstream Channel ID is 0 then this is for Telephony Return) */ - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_clear (pinfo->cinfo, COL_INFO); - if (upchid > 0) + col_clear (pinfo->cinfo, COL_INFO); + if (upchid > 0) col_add_fstr (pinfo->cinfo, COL_INFO, "type29ucd Message: Channel ID = %u (U%u)", upchid, upchid - 1); - else + else col_add_fstr (pinfo->cinfo, COL_INFO, "type29ucd Message: Channel ID = %u (Telephony Return)", upchid); - } if (tree) { diff --git a/plugins/docsis/packet-uccreq.c b/plugins/docsis/packet-uccreq.c index ba5aa25384..e3b697936e 100644 --- a/plugins/docsis/packet-uccreq.c +++ b/plugins/docsis/packet-uccreq.c @@ -51,13 +51,10 @@ dissect_uccreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) chid = tvb_get_guint8 (tvb, 0); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_clear (pinfo->cinfo, COL_INFO); - col_add_fstr (pinfo->cinfo, COL_INFO, - "Upstream Channel Change request Channel ID = %u (U%u)", - chid, (chid > 0 ? chid - 1 : chid)); - } + col_clear (pinfo->cinfo, COL_INFO); + col_add_fstr (pinfo->cinfo, COL_INFO, + "Upstream Channel Change request Channel ID = %u (U%u)", + chid, (chid > 0 ? chid - 1 : chid)); if (tree) { diff --git a/plugins/docsis/packet-uccrsp.c b/plugins/docsis/packet-uccrsp.c index 8321392070..ce411ec8b2 100644 --- a/plugins/docsis/packet-uccrsp.c +++ b/plugins/docsis/packet-uccrsp.c @@ -49,13 +49,10 @@ dissect_uccrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) chid = tvb_get_guint8 (tvb, 0); - if (check_col (pinfo->cinfo, COL_INFO)) - { - col_clear (pinfo->cinfo, COL_INFO); - col_add_fstr (pinfo->cinfo, COL_INFO, - "Upstream Channel Change response Channel ID = %u (U%u)", - chid, (chid > 0 ? chid - 1 : chid)); - } + col_clear (pinfo->cinfo, COL_INFO); + col_add_fstr (pinfo->cinfo, COL_INFO, + "Upstream Channel Change response Channel ID = %u (U%u)", + chid, (chid > 0 ? chid - 1 : chid)); if (tree) { diff --git a/plugins/docsis/packet-ucd.c b/plugins/docsis/packet-ucd.c index ae2e7a1f3f..80b2c9eb6d 100644 --- a/plugins/docsis/packet-ucd.c +++ b/plugins/docsis/packet-ucd.c @@ -171,8 +171,6 @@ static void upchid = tvb_get_guint8 (tvb, 0); /* if the upstream Channel ID is 0 then this is for Telephony Return) */ - if (check_col (pinfo->cinfo, COL_INFO)) - { col_clear (pinfo->cinfo, COL_INFO); if (upchid > 0) col_add_fstr (pinfo->cinfo, COL_INFO, @@ -182,7 +180,6 @@ static void col_add_fstr (pinfo->cinfo, COL_INFO, "UCD Message: Channel ID = %u (Telephony Return)", upchid); - } if (tree) { diff --git a/plugins/ethercat/packet-ams.c b/plugins/ethercat/packet-ams.c index ca9653ade6..4793e813ad 100644 --- a/plugins/ethercat/packet-ams.c +++ b/plugins/ethercat/packet-ams.c @@ -822,14 +822,11 @@ static void dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } else { - if (check_col(pinfo->cinfo, COL_INFO)) - { - if ( (stateflags & AMSCMDSF_RESPONSE) == 0 ) - col_append_str(pinfo->cinfo, COL_INFO, "AMS Request"); - else - col_append_str(pinfo->cinfo, COL_INFO, "AMS Response"); - } - if( tree && ams_length-offset > 0 ) + if ( (stateflags & AMSCMDSF_RESPONSE) == 0 ) + col_append_str(pinfo->cinfo, COL_INFO, "AMS Request"); + else + col_append_str(pinfo->cinfo, COL_INFO, "AMS Response"); + if( tree && ams_length-offset > 0 ) proto_tree_add_item(ams_tree, hf_ams_data, tvb, offset, ams_length-offset, TRUE); } diff --git a/plugins/ethercat/packet-ecatmb.c b/plugins/ethercat/packet-ecatmb.c index 37b549c30a..fa46ea5f38 100644 --- a/plugins/ethercat/packet-ecatmb.c +++ b/plugins/ethercat/packet-ecatmb.c @@ -637,8 +637,7 @@ static void dissect_ecat_coe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro init_sdo_header(&sdo, tvb, offset); CANopenSdoReqFormatter(&sdo, szText, nMax); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_str(pinfo->cinfo, COL_INFO, szText); + col_append_str(pinfo->cinfo, COL_INFO, szText); if( tree ) { @@ -727,8 +726,7 @@ static void dissect_ecat_coe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro init_sdo_header(&sdo, tvb, offset); CANopenSdoResFormatter(&sdo, szText, nMax); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_str(pinfo->cinfo, COL_INFO, szText); + col_append_str(pinfo->cinfo, COL_INFO, szText); if( tree ) { @@ -805,8 +803,7 @@ static void dissect_ecat_coe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro init_sdo_info_header(&info, tvb, offset); CANopenSdoInfoFormatter(&info, szText, nMax); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_str(pinfo->cinfo, COL_INFO, szText); + col_append_str(pinfo->cinfo, COL_INFO, szText); if( tree ) { @@ -940,8 +937,7 @@ static void dissect_ecat_soe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro if( soe_length >= ETHERCAT_SOE_HEADER_LEN ) { SoeFormatter(tvb, offset, szText, nMax, soe_length); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_str(pinfo->cinfo, COL_INFO, szText); + col_append_str(pinfo->cinfo, COL_INFO, szText); if( tree ) { @@ -1034,14 +1030,11 @@ static void dissect_ecat_eoe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro { ETHERCAT_EOE_HEADER eoe; init_eoe_header(&eoe, tvb, offset); - if (check_col(pinfo->cinfo, COL_INFO)) - { - if ( eoe.anEoeHeaderInfoUnion.v.Type == EOE_TYPE_FRAME_FRAG ) - g_snprintf ( szText, nMax, "EoE-Frag %d", eoe.anEoeHeaderDataUnion.v.Fragment); - else - g_snprintf ( szText, nMax, "EoE"); + if ( eoe.anEoeHeaderInfoUnion.v.Type == EOE_TYPE_FRAME_FRAG ) + g_snprintf ( szText, nMax, "EoE-Frag %d", eoe.anEoeHeaderDataUnion.v.Fragment); + else + g_snprintf ( szText, nMax, "EoE"); col_append_str(pinfo->cinfo, COL_INFO, szText); - } { ecat_eoe_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_eoe); @@ -1177,11 +1170,9 @@ static void dissect_ecat_eoe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro } } - if (check_col(pinfo->cinfo, COL_INFO)) - col_prepend_fstr(pinfo->cinfo, COL_INFO, "EoE("); + col_prepend_fstr(pinfo->cinfo, COL_INFO, "EoE("); - if (check_col(pinfo->cinfo, COL_PROTOCOL)) - col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "EoE-"); + col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "EoE-"); } else { @@ -1211,8 +1202,7 @@ static void dissect_ecat_foe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro if( foe_length >= ETHERCAT_FOE_HEADER_LEN ) { FoeFormatter(tvb, offset, szText, nMax, foe_length); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_str(pinfo->cinfo, COL_INFO, szText); + col_append_str(pinfo->cinfo, COL_INFO, szText); if( tree ) { diff --git a/plugins/ethercat/packet-ethercat-datagram.c b/plugins/ethercat/packet-ethercat-datagram.c index cc577ccd89..564c100462 100644 --- a/plugins/ethercat/packet-ethercat-datagram.c +++ b/plugins/ethercat/packet-ethercat-datagram.c @@ -485,8 +485,7 @@ static void dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree datagram_padding_bytes = datagram_length - ecLength; EcSummaryFormater(ecLength, tvb, offset, szText, nMax); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_str(pinfo->cinfo, COL_INFO, szText); + col_append_str(pinfo->cinfo, COL_INFO, szText); if( tree ) { diff --git a/plugins/ethercat/packet-ethercat-frame.c b/plugins/ethercat/packet-ethercat-frame.c index b17af4afae..9ef143b9dc 100644 --- a/plugins/ethercat/packet-ethercat-frame.c +++ b/plugins/ethercat/packet-ethercat-frame.c @@ -97,12 +97,9 @@ static void dissect_ethercat_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree if (!dissector_try_port(ethercat_frame_dissector_table, hdr.v.protocol, next_tvb, pinfo, tree)) { - if (check_col (pinfo->cinfo, COL_PROTOCOL)) - { - col_add_fstr (pinfo->cinfo, COL_PROTOCOL, "0x%04x", hdr.v.protocol); - } + col_add_fstr (pinfo->cinfo, COL_PROTOCOL, "0x%04x", hdr.v.protocol); /* No sub dissector wanted to handle this payload, decode it as general - data instead. */ + data instead. */ call_dissector (ethercat_frame_data_handle, next_tvb, pinfo, tree); } } diff --git a/plugins/ethercat/packet-ioraw.c b/plugins/ethercat/packet-ioraw.c index 5f25db6c7c..cc1cf59a56 100644 --- a/plugins/ethercat/packet-ioraw.c +++ b/plugins/ethercat/packet-ioraw.c @@ -67,8 +67,7 @@ static void dissect_ioraw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) IoRawSummaryFormater(szText, nMax); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_str(pinfo->cinfo, COL_INFO, szText); + col_append_str(pinfo->cinfo, COL_INFO, szText); if (tree) { diff --git a/plugins/ethercat/packet-nv.c b/plugins/ethercat/packet-nv.c index 171d941871..6fee4f589e 100644 --- a/plugins/ethercat/packet-nv.c +++ b/plugins/ethercat/packet-nv.c @@ -107,8 +107,7 @@ static void dissect_nv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_clear(pinfo->cinfo, COL_INFO); NvSummaryFormater(tvb, offset, szText, nMax); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_str(pinfo->cinfo, COL_INFO, szText); + col_append_str(pinfo->cinfo, COL_INFO, szText); if (tree) { diff --git a/plugins/giop/packet-coseventcomm.c b/plugins/giop/packet-coseventcomm.c index 882e907072..8548b5393f 100644 --- a/plugins/giop/packet-coseventcomm.c +++ b/plugins/giop/packet-coseventcomm.c @@ -611,7 +611,6 @@ static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tre * Do not clear COL_INFO, as nothing is being written there by * this dissector yet. So leave it as is from the GIOP dissector. * TODO: add something useful to COL_INFO - * if (check_col(pinfo->cinfo, COL_INFO)) * col_clear(pinfo->cinfo, COL_INFO); */ diff --git a/plugins/giop/packet-cosnaming.c b/plugins/giop/packet-cosnaming.c index 8df1757462..3cdfb09bd1 100644 --- a/plugins/giop/packet-cosnaming.c +++ b/plugins/giop/packet-cosnaming.c @@ -1558,7 +1558,6 @@ static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tre * Do not clear COL_INFO, as nothing is being written there by * this dissector yet. So leave it as is from the GIOP dissector. * TODO: add something useful to COL_INFO - * if (check_col(pinfo->cinfo, COL_INFO)) * col_clear(pinfo->cinfo, COL_INFO); */ diff --git a/plugins/giop/packet-parlay.c b/plugins/giop/packet-parlay.c index a457eb13a6..22fbd22179 100644 --- a/plugins/giop/packet-parlay.c +++ b/plugins/giop/packet-parlay.c @@ -101301,7 +101301,6 @@ static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tre * Do not clear COL_INFO, as nothing is being written there by * this dissector yet. So leave it as is from the GIOP dissector. * TODO: add something useful to COL_INFO - * if (check_col(pinfo->cinfo, COL_INFO)) * col_clear(pinfo->cinfo, COL_INFO); */ diff --git a/plugins/giop/packet-tango.c b/plugins/giop/packet-tango.c index 54a8920a3f..38a7a53a78 100644 --- a/plugins/giop/packet-tango.c +++ b/plugins/giop/packet-tango.c @@ -4237,7 +4237,6 @@ static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tre * Do not clear COL_INFO, as nothing is being written there by * this dissector yet. So leave it as is from the GIOP dissector. * TODO: add something useful to COL_INFO - * if (check_col(pinfo->cinfo, COL_INFO)) * col_clear(pinfo->cinfo, COL_INFO); */ diff --git a/plugins/gryphon/packet-gryphon.c b/plugins/gryphon/packet-gryphon.c index a172aae682..c1ca99cf99 100644 --- a/plugins/gryphon/packet-gryphon.c +++ b/plugins/gryphon/packet-gryphon.c @@ -223,21 +223,19 @@ dissect_gryphon_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, frmtyp = flags & ~RESPONSE_FLAGS; if (!is_msgresp_add) { - /* - * This tvbuff includes padding to make its length a multiple - * of 4 bytes; set it to the actual length. - */ - set_actual_length(tvb, msglen + FRAME_HEADER_LEN); + /* + * This tvbuff includes padding to make its length a multiple + * of 4 bytes; set it to the actual length. + */ + set_actual_length(tvb, msglen + FRAME_HEADER_LEN); - if (check_col(pinfo->cinfo, COL_INFO)) { /* * Indicate what kind of message this is. */ if (frmtyp >= SIZEOF (frame_type)) - col_set_str(pinfo->cinfo, COL_INFO, "- Invalid -"); + col_set_str(pinfo->cinfo, COL_INFO, "- Invalid -"); else - col_set_str(pinfo->cinfo, COL_INFO, frame_type[frmtyp]); - } + col_set_str(pinfo->cinfo, COL_INFO, frame_type[frmtyp]); } if (tree == NULL) diff --git a/plugins/irda/packet-ircomm.c b/plugins/irda/packet-ircomm.c index 50d82e723d..8a7a2f2114 100644 --- a/plugins/irda/packet-ircomm.c +++ b/plugins/irda/packet-ircomm.c @@ -166,6 +166,8 @@ static void dissect_cooked_ircomm(tvbuff_t* tvb, packet_info* pinfo, proto_tree* { unsigned offset = 0; unsigned clen; + char buf[128]; + unsigned len; if (tvb_length(tvb) == 0) @@ -175,19 +177,15 @@ static void dissect_cooked_ircomm(tvbuff_t* tvb, packet_info* pinfo, proto_tree* col_set_str(pinfo->cinfo, COL_PROTOCOL, "IrCOMM"); clen = tvb_get_guint8(tvb, offset); + len = tvb_length(tvb) - 1 - clen; - if (check_col(pinfo->cinfo, COL_INFO)) - { - char buf[128]; - unsigned len = tvb_length(tvb) - 1 - clen; - if (len > 0) - g_snprintf(buf, 128, "Clen=%d, UserData: %d byte%s", clen, len, (len > 1)? "s": ""); - else - g_snprintf(buf, 128, "Clen=%d", clen); - col_add_str(pinfo->cinfo, COL_INFO, buf); - } + if (len > 0) + g_snprintf(buf, 128, "Clen=%d, UserData: %d byte%s", clen, len, (len > 1)? "s": ""); + else + g_snprintf(buf, 128, "Clen=%d", clen); + col_add_str(pinfo->cinfo, COL_INFO, buf); if (root) { @@ -220,7 +218,7 @@ static void dissect_cooked_ircomm(tvbuff_t* tvb, packet_info* pinfo, proto_tree* static void dissect_raw_ircomm(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) { unsigned len = tvb_length(tvb); - + char buf[128]; if (len == 0) return; @@ -228,13 +226,8 @@ static void dissect_raw_ircomm(tvbuff_t* tvb, packet_info* pinfo, proto_tree* ro /* Make entries in Protocol column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "IrCOMM"); - if (check_col(pinfo->cinfo, COL_INFO)) - { - char buf[128]; - - g_snprintf(buf, 128, "User Data: %d byte%s", len, (len > 1)? "s": ""); - col_add_str(pinfo->cinfo, COL_INFO, buf); - } + g_snprintf(buf, 128, "User Data: %d byte%s", len, (len > 1)? "s": ""); + col_add_str(pinfo->cinfo, COL_INFO, buf); if (root) { diff --git a/plugins/irda/packet-irda.c b/plugins/irda/packet-irda.c index 0d9647cb1e..55bc5fe459 100644 --- a/plugins/irda/packet-irda.c +++ b/plugins/irda/packet-irda.c @@ -458,7 +458,7 @@ static unsigned dissect_ttp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root, { unsigned offset = 0; guint8 head; - + char buf[128]; if (tvb_length(tvb) == 0) return 0; @@ -468,15 +468,9 @@ static unsigned dissect_ttp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root, head = tvb_get_guint8(tvb, offset); - if (check_col(pinfo->cinfo, COL_INFO)) - { - char buf[128]; - - - g_snprintf(buf, 128, ", Credit=%d", head & ~TTP_PARAMETERS); - col_append_str(pinfo->cinfo, COL_INFO, buf); - } - + g_snprintf(buf, 128, ", Credit=%d", head & ~TTP_PARAMETERS); + col_append_str(pinfo->cinfo, COL_INFO, buf); + if (root) { /* create display subtree for the protocol */ @@ -518,7 +512,7 @@ static void dissect_iap_request(tvbuff_t* tvb, packet_info* pinfo, proto_tree* r address destaddr; conversation_t* conv; iap_conversation_t* iap_conv; - + char buf[128]; if (tvb_length(tvb) == 0) return; @@ -602,20 +596,14 @@ static void dissect_iap_request(tvbuff_t* tvb, packet_info* pinfo, proto_tree* r } } - if (check_col(pinfo->cinfo, COL_INFO)) - { - char buf[128]; - - - col_add_str(pinfo->cinfo, COL_INFO, "GetValueByClass: \""); + col_add_str(pinfo->cinfo, COL_INFO, "GetValueByClass: \""); - tvb_memcpy(tvb, buf, offset + 1 + 1, clen); - memcpy(&buf[clen], "\" \"", 3); - tvb_memcpy(tvb, buf + clen + 3, offset + 1 + 1 + clen + 1, alen); - buf[clen + 3 + alen] = '\"'; - buf[clen + 3 + alen + 1] = 0; - col_append_str(pinfo->cinfo, COL_INFO, buf); - } + tvb_memcpy(tvb, buf, offset + 1 + 1, clen); + memcpy(&buf[clen], "\" \"", 3); + tvb_memcpy(tvb, buf + clen + 3, offset + 1 + 1 + clen + 1, alen); + buf[clen + 3 + alen] = '\"'; + buf[clen + 3 + alen + 1] = 0; + col_append_str(pinfo->cinfo, COL_INFO, buf); } if (root) @@ -729,43 +717,40 @@ static void dissect_iap_result(tvbuff_t* tvb, packet_info* pinfo, proto_tree* ro } } - if (check_col(pinfo->cinfo, COL_INFO)) - { - col_set_str(pinfo->cinfo, COL_INFO, "Result: "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str(retcode, iap_return_vals, "0x%02X")); + col_set_str(pinfo->cinfo, COL_INFO, "Result: "); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str(retcode, iap_return_vals, "0x%02X")); - switch (op) - { - case GET_VALUE_BY_CLASS: - if (retcode == 0) + switch (op) + { + case GET_VALUE_BY_CLASS: + if (retcode == 0) + { + guint8 *string; + switch (tvb_get_guint8(tvb, offset + 6)) { - guint8 *string; - switch (tvb_get_guint8(tvb, offset + 6)) - { - case IAS_MISSING: - g_snprintf(buf, 300, ", Missing"); - break; - - case IAS_INTEGER: - g_snprintf(buf, 300, ", Integer: %d", tvb_get_ntohl(tvb, offset + 7)); - break; - - case IAS_OCT_SEQ: - g_snprintf(buf, 300, ", %d Octets", tvb_get_ntohs(tvb, offset + 7)); - break; - - case IAS_STRING: - n = tvb_get_guint8(tvb, offset + 8); - string = tvb_get_ephemeral_string(tvb, offset + 9, n); - g_snprintf(buf, 300, ", \"%s\"", string); - break; - } - col_append_str(pinfo->cinfo, COL_INFO, buf); - if (tvb_get_ntohs(tvb, offset + 2) > 1) - col_append_str(pinfo->cinfo, COL_INFO, ", ..."); + case IAS_MISSING: + g_snprintf(buf, 300, ", Missing"); + break; + + case IAS_INTEGER: + g_snprintf(buf, 300, ", Integer: %d", tvb_get_ntohl(tvb, offset + 7)); + break; + + case IAS_OCT_SEQ: + g_snprintf(buf, 300, ", %d Octets", tvb_get_ntohs(tvb, offset + 7)); + break; + + case IAS_STRING: + n = tvb_get_guint8(tvb, offset + 8); + string = tvb_get_ephemeral_string(tvb, offset + 9, n); + g_snprintf(buf, 300, ", \"%s\"", string); + break; } - break; - } + col_append_str(pinfo->cinfo, COL_INFO, buf); + if (tvb_get_ntohs(tvb, offset + 2) > 1) + col_append_str(pinfo->cinfo, COL_INFO, ", ..."); + } + break; } if (root) @@ -1066,23 +1051,19 @@ static void dissect_irlmp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) { opcode = tvb_get_guint8(tvb, offset+2); - if (check_col(pinfo->cinfo, COL_INFO)) + col_add_fstr(pinfo->cinfo, COL_INFO, "%d > %d, ", slsap, dlsap); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str(opcode, lmp_opcode_vals, "0x%02X")); + if ((opcode == ACCESSMODE_CMD) || (opcode == ACCESSMODE_CNF)) { - col_add_fstr(pinfo->cinfo, COL_INFO, "%d > %d, ", slsap, dlsap); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str(opcode, lmp_opcode_vals, "0x%02X")); - if ((opcode == ACCESSMODE_CMD) || (opcode == ACCESSMODE_CNF)) - { - col_append_str(pinfo->cinfo, COL_INFO, " ("); - col_append_str(pinfo->cinfo, COL_INFO, - val_to_str(tvb_get_guint8(tvb, offset+4), lmp_mode_vals, "0x%02X")); - col_append_str(pinfo->cinfo, COL_INFO, ")"); - } + col_append_str(pinfo->cinfo, COL_INFO, " ("); + col_append_str(pinfo->cinfo, COL_INFO, + val_to_str(tvb_get_guint8(tvb, offset+4), lmp_mode_vals, "0x%02X")); + col_append_str(pinfo->cinfo, COL_INFO, ")"); } } else - if (check_col(pinfo->cinfo, COL_INFO)) - col_add_fstr(pinfo->cinfo, COL_INFO, "%d > %d, Len=%d", slsap, dlsap, - tvb_length(tvb) - 2); + col_add_fstr(pinfo->cinfo, COL_INFO, "%d > %d, Len=%d", slsap, dlsap, + tvb_length(tvb) - 2); if (root) { @@ -1498,15 +1479,13 @@ static void dissect_xid(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root, pro offset++; saddr = tvb_get_letohl(tvb, offset); - if (check_col(pinfo->cinfo, COL_DEF_SRC)) - col_add_fstr(pinfo->cinfo, COL_DEF_SRC, "0x%08X", saddr); + col_add_fstr(pinfo->cinfo, COL_DEF_SRC, "0x%08X", saddr); if (lap_tree) proto_tree_add_uint(i_tree, hf_xid_saddr, tvb, offset, 4, saddr); offset += 4; daddr = tvb_get_letohl(tvb, offset); - if (check_col(pinfo->cinfo, COL_DEF_DST)) - col_add_fstr(pinfo->cinfo, COL_DEF_DST, "0x%08X", daddr); + col_add_fstr(pinfo->cinfo, COL_DEF_DST, "0x%08X", daddr); if (lap_tree) proto_tree_add_uint(i_tree, hf_xid_daddr, tvb, offset, 4, daddr); offset += 4; @@ -1523,13 +1502,10 @@ static void dissect_xid(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root, pro if (is_command) { s = tvb_get_guint8(tvb, offset); - if (check_col(pinfo->cinfo, COL_INFO)) - { - if (s == 0xFF) - col_append_str(pinfo->cinfo, COL_INFO, ", s=final"); - else - col_append_fstr(pinfo->cinfo, COL_INFO, ", s=%u", s); - } + if (s == 0xFF) + col_append_str(pinfo->cinfo, COL_INFO, ", s=final"); + else + col_append_fstr(pinfo->cinfo, COL_INFO, ", s=%u", s); if (lap_tree) { ti = proto_tree_add_uint(i_tree, hf_xid_slotnr, tvb, offset, 1, s); @@ -1554,6 +1530,7 @@ static void dissect_xid(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root, pro unsigned hints_len; guint8 hint1 = 0; guint8 hint2 = 0; + char buf[23]; if (root) { @@ -1629,18 +1606,14 @@ static void dissect_xid(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root, pro { if (cset == 0x00) { - if (check_col(pinfo->cinfo, COL_INFO)) - { - char buf[23]; - - if (name_len > 22) - name_len = 22; - tvb_memcpy(tvb, buf, offset, name_len); - buf[name_len] = 0; - col_append_str(pinfo->cinfo, COL_INFO, ", \""); - col_append_str(pinfo->cinfo, COL_INFO, buf); - col_append_str(pinfo->cinfo, COL_INFO, "\""); - } + + if (name_len > 22) + name_len = 22; + tvb_memcpy(tvb, buf, offset, name_len); + buf[name_len] = 0; + col_append_str(pinfo->cinfo, COL_INFO, ", \""); + col_append_str(pinfo->cinfo, COL_INFO, buf); + col_append_str(pinfo->cinfo, COL_INFO, "\""); if (root) proto_tree_add_item(lmp_tree, hf_lmp_xid_name, tvb, offset, -1, FALSE); @@ -1670,7 +1643,7 @@ static void dissect_log(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) { col_set_str(pinfo->cinfo, COL_INFO, "WARNING: Missed one or more messages while capturing!"); } - else if (check_col(pinfo->cinfo, COL_INFO)) + else { guint length; char buf[256]; @@ -1724,18 +1697,15 @@ static void dissect_irlap(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) col_clear(pinfo->cinfo, COL_INFO); /* set direction column */ - if (check_col(pinfo->cinfo, COL_IF_DIR)) + switch (pinfo->pseudo_header->irda.pkttype) { - switch (pinfo->pseudo_header->irda.pkttype) - { - case IRDA_OUTGOING: - col_set_str(pinfo->cinfo, COL_IF_DIR, "Out"); - break; - - case IRDA_INCOMING: - col_set_str(pinfo->cinfo, COL_IF_DIR, "In"); - break; - } + case IRDA_OUTGOING: + col_set_str(pinfo->cinfo, COL_IF_DIR, "Out"); + break; + + case IRDA_INCOMING: + col_set_str(pinfo->cinfo, COL_IF_DIR, "In"); + break; } /* decode values used for demuxing */ @@ -1804,8 +1774,7 @@ static void dissect_irlap(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) saddr = tvb_get_letohl(tvb, offset); if (!is_response) { - if (check_col(pinfo->cinfo, COL_DEF_SRC)) - col_add_fstr(pinfo->cinfo, COL_DEF_SRC, "0x%08X", saddr); + col_add_fstr(pinfo->cinfo, COL_DEF_SRC, "0x%08X", saddr); } if (root) proto_tree_add_uint(i_tree, hf_snrm_saddr, tvb, offset, 4, saddr); @@ -1814,8 +1783,7 @@ static void dissect_irlap(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) daddr = tvb_get_letohl(tvb, offset); if (!is_response) { - if (check_col(pinfo->cinfo, COL_DEF_DST)) - col_add_fstr(pinfo->cinfo, COL_DEF_DST, "0x%08X", daddr); + col_add_fstr(pinfo->cinfo, COL_DEF_DST, "0x%08X", daddr); } if (root) proto_tree_add_uint(i_tree, hf_snrm_daddr, tvb, offset, 4, daddr); @@ -1824,8 +1792,7 @@ static void dissect_irlap(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) ca = tvb_get_guint8(tvb, offset); if (!is_response) { - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", ca=0x%02X", + col_append_fstr(pinfo->cinfo, COL_INFO, ", ca=0x%02X", ca >> 1); } if (root) @@ -1852,15 +1819,13 @@ static void dissect_irlap(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) } saddr = tvb_get_letohl(tvb, offset); - if (check_col(pinfo->cinfo, COL_DEF_SRC)) - col_add_fstr(pinfo->cinfo, COL_DEF_SRC, "0x%08X", saddr); + col_add_fstr(pinfo->cinfo, COL_DEF_SRC, "0x%08X", saddr); if (root) proto_tree_add_uint(i_tree, hf_ua_saddr, tvb, offset, 4, saddr); offset += 4; daddr = tvb_get_letohl(tvb, offset); - if (check_col(pinfo->cinfo, COL_DEF_DST)) - col_add_fstr(pinfo->cinfo, COL_DEF_DST, "0x%08X", daddr); + col_add_fstr(pinfo->cinfo, COL_DEF_DST, "0x%08X", daddr); if (root) proto_tree_add_uint(i_tree, hf_ua_daddr, tvb, offset, 4, daddr); offset += 4; diff --git a/plugins/m2m/packet-m2m.c b/plugins/m2m/packet-m2m.c index a5ecd14d4c..2aeee687bb 100644 --- a/plugins/m2m/packet-m2m.c +++ b/plugins/m2m/packet-m2m.c @@ -216,10 +216,7 @@ static void dissect_m2m(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tlv_len = get_tlv_length(&m2m_tlv_info); if(tlv_type == -1 || tlv_len > 64000 || tlv_len < 1) { /* invalid tlv info */ - if (check_col(pinfo->cinfo, COL_INFO)) - { - col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", "M2M TLV error"); - } + col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", "M2M TLV error"); /* display the invalid TLV in HEX */ proto_tree_add_item(m2m_tree, hf_wimax_invalid_tlv, tvb, offset, (length - offset), FALSE); break; @@ -426,20 +423,17 @@ static void pdu_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint gint pdu_length = 0; /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) + switch (frag_type) { - switch (frag_type) - { - case TLV_FIRST_FRAG: - col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "First TLV Fragment (%d)", frag_number); - break; - case TLV_LAST_FRAG: - col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Last TLV Fragment (%d)", frag_number); - break; - case TLV_MIDDLE_FRAG: - col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Middle TLV Fragment %d", frag_number); - break; - } + case TLV_FIRST_FRAG: + col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "First TLV Fragment (%d)", frag_number); + break; + case TLV_LAST_FRAG: + col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Last TLV Fragment (%d)", frag_number); + break; + case TLV_MIDDLE_FRAG: + col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Middle TLV Fragment %d", frag_number); + break; } if(frag_type == TLV_NO_FRAG) { /* not fragmented PDU */ @@ -462,8 +456,7 @@ static void pdu_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint pdu_tvb = NULL; if(frag_type == TLV_LAST_FRAG) { /* update the info column */ - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", "Incomplete PDU frame"); + col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", "Incomplete PDU frame"); } } } diff --git a/plugins/opcua/opcua.c b/plugins/opcua/opcua.c index a7feaebfb6..36baaf37f3 100644 --- a/plugins/opcua/opcua.c +++ b/plugins/opcua/opcua.c @@ -203,10 +203,7 @@ static void dissect_opcua_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree } /* Clear out stuff in the info column */ - if(check_col(pinfo->cinfo, COL_INFO)) - { - col_set_str(pinfo->cinfo, COL_INFO, g_szMessageTypes[msgtype]); - } + col_set_str(pinfo->cinfo, COL_INFO, g_szMessageTypes[msgtype]); if (tree && pfctParse) { diff --git a/plugins/profinet/packet-dcom-cba-acco.c b/plugins/profinet/packet-dcom-cba-acco.c index 4f77a7fe49..a350c29b73 100644 --- a/plugins/profinet/packet-dcom-cba-acco.c +++ b/plugins/profinet/packet-dcom-cba-acco.c @@ -1072,11 +1072,9 @@ dissect_HResultArray_resp(tvbuff_t *tvb, int offset, offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s", - u32ArraySize, - val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s", + u32ArraySize, + val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); return offset; } @@ -1119,11 +1117,9 @@ dissect_ICBAAccoServer_SetActivation_resp(tvbuff_t *tvb, int offset, offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s", - u32ArraySize, - val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s", + u32ArraySize, + val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); return offset; } @@ -1166,11 +1162,9 @@ dissect_ICBAAccoServerSRT_Disconnect_resp(tvbuff_t *tvb, int offset, offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s", - u32ArraySize, - val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s", + u32ArraySize, + val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); return offset; } @@ -1213,11 +1207,9 @@ dissect_ICBAAccoServerSRT_SetActivation_resp(tvbuff_t *tvb, int offset, offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s", - u32ArraySize, - val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s", + u32ArraySize, + val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); return offset; } @@ -1363,9 +1355,7 @@ dissect_ICBAAccoServer_Connect_rqst(tvbuff_t *tvb, int offset, u32Idx++; } - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Consumer=\"%s\" Cnt=%u", szCons, u32Count); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": Consumer=\"%s\" Cnt=%u", szCons, u32Count); return u32VariableOffset; } @@ -1557,9 +1547,8 @@ dissect_ICBAAccoServer2_Connect2_rqst(tvbuff_t *tvb, int offset, u32Idx++; } - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Consumer=\"%s\" Cnt=%u", szCons, u32Count); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": Consumer=\"%s\" Cnt=%u", szCons, u32Count); + return u32VariableOffset; } @@ -1646,12 +1635,10 @@ dissect_ICBAAccoServer_Connect_resp(tvbuff_t *tvb, int offset, u32Idx++; } - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": %s Cnt=%u -> %s", - (u8FirstConnect) ? "First" : "NotFirst", - u32Idx-1, - val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": %s Cnt=%u -> %s", + (u8FirstConnect) ? "First" : "NotFirst", + u32Idx-1, + val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); return offset; } @@ -1713,9 +1700,8 @@ dissect_ICBAAccoServer_Disconnect_rqst(tvbuff_t *tvb, int offset, } /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); + return offset; } @@ -1775,11 +1761,9 @@ dissect_ICBAAccoServer_Disconnect_resp(tvbuff_t *tvb, int offset, offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s", - u32ArraySize, - val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s", + u32ArraySize, + val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); return offset; } @@ -1816,9 +1800,7 @@ dissect_ICBAAccoServerSRT_Disconnect_rqst(tvbuff_t *tvb, int offset, } /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); return offset; } @@ -1860,9 +1842,7 @@ dissect_ICBAAccoServer_DisconnectMe_rqst(tvbuff_t *tvb, int offset, } /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr); - } + col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr); return offset; } @@ -1892,10 +1872,8 @@ dissect_ICBAAccoServer_DisconnectMe_resp(tvbuff_t *tvb, int offset, cba_connection_disconnectme(tvb, pinfo, tree, call->cons, call->prov); } - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", + col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } return offset; } @@ -1937,9 +1915,7 @@ dissect_ICBAAccoServerSRT_DisconnectMe_rqst(tvbuff_t *tvb, int offset, } /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr); - } + col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr); return offset; } @@ -1969,10 +1945,8 @@ dissect_ICBAAccoServerSRT_DisconnectMe_resp(tvbuff_t *tvb, int offset, cba_frame_disconnectme(tvb, pinfo, tree, call->cons, call->prov); } - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", - val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } + col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", + val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); return offset; } @@ -1995,10 +1969,8 @@ dissect_ICBAAccoServer_Ping_resp(tvbuff_t *tvb, int offset, offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", + col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } return offset; } @@ -2039,9 +2011,8 @@ dissect_ICBAAccoServer_SetActivation_rqst(tvbuff_t *tvb, int offset, } /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); - } + + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); return offset; } @@ -2082,9 +2053,7 @@ dissect_ICBAAccoServerSRT_SetActivation_rqst(tvbuff_t *tvb, int offset, } /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); return offset; } @@ -2109,9 +2078,7 @@ dissect_ICBAAccoServer_Ping_rqst(tvbuff_t *tvb, int offset, hf_cba_acco_conn_consumer, szStr, u32MaxStr); /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr); - } + col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr); return offset; } @@ -2252,10 +2219,8 @@ dissect_ICBAAccoServerSRT_ConnectCR_rqst(tvbuff_t *tvb, int offset, /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": %sConsCRID=0x%x Len=%u QoS=%u", - (u32Flags & 0x2) ? "Reco " : "", u16CRID, u16CRLength, u16QoSValue); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": %sConsCRID=0x%x Len=%u QoS=%u", + (u32Flags & 0x2) ? "Reco " : "", u16CRID, u16CRLength, u16QoSValue); return offset; } @@ -2352,12 +2317,10 @@ dissect_ICBAAccoServerSRT_ConnectCR_resp(tvbuff_t *tvb, int offset, u32Idx++; } - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": %s PCRID=0x%x -> %s", - (u8FirstConnect) ? "FirstCR" : "NotFirstCR", - u32ProvCRID, - val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": %s PCRID=0x%x -> %s", + (u8FirstConnect) ? "FirstCR" : "NotFirstCR", + u32ProvCRID, + val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); return offset; } @@ -2419,10 +2382,8 @@ dissect_ICBAAccoServerSRT_DisconnectCR_rqst(tvbuff_t *tvb, int offset, } /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": PCRID=0x%x", - u32ProvCRID); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": PCRID=0x%x", + u32ProvCRID); return offset; } @@ -2476,10 +2437,8 @@ dissect_ICBAAccoServerSRT_DisconnectCR_resp(tvbuff_t *tvb, int offset, offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", - val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } + col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", + val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); return offset; } @@ -2647,12 +2606,10 @@ dissect_ICBAAccoServerSRT_Connect_rqst(tvbuff_t *tvb, int offset, } /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": %s Cnt=%u PCRID=0x%x", - (u8LastConnect) ? "LastOfCR" : "", - u32Idx-1, - u32ProvCRID); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": %s Cnt=%u PCRID=0x%x", + (u8LastConnect) ? "LastOfCR" : "", + u32Idx-1, + u32ProvCRID); return u32VariableOffset; } @@ -2739,11 +2696,9 @@ dissect_ICBAAccoServerSRT_Connect_resp(tvbuff_t *tvb, int offset, u32Idx++; } - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s", - u32Idx-1, - val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s", + u32Idx-1, + val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); return offset; } @@ -2766,12 +2721,10 @@ dissect_Server_GetProvIDs_resp(tvbuff_t *tvb, int offset, offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep, hf_cba_acco_count, &u32Count); - if (check_col(pinfo->cinfo, COL_INFO)) { - if (u32Count) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u ProvID=", u32Count); - } else { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); - } + if (u32Count) { + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u ProvID=", u32Count); + } else { + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); } offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep, @@ -2786,14 +2739,12 @@ dissect_Server_GetProvIDs_resp(tvbuff_t *tvb, int offset, tree, drep, hf_cba_acco_conn_prov_id, &u32ProvID, u32Idx); - if (check_col(pinfo->cinfo, COL_INFO)) { - if (u32Idx == 1) { - col_append_fstr(pinfo->cinfo, COL_INFO, "0x%x", u32ProvID); - } else if (u32Idx < 10) { - col_append_fstr(pinfo->cinfo, COL_INFO, ",0x%x", u32ProvID); - } else if (u32Idx == 10) { - col_append_fstr(pinfo->cinfo, COL_INFO, ",..."); - } + if (u32Idx == 1) { + col_append_fstr(pinfo->cinfo, COL_INFO, "0x%x", u32ProvID); + } else if (u32Idx < 10) { + col_append_fstr(pinfo->cinfo, COL_INFO, ",0x%x", u32ProvID); + } else if (u32Idx == 10) { + col_append_fstr(pinfo->cinfo, COL_INFO, ",..."); } u32Idx++; @@ -2803,10 +2754,8 @@ dissect_Server_GetProvIDs_resp(tvbuff_t *tvb, int offset, offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", + col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } return offset; } @@ -2838,9 +2787,7 @@ dissect_Server_GetProvConnections_rqst(tvbuff_t *tvb, int offset, } /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); return offset; } @@ -2941,10 +2888,8 @@ dissect_Server_GetProvConnections_resp(tvbuff_t *tvb, int offset, u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", + col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } return u32VariableOffset; } @@ -3025,8 +2970,7 @@ dissect_CBA_Connection_Data(tvbuff_t *tvb, /* update column info now */ #if 0 - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, " Cnt=%u", u16Count); + col_append_fstr(pinfo->cinfo, COL_INFO, " Cnt=%u", u16Count); #endif /* is this an OnDataChanged buffer format (version), we know? */ @@ -3191,8 +3135,7 @@ dissect_CBA_Connection_Data(tvbuff_t *tvb, } proto_item_set_len(conn_data_item, offset); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ", QC (G:%u,U:%u,B:%u)", + col_append_fstr(pinfo->cinfo, COL_INFO, ", QC (G:%u,U:%u,B:%u)", qc_good, qc_uncertain, qc_bad); return offset; @@ -3293,10 +3236,8 @@ dissect_ICBAAccoCallback_OnDataChanged_resp(tvbuff_t *tvb, int offset, offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", + col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } return offset; } @@ -3336,10 +3277,8 @@ dissect_ICBAAccoCallback_Gnip_resp(tvbuff_t *tvb, int offset, offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", + col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } return offset; } @@ -3376,9 +3315,7 @@ dissect_ICBAAccoServer2_GetConnectionData_rqst(tvbuff_t *tvb, int offset, } /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr); - } + col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr); return offset; } @@ -3435,10 +3372,8 @@ dissect_ICBAAccoServer2_GetConnectionData_resp(tvbuff_t *tvb, int offset, &u32HResult); /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", + col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } return offset; } @@ -3529,12 +3464,10 @@ dissect_ICBAAccoMgt_AddConnections_rqst(tvbuff_t *tvb, int offset, } /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Prov=\"%s\" State=%s Cnt=%u", + col_append_fstr(pinfo->cinfo, COL_INFO, ": Prov=\"%s\" State=%s Cnt=%u", szConsumer, val_to_str(u8State, cba_acco_conn_state_vals, "Unknown (0x%02x)"), u32Count); - } return u32VariableOffset; } @@ -3590,19 +3523,15 @@ dissect_ICBAAccoMgt_AddConnections_resp(tvbuff_t *tvb, int offset, } /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); } offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult); /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", - val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } + col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", + val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); return offset; } @@ -3634,9 +3563,7 @@ dissect_ICBAAccoMgt_RemoveConnections_rqst(tvbuff_t *tvb, int offset, } /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); return offset; } @@ -3672,9 +3599,7 @@ dissect_ICBAAccoMgt_SetActivationState_rqst(tvbuff_t *tvb, int offset, } /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); return offset; } @@ -3700,8 +3625,7 @@ dissect_ICBAAccoMgt_GetInfo_resp(tvbuff_t *tvb, int offset, offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ": %u/%u -> %s", + col_append_fstr(pinfo->cinfo, COL_INFO, ": %u/%u -> %s", u32CurCnt, u32Max, val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); @@ -3731,12 +3655,10 @@ dissect_ICBAAccoMgt_GetIDs_resp(tvbuff_t *tvb, int offset, offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep, hf_cba_acco_count, &u32Count); - if (check_col(pinfo->cinfo, COL_INFO)) { - if (u32Count) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u ConsID=", u32Count); - } else { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); - } + if (u32Count) { + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u ConsID=", u32Count); + } else { + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); } offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep, @@ -3767,14 +3689,12 @@ dissect_ICBAAccoMgt_GetIDs_resp(tvbuff_t *tvb, int offset, val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); proto_item_set_len(sub_item, offset - u32SubStart); - if (check_col(pinfo->cinfo, COL_INFO)) { - if (u32Idx == 1) { - col_append_fstr(pinfo->cinfo, COL_INFO, "0x%x", u32ConsID); - } else if (u32Idx < 10) { - col_append_fstr(pinfo->cinfo, COL_INFO, ",0x%x", u32ConsID); - } else if (u32Idx == 10) { - col_append_fstr(pinfo->cinfo, COL_INFO, ",..."); - } + if (u32Idx == 1) { + col_append_fstr(pinfo->cinfo, COL_INFO, "0x%x", u32ConsID); + } else if (u32Idx < 10) { + col_append_fstr(pinfo->cinfo, COL_INFO, ",0x%x", u32ConsID); + } else if (u32Idx == 10) { + col_append_fstr(pinfo->cinfo, COL_INFO, ",..."); } u32Idx++; @@ -3784,10 +3704,8 @@ dissect_ICBAAccoMgt_GetIDs_resp(tvbuff_t *tvb, int offset, offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", + col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } return offset; } @@ -3810,12 +3728,10 @@ dissect_ICBAAccoMgt2_GetConsIDs_resp(tvbuff_t *tvb, int offset, offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep, hf_cba_acco_count, &u32Count); - if (check_col(pinfo->cinfo, COL_INFO)) { - if (u32Count) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u ConsID=", u32Count); - } else { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); - } + if (u32Count) { + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u ConsID=", u32Count); + } else { + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); } offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep, @@ -3830,14 +3746,12 @@ dissect_ICBAAccoMgt2_GetConsIDs_resp(tvbuff_t *tvb, int offset, tree, drep, hf_cba_acco_conn_cons_id, &u32ConsID, u32Idx); - if (check_col(pinfo->cinfo, COL_INFO)) { - if (u32Idx == 1) { - col_append_fstr(pinfo->cinfo, COL_INFO, "0x%x", u32ConsID); - } else if (u32Idx < 10) { - col_append_fstr(pinfo->cinfo, COL_INFO, ",0x%x", u32ConsID); - } else if (u32Idx == 10) { - col_append_fstr(pinfo->cinfo, COL_INFO, ",..."); - } + if (u32Idx == 1) { + col_append_fstr(pinfo->cinfo, COL_INFO, "0x%x", u32ConsID); + } else if (u32Idx < 10) { + col_append_fstr(pinfo->cinfo, COL_INFO, ",0x%x", u32ConsID); + } else if (u32Idx == 10) { + col_append_fstr(pinfo->cinfo, COL_INFO, ",..."); } u32Idx++; @@ -3847,10 +3761,8 @@ dissect_ICBAAccoMgt2_GetConsIDs_resp(tvbuff_t *tvb, int offset, offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", + col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } return offset; } @@ -3957,10 +3869,8 @@ dissect_ICBAAccoMgt2_GetConsConnections_resp(tvbuff_t *tvb, int offset, u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", + col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } return u32VariableOffset; } @@ -4037,10 +3947,8 @@ dissect_ICBAAccoMgt2_DiagConsConnections_resp(tvbuff_t *tvb, int offset, u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", + col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } return u32VariableOffset; } @@ -4179,10 +4087,8 @@ dissect_ICBAAccoMgt_GetConnections_resp(tvbuff_t *tvb, int offset, u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", + col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } return u32VariableOffset; } @@ -4209,12 +4115,10 @@ dissect_ICBAAccoMgt_ReviseQoS_rqst(tvbuff_t *tvb, int offset, offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep, hf_cba_acco_conn_qos_value, &u16QoSValue); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": RTAuto=\"%s\" QoSType=%s QoSValue=%u", + col_append_fstr(pinfo->cinfo, COL_INFO, ": RTAuto=\"%s\" QoSType=%s QoSValue=%u", szStr, val_to_str(u16QoSType, cba_qos_type_vals, "Unknown (0x%04x)"), u16QoSValue); - } return offset; } @@ -4236,8 +4140,7 @@ dissect_ICBAAccoMgt_ReviseQoS_resp(tvbuff_t *tvb, int offset, offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ": %u -> %s", + col_append_fstr(pinfo->cinfo, COL_INFO, ": %u -> %s", u16QoSValue, val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); @@ -4261,8 +4164,7 @@ dissect_ICBAAccoMgt_get_PingFactor_resp(tvbuff_t *tvb, int offset, offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ": %u -> %s", + col_append_fstr(pinfo->cinfo, COL_INFO, ": %u -> %s", u16PF, val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); @@ -4282,8 +4184,7 @@ dissect_ICBAAccoMgt_put_PingFactor_rqst(tvbuff_t *tvb, int offset, offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep, hf_cba_acco_ping_factor, &u16PF); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", u16PF); + col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", u16PF); return offset; } @@ -4306,11 +4207,9 @@ dissect_ICBAAccoMgt_get_CDBCookie_resp(tvbuff_t *tvb, int offset, offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": CDBCookie=0x%x -> %s", + col_append_fstr(pinfo->cinfo, COL_INFO, ": CDBCookie=0x%x -> %s", u32Cookie, val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } return offset; } @@ -4340,11 +4239,9 @@ dissect_ICBAAccoMgt_GetDiagnosis_rqst(tvbuff_t *tvb, int offset, proto_tree_add_item(tree, hf_cba_acco_diag_data, tvb, offset, u32InLength, FALSE); } - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": %s: %u bytes", + col_append_fstr(pinfo->cinfo, COL_INFO, ": %s: %u bytes", val_to_str(u32Request, cba_acco_diag_req_vals, "Unknown request (0x%08x)"), u32InLength); - } return offset; } @@ -4366,10 +4263,8 @@ dissect_ICBAAccoMgt_GetDiagnosis_resp(tvbuff_t *tvb, int offset, proto_tree_add_item(tree, hf_cba_acco_diag_data, tvb, offset, u32OutLength, FALSE); } - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": %u bytes", + col_append_fstr(pinfo->cinfo, COL_INFO, ": %u bytes", u32OutLength); - } return offset; } @@ -4410,9 +4305,7 @@ dissect_ICBAAccoSync_ReadItems_rqst(tvbuff_t *tvb, int offset, u32Idx++; } - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); return u32VariableOffset; } @@ -4482,11 +4375,9 @@ dissect_ICBAAccoSync_ReadItems_resp(tvbuff_t *tvb, int offset, u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep, &u32HResult); - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s", + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s", u32ArraySize, val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - } return u32VariableOffset; } @@ -4542,9 +4433,7 @@ dissect_ICBAAccoSync_WriteItems_rqst(tvbuff_t *tvb, int offset, u32Idx++; } - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); return u32VariableOffset; } @@ -4610,9 +4499,7 @@ dissect_ICBAAccoSync_WriteItemsQCD_rqst(tvbuff_t *tvb, int offset, u32Idx++; } - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); - } + col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count); return u32VariableOffset; } diff --git a/tools/wireshark_gen.py b/tools/wireshark_gen.py index ade13592b7..19dd25a06e 100755 --- a/tools/wireshark_gen.py +++ b/tools/wireshark_gen.py @@ -2141,7 +2141,6 @@ static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tre * Do not clear COL_INFO, as nothing is being written there by * this dissector yet. So leave it as is from the GIOP dissector. * TODO: add something useful to COL_INFO - * if (check_col(pinfo->cinfo, COL_INFO)) * col_clear(pinfo->cinfo, COL_INFO); */ |