Removed check_col() and the occasional tree.
authorMichael Mann <mmann78@netscape.net>
Fri, 14 Jun 2013 17:49:53 +0000 (17:49 -0000)
committerMichael Mann <mmann78@netscape.net>
Fri, 14 Jun 2013 17:49:53 +0000 (17:49 -0000)
svn path=/trunk/; revision=49938

72 files changed:
epan/dissectors/packet-enrp.c
epan/dissectors/packet-hci_h1.c
epan/dissectors/packet-isis-snp.c
epan/dissectors/packet-ismacryp.c
epan/dissectors/packet-kerberos.c
epan/dissectors/packet-kerberos4.c
epan/dissectors/packet-kpasswd.c
epan/dissectors/packet-l1-events.c
epan/dissectors/packet-l2tp.c
epan/dissectors/packet-lanforge.c
epan/dissectors/packet-lapd.c
epan/dissectors/packet-laplink.c
epan/dissectors/packet-lapsat.c
epan/dissectors/packet-ldp.c
epan/dissectors/packet-ldss.c
epan/dissectors/packet-llc.c
epan/dissectors/packet-lldp.c
epan/dissectors/packet-llt.c
epan/dissectors/packet-lmi.c
epan/dissectors/packet-lon.c
epan/dissectors/packet-loop.c
epan/dissectors/packet-lpd.c
epan/dissectors/packet-lsc.c
epan/dissectors/packet-lwapp.c
epan/dissectors/packet-lwres.c
epan/dissectors/packet-m2pa.c
epan/dissectors/packet-m2tp.c
epan/dissectors/packet-m2ua.c
epan/dissectors/packet-m3ua.c
epan/dissectors/packet-mactelnet.c
epan/dissectors/packet-mbtcp.c
epan/dissectors/packet-media.c
epan/dissectors/packet-megaco.c
epan/dissectors/packet-mikey.c
epan/dissectors/packet-mmse.c
epan/dissectors/packet-mount.c
epan/dissectors/packet-mpls-echo.c
epan/dissectors/packet-mpls-y1711.c
epan/dissectors/packet-mq-pcf.c
epan/dissectors/packet-mq.c
epan/dissectors/packet-mrdisc.c
epan/dissectors/packet-msdp.c
epan/dissectors/packet-msn-messenger.c
epan/dissectors/packet-msnip.c
epan/dissectors/packet-msproxy.c
epan/dissectors/packet-mstp.c
epan/dissectors/packet-mysql.c
epan/dissectors/packet-nasdaq-soup.c
epan/dissectors/packet-nbd.c
epan/dissectors/packet-nbipx.c
epan/dissectors/packet-ncp-nmas.c
epan/dissectors/packet-ncp-sss.c
epan/dissectors/packet-ncp.c
epan/dissectors/packet-ndmp.c
epan/dissectors/packet-ndp.c
epan/dissectors/packet-ndps.c
epan/dissectors/packet-netbios.c
epan/dissectors/packet-netflow.c
epan/dissectors/packet-netperfmeter.c
epan/dissectors/packet-nettl.c
epan/dissectors/packet-nlm.c
epan/dissectors/packet-nlsp.c
epan/dissectors/packet-nntp.c
epan/dissectors/packet-noe.c
epan/dissectors/packet-nsip.c
epan/dissectors/packet-pgsql.c
epan/dissectors/packet-q933.c
epan/dissectors/packet-starteam.c
epan/dissectors/packet-tr.c
epan/dissectors/packet-usb.c
epan/dissectors/packet-vines.c
epan/dissectors/packet-wol.c

index 82f15d5797d5be966bd26315029ec455a2ab9e49..132721324d7d46b859b15a2bf0fa287c8aadb06f 100644 (file)
@@ -942,7 +942,7 @@ dissect_enrp_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *enrp
 
   type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET);
   /* pinfo is NULL only if dissect_enrp_message is called via dissect_error_cause */
-  if (pinfo && (check_col(pinfo->cinfo, COL_INFO)))
+  if (pinfo)
     col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(type, message_type_values, "Unknown ENRP Type"));
 
   if (enrp_tree) {
index d5f9dc1239d80e2832d368482f918a335678a551..cd61094f04005128d2e8f78a99dbf8d8f6df1643 100644 (file)
@@ -95,19 +95,17 @@ dissect_hci_h1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                                                          "Unknown 0x%02x"));
        }
 
-       if(check_col(pinfo->cinfo, COL_INFO)){
-               if(pinfo->p2p_dir == P2P_DIR_SENT ||
-                  pinfo->p2p_dir == P2P_DIR_RECV)
-                       col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
-                                    val_to_str(pinfo->p2p_dir,
-                                               hci_h1_direction_vals, "Unknown: %d"),
+       if(pinfo->p2p_dir == P2P_DIR_SENT ||
+          pinfo->p2p_dir == P2P_DIR_RECV)
+               col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
+                            val_to_str(pinfo->p2p_dir,
+                                       hci_h1_direction_vals, "Unknown: %d"),
                                     val_to_str(type, hci_h1_type_vals,
-                                               "Unknown 0x%02x"));
-               else
-                       col_add_fstr(pinfo->cinfo, COL_INFO, "%s",
-                                    val_to_str(type, hci_h1_type_vals,
-                                               "Unknown 0x%02x"));
-       }
+                                       "Unknown 0x%02x"));
+       else
+               col_add_fstr(pinfo->cinfo, COL_INFO, "%s",
+                            val_to_str(type, hci_h1_type_vals,
+                                       "Unknown 0x%02x"));
 
        pd_save = pinfo->private_data;
        hci_data = wmem_new(wmem_packet_scope(),hci_data_t);
index 08c0edeef7bfbb0bb9b4003ad24e8a67a181a2a8..9f2f45fc3a1aeed012699ec59a417135234c3126 100644 (file)
@@ -294,32 +294,25 @@ isis_dissect_isis_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
                        "Source-ID:    %s",
                                print_system_id( tvb_get_ptr(tvb, offset, id_length+1), id_length+1 ) );
        }
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, ", Source-ID: %s",
+       col_append_fstr(pinfo->cinfo, COL_INFO, ", Source-ID: %s",
                        print_system_id( tvb_get_ptr(tvb, offset, id_length+1), id_length+1 ) );
-       }
+
        offset += id_length + 1;
 
-       if (tree) {
-               proto_tree_add_text(csnp_tree, tvb, offset, id_length + 2,
-                       "Start LSP-ID: %s",
-                                    print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2 ) );                
-       }
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, ", Start LSP-ID: %s",
+       proto_tree_add_text(csnp_tree, tvb, offset, id_length + 2, "Start LSP-ID: %s",
+                                    print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2 ) );
+
+       col_append_fstr(pinfo->cinfo, COL_INFO, ", Start LSP-ID: %s",
                        print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2 ) );
-       }
+
        offset += id_length + 2;
 
-       if (tree) {
-               proto_tree_add_text(csnp_tree, tvb, offset, id_length + 2,
-                       "End LSP-ID: %s",
-                                    print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2 ) );  
-       }
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, ", End LSP-ID: %s",
+       proto_tree_add_text(csnp_tree, tvb, offset, id_length + 2, "End LSP-ID: %s",
+                                    print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2 ) );
+
+       col_append_fstr(pinfo->cinfo, COL_INFO, ", End LSP-ID: %s",
                        print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2 ) );
-       }
+
        offset += id_length + 2;
 
        len = pdu_length - header_length;
@@ -378,15 +371,12 @@ isis_dissect_isis_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
        }
        offset += 2;
 
-       if (tree) {
-               proto_tree_add_text(psnp_tree, tvb, offset, id_length + 1,
-                       "Source-ID: %s",
+       proto_tree_add_text(psnp_tree, tvb, offset, id_length + 1, "Source-ID: %s",
                        print_system_id( tvb_get_ptr(tvb, offset, id_length+1), id_length + 1 ) );
-       }
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, ", Source-ID: %s",
+
+       col_append_fstr(pinfo->cinfo, COL_INFO, ", Source-ID: %s",
                        print_system_id( tvb_get_ptr(tvb, offset, id_length+1), id_length+1 ) );
-       }
+
        offset += id_length + 1;
 
        len = pdu_length - header_length;
index aee049fb21dd0f179622e6be48c0d2b78ed38f3c..502d11a159561713d3d8585557fb5bc5ef3bc8ee 100644 (file)
@@ -258,26 +258,20 @@ static void dissect_ismacryp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tre
        }
 
        if (set_version == V11){
-               if (check_col(pinfo->cinfo, COL_PROTOCOL))
-                       col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_ISMACRYP_11);
+               col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_ISMACRYP_11);
                /* display mode */
                if (pref_user_mode == FALSE){
-                       if (check_col( pinfo->cinfo, COL_INFO))
-                               col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",val_to_str_const(mode, modetypenames, "user mode"));
-               }
-               if (pref_user_mode == TRUE){
-                       if ( check_col( pinfo->cinfo, COL_INFO))
-                               col_append_fstr(pinfo->cinfo, COL_INFO, ", %s","user mode");
+                       col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",val_to_str_const(mode, modetypenames, "user mode"));
+               } else {
+                       col_append_fstr(pinfo->cinfo, COL_INFO, ", %s","user mode");
                }
                user_mode = pref_user_mode;
        }
        if (set_version == V20){
-               if (check_col(pinfo->cinfo, COL_PROTOCOL))
-                       col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_ISMACRYP_20);
+               col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_ISMACRYP_20);
                user_mode = TRUE;
                /* display mode */
-               if (check_col( pinfo->cinfo, COL_INFO))
-                       col_append_fstr(pinfo->cinfo, COL_INFO, ", %s","user mode");
+               col_append_fstr(pinfo->cinfo, COL_INFO, ", %s","user mode");
        }
        /* select correct AU values depending on version & selected mode in preferences menu if not in user_mode */
        if (user_mode == TRUE){ /* use values set in preference menu */
@@ -573,10 +567,9 @@ static offset_struct* dissect_auheader( tvbuff_t *tvb, offset_struct *poffset, p
        {
                ismacryp_item = proto_tree_add_item(ismacryp_header_tree, hf_ismacryp_iv, tvb, poffset->offset_bytes, iv_length, ENC_NA);
                proto_item_append_text(ismacryp_item, ": Length=%d bytes",iv_length); /* add IV info */
-               if ( check_col( pinfo->cinfo, COL_INFO) ) {
-                       col_append_fstr( pinfo->cinfo, COL_INFO,
+               col_append_fstr( pinfo->cinfo, COL_INFO,
                        ", IV=0x%s", tvb_bytes_to_str_punct(tvb, poffset->offset_bytes, iv_length,' '));
-               }
+
                poffset->offset_bytes+=iv_length; /* add IV length to offset_bytes */
        }
        /*Delta  IV */
@@ -585,10 +578,8 @@ static offset_struct* dissect_auheader( tvbuff_t *tvb, offset_struct *poffset, p
                ismacryp_item = proto_tree_add_item(ismacryp_header_tree, hf_ismacryp_delta_iv,
                                                    tvb, poffset->offset_bytes, delta_iv_length, ENC_NA);
                proto_item_append_text(ismacryp_item, ": Length=%d bytes",delta_iv_length); /* add delta IV info */
-               if ( check_col( pinfo->cinfo, COL_INFO) ) {
-                       col_append_fstr( pinfo->cinfo, COL_INFO,
+               col_append_fstr( pinfo->cinfo, COL_INFO,
                        ", Delta IV=0x%s", tvb_bytes_to_str_punct(tvb, poffset->offset_bytes, delta_iv_length,' '));
-               }
                poffset->offset_bytes+=iv_length; /* add IV length to offset_bytes */
        }
        /* Key Indicator */
@@ -598,10 +589,8 @@ static offset_struct* dissect_auheader( tvbuff_t *tvb, offset_struct *poffset, p
                ismacryp_item = proto_tree_add_item(ismacryp_header_tree, hf_ismacryp_key_indicator,
                                                    tvb, poffset->offset_bytes, key_indicator_length, ENC_NA);
                proto_item_append_text(ismacryp_item,": Length=%d bytes",key_indicator_length); /* add KI info */
-               if ( check_col( pinfo->cinfo, COL_INFO) ) {
-                       col_append_fstr( pinfo->cinfo, COL_INFO,
+               col_append_fstr( pinfo->cinfo, COL_INFO,
                                         ", KI=0x%s", tvb_bytes_to_str_punct(tvb, poffset->offset_bytes, key_indicator_length,' '));
-               }
                poffset->offset_bytes+=key_indicator_length; /* add KI length to offset_bytes */
        }
        /* AU size */
index 90000c23d9c0453437a15e02c1243ac860919a68..e99687e8850beeea8a0edff2ed4e98abeab36498 100644 (file)
@@ -1674,7 +1674,7 @@ static int
 dissect_krb5_error_code(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_)
 {
     offset=dissect_ber_integer(FALSE, actx, tree, tvb, offset, hf_krb_error_code, &krb5_errorcode);
-    if(krb5_errorcode && check_col(actx->pinfo->cinfo, COL_INFO)) {
+    if(krb5_errorcode) {
         col_add_fstr(actx->pinfo->cinfo, COL_INFO,
                      "KRB Error: %s",
                      val_to_str(krb5_errorcode, krb5_error_codes,
@@ -1916,7 +1916,7 @@ dissect_krb5_msg_type(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *a
 
     offset=dissect_ber_integer(FALSE, actx, tree, tvb, offset, hf_krb_msg_type, &msgtype);
 
-    if (gbl_do_col_info & check_col(actx->pinfo->cinfo, COL_INFO)) {
+    if (gbl_do_col_info) {
         col_add_str(actx->pinfo->cinfo, COL_INFO,
                     val_to_str(msgtype, krb5_msg_types,
                                "Unknown msg type %#x"));
@@ -2295,7 +2295,7 @@ dissect_krb5_PW_SALT(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *ac
      */
     proto_tree_add_item(tree, hf_krb_smb_nt_status, tvb, offset, 4, ENC_LITTLE_ENDIAN);
     nt_status=tvb_get_letohl(tvb, offset);
-    if(nt_status && check_col(actx->pinfo->cinfo, COL_INFO)) {
+    if(nt_status) {
         col_append_fstr(actx->pinfo->cinfo, COL_INFO,
                         " NT Status: %s",
                         val_to_str(nt_status, NT_errors,
index 036bb0e6f4d2c22f0ed642c24d83bfbff526a4e0..690717ed1aa026c1c6dc22a3d0bcfaa30a13c95e 100644 (file)
@@ -263,8 +263,7 @@ dissect_krb4_auth_msg_type(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t
 
        /* m_type */
        proto_tree_add_item(tree, hf_krb4_m_type, tvb, offset, 1, ENC_BIG_ENDIAN);
-       if (check_col(pinfo->cinfo, COL_INFO))
-         col_append_fstr(pinfo->cinfo, COL_INFO, "%s%s",
+       col_append_fstr(pinfo->cinfo, COL_INFO, "%s%s",
           (version==TRANSARC_SPECIAL_VERSION)?"TRANSARC-":"",
            val_to_str(auth_msg_type>>1, m_type_vals, "Unknown (0x%04x)"));
        proto_item_append_text(item, " %s%s",
index 053572700c5ca789e126fd55f01ff46224e43302..ac6ec418b4b75acc8de0791f948c7c634edb7423 100644 (file)
@@ -139,9 +139,8 @@ dissect_kpasswd_user_data_reply(packet_info *pinfo, tvbuff_t *tvb, proto_tree *t
     result = tvb_get_ntohs(tvb, offset);
     proto_tree_add_uint(tree, hf_kpasswd_result, tvb, offset, 2, result);
     offset+=2;
-    if (check_col(pinfo->cinfo, COL_INFO))
-        col_add_str(pinfo->cinfo, COL_INFO,
-            val_to_str(result, kpasswd_result_types, "Result: %u"));
+    col_add_str(pinfo->cinfo, COL_INFO,
+        val_to_str(result, kpasswd_result_types, "Result: %u"));
 
 
     /* optional result string */
@@ -233,8 +232,7 @@ dissect_kpasswd_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboo
 
     proto_tree_add_uint(kpasswd_tree, hf_kpasswd_message_len, tvb, offset, 2, message_len);
     proto_tree_add_uint(kpasswd_tree, hf_kpasswd_version, tvb, offset+2, 2, version);
-    if (check_col(pinfo->cinfo, COL_INFO))
-        col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(version, vers_vals, "Unknown command"));
+    col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(version, vers_vals, "Unknown command"));
     proto_tree_add_uint(kpasswd_tree, hf_kpasswd_ap_req_len, tvb, offset+4, 2, ap_req_len);
     offset+=6;
 
index cb03819b873d13f18dda90c3e10e63a05a2b7910..f1b1fd42848e3504a63443e18cca775a0a3e9bb8 100644 (file)
@@ -71,17 +71,13 @@ dissect_l1_events(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        }
 
        col_set_str(pinfo->cinfo, COL_PROTOCOL, "Layer1");
-       if (check_col(pinfo->cinfo, COL_DEF_SRC))
-               col_set_str(pinfo->cinfo, COL_DEF_SRC,
+       col_set_str(pinfo->cinfo, COL_DEF_SRC,
                            pinfo->pseudo_header->l1event.uton? "TE" : "NT");
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               len = tvb_find_line_end(tvb, 0,
-                                       tvb_ensure_length_remaining(tvb, 0),
+       len = tvb_find_line_end(tvb, 0, tvb_ensure_length_remaining(tvb, 0),
                                        &next_offset, FALSE);
-               if(len>0)
-                       col_add_str(pinfo->cinfo, COL_INFO,
-                                   tvb_format_text(tvb, 0, len));
-       }
+       if(len>0)
+               col_add_str(pinfo->cinfo, COL_INFO, tvb_format_text(tvb, 0, len));
+
        if (tree) {
                ti = proto_tree_add_item(tree, proto_l1_events,
                                tvb, 0, -1, ENC_NA);
index 3459f8227ea263155f5374cb98e15506accd78fd..e601d60ea22a61e206cbbfb486ed00d07ab2b66a 100644 (file)
@@ -2033,11 +2033,9 @@ process_l2tpv3_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
     if (cookie_len == -1)
         cookie_len = L2TPv3_COOKIE_DEFAULT;
 
-    if (check_col(pinfo->cinfo, COL_INFO)) {
-        col_add_fstr(pinfo->cinfo,COL_INFO,
-                     "%s            (session id=%u)",
-                     data_msg, sid);
-    }
+    col_add_fstr(pinfo->cinfo,COL_INFO,
+                    "%s            (session id=%u)",
+                    data_msg, sid);
 
     if (tree) {
         proto_tree_add_item(l2tp_tree, hf_l2tp_sid, tvb, idx-4, 4, ENC_BIG_ENDIAN);
@@ -2270,42 +2268,40 @@ process_l2tpv3_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
     ccid = tvb_get_ntohl(tvb, idx);
     idx += 4;
 
-    if (check_col(pinfo->cinfo, COL_INFO)) {
-        tmp_idx = idx;
+    tmp_idx = idx;
 
-        if ((LENGTH_BIT(control))&&(length==12))                /* ZLB Message */
-            col_add_fstr(pinfo->cinfo, COL_INFO,
-                         "%s - ZLB      (tunnel id=%u)",
-                         control_msg , ccid);
-        else
-        {
-            if (SEQUENCE_BIT(control)) {
-                tmp_idx += 4;
-            }
+    if ((LENGTH_BIT(control))&&(length==12))                /* ZLB Message */
+        col_add_fstr(pinfo->cinfo, COL_INFO,
+                        "%s - ZLB      (tunnel id=%u)",
+                        control_msg , ccid);
+    else
+    {
+        if (SEQUENCE_BIT(control)) {
+            tmp_idx += 4;
+        }
 
-            tmp_idx+=4;
+        tmp_idx+=4;
 
-            avp_type = tvb_get_ntohs(tvb, tmp_idx);
-            tmp_idx += 2;
+        avp_type = tvb_get_ntohs(tvb, tmp_idx);
+        tmp_idx += 2;
 
-            if (avp_type == CONTROL_MESSAGE) {
-                /* We print message type */
-                msg_type = tvb_get_ntohs(tvb, tmp_idx);
-                col_add_fstr(pinfo->cinfo, COL_INFO,
-                             "%s - %s (tunnel id=%u)",
-                             control_msg ,
-                             val_to_str(msg_type, l2tp_message_type_short_str_vals, "Unknown (%u)"),
-                             ccid);
-            }
-            else {
-                /*
-                 * This is not a control message.
-                 * We never pass here except in case of bad l2tp packet!
-                 */
-                col_add_fstr(pinfo->cinfo, COL_INFO,
-                             "%s (tunnel id=%u)",
-                             control_msg,  ccid);
-            }
+        if (avp_type == CONTROL_MESSAGE) {
+            /* We print message type */
+            msg_type = tvb_get_ntohs(tvb, tmp_idx);
+            col_add_fstr(pinfo->cinfo, COL_INFO,
+                            "%s - %s (tunnel id=%u)",
+                            control_msg ,
+                            val_to_str(msg_type, l2tp_message_type_short_str_vals, "Unknown (%u)"),
+                            ccid);
+        }
+        else {
+            /*
+                * This is not a control message.
+                * We never pass here except in case of bad l2tp packet!
+                */
+            col_add_fstr(pinfo->cinfo, COL_INFO,
+                            "%s (tunnel id=%u)",
+                            control_msg,  ccid);
         }
     }
 
@@ -2492,53 +2488,51 @@ dissect_l2tp_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
     idx += 2;
     cid = tvb_get_ntohs(tvb, idx);
 
-    if (check_col(pinfo->cinfo, COL_INFO)) {
-        if (CONTROL_BIT(control)) {
-            /* CONTROL MESSAGE */
-            tmp_idx = idx;
+    if (CONTROL_BIT(control)) {
+        /* CONTROL MESSAGE */
+        tmp_idx = idx;
 
-            if ((LENGTH_BIT(control))&&(length==12))        /* ZLB Message */
-                col_add_fstr(pinfo->cinfo, COL_INFO,
-                             "%s - ZLB      (tunnel id=%d, session id=%u)",
-                             control_msg, tid, cid);
-            else
-            {
-                if (SEQUENCE_BIT(control)) {
-                    tmp_idx += 4;
-                }
+        if ((LENGTH_BIT(control))&&(length==12))        /* ZLB Message */
+            col_add_fstr(pinfo->cinfo, COL_INFO,
+                            "%s - ZLB      (tunnel id=%d, session id=%u)",
+                            control_msg, tid, cid);
+        else
+        {
+            if (SEQUENCE_BIT(control)) {
+                tmp_idx += 4;
+            }
 
-                tmp_idx+=4;
+            tmp_idx+=4;
 
-                avp_type = tvb_get_ntohs(tvb, (tmp_idx+=2));
+            avp_type = tvb_get_ntohs(tvb, (tmp_idx+=2));
 
-                if (avp_type == CONTROL_MESSAGE) {
-                    /* We print message type */
-                    msg_type = tvb_get_ntohs(tvb, tmp_idx+2);
-                    col_add_fstr(pinfo->cinfo, COL_INFO,
-                                 "%s - %s (tunnel id=%u, session id=%u)",
-                                 control_msg,
-                                 val_to_str(msg_type, l2tp_message_type_short_str_vals, "Unknown (%u)"),
-                                 tid, cid);
-                }
-                else
-                {
-                    /*
-                     * This is not a control message.
-                     * We never pass here except in case of bad l2tp packet!
-                     */
-                    col_add_fstr(pinfo->cinfo, COL_INFO,
-                                 "%s (tunnel id=%u, session id=%u)",
-                                 control_msg, tid, cid);
+            if (avp_type == CONTROL_MESSAGE) {
+                /* We print message type */
+                msg_type = tvb_get_ntohs(tvb, tmp_idx+2);
+                col_add_fstr(pinfo->cinfo, COL_INFO,
+                                "%s - %s (tunnel id=%u, session id=%u)",
+                                control_msg,
+                                val_to_str(msg_type, l2tp_message_type_short_str_vals, "Unknown (%u)"),
+                                tid, cid);
+            }
+            else
+            {
+                /*
+                    * This is not a control message.
+                    * We never pass here except in case of bad l2tp packet!
+                    */
+                col_add_fstr(pinfo->cinfo, COL_INFO,
+                                "%s (tunnel id=%u, session id=%u)",
+                                control_msg, tid, cid);
 
-                }
             }
         }
-        else {
-            /* DATA Message */
-            col_add_fstr(pinfo->cinfo, COL_INFO,
-                         "%s            (tunnel id=%u, session id=%u)",
-                         data_msg, tid, cid);
-        }
+    }
+    else {
+        /* DATA Message */
+        col_add_fstr(pinfo->cinfo, COL_INFO,
+                        "%s            (tunnel id=%u, session id=%u)",
+                        data_msg, tid, cid);
     }
 
     if (LENGTH_BIT(control)) {
index f72c4876ccee1e8b60517404ce864aee02810104..20273fc5af98514f2b56b762a8ff2720f4e4fb51 100644 (file)
@@ -89,9 +89,7 @@ static gboolean dissect_lanforge(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
 
     col_set_str(pinfo->cinfo, COL_PROTOCOL, "LANforge");
 
-    if(check_col(pinfo->cinfo, COL_INFO)) {
-        col_add_fstr(pinfo->cinfo, COL_INFO, "Seq: %u", tvb_get_ntohl(tvb, 16));
-    }
+    col_add_fstr(pinfo->cinfo, COL_INFO, "Seq: %u", tvb_get_ntohl(tvb, 16));
 
     if(tree) {
 
index a5b730308b6c7e6b214f7f06206fa2c1c177e270..53d4ba8b7d78e75b4a4b7e5c7063bef8ee6ca203 100644 (file)
@@ -435,8 +435,7 @@ dissect_lapd_full(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
        sapi = (addr & LAPD_SAPI) >> LAPD_SAPI_SHIFT;
        lapd_header_len = 2;    /* addr */
 
-       if (check_col(pinfo->cinfo, COL_TEI))
-               col_add_fstr(pinfo->cinfo, COL_TEI, "%u", tei);
+       col_add_fstr(pinfo->cinfo, COL_TEI, "%u", tei);
 
        /* Append TEI to info field */
        col_append_fstr(pinfo->cinfo, COL_INFO, "TEI:%02u ", tei);
index aa11be1767f88f8188d94cc23cf130a02ee679e5..50beae0c75b4327f665cb4139ca615d02bf6f9d9 100644 (file)
@@ -93,8 +93,7 @@ dissect_laplink_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
 /* Make entries in Protocol column and Info column on summary display */
        col_set_str(pinfo->cinfo, COL_PROTOCOL, "Laplink");
 
-       if (check_col(pinfo->cinfo, COL_INFO))
-               col_add_str(pinfo->cinfo, COL_INFO, udp_ident_string);
+       col_add_str(pinfo->cinfo, COL_INFO, udp_ident_string);
 
        if (tree){
                ti = proto_tree_add_item(tree, proto_laplink, tvb, 0, -1, ENC_NA);
@@ -122,10 +121,8 @@ dissect_laplink_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        col_set_str(pinfo->cinfo, COL_PROTOCOL, "Laplink");
 
        tcp_ident = tvb_get_ntohl(tvb, offset);
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_add_str(pinfo->cinfo, COL_INFO,
+       col_add_str(pinfo->cinfo, COL_INFO,
                            val_to_str(tcp_ident, laplink_tcp_magic, "TCP TBA (%u)"));
-       }
 
        if (tree){
                ti = proto_tree_add_item(tree, proto_laplink, tvb, 0, -1, ENC_NA);
index e4e989df9916dd10c0ea8f5bd566b4875856456a..f614b0ce6f57333469576350d4e04dbfc70e0ddd 100644 (file)
@@ -345,8 +345,7 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int is_
        }
 
        /* Add info */
-       if (check_col(pinfo->cinfo, COL_INFO))
-               col_add_str(pinfo->cinfo, COL_INFO, info);
+       col_add_str(pinfo->cinfo, COL_INFO, info);
 
        /* Create item & subtree */
        ctl_ti = proto_tree_add_uint_format_value(
index 8dcdf464a9e4df78deeb7ace5ef13d5251540737..3eae7e9b09ee7bc771db43834e27bdd22548b23d 100644 (file)
@@ -2581,17 +2581,15 @@ dissect_msg(tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree)
     rem -= 4;
     length = MIN(length, rem);  /* Don't go haywire if a problem ... */
 
-    if( check_col(pinfo->cinfo, COL_INFO) ){
-        switch (type) {
-        case LDP_VENDOR_PRIVATE_START:
-            col_append_fstr(pinfo->cinfo, COL_INFO, "Vendor-Private Message (0x%04X) ", typebak);
-            break;
-        case LDP_EXPERIMENTAL_MESSAGE_START:
-            col_append_fstr(pinfo->cinfo, COL_INFO, "Experimental Message (0x%04X) ", typebak);
-            break;
-        default:
-            col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(type, ldp_message_types, "Unknown Message (0x%04X)"));
-        }
+    switch (type) {
+    case LDP_VENDOR_PRIVATE_START:
+        col_append_fstr(pinfo->cinfo, COL_INFO, "Vendor-Private Message (0x%04X) ", typebak);
+        break;
+    case LDP_EXPERIMENTAL_MESSAGE_START:
+        col_append_fstr(pinfo->cinfo, COL_INFO, "Experimental Message (0x%04X) ", typebak);
+        break;
+    default:
+        col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(type, ldp_message_types, "Unknown Message (0x%04X)"));
     }
 
     if (tree) {
index 90db41e304b9eb0a6d346686f613a8d034ad5f3b..39ffc7469a39f7051ef298861148e4e7125c1ee9 100644 (file)
@@ -324,11 +324,9 @@ dissect_ldss_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        packet_detail = val_to_str_const(messageDetail, ldss_inferred_info, "unknown");
 
        /* Set the info column */
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_add_fstr(pinfo->cinfo, COL_INFO, "LDSS Broadcast (%s%s)",
+       col_add_fstr(pinfo->cinfo, COL_INFO, "LDSS Broadcast (%s%s)",
                             packet_type,
                             packet_detail);
-       }
 
        /* If we have a non-null tree (ie we are building the proto_tree
         * instead of just filling out the columns), then give more detail. */
@@ -680,12 +678,10 @@ dissect_ldss_transfer (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                transfer_info->resp_num = pinfo->fd->num;
                transfer_info->resp_ts = pinfo->fd->abs_ts;
 
-               if (check_col(pinfo->cinfo, COL_INFO)) {
-                       col_add_fstr(pinfo->cinfo, COL_INFO, "LDSS File Transfer (Sending file - %s)",
+               col_add_fstr(pinfo->cinfo, COL_INFO, "LDSS File Transfer (Sending file - %s)",
                                     transfer_info->broadcast->message_id == MESSAGE_ID_WILLSEND
                                     ? "pull"
                                     : "push");
-               }
 
                if (tree) {
                        ti = proto_tree_add_item(tree, proto_ldss,
index 65c761941e62fad011f7093d0f7f6f2bacba287a..edf799456613cecd02b583c0967b82f3bb541c35 100644 (file)
@@ -440,20 +440,17 @@ dissect_basicxid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                proto_tree_add_uint(xid_tree, hf_llc_xid_types, tvb, 1,
                        1, types & TYPES_MASK);
        }
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO,
+       col_append_fstr(pinfo->cinfo, COL_INFO,
                    "; %s", val_to_str(types & TYPES_MASK, type_vals, "0x%02x")
                );
-       }
+
        wsize = tvb_get_guint8(tvb, 2);
        if (tree) {
                proto_tree_add_uint(xid_tree, hf_llc_xid_wsize, tvb, 2,
                        1, (wsize & 0xFE) >> 1);
        }
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO,
+       col_append_fstr(pinfo->cinfo, COL_INFO,
                    "; Window Size %d", (wsize & 0xFE) >> 1);
-       }
 }
 
 static void
@@ -515,8 +512,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                    hf_llc_oui, hf_llc_type, hf_llc_pid, 2);
        }
        else {
-               if (check_col(pinfo->cinfo, COL_INFO)) {
-                       col_append_fstr(pinfo->cinfo, COL_INFO,
+               col_append_fstr(pinfo->cinfo, COL_INFO,
                            "; DSAP %s %s, SSAP %s %s",
                            val_to_str(dsap & SAP_MASK, sap_vals, "0x%02x"),
                            dsap & DSAP_GI_BIT ?
@@ -525,7 +521,6 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                            ssap & SSAP_CR_BIT ?
                              "Response" : "Command"
                        );
-               }
 
                if (tvb_length_remaining(tvb, llc_header_len) > 0) {
                        next_tvb = tvb_new_subset_remaining(tvb, llc_header_len);
@@ -591,14 +586,11 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
        oui =   tvb_get_ntoh24(tvb, offset);
        etype = tvb_get_ntohs(tvb, offset+3);
 
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO,
+       col_append_fstr(pinfo->cinfo, COL_INFO,
                    "; SNAP, OUI 0x%06X (%s), PID 0x%04X",
                    oui, val_to_str_const(oui, oui_vals, "Unknown"), etype);
-       }
-       if (tree) {
-               proto_tree_add_uint(snap_tree, hf_oui, tvb, offset, 3, oui);
-       }
+
+       proto_tree_add_uint(snap_tree, hf_oui, tvb, offset, 3, oui);
 
        switch (oui) {
 
index e395699a00626d517be412db47f5378b8afa67a8..08e1a6ce002e3832f91ef593ee75526530921162 100644 (file)
@@ -824,8 +824,7 @@ dissect_lldp_chassis_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui
                return -1;
        }
 
-       if (check_col(pinfo->cinfo, COL_INFO))
-               col_add_fstr(pinfo->cinfo, COL_INFO, "Chassis Id = %s ", strPtr);
+       col_add_fstr(pinfo->cinfo, COL_INFO, "Chassis Id = %s ", strPtr);
 
        if (tree)
        {
@@ -950,8 +949,7 @@ dissect_lldp_port_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint3
        }
        }
 
-       if (check_col(pinfo->cinfo, COL_INFO))
-               col_append_fstr(pinfo->cinfo, COL_INFO, "Port Id = %s ", strPtr);
+       col_append_fstr(pinfo->cinfo, COL_INFO, "Port Id = %s ", strPtr);
 
        if (tree)
        {
@@ -1024,8 +1022,7 @@ dissect_lldp_time_to_live(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
        tempLen = TLV_INFO_LEN(tempShort);
        tempShort = tvb_get_ntohs(tvb, (offset+2));
 
-       if (check_col(pinfo->cinfo, COL_INFO))
-               col_append_fstr(pinfo->cinfo, COL_INFO, "TTL = %u ", tempShort);
+       col_append_fstr(pinfo->cinfo, COL_INFO, "TTL = %u ", tempShort);
 
        if (tree)
        {
@@ -1134,8 +1131,7 @@ dissect_lldp_system_name(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
                /* Set system name tree */
                if (tempType == SYSTEM_NAME_TLV_TYPE) {
                        tf = proto_tree_add_text(tree, tvb, offset, (tempLen + 2), "System Name = %s", strPtr);
-                       if (check_col(pinfo->cinfo, COL_INFO))
-                               col_append_fstr(pinfo->cinfo, COL_INFO, "System Name = %s ", strPtr);
+                       col_append_fstr(pinfo->cinfo, COL_INFO, "System Name = %s ", strPtr);
                } else
                        tf = proto_tree_add_text(tree, tvb, offset, (tempLen + 2), "System Description = %s", strPtr);
                system_name_tree = proto_item_add_subtree(tf, ett_system_name);
index 2ec3c09c1c60f20f9656dd0df5b3d698fc97bb30..3a32c7b9ce6ca9b5f72cefa4eba010c5c0a3cd69 100644 (file)
@@ -59,8 +59,8 @@ static void
 dissect_llt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
        /* Set up structures needed to add the protocol subtree and manage it */
-       proto_item *ti=NULL;
-       proto_tree *llt_tree=NULL;
+       proto_item *ti;
+       proto_tree *llt_tree;
        guint8 message_type;
 
        /* Make entries in Protocol column and Info column on summary display */
@@ -68,14 +68,10 @@ dissect_llt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
        message_type = tvb_get_guint8(tvb, 3);
 
-       if(check_col(pinfo->cinfo, COL_INFO)) {
-               col_add_fstr(pinfo->cinfo, COL_INFO, "Message type: %s", val_to_str(message_type, message_type_vs, "Unknown (0x%02x)"));
-       }
+       col_add_fstr(pinfo->cinfo, COL_INFO, "Message type: %s", val_to_str(message_type, message_type_vs, "Unknown (0x%02x)"));
 
-       if (tree) {
-               ti = proto_tree_add_item(tree, proto_llt, tvb, 0, -1, ENC_NA);
-               llt_tree = proto_item_add_subtree(ti, ett_llt);
-       }
+       ti = proto_tree_add_item(tree, proto_llt, tvb, 0, -1, ENC_NA);
+       llt_tree = proto_item_add_subtree(ti, ett_llt);
 
        proto_tree_add_item(llt_tree, hf_llt_cluster_num, tvb, 2, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(llt_tree, hf_llt_message_type, tvb, 3, 1, ENC_BIG_ENDIAN);
index 304ea4d6de0eeaa67026afb598a0fec09798f469..12061aed54bc76cfb35293d13aaf45f0b3f7c166 100644 (file)
@@ -151,10 +151,9 @@ dissect_lmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                proto_tree_add_item(lmi_tree, hf_lmi_call_ref, tvb, 0, 1, ENC_BIG_ENDIAN);
        }
        msg_type = tvb_get_guint8( tvb, 1);
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_add_str(pinfo->cinfo, COL_INFO,
+       col_add_str(pinfo->cinfo, COL_INFO,
                    val_to_str(msg_type, msg_type_str, "Unknown message type (0x%02x)"));
-       }
+
        if (tree) {
                proto_tree_add_uint(lmi_tree, hf_lmi_msg_type, tvb, 1, 1, msg_type);
 
index 000ab922c43972ef382ffcd0c19c25fbaf30490f..76aeab616d395969be746eff1d25fee1f7de8be5 100644 (file)
@@ -206,22 +206,19 @@ dissect_lon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
        proto_tree *ti;
        proto_item *pi;
        proto_tree *lon_tree;
+       gint npdu, type;
 
        col_set_str(pinfo->cinfo, COL_PROTOCOL, "LON");
        col_clear(pinfo->cinfo, COL_INFO);
 
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               gint npdu, type;
-               npdu = tvb_get_guint8(tvb, 0);
-               type = tvb_get_guint8(tvb, 1);
-               type = (type&0x30)>>4;
-               col_add_fstr(pinfo->cinfo, COL_INFO,
+       npdu = tvb_get_guint8(tvb, 0);
+       type = tvb_get_guint8(tvb, 1);
+       type = (type&0x30)>>4;
+       col_add_fstr(pinfo->cinfo, COL_INFO,
                             "%sDelta_BL: %i Type: %s",
                             npdu&0x80?"Priority ":"",
                             npdu&0x3F,
                             val_to_str_const(type, pdu_fmt_vs, "Unknown"));
-       }
-
 
        ti = proto_tree_add_item(tree, proto_lon, tvb, offset, -1, ENC_NA);
        lon_tree = proto_item_add_subtree(ti, ett_lon);
index 6fa0d0431507f09e5523b93032c0c751209944fa..c45b6411a04e270e167d368a90b2ed633fdef5cd 100644 (file)
@@ -78,12 +78,10 @@ dissect_loop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   do {
     function = tvb_get_letohs(tvb, offset);
     if (offset == skip_offset) {
-      if (check_col(pinfo->cinfo, COL_INFO)) {
-        col_add_str(pinfo->cinfo, COL_INFO,
+      col_add_str(pinfo->cinfo, COL_INFO,
                     val_to_str(function, function_vals, "Unknown function (%u)"));
-      }
-      if (tree)
-        proto_tree_add_text(loop_tree, tvb, offset, 2, "Relevant function:");
+
+      proto_tree_add_text(loop_tree, tvb, offset, 2, "Relevant function:");
       set_info = FALSE;
     }
     if (tree)
index d726f9d2b13b64c0383e7e076ce7f2d989f1e705..48f94f511cb0d70b672c06bc63ee90c4d447b1bc 100644 (file)
@@ -88,16 +88,14 @@ dissect_lpd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                lpr_packet_type = unknown;
        }
 
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               if (lpr_packet_type == request && code !=0) {
-                       col_add_str(pinfo->cinfo, COL_INFO, val_to_str(code, lpd_client_code, "Unknown client code: %u"));
-               }
-               else if (lpr_packet_type == response) {
-                       col_set_str(pinfo->cinfo, COL_INFO, "LPD response");
-               }
-               else {
-                       col_set_str(pinfo->cinfo, COL_INFO, "LPD continuation");
-               }
+       if (lpr_packet_type == request && code !=0) {
+               col_add_str(pinfo->cinfo, COL_INFO, val_to_str(code, lpd_client_code, "Unknown client code: %u"));
+       }
+       else if (lpr_packet_type == response) {
+               col_set_str(pinfo->cinfo, COL_INFO, "LPD response");
+       }
+       else {
+               col_set_str(pinfo->cinfo, COL_INFO, "LPD continuation");
        }
 
        if (tree) {
index 485edf72f5af60145719b71ca1235fcba229da14..4b6bf2d8d1f991734a50cf0f6fce48e3d6573c80 100644 (file)
@@ -196,16 +196,14 @@ dissect_lsc_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     }
 
   /* Display the op code in the summary */
-  if (check_col(pinfo->cinfo, COL_INFO)) {
-    col_add_fstr(pinfo->cinfo, COL_INFO, "%s, session %.8u",
+  col_add_fstr(pinfo->cinfo, COL_INFO, "%s, session %.8u",
                  val_to_str(op_code, op_code_vals, "Unknown op code (0x%x)"),
                  stream);
 
-    if (tvb_length(tvb) < expected_len)
-      col_append_str(pinfo->cinfo, COL_INFO, " [Too short]");
-    else if (tvb_length(tvb) > expected_len)
-      col_append_str(pinfo->cinfo, COL_INFO, " [Too long]");
-  }
+  if (tvb_length(tvb) < expected_len)
+    col_append_str(pinfo->cinfo, COL_INFO, " [Too short]");
+  else if (tvb_length(tvb) > expected_len)
+    col_append_str(pinfo->cinfo, COL_INFO, " [Too long]");
 
   if (tree) {
     /* Create display subtree for the protocol */
index de7fd75217ca50f0521ec97952b9e7c5651277dd..06423ae9884f5bd886d225a51df55d02cda1d99e 100644 (file)
@@ -279,10 +279,8 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo,
      */
     header.length = g_ntohs(header.length);
 
-    if (check_col(pinfo->cinfo, COL_INFO)) {
-        col_append_str(pinfo->cinfo, COL_INFO,
-            val_to_str_ext(header.type, &control_msg_vals_ext, "Bad Type: 0x%02x"));
-    }
+    col_append_str(pinfo->cinfo, COL_INFO,
+        val_to_str_ext(header.type, &control_msg_vals_ext, "Bad Type: 0x%02x"));
 
     /* In the interest of speed, if "tree" is NULL, don't do any work not
        necessary to generate protocol tree items. */
@@ -396,14 +394,12 @@ dissect_lwapp(tvbuff_t *tvb, packet_info *pinfo,
     version = (header.flags & 0xc0) >> 6;
     slotId = (header.flags & 0x38) >> 3;
 
-    if (check_col(pinfo->cinfo, COL_INFO)) {
-        if ((header.flags & LWAPP_FLAGS_T) != 0)
-            col_append_str(pinfo->cinfo, COL_INFO,
-                           " Control Packet");
-        else
-            col_append_str(pinfo->cinfo, COL_INFO,
-                           " 802.11 Packet");
-    }
+    if ((header.flags & LWAPP_FLAGS_T) != 0)
+        col_append_str(pinfo->cinfo, COL_INFO,
+                        " Control Packet");
+    else
+        col_append_str(pinfo->cinfo, COL_INFO,
+                        " 802.11 Packet");
 
     /* In the interest of speed, if "tree" is NULL, don't do any work not
        necessary to generate protocol tree items. */
index 532ee766fe08b4a45a206aefa2ee75ee3ef53e8e..600c2e8b8bdcb56de7d74f49d98b032527226847 100644 (file)
@@ -907,26 +907,24 @@ dissect_lwres(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
     message_type = (flags & LWRES_LWPACKETFLAG_RESPONSE) ? 2 : 1;
 
-    if (check_col(pinfo->cinfo, COL_INFO)) {
-            col_clear(pinfo->cinfo, COL_INFO);
+    col_clear(pinfo->cinfo, COL_INFO);
 
-        if(flags & LWRES_LWPACKETFLAG_RESPONSE)
-        {
-                col_add_fstr(pinfo->cinfo, COL_INFO,
-                    "%s, opcode=%s, serial=0x%x, result=%s",
-                        val_to_str_const((guint32)message_type,message_types_values,"unknown"),
-                        val_to_str_const(opcode, opcode_values, "unknown"),
-                        serial,
-                        val_to_str_const(result,result_values,"unknown"));
-            }
-        else
-        {
-                col_add_fstr(pinfo->cinfo, COL_INFO,
-                        "%s, opcode=%s, serial=0x%x",
-                        val_to_str_const((guint32)message_type,message_types_values,"unknown"),
-                        val_to_str_const(opcode, opcode_values, "unknown"),
-                serial);
-        }
+    if(flags & LWRES_LWPACKETFLAG_RESPONSE)
+    {
+        col_add_fstr(pinfo->cinfo, COL_INFO,
+            "%s, opcode=%s, serial=0x%x, result=%s",
+                val_to_str_const((guint32)message_type,message_types_values,"unknown"),
+                val_to_str_const(opcode, opcode_values, "unknown"),
+                serial,
+                val_to_str_const(result,result_values,"unknown"));
+    }
+    else
+    {
+        col_add_fstr(pinfo->cinfo, COL_INFO,
+                "%s, opcode=%s, serial=0x%x",
+                val_to_str_const((guint32)message_type,message_types_values,"unknown"),
+                val_to_str_const(opcode, opcode_values, "unknown"),
+        serial);
     }
 
     if(tree)
index 06bf68523c6bc4d6b0a52ef16f2602a60ac597ed..240abc678070c8098bff1f3dbf36aacefe50e336 100644 (file)
@@ -160,8 +160,7 @@ dissect_v2_header(tvbuff_t *header_tvb, packet_info *pinfo, proto_tree *m2pa_tre
 
   message_type  = tvb_get_ntohs(header_tvb, V2_TYPE_OFFSET);
 
-  if (check_col(pinfo->cinfo, COL_INFO))
-    col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_type, v2_message_type_values, "reserved"));
+  col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_type, v2_message_type_values, "reserved"));
 
   if (m2pa_tree) {
     proto_tree_add_item(m2pa_tree, hf_version, header_tvb, VERSION_OFFSET,       VERSION_LENGTH, ENC_BIG_ENDIAN);
@@ -178,8 +177,7 @@ dissect_v8_header(tvbuff_t *header_tvb, packet_info *pinfo, proto_tree *m2pa_tre
 
   message_type  = tvb_get_guint8(header_tvb, V8_TYPE_OFFSET);
 
-  if (check_col(pinfo->cinfo, COL_INFO))
-    col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_type, v8_message_type_values, "Unknown"));
+  col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_type, v8_message_type_values, "Unknown"));
 
   if (m2pa_tree) {
     proto_tree_add_item(m2pa_tree, hf_version, header_tvb, VERSION_OFFSET,       VERSION_LENGTH, ENC_BIG_ENDIAN);
@@ -201,8 +199,7 @@ dissect_header(tvbuff_t *header_tvb, packet_info *pinfo, proto_tree *m2pa_tree)
 
   message_type  = tvb_get_guint8(header_tvb, V8_TYPE_OFFSET);
 
-  if (check_col(pinfo->cinfo, COL_INFO))
-    col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_type, v8_message_type_values, "Unknown"));
+  col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_type, v8_message_type_values, "Unknown"));
 
   if (m2pa_tree) {
     proto_tree_add_item(m2pa_tree, hf_version,  header_tvb, VERSION_OFFSET,       VERSION_LENGTH,  ENC_BIG_ENDIAN);
@@ -318,10 +315,8 @@ static const value_string v2_link_status_values[] = {
 static void
 dissect_v2_link_status_message(tvbuff_t *message_data_tvb, packet_info *pinfo, proto_tree *m2pa_tree)
 {
-  if (check_col(pinfo->cinfo, COL_INFO))
-    col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str_const(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), v2_link_status_values, "Unknown"));
-  if (m2pa_tree)
-    proto_tree_add_item(m2pa_tree, hf_v2_status, message_data_tvb, STATUS_OFFSET, STATUS_LENGTH, ENC_BIG_ENDIAN);
+  col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str_const(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), v2_link_status_values, "Unknown"));
+  proto_tree_add_item(m2pa_tree, hf_v2_status, message_data_tvb, STATUS_OFFSET, STATUS_LENGTH, ENC_BIG_ENDIAN);
 }
 
 static const value_string v8_link_status_values[] = {
@@ -341,8 +336,7 @@ dissect_v8_link_status_message(tvbuff_t *message_data_tvb, packet_info *pinfo, p
 {
   guint16 filler_length;
 
-  if (check_col(pinfo->cinfo, COL_INFO))
-    col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str_const(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), v8_link_status_values, "Unknown"));
+  col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str_const(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), v8_link_status_values, "Unknown"));
 
   filler_length = tvb_length(message_data_tvb) - STATUS_LENGTH;
 
@@ -368,8 +362,7 @@ dissect_link_status_message(tvbuff_t *message_data_tvb, packet_info *pinfo, prot
 {
   guint16 filler_length;
 
-  if (check_col(pinfo->cinfo, COL_INFO))
-    col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str_const(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), link_status_values, "Unknown"));
+  col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str_const(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), link_status_values, "Unknown"));
 
   filler_length = tvb_length(message_data_tvb) - STATUS_LENGTH;
 
@@ -518,26 +511,20 @@ dissect_m2pa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   proto_item *m2pa_item;
   proto_tree *m2pa_tree;
 
-  if (check_col(pinfo->cinfo, COL_PROTOCOL))
-    switch(m2pa_version) {
-    case M2PA_V02:
-      col_set_str(pinfo->cinfo, COL_PROTOCOL, "M2PA (ID 02)");
-      break;
-    case M2PA_V08:
-      col_set_str(pinfo->cinfo, COL_PROTOCOL, "M2PA (ID 08)");
-      break;
-    case M2PA_RFC4165:
-      col_set_str(pinfo->cinfo, COL_PROTOCOL, "M2PA");
-      break;
-    };
+  switch(m2pa_version) {
+  case M2PA_V02:
+    col_set_str(pinfo->cinfo, COL_PROTOCOL, "M2PA (ID 02)");
+    break;
+  case M2PA_V08:
+    col_set_str(pinfo->cinfo, COL_PROTOCOL, "M2PA (ID 08)");
+    break;
+  case M2PA_RFC4165:
+    col_set_str(pinfo->cinfo, COL_PROTOCOL, "M2PA");
+    break;
+  };
 
-  if (tree) {
-    m2pa_item = proto_tree_add_item(tree, proto_m2pa, tvb, 0, -1, ENC_NA);
-    m2pa_tree = proto_item_add_subtree(m2pa_item, ett_m2pa);
-  } else {
-    m2pa_item = NULL;
-    m2pa_tree = NULL;
-  }
+  m2pa_item = proto_tree_add_item(tree, proto_m2pa, tvb, 0, -1, ENC_NA);
+  m2pa_tree = proto_item_add_subtree(m2pa_item, ett_m2pa);
 
   switch(m2pa_version) {
     case M2PA_V02:
index 14339b0a3f47bd3902a2ff000dcac18a78ef85cf..e82884dab8c393cb76529ca9bfe24741095174c3 100644 (file)
@@ -269,8 +269,7 @@ dissect_m2tp_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, prot
   message_type   = tvb_get_guint8(common_header_tvb, MESSAGE_TYPE_OFFSET);
   message_length = tvb_get_ntohl (common_header_tvb, MESSAGE_LENGTH_OFFSET);
 
-  if (check_col(pinfo->cinfo, COL_INFO))
-    col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_class * 256 + message_type, m2tp_message_class_type_acro_values, "reserved"));
+  col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_class * 256 + message_type, m2tp_message_class_type_acro_values, "reserved"));
 
   if (m2tp_tree) {
     /* add the components of the common header to the protocol tree */
index 5490f2a39e7b706101da0922faf0436fd46de6a2..a25d1b1d15e8d64661ce4b8a29f30db9b0b2684b 100644 (file)
@@ -240,8 +240,7 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
   message_class  = tvb_get_guint8(common_header_tvb, MESSAGE_CLASS_OFFSET);
   message_type   = tvb_get_guint8(common_header_tvb, MESSAGE_TYPE_OFFSET);
 
-  if (check_col(pinfo->cinfo, COL_INFO))
-    col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_class * 256 + message_type, message_class_type_acro_values, "reserved"));
+  col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_class * 256 + message_type, message_class_type_acro_values, "reserved"));
 
   if (m2ua_tree) {
     /* add the components of the common header to the protocol tree */
index db852997cfe86393aa6c3e6c73208b76975879d6..6f7278882555550d0b5959975f8f193a6562907c 100644 (file)
@@ -338,8 +338,7 @@ dissect_v5_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_
   message_class  = tvb_get_guint8(common_header_tvb, MESSAGE_CLASS_OFFSET);
   message_type   = tvb_get_guint8(common_header_tvb, MESSAGE_TYPE_OFFSET);
 
-  if (check_col(pinfo->cinfo, COL_INFO))
-    col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_class * 256 + message_type, v5_message_class_type_acro_values, "reserved"));
+  col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_class * 256 + message_type, v5_message_class_type_acro_values, "reserved"));
 
   if (m3ua_tree) {
     /* add the components of the common header to the protocol tree */
@@ -361,8 +360,7 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
   message_class  = tvb_get_guint8(common_header_tvb, MESSAGE_CLASS_OFFSET);
   message_type   = tvb_get_guint8(common_header_tvb, MESSAGE_TYPE_OFFSET);
 
-  if (check_col(pinfo->cinfo, COL_INFO))
-    col_add_fstr(pinfo->cinfo, COL_INFO,"%s ", val_to_str_const(message_class * 256 + message_type, message_class_type_acro_values, "reserved"));
+  col_add_fstr(pinfo->cinfo, COL_INFO,"%s ", val_to_str_const(message_class * 256 + message_type, message_class_type_acro_values, "reserved"));
 
   if (m3ua_tree) {
     /* add the components of the common header to the protocol tree */
@@ -2008,8 +2006,7 @@ dissect_m3ua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
 
 
   /* make entry in the Protocol column on summary display */
-  if (check_col(pinfo->cinfo, COL_PROTOCOL))
-    switch(version) {
+  switch(version) {
       case M3UA_V5:
         col_set_str(pinfo->cinfo, COL_PROTOCOL, "M3UA (ID 05)");
         break;
@@ -2022,21 +2019,14 @@ dissect_m3ua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
       case M3UA_RFC:
         col_set_str(pinfo->cinfo, COL_PROTOCOL, "M3UA (RFC 4666)");
         break;
-      };
-
-  /* In the interest of speed, if "tree" is NULL, don't do any work not
-     necessary to generate protocol tree items. */
-  if (tree) {
-    /* create the m3ua protocol tree */
-    m3ua_item = proto_tree_add_item(tree, proto_m3ua, message_tvb, 0, -1, ENC_NA);
-    m3ua_tree = proto_item_add_subtree(m3ua_item, ett_m3ua);
-  } else {
-    m3ua_tree = NULL;
   };
 
+  /* create the m3ua protocol tree */
+  m3ua_item = proto_tree_add_item(tree, proto_m3ua, message_tvb, 0, -1, ENC_NA);
+  m3ua_tree = proto_item_add_subtree(m3ua_item, ett_m3ua);
+
   /* dissect the message */
   dissect_message(message_tvb, pinfo, tree, m3ua_tree);
-
 }
 
 /* Register the protocol with Wireshark */
index b0613f1dc147b610b7ae33a3b6e06037007d06de..1ea09b61666301433c872f4c23513847492ccb21 100644 (file)
@@ -147,14 +147,12 @@ dissect_mactelnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
     /* Make entries in Protocol column and Info column on summary display */
     col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_MACTELNET);
 
-    if (check_col(pinfo->cinfo, COL_INFO)) {
-            col_add_fstr(pinfo->cinfo, COL_INFO, "%s > %s Direction: %s Type: %s",
-                         tvb_ether_to_str(tvb, 2),
-                         tvb_ether_to_str(tvb, 8),
-                         ((foundclient >= 0) || (type == 4) ? "Client->Server" : "Server->Client" ),
-                         val_to_str(type, packettypenames, "Unknown Type:0x%02x")
-                );
-        }
+    col_add_fstr(pinfo->cinfo, COL_INFO, "%s > %s Direction: %s Type: %s",
+                    tvb_ether_to_str(tvb, 2),
+                    tvb_ether_to_str(tvb, 8),
+                    ((foundclient >= 0) || (type == 4) ? "Client->Server" : "Server->Client" ),
+                    val_to_str(type, packettypenames, "Unknown Type:0x%02x")
+        );
 
     if (tree) {
         guint32 offset = 0;
index d5b04cacd5c3376210173d5dac8da6aab8413f12..8948e678c5907d81ef1daa6ee5387a6446386b20 100644 (file)
@@ -393,52 +393,49 @@ dissect_mbtcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     /* "Request" or "Response" */
     packet_type = classify_mbtcp_packet(pinfo);
 
-    if (check_col(pinfo->cinfo, COL_INFO))
-    {
-        switch ( packet_type ) {
-            case QUERY_PACKET :
-                pkt_type_str="Query";
-                break;
-            case RESPONSE_PACKET :
-                pkt_type_str="Response";
-                break;
-            case CANNOT_CLASSIFY :
-                err_str="Unable to classify as query or response.";
-                pkt_type_str="unknown";
-                break;
-            default :
-                break;
+    switch ( packet_type ) {
+        case QUERY_PACKET :
+            pkt_type_str="Query";
+            break;
+        case RESPONSE_PACKET :
+            pkt_type_str="Response";
+            break;
+        case CANNOT_CLASSIFY :
+            err_str="Unable to classify as query or response.";
+            pkt_type_str="unknown";
+            break;
+        default :
+            break;
+    }
+    if ( exception_code != 0 )
+        err_str="Exception returned ";
+
+    if (subfunction_code == 0) {
+        if (strlen(err_str) > 0) {
+            col_add_fstr(pinfo->cinfo, COL_INFO,
+                    "%8s: Trans: %5u; Unit: %3u, Func: %3u: %s. %s",
+                    pkt_type_str, transaction_id, unit_id,
+                    function_code, func_string, err_str);
         }
-        if ( exception_code != 0 )
-            err_str="Exception returned ";
-
-        if (subfunction_code == 0) {
-            if (strlen(err_str) > 0) {
-                col_add_fstr(pinfo->cinfo, COL_INFO,
-                      "%8s: Trans: %5u; Unit: %3u, Func: %3u: %s. %s",
-                      pkt_type_str, transaction_id, unit_id,
-                      function_code, func_string, err_str);
-            }
-            else {
-                col_add_fstr(pinfo->cinfo, COL_INFO,
-                      "%8s: Trans: %5u; Unit: %3u, Func: %3u: %s",
-                      pkt_type_str, transaction_id, unit_id,
-                      function_code, func_string);
-            }
+        else {
+            col_add_fstr(pinfo->cinfo, COL_INFO,
+                    "%8s: Trans: %5u; Unit: %3u, Func: %3u: %s",
+                    pkt_type_str, transaction_id, unit_id,
+                    function_code, func_string);
+        }
+    }
+    else {
+        if (strlen(err_str) > 0) {
+            col_add_fstr(pinfo->cinfo, COL_INFO,
+                    "%8s: Trans: %5u; Unit: %3u, Func: %3u/%3u: %s. %s",
+                    pkt_type_str, transaction_id, unit_id,
+                    function_code, subfunction_code, func_string, err_str);
         }
         else {
-            if (strlen(err_str) > 0) {
-                col_add_fstr(pinfo->cinfo, COL_INFO,
-                      "%8s: Trans: %5u; Unit: %3u, Func: %3u/%3u: %s. %s",
-                      pkt_type_str, transaction_id, unit_id,
-                      function_code, subfunction_code, func_string, err_str);
-            }
-            else {
-                col_add_fstr(pinfo->cinfo, COL_INFO,
-                      "%8s: Trans: %5u; Unit: %3u, Func: %3u/%3u: %s",
-                      pkt_type_str, transaction_id, unit_id,
-                      function_code, subfunction_code, func_string);
-            }
+            col_add_fstr(pinfo->cinfo, COL_INFO,
+                    "%8s: Trans: %5u; Unit: %3u, Func: %3u/%3u: %s",
+                    pkt_type_str, transaction_id, unit_id,
+                    function_code, subfunction_code, func_string);
         }
     }
 
@@ -528,52 +525,49 @@ dissect_mbrtu_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     /* "Request" or "Response" */
     packet_type = classify_mbrtu_packet(pinfo);
 
-    if (check_col(pinfo->cinfo, COL_INFO))
-    {
-        switch ( packet_type ) {
-            case QUERY_PACKET :
-                pkt_type_str="Query";
-                break;
-            case RESPONSE_PACKET :
-                pkt_type_str="Response";
-                break;
-            case CANNOT_CLASSIFY :
-                err_str="Unable to classify as query or response.";
-                pkt_type_str="unknown";
-                break;
-            default :
-                break;
+    switch ( packet_type ) {
+        case QUERY_PACKET :
+            pkt_type_str="Query";
+            break;
+        case RESPONSE_PACKET :
+            pkt_type_str="Response";
+            break;
+        case CANNOT_CLASSIFY :
+            err_str="Unable to classify as query or response.";
+            pkt_type_str="unknown";
+            break;
+        default :
+            break;
+    }
+    if ( exception_code != 0 )
+        err_str="Exception returned ";
+
+    if (subfunction_code == 0) {
+        if (strlen(err_str) > 0) {
+            col_add_fstr(pinfo->cinfo, COL_INFO,
+                    "%8s: Unit: %3u, Func: %3u: %s. %s",
+                    pkt_type_str, unit_id,
+                    function_code, func_string, err_str);
         }
-        if ( exception_code != 0 )
-            err_str="Exception returned ";
-
-        if (subfunction_code == 0) {
-            if (strlen(err_str) > 0) {
-                col_add_fstr(pinfo->cinfo, COL_INFO,
-                      "%8s: Unit: %3u, Func: %3u: %s. %s",
-                      pkt_type_str, unit_id,
-                      function_code, func_string, err_str);
-            }
-            else {
-                col_add_fstr(pinfo->cinfo, COL_INFO,
-                      "%8s: Unit: %3u, Func: %3u: %s",
-                      pkt_type_str, unit_id,
-                      function_code, func_string);
-            }
+        else {
+            col_add_fstr(pinfo->cinfo, COL_INFO,
+                    "%8s: Unit: %3u, Func: %3u: %s",
+                    pkt_type_str, unit_id,
+                    function_code, func_string);
+        }
+    }
+    else {
+        if (strlen(err_str) > 0) {
+            col_add_fstr(pinfo->cinfo, COL_INFO,
+                    "%8s: Unit: %3u, Func: %3u/%3u: %s. %s",
+                    pkt_type_str, unit_id,
+                    function_code, subfunction_code, func_string, err_str);
         }
         else {
-            if (strlen(err_str) > 0) {
-                col_add_fstr(pinfo->cinfo, COL_INFO,
-                      "%8s: Unit: %3u, Func: %3u/%3u: %s. %s",
-                      pkt_type_str, unit_id,
-                      function_code, subfunction_code, func_string, err_str);
-            }
-            else {
-                col_add_fstr(pinfo->cinfo, COL_INFO,
-                      "%8s: Unit: %3u, Func: %3u/%3u: %s",
-                      pkt_type_str, unit_id,
-                      function_code, subfunction_code, func_string);
-            }
+            col_add_fstr(pinfo->cinfo, COL_INFO,
+                    "%8s: Unit: %3u, Func: %3u/%3u: %s",
+                    pkt_type_str, unit_id,
+                    function_code, subfunction_code, func_string);
         }
     }
 
index dd118a357822635c16184a7ee33ecfec79625ffc..a4c80310d43f57d9b8c7854152f6505bedb41778 100644 (file)
@@ -52,9 +52,7 @@ dissect_media(tvbuff_t *tvb, packet_info *pinfo , proto_tree *tree)
     }
 
     /* Add media type to the INFO column if it is visible */
-    if (check_col(pinfo->cinfo, COL_INFO)) {
-        col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", (pinfo->match_string) ? pinfo->match_string : "");
-    }
+    col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", (pinfo->match_string) ? pinfo->match_string : "");
 
     if (tree) {
         if ( (bytes = tvb_length(tvb)) > 0 )
index f4efa1a30b21812daa2559cf3fad7c87b1dfee32..423d50aa69dfebcde777c966a63fc3058befa7de 100644 (file)
@@ -580,8 +580,7 @@ dissect_megaco_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
             if (!first) {
               col_append_str(pinfo->cinfo, COL_INFO, " ");
             }
-            if (check_col(pinfo->cinfo, COL_INFO) )
-                col_append_fstr(pinfo->cinfo, COL_INFO, "%s TransactionResponseAck",
+            col_append_fstr(pinfo->cinfo, COL_INFO, "%s TransactionResponseAck",
                 tvb_format_text(tvb,tvb_previous_offset,len));
 
             if(tree)
@@ -614,8 +613,7 @@ dissect_megaco_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
             if (!first) {
               col_append_str(pinfo->cinfo, COL_INFO, " ");
             }
-            if (check_col(pinfo->cinfo, COL_INFO) )
-                col_append_fstr(pinfo->cinfo, COL_INFO, "%s Pending",
+            col_append_fstr(pinfo->cinfo, COL_INFO, "%s Pending",
                 tvb_format_text(tvb,tvb_offset,len));
 
             if(tree)
@@ -642,8 +640,7 @@ dissect_megaco_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
             tvb_current_offset  = megaco_tvb_skip_wsp_return(tvb, tvb_LBRKT-1);
             len = tvb_current_offset - tvb_offset;
 
-            if (check_col(pinfo->cinfo, COL_INFO) )
-                col_add_fstr(pinfo->cinfo, COL_INFO, "%s Reply  ",
+            col_add_fstr(pinfo->cinfo, COL_INFO, "%s Reply  ",
                   tvb_format_text(tvb,tvb_offset,len));
             trx_id = (guint)strtoul(tvb_format_text(tvb,tvb_offset,len),NULL,10);
 
@@ -679,8 +676,7 @@ dissect_megaco_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
             if (!first) {
               col_append_str(pinfo->cinfo, COL_INFO, " ");
             }
-            if (check_col(pinfo->cinfo, COL_INFO) )
-                col_append_fstr(pinfo->cinfo, COL_INFO, "%s Request",
+            col_append_fstr(pinfo->cinfo, COL_INFO, "%s Request",
                   tvb_format_text(tvb,tvb_offset,len));
             trx_id = (guint)strtoul(tvb_format_text(tvb,tvb_offset,len),NULL,10);
             if(tree)
@@ -768,8 +764,7 @@ nextcontext:
                 tokenlen));
             ctx_id = (guint)strtoul(tvb_format_text(tvb, tvb_previous_offset, tokenlen),NULL,10);
 
-            if (check_col(pinfo->cinfo, COL_INFO) )
-                col_append_fstr(pinfo->cinfo, COL_INFO, " |=%s",tvb_format_text(tvb, tvb_previous_offset,tokenlen));
+            col_append_fstr(pinfo->cinfo, COL_INFO, " |=%s",tvb_format_text(tvb, tvb_previous_offset,tokenlen));
         }
 
         ctx = gcp_ctx(msg,trx,ctx_id,keep_persistent_data);
@@ -1218,8 +1213,7 @@ nextcontext:
                             tvb_command_start_offset, tokenlen,
                             tvb_format_text(tvb, tvb_command_start_offset,
                             tokenlen));
-                            if (check_col(pinfo->cinfo, COL_INFO) )
-                                col_append_fstr(pinfo->cinfo, COL_INFO, " %s",command);
+                            col_append_fstr(pinfo->cinfo, COL_INFO, " %s",command);
                     }
 
                     if (cmd_type == GCP_CMD_NONE && trx_type == GCP_TRX_REPLY) {
@@ -1312,8 +1306,7 @@ nextcontext:
 
                         gcp_cmd_add_term(msg, trx, cmd, term, wild_term, keep_persistent_data);
 
-                            if (check_col(pinfo->cinfo, COL_INFO) )
-                                col_append_fstr(pinfo->cinfo, COL_INFO, "=%s",tvb_format_text(tvb, tvb_offset,tokenlen));
+                        col_append_fstr(pinfo->cinfo, COL_INFO, "=%s",tvb_format_text(tvb, tvb_offset,tokenlen));
                         break;
                     }
 
@@ -2101,8 +2094,7 @@ dissect_megaco_signaldescriptor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *m
 
     tvb_current_offset = tvb_LBRKT;
     tvb_next_offset = megaco_tvb_skip_wsp(tvb, tvb_current_offset+1);
-    if (check_col(pinfo->cinfo, COL_INFO) )
-        col_append_fstr(pinfo->cinfo, COL_INFO, " (Signal:%s)",tvb_format_text(tvb, tvb_current_offset,tokenlen-tvb_current_offset+tvb_previous_offset));
+    col_append_fstr(pinfo->cinfo, COL_INFO, " (Signal:%s)",tvb_format_text(tvb, tvb_current_offset,tokenlen-tvb_current_offset+tvb_previous_offset));
 
 
     if ( tvb_current_offset < tvb_signals_end_offset && tvb_current_offset != -1 && tvb_next_offset != tvb_signals_end_offset){
@@ -3146,8 +3138,7 @@ dissect_megaco_LocalControldescriptor(tvbuff_t *tvb, proto_tree *megaco_mediades
                 tvb_current_offset, tokenlen,
                 tvb_format_text(tvb, tvb_current_offset,
                 tokenlen));
-            if (check_col(pinfo->cinfo, COL_INFO) )
-                col_append_fstr(pinfo->cinfo, COL_INFO, " (Mode:%s)",tvb_format_text(tvb, tvb_current_offset,tokenlen));
+            col_append_fstr(pinfo->cinfo, COL_INFO, " (Mode:%s)",tvb_format_text(tvb, tvb_current_offset,tokenlen));
             tvb_current_offset = megaco_tvb_skip_wsp(tvb, tvb_offset +1);
             break;
 
index ed54705349a8e279188d56c4a3bc56cd6c19325d..4e4b4bb491c4ab9707300ed2be2f6ed166a0cf37 100644 (file)
@@ -1419,8 +1419,7 @@ dissect_mikey(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
 
        col_append_str(pinfo->cinfo, COL_PROTOCOL, "/MIKEY");
 
-       if (check_col(pinfo->cinfo, COL_INFO))
-               col_append_fstr(pinfo->cinfo, COL_INFO, ", Mikey: %s",
+       col_append_fstr(pinfo->cinfo, COL_INFO, ", Mikey: %s",
                                val_to_str_ext_const(mikey->type, &data_type_vals_ext, "Unknown"));
 
        /* Return the amount of data this dissector was able to dissect */
index aacebaf1fa63ac904c64cc783f4140a6f2328aa4..af0dc3a7d42b84ec43432e33dfd067cfef97b343 100644 (file)
@@ -666,10 +666,8 @@ dissect_mmse_standalone(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, "MMSE");
 
-    if (check_col(pinfo->cinfo, COL_INFO)) {
        col_clear(pinfo->cinfo, COL_INFO);
        col_add_fstr(pinfo->cinfo, COL_INFO, "MMS %s", message_type);
-    }
 
     dissect_mmse(tvb, pinfo, tree, pdut, message_type);
 }
@@ -687,10 +685,8 @@ dissect_mmse_encapsulated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     message_type = val_to_str(pdut, vals_message_type, "Unknown type %u");
 
     /* Make entries in Info column on summary display */
-    if (check_col(pinfo->cinfo, COL_INFO)) {
        col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "(MMS %s)",
                message_type);
-    }
 
     dissect_mmse(tvb, pinfo, tree, pdut, message_type);
 }
index fa2391646261b8288e096760f0c50a2f0428d567..5a02d56e2fea3ef4f5ffe96797435bc727a4665e 100644 (file)
@@ -142,12 +142,10 @@ dissect_fhstatus(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree
                break;
                default:
                        /* void */
-                       if (check_col(pinfo->cinfo, COL_INFO)) {
-                               col_append_fstr(
+                       col_append_fstr(
                                        pinfo->cinfo, COL_INFO, " Error:%s",
                                        val_to_str(status, mount3_mountstat3,
                                            "Unknown (0x%08X)"));
-                       }
                break;
        }
 
@@ -189,10 +187,7 @@ dissect_mount_dirpath_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        }
 
        offset = dissect_rpc_string(tvb,tree,hf_mount_path,offset,&mountpoint);
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO," %s", mountpoint);
-       }
-
+       col_append_fstr(pinfo->cinfo, COL_INFO," %s", mountpoint);
 
        return offset;
 }
@@ -530,12 +525,10 @@ dissect_mountstat3(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, int offs
 
        mountstat3 = tvb_get_ntohl(tvb, offset);
        if(mountstat3){
-               if (check_col(pinfo->cinfo, COL_INFO)) {
-                       col_append_fstr(
+               col_append_fstr(
                                pinfo->cinfo, COL_INFO, " Error:%s",
                                val_to_str(mountstat3, mount3_mountstat3,
                                    "Unknown (0x%08X)"));
-               }
        }
 
        offset = dissect_rpc_uint32(tvb,tree,hfindex,offset);
index 85ec2bf8b97faab04ee3e39f6bdbcbb863892697..8a2bf5e5e362f04e7ca80fb0cc5b9c52a5b8cad0 100644 (file)
@@ -1705,9 +1705,8 @@ dissect_mpls_echo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
         return 0;
     }
 
-    if (check_col(pinfo->cinfo, COL_INFO))
-        col_add_str(pinfo->cinfo, COL_INFO,
-                    val_to_str(msgtype, mpls_echo_msgtype, "Unknown Message Type (0x%02X)"));
+    col_add_str(pinfo->cinfo, COL_INFO,
+                val_to_str(msgtype, mpls_echo_msgtype, "Unknown Message Type (0x%02X)"));
 
 
     if (tree) {
index f4d356dfee81e271d0e95868d3ccfb4e9fa28ea9..2d26544b3c569f76949c0e11bc2c2901c61d1892 100644 (file)
@@ -114,14 +114,12 @@ dissect_mpls_y1711(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
                                       0x00, 0x00, 0x00, 0x00, 0x00 };
 
     functype = tvb_get_guint8(tvb, offset);
-    if (check_col(pinfo->cinfo, COL_INFO)) {
-        col_append_fstr(pinfo->cinfo, COL_INFO, " (Y.1711: %s)",
-                        (functype == 0x01) ? "CV" :
-                        (functype == 0x02) ? "FDI" :
-                        (functype == 0x03) ? "BDI" :
-                        (functype == 0x07) ? "FDD" :
-                        "reserved/unknown");
-    }
+    col_append_fstr(pinfo->cinfo, COL_INFO, " (Y.1711: %s)",
+                    (functype == 0x01) ? "CV" :
+                    (functype == 0x02) ? "FDI" :
+                    (functype == 0x03) ? "BDI" :
+                    (functype == 0x07) ? "FDD" :
+                    "reserved/unknown");
 
     /* sanity checks */
     if (tvb_reported_length(tvb) < 44) {
index 425bc0cfa6db43b78fc38c7c10b8309ff8617826..147999a8dfa1d5156af095f51ee61025975a2ea5 100644 (file)
@@ -221,10 +221,7 @@ dissect_mqpcf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                gint iSizeMQCFH = 36;
                guint32 iCommand = tvb_get_guint32_endian(tvb, offset + 12, bLittleEndian);
 
-               if (check_col(pinfo->cinfo, COL_INFO))
-               {
-                       col_append_str(pinfo->cinfo, COL_INFO, val_to_str(iCommand, mqpcf_opcode_vals, "Unknown (0x%02x)"));
-               }
+               col_append_str(pinfo->cinfo, COL_INFO, val_to_str(iCommand, mqpcf_opcode_vals, "Unknown (0x%02x)"));
 
                if (tree)
                {
index 4ae68cc73189457fe28f5ce606c96c144d5480e0..2067312f39a689997a88a5c2a4e3c6b2843e4a90 100644 (file)
@@ -1129,14 +1129,11 @@ dissect_mq_gmo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint int_rep
 
             if (iSizeGMO != 0 && tvb_length_remaining(tvb, offset) >= iSizeGMO)
             {
-                if (check_col(pinfo->cinfo, COL_INFO))
+                guint8* sQueue;
+                sQueue = tvb_get_ephemeral_string_enc(tvb, offset + 24, 48, string_rep);
+                if (strip_trailing_blanks(sQueue, 48) != 0)
                 {
-                    guint8* sQueue;
-                    sQueue = tvb_get_ephemeral_string_enc(tvb, offset + 24, 48, string_rep);
-                    if (strip_trailing_blanks(sQueue, 48) != 0)
-                    {
-                        col_append_fstr(pinfo->cinfo, COL_INFO, " Q=%s", sQueue);
-                    }
+                    col_append_fstr(pinfo->cinfo, COL_INFO, " Q=%s", sQueue);
                 }
 
                 if (tree)
@@ -1199,20 +1196,17 @@ dissect_mq_pmo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint int_rep
             {
                 gint iNbrRecords = 0;
                 guint32 iRecFlags = 0;
+                guint8* sQueue;
                 if (iVersionPMO >= 2)
                 {
                     iNbrRecords = tvb_get_guint32_endian(tvb, offset + 128, int_rep);
                     iRecFlags = tvb_get_guint32_endian(tvb, offset + 132, int_rep);
                 }
 
-                if (check_col(pinfo->cinfo, COL_INFO))
+                sQueue = tvb_get_ephemeral_string_enc(tvb, offset + 32, 48, string_rep);
+                if (strip_trailing_blanks(sQueue, 48) != 0)
                 {
-                    guint8* sQueue;
-                    sQueue = tvb_get_ephemeral_string_enc(tvb, offset + 32, 48, string_rep);
-                    if (strip_trailing_blanks(sQueue, 48) != 0)
-                    {
-                        col_append_fstr(pinfo->cinfo, COL_INFO, " Q=%s", sQueue);
-                    }
+                    col_append_fstr(pinfo->cinfo, COL_INFO, " Q=%s", sQueue);
                 }
 
                 if (tree)
@@ -1345,12 +1339,9 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
             int_rep = (tvb_get_guint8(tvb, offset + iSizeMultiplexFields + 8) == MQ_LITTLE_ENDIAN ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN);
             iControlFlags = tvb_get_guint8(tvb, offset + iSizeMultiplexFields + 10);
 
-            if (check_col(pinfo->cinfo, COL_INFO))
-            {
-                col_clear(pinfo->cinfo, COL_INFO);
-                col_append_sep_str(pinfo->cinfo, COL_INFO, " | ", val_to_str_ext(opcode, &mq_opcode_vals_ext, "Unknown (0x%02x)"));
-                col_set_fence(pinfo->cinfo, COL_INFO);
-            }
+            col_clear(pinfo->cinfo, COL_INFO);
+            col_append_sep_str(pinfo->cinfo, COL_INFO, " | ", val_to_str_ext(opcode, &mq_opcode_vals_ext, "Unknown (0x%02x)"));
+            col_set_fence(pinfo->cinfo, COL_INFO);
 
             if (tree)
             {
@@ -1412,11 +1403,8 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                     {
                         guint32 iReturnCode = 0;
                         iReturnCode = tvb_get_guint32_endian(tvb, offset + 8, int_rep);
-                        if (check_col(pinfo->cinfo, COL_INFO))
-                        {
-                            if (iReturnCode != 0)
-                                col_append_fstr(pinfo->cinfo, COL_INFO, " [RC=%d]", iReturnCode);
-                        }
+                        if (iReturnCode != 0)
+                            col_append_fstr(pinfo->cinfo, COL_INFO, " [RC=%d]", iReturnCode);
 
                         if (tree)
                         {
@@ -1459,11 +1447,9 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
                         if (tvb_length_remaining(tvb, offset) >= iStatusLength)
                         {
-                            if (check_col(pinfo->cinfo, COL_INFO))
-                            {
-                                if (iStatus != 0)
-                                    col_append_fstr(pinfo->cinfo, COL_INFO, ": Code=%s", val_to_str(iStatus, mq_status_vals, "Unknown (0x%08x)"));
-                            }
+                            if (iStatus != 0)
+                                col_append_fstr(pinfo->cinfo, COL_INFO, ": Code=%s", val_to_str(iStatus, mq_status_vals, "Unknown (0x%08x)"));
+
                             if (tree)
                             {
                                 ti = proto_tree_add_text(mqroot_tree, tvb, offset, 8, MQ_TEXT_STAT);
@@ -1514,22 +1500,18 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
                         if (iSizeCONN != 0 && tvb_length_remaining(tvb, offset) >= iSizeCONN)
                         {
-                            if (check_col(pinfo->cinfo, COL_INFO))
+                            guint8* sApplicationName;
+                            guint8* sQueueManager;
+                            sApplicationName = tvb_get_ephemeral_string_enc(tvb, offset + 48, 28, string_rep);
+                            if (strip_trailing_blanks(sApplicationName, 28) != 0)
                             {
-                                guint8* sApplicationName;
-                                guint8* sQueueManager;
-                                sApplicationName = tvb_get_ephemeral_string_enc(tvb, offset + 48, 28, string_rep);
-                                if (strip_trailing_blanks(sApplicationName, 28) != 0)
-                                {
-                                    col_append_fstr(pinfo->cinfo, COL_INFO, ": App=%s", sApplicationName);
-                                }
-                                sQueueManager = tvb_get_ephemeral_string_enc(tvb, offset, 48, string_rep);
-                                if (strip_trailing_blanks(sQueueManager, 48) != 0)
-                                {
-                                    col_append_fstr(pinfo->cinfo, COL_INFO, " QM=%s", sQueueManager);
-                                }
+                                col_append_fstr(pinfo->cinfo, COL_INFO, ": App=%s", sApplicationName);
+                            }
+                            sQueueManager = tvb_get_ephemeral_string_enc(tvb, offset, 48, string_rep);
+                            if (strip_trailing_blanks(sQueueManager, 48) != 0)
+                            {
+                                col_append_fstr(pinfo->cinfo, COL_INFO, " QM=%s", sQueueManager);
                             }
-
 
                             if (tree)
                             {
@@ -1616,10 +1598,7 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                         guint32 iSpiVerb = 0;
 
                         iSpiVerb = tvb_get_guint32_endian(tvb, offset, int_rep);
-                        if (check_col(pinfo->cinfo, COL_INFO))
-                        {
-                            col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", val_to_str(iSpiVerb, mq_spi_verbs_vals, "Unknown (0x%08x)"));
-                        }
+                        col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", val_to_str(iSpiVerb, mq_spi_verbs_vals, "Unknown (0x%08x)"));
 
                         if (tree)
                         {
@@ -1865,14 +1844,11 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
                         if (iSizeID != 0 && tvb_length_remaining(tvb, offset) >= iSizeID)
                         {
-                            if (check_col(pinfo->cinfo, COL_INFO))
+                            guint8* sChannel;
+                            sChannel = tvb_get_ephemeral_string_enc(tvb, offset + 24, 20, string_rep);
+                            if (strip_trailing_blanks(sChannel, 20) != 0)
                             {
-                                guint8* sChannel;
-                                sChannel = tvb_get_ephemeral_string_enc(tvb, offset + 24, 20, string_rep);
-                                if (strip_trailing_blanks(sChannel, 20) != 0)
-                                {
-                                    col_append_fstr(pinfo->cinfo, COL_INFO, ": CHL=%s", sChannel);
-                                }
+                                col_append_fstr(pinfo->cinfo, COL_INFO, ": CHL=%s", sChannel);
                             }
 
                             if (tree)
@@ -1931,14 +1907,11 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
                             if (iVersionID >= 4)
                             {
-                                if (check_col(pinfo->cinfo, COL_INFO))
+                                guint8* sQueueManager;
+                                sQueueManager = tvb_get_ephemeral_string_enc(tvb, offset + 48, 48, string_rep);
+                                if (strip_trailing_blanks(sQueueManager,48) != 0)
                                 {
-                                    guint8* sQueueManager;
-                                    sQueueManager = tvb_get_ephemeral_string_enc(tvb, offset + 48, 48, string_rep);
-                                    if (strip_trailing_blanks(sQueueManager,48) != 0)
-                                    {
-                                        col_append_fstr(pinfo->cinfo, COL_INFO, " QM=%s", sQueueManager);
-                                    }
+                                    col_append_fstr(pinfo->cinfo, COL_INFO, " QM=%s", sQueueManager);
                                 }
 
                                 if (tree)
@@ -1965,14 +1938,11 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
                         if (iSizeUID != 0 && tvb_length_remaining(tvb, offset) >= iSizeUID)
                         {
-                            if (check_col(pinfo->cinfo, COL_INFO))
+                            guint8* sUserId;
+                            sUserId = tvb_get_ephemeral_string_enc(tvb, offset + 4, 12, string_rep);
+                            if (strip_trailing_blanks(sUserId, 12) != 0)
                             {
-                                guint8* sUserId;
-                                sUserId = tvb_get_ephemeral_string_enc(tvb, offset + 4, 12, string_rep);
-                                if (strip_trailing_blanks(sUserId, 12) != 0)
-                                {
-                                    col_append_fstr(pinfo->cinfo, COL_INFO, ": User=%s", sUserId);
-                                }
+                                col_append_fstr(pinfo->cinfo, COL_INFO, ": User=%s", sUserId);
                             }
 
                             if (tree)
@@ -2013,17 +1983,14 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                         if (iSizeOD != 0 && tvb_length_remaining(tvb, offset) >= iSizeOD)
                         {
                             gint iNbrRecords = 0;
+                            guint8* sQueue;
                             if (iVersionOD >= 2)
                                 iNbrRecords = tvb_get_guint32_endian(tvb, offset + 168, int_rep);
 
-                            if (check_col(pinfo->cinfo, COL_INFO))
+                            sQueue = tvb_get_ephemeral_string_enc(tvb, offset + 12, 48, string_rep);
+                            if (strip_trailing_blanks(sQueue,48) != 0)
                             {
-                                guint8* sQueue;
-                                sQueue = tvb_get_ephemeral_string_enc(tvb, offset + 12, 48, string_rep);
-                                if (strip_trailing_blanks(sQueue,48) != 0)
-                                {
-                                    col_append_fstr(pinfo->cinfo, COL_INFO, " Obj=%s", sQueue);
-                                }
+                                col_append_fstr(pinfo->cinfo, COL_INFO, " Obj=%s", sQueue);
                             }
 
                             if (tree)
@@ -2122,8 +2089,7 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                     }
                     if (iDistributionListSize > 0)
                     {
-                        if (check_col(pinfo->cinfo, COL_INFO))
-                            col_append_fstr(pinfo->cinfo, COL_INFO, " (Distribution List, Size=%d)", iDistributionListSize);
+                        col_append_fstr(pinfo->cinfo, COL_INFO, " (Distribution List, Size=%d)", iDistributionListSize);
                     }
                     if (bPayload == TRUE)
                     {
@@ -2333,10 +2299,7 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                                     PROTO_ITEM_SET_HIDDEN(hidden_item);
                                 }
                             }
-                            if (check_col(pinfo->cinfo, COL_INFO))
-                            {
-                                col_append_fstr(pinfo->cinfo, COL_INFO, " (%d bytes)", iSizePayload - iHeadersLength);
-                            }
+                            col_append_fstr(pinfo->cinfo, COL_INFO, " (%d bytes)", iSizePayload - iHeadersLength);
 
                             {
                                 /* Call subdissector for the payload */
@@ -2449,8 +2412,7 @@ reassemble_mq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                     {
                         /* Reassembly in progress */
                         col_set_str(pinfo->cinfo, COL_PROTOCOL, "MQ");
-                        if (check_col(pinfo->cinfo, COL_INFO))
-                            col_add_fstr(pinfo->cinfo, COL_INFO, "%s [Reassembled MQ]", val_to_str(opcode, mq_opcode_vals, "Unknown (0x%02x)"));
+                        col_add_fstr(pinfo->cinfo, COL_INFO, "%s [Reassembled MQ]", val_to_str(opcode, mq_opcode_vals, "Unknown (0x%02x)"));
                         if (tree)
                         {
                             proto_item* ti = NULL;
index bf1fc86d9d777c68a04bfcfffc2f5edc742c150a..260cbd37cdf23846d832bcce48492ec4b8041827 100644 (file)
@@ -204,11 +204,9 @@ dissect_mrdisc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int o
 
 
        type = tvb_get_guint8(tvb, offset);
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_add_str(pinfo->cinfo, COL_INFO,
+       col_add_str(pinfo->cinfo, COL_INFO,
                        val_to_str(type, mrdisc_types,
                                "Unknown Type:0x%02x"));
-       }
 
        /* type of command */
        proto_tree_add_uint(tree, hf_type, tvb, offset, 1, type);
index 6791f6308332ae67936f56bebcafb642895154d8..b6974576029ed3c70055299283ebe08df62a9290 100644 (file)
@@ -181,8 +181,7 @@ dissect_msdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
         col_set_str(pinfo->cinfo, COL_PROTOCOL, "MSDP");
 
-        if (check_col(pinfo->cinfo, COL_INFO))
-                col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(tvb, 0),
+        col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(tvb, 0),
                                                                      msdp_types,
                                                                      "<Unknown MSDP message type>"));
 
index 5b1450f8d45ea1b98bf661d018aad17b6b4b9e0b..a89dd4688d24784a2043082f407fd29da66fd89a 100644 (file)
@@ -84,13 +84,11 @@ dissect_msnms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        line = tvb_get_ptr(tvb, offset, linelen);
 
 
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               /*
-                * Put the first line from the buffer into the summary.
-                */
-               col_add_str(pinfo->cinfo, COL_INFO,
+       /*
+        * Put the first line from the buffer into the summary.
+        */
+       col_add_str(pinfo->cinfo, COL_INFO,
                            format_text(line, linelen));
-       }
 
        if (tree) {
                ti = proto_tree_add_item(tree, proto_msnms, tvb, offset, -1,
index d934c14f0b92b29f80f360096d68d12e3165e0f9..6632e75170985a6f90e4c33ba45bf64f18d453bc 100644 (file)
@@ -234,11 +234,9 @@ dissect_msnip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int of
 
 
        type = tvb_get_guint8(tvb, offset);
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_add_str(pinfo->cinfo, COL_INFO,
+       col_add_str(pinfo->cinfo, COL_INFO,
                        val_to_str(type, msnip_types,
                                "Unknown Type:0x%02x"));
-       }
 
        /* type of command */
        proto_tree_add_uint(tree, hf_type, tvb, offset, 1, type);
index c0dbb7970e2556c64dd347319235388d96d57f1e..36c7c9e6a2101a4f689c1a38714f7d386315d400 100644 (file)
@@ -214,8 +214,7 @@ static void msproxy_sub_dissector( tvbuff_t *tvb, packet_info *pinfo,
 
        col_set_str(pinfo->cinfo, COL_PROTOCOL, "MS Proxy");
 
-       if (check_col(pinfo->cinfo, COL_INFO))
-               col_set_str(pinfo->cinfo, COL_INFO,
+       col_set_str(pinfo->cinfo, COL_INFO,
                        (( redirect_info->proto == PT_TCP) ? "TCP stream" :
                         "UDP packets"));
 
@@ -1075,7 +1074,7 @@ static void dissect_msproxy_response(tvbuff_t *tvb, packet_info *pinfo,
 static void dissect_msproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
 
 
-       proto_tree      *msproxy_tree = NULL;
+       proto_tree      *msproxy_tree;
        proto_item      *ti;
        unsigned int    cmd;
 
@@ -1095,25 +1094,17 @@ static void dissect_msproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                        hash_info);
        }
 
-       if (check_col(pinfo->cinfo, COL_INFO)){
+       cmd = tvb_get_ntohs( tvb, 36);
 
-               cmd = tvb_get_ntohs( tvb, 36);
-
-               if ( pinfo->srcport == UDP_PORT_MSPROXY)
-                       col_add_fstr( pinfo->cinfo, COL_INFO, "Server message: %s",
-                               get_msproxy_cmd_name( cmd, FROM_SERVER));
-               else
-                       col_add_fstr(pinfo->cinfo, COL_INFO, "Client message: %s",
-                               get_msproxy_cmd_name( cmd, FROM_CLIENT));
-
-       }
-
-       if (tree) {                             /* if proto tree, decode data */
-               ti = proto_tree_add_item( tree, proto_msproxy, tvb, 0, -1,
-                               ENC_NA );
+       if ( pinfo->srcport == UDP_PORT_MSPROXY)
+               col_add_fstr( pinfo->cinfo, COL_INFO, "Server message: %s",
+                       get_msproxy_cmd_name( cmd, FROM_SERVER));
+       else
+               col_add_fstr(pinfo->cinfo, COL_INFO, "Client message: %s",
+                       get_msproxy_cmd_name( cmd, FROM_CLIENT));
 
-               msproxy_tree = proto_item_add_subtree(ti, ett_msproxy);
-       }
+       ti = proto_tree_add_item( tree, proto_msproxy, tvb, 0, -1, ENC_NA );
+       msproxy_tree = proto_item_add_subtree(ti, ett_msproxy);
 
        if ( pinfo->srcport == UDP_PORT_MSPROXY)
                dissect_msproxy_response( tvb, pinfo, msproxy_tree, hash_info);
index 2adac4d60ef33e5f0a5a369b00d661d15dafa535..56a1e4f6bd27676ccaef854f736f4c83ab96a005 100644 (file)
@@ -175,10 +175,9 @@ dissect_mstp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
        col_set_str(pinfo->cinfo, COL_INFO, "BACnet MS/TP");
        mstp_frame_type = tvb_get_guint8(tvb, offset);
        mstp_frame_pdu_len = tvb_get_ntohs(tvb, offset+3);
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
+       col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
                        mstp_frame_type_text(mstp_frame_type));
-       }
+
        /* Add the items to the tree */
        proto_tree_add_item(subtree, hf_mstp_frame_type, tvb,
                        offset, 1, ENC_LITTLE_ENDIAN);
index d87efe9fba5ce77b7b29df5332cb785a363b14c4..bae91ad2ba39f7f1bf0b1856ba1a372e3e554fea 100644 (file)
@@ -840,23 +840,19 @@ mysql_dissect_greeting(tvbuff_t *tvb, packet_info *pinfo, int offset,
 
        conn_data->state= LOGIN;
 
-       if (tree) {
-               tf = proto_tree_add_item(tree, hf_mysql_server_greeting, tvb, offset, -1, ENC_NA);
-               greeting_tree = proto_item_add_subtree(tf, ett_server_greeting);
-       }
+       tf = proto_tree_add_item(tree, hf_mysql_server_greeting, tvb, offset, -1, ENC_NA);
+       greeting_tree = proto_item_add_subtree(tf, ett_server_greeting);
+
+       col_append_fstr(pinfo->cinfo, COL_INFO, " proto=%d", protocol) ;
 
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, " proto=%d", protocol) ;
-       }
        proto_tree_add_item(greeting_tree, hf_mysql_protocol, tvb, offset, 1, ENC_NA);
 
        offset += 1;
 
        /* version string */
        lenstr = tvb_strsize(tvb,offset);
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, " version=%s", tvb_get_ephemeral_string(tvb, offset, lenstr));
-       }
+       col_append_fstr(pinfo->cinfo, COL_INFO, " version=%s", tvb_get_ephemeral_string(tvb, offset, lenstr));
+
        proto_tree_add_item(greeting_tree, hf_mysql_version, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
        conn_data->major_version = 0;
        for (ver_offset = 0; ver_offset < lenstr; ver_offset++) {
@@ -942,9 +938,7 @@ mysql_dissect_login(tvbuff_t *tvb, packet_info *pinfo, int offset,
 
        /* User name */
        lenstr = my_tvb_strsize(tvb, offset);
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, " user=%s", tvb_get_ephemeral_string(tvb, offset, lenstr));
-       }
+       col_append_fstr(pinfo->cinfo, COL_INFO, " user=%s", tvb_get_ephemeral_string(tvb, offset, lenstr));
        proto_tree_add_item(login_tree, hf_mysql_user, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
        offset += lenstr;
 
@@ -971,9 +965,8 @@ mysql_dissect_login(tvbuff_t *tvb, packet_info *pinfo, int offset,
                        return offset;
                }
 
-               if (check_col(pinfo->cinfo, COL_INFO)) {
-                       col_append_fstr(pinfo->cinfo, COL_INFO, " db=%s", tvb_get_ephemeral_string(tvb, offset, lenstr));
-               }
+               col_append_fstr(pinfo->cinfo, COL_INFO, " db=%s", tvb_get_ephemeral_string(tvb, offset, lenstr));
+
                proto_tree_add_item(login_tree, hf_mysql_schema, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
                offset += lenstr;
        }
@@ -1182,9 +1175,8 @@ mysql_dissect_request(tvbuff_t *tvb,packet_info *pinfo, int offset,
        }
 
        opcode = tvb_get_guint8(tvb, offset);
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(opcode, mysql_command_vals, "Unknown (%u)"));
-       }
+       col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(opcode, mysql_command_vals, "Unknown (%u)"));
+
        proto_tree_add_item(req_tree, hf_mysql_command, tvb, offset, 1, ENC_NA);
        proto_item_append_text(tf, " %s", val_to_str(opcode, mysql_command_vals, "Unknown (%u)"));
        offset += 1;
@@ -1221,8 +1213,7 @@ mysql_dissect_request(tvbuff_t *tvb,packet_info *pinfo, int offset,
                lenstr = my_tvb_strsize(tvb, offset);
                proto_tree_add_item(req_tree, hf_mysql_query, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
                if (mysql_showquery) {
-                       if (check_col(pinfo->cinfo, COL_INFO))
-                               col_append_fstr(pinfo->cinfo, COL_INFO, " { %s } ", tvb_get_ephemeral_string(tvb, offset, lenstr));
+                       col_append_fstr(pinfo->cinfo, COL_INFO, " { %s } ", tvb_get_ephemeral_string(tvb, offset, lenstr));
                }
                offset += lenstr;
                conn_data->state = RESPONSE_TABULAR;
@@ -1546,9 +1537,8 @@ static int
 mysql_dissect_error_packet(tvbuff_t *tvb, packet_info *pinfo,
                           int offset, proto_tree *tree)
 {
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, " Error %d", tvb_get_letohs(tvb, offset));
-       }
+       col_append_fstr(pinfo->cinfo, COL_INFO, " Error %d", tvb_get_letohs(tvb, offset));
+
        proto_tree_add_item(tree, hf_mysql_error_code, tvb, offset, 2, ENC_LITTLE_ENDIAN);
        offset += 2;
 
index a8f0d90f5b283f490de6d4e735bcec7c8a5bf26a..03095dc94c0e892f82d65fdfa91580318b352cf1 100644 (file)
@@ -157,10 +157,8 @@ dissect_nasdaq_soup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     int  linelen;
     gint next_offset;
     int  offset = 0;
-    gint col_info;
     gint counter = 0;
 
-    col_info = check_col(pinfo->cinfo, COL_INFO);
     while (tvb_offset_exists(tvb, offset)) {
       /* there's only a \n no \r */
       linelen = tvb_find_line_end(tvb, offset, -1, &next_offset, nasdaq_soup_desegment && pinfo->can_desegment);
@@ -180,21 +178,18 @@ dissect_nasdaq_soup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
       nasdaq_soup_type = tvb_get_guint8(tvb, offset);
       if (counter == 0) {
         col_set_str(pinfo->cinfo, COL_PROTOCOL, "Nasdaq-SOUP");
-        if (col_info)
-            col_clear(pinfo->cinfo, COL_INFO);
+        col_clear(pinfo->cinfo, COL_INFO);
       }
-      if (col_info ) {
-        if (counter) {
-          col_append_str(pinfo->cinfo, COL_INFO, "; ");
-          col_set_fence(pinfo->cinfo, COL_INFO);
-        }
-        col_append_str(pinfo->cinfo, COL_INFO, val_to_str(nasdaq_soup_type, message_types_val, "Unknown packet type (0x%02x)"));
+      if (counter) {
+        col_append_str(pinfo->cinfo, COL_INFO, "; ");
+        col_set_fence(pinfo->cinfo, COL_INFO);
       }
+      col_append_str(pinfo->cinfo, COL_INFO, val_to_str(nasdaq_soup_type, message_types_val, "Unknown packet type (0x%02x)"));
+
       counter++;
-      if (tree) {
-          ti = proto_tree_add_item(tree, proto_nasdaq_soup, tvb, offset, linelen +1, ENC_NA);
-          nasdaq_soup_tree = proto_item_add_subtree(ti, ett_nasdaq_soup);
-      }
+      ti = proto_tree_add_item(tree, proto_nasdaq_soup, tvb, offset, linelen +1, ENC_NA);
+      nasdaq_soup_tree = proto_item_add_subtree(ti, ett_nasdaq_soup);
+
       dissect_nasdaq_soup_packet(tvb, pinfo, tree, nasdaq_soup_tree, offset, linelen);
       offset = next_offset;
     }
index 3ca16d287a1254f72448f1212393f11a021236df..ccc6e64f1fc042cae534f405741929620899b42b 100644 (file)
@@ -332,18 +332,16 @@ dissect_nbd_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
                proto_tree_add_item(tree, hf_nbd_len, tvb, offset, 4, ENC_BIG_ENDIAN);
                offset+=4;
 
-               if(check_col(pinfo->cinfo, COL_INFO)){
-                       switch(nbd_trans->type){
-                       case NBD_CMD_WRITE:
-                               col_add_fstr(pinfo->cinfo, COL_INFO, "Write Request  Offset:0x%" G_GINT64_MODIFIER "x Length:%d", from, nbd_trans->datalen);
-                               break;
-                       case NBD_CMD_READ:
-                               col_add_fstr(pinfo->cinfo, COL_INFO, "Read Request  Offset:0x%" G_GINT64_MODIFIER "x Length:%d", from, nbd_trans->datalen);
-                               break;
-                       case NBD_CMD_DISC:
-                               col_set_str(pinfo->cinfo, COL_INFO, "Disconnect Request");
-                               break;
-                       }
+               switch(nbd_trans->type){
+               case NBD_CMD_WRITE:
+                       col_add_fstr(pinfo->cinfo, COL_INFO, "Write Request  Offset:0x%" G_GINT64_MODIFIER "x Length:%d", from, nbd_trans->datalen);
+                       break;
+               case NBD_CMD_READ:
+                       col_add_fstr(pinfo->cinfo, COL_INFO, "Read Request  Offset:0x%" G_GINT64_MODIFIER "x Length:%d", from, nbd_trans->datalen);
+                       break;
+               case NBD_CMD_DISC:
+                       col_set_str(pinfo->cinfo, COL_INFO, "Disconnect Request");
+                       break;
                }
 
                if(nbd_trans->type==NBD_CMD_WRITE){
@@ -361,9 +359,7 @@ dissect_nbd_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
                proto_tree_add_item(tree, hf_nbd_handle, tvb, offset, 8, ENC_BIG_ENDIAN);
                offset+=8;
 
-               if(check_col(pinfo->cinfo, COL_INFO)){
-                       col_add_fstr(pinfo->cinfo, COL_INFO, "%s Response  Error:%d", (nbd_trans->type==NBD_CMD_WRITE)?"Write":"Read", error);
-               }
+               col_add_fstr(pinfo->cinfo, COL_INFO, "%s Response  Error:%d", (nbd_trans->type==NBD_CMD_WRITE)?"Write":"Read", error);
 
                if(nbd_trans->type==NBD_CMD_READ){
                        proto_tree_add_item(tree, hf_nbd_data, tvb, offset, nbd_trans->datalen, ENC_NA);
index e83e87abc5a29f9b444ab8831772ce18d4ce4d20..0e2923146e80b71674891316315b366ec9bc92ee 100644 (file)
@@ -300,11 +300,10 @@ dissect_nbipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        case NBIPX_NAME_IN_USE:
        case NBIPX_DEREGISTER_NAME:
                name_type = get_netbios_name(tvb, offset+2, name, (NETBIOS_NAME_LEN - 1)*4 + 1);
-               if (check_col(pinfo->cinfo, COL_INFO)) {
-                       col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s<%02x>",
+               col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s<%02x>",
                                val_to_str_const(packet_type, nbipx_data_stream_type_vals, "Unknown"),
                                name, name_type);
-               }
+
                if (nbipx_tree) {
                        tf = proto_tree_add_item(nbipx_tree, hf_nbipx_name_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
                        name_type_flag_tree = proto_item_add_subtree(tf, ett_nbipx_name_type_flags);
@@ -333,10 +332,9 @@ dissect_nbipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        case NBIPX_SESSION_DATA:
        case NBIPX_SESSION_END:
        case NBIPX_SESSION_END_ACK:
-               if (check_col(pinfo->cinfo, COL_INFO)) {
-                       col_add_str(pinfo->cinfo, COL_INFO,
+               col_add_str(pinfo->cinfo, COL_INFO,
                                val_to_str_const(packet_type, nbipx_data_stream_type_vals, "Unknown"));
-               }
+
                dissect_conn_control(tvb, offset, nbipx_tree);
                offset += 1;
 
@@ -374,10 +372,9 @@ dissect_nbipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                break;
 
        case NBIPX_DIRECTED_DATAGRAM:
-               if (check_col(pinfo->cinfo, COL_INFO)) {
-                       col_add_str(pinfo->cinfo, COL_INFO,
+               col_add_str(pinfo->cinfo, COL_INFO,
                                val_to_str_const(packet_type, nbipx_data_stream_type_vals, "Unknown"));
-               }
+
                dissect_conn_control(tvb, offset, nbipx_tree);
                offset += 1;
 
@@ -401,10 +398,8 @@ dissect_nbipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                break;
 
        default:
-               if (check_col(pinfo->cinfo, COL_INFO)) {
-                       col_add_str(pinfo->cinfo, COL_INFO,
+               col_add_str(pinfo->cinfo, COL_INFO,
                                val_to_str_const(packet_type, nbipx_data_stream_type_vals, "Unknown"));
-               }
 
                /*
                 * We don't know what the first byte is.
@@ -739,55 +734,53 @@ dissect_nmpi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        name_type = get_netbios_name(tvb, offset+4, name, (NETBIOS_NAME_LEN - 1)*4 + 1);
        /*node_name_type = */get_netbios_name(tvb, offset+20, node_name, (NETBIOS_NAME_LEN - 1)*4 + 1);
 
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               switch (opcode) {
+       switch (opcode) {
 
-               case INAME_CLAIM:
-                       col_add_fstr(pinfo->cinfo, COL_INFO, "Claim name %s<%02x>",
+       case INAME_CLAIM:
+               col_add_fstr(pinfo->cinfo, COL_INFO, "Claim name %s<%02x>",
                                        name, name_type);
-                       break;
+               break;
 
-               case INAME_DELETE:
-                       col_add_fstr(pinfo->cinfo, COL_INFO, "Delete name %s<%02x>",
+       case INAME_DELETE:
+               col_add_fstr(pinfo->cinfo, COL_INFO, "Delete name %s<%02x>",
                                        name, name_type);
-                       break;
+               break;
 
-               case INAME_QUERY:
-                       col_add_fstr(pinfo->cinfo, COL_INFO, "Query name %s<%02x>",
+       case INAME_QUERY:
+               col_add_fstr(pinfo->cinfo, COL_INFO, "Query name %s<%02x>",
                                        name, name_type);
-                       break;
+               break;
 
-               case INAME_FOUND:
-                       col_add_fstr(pinfo->cinfo, COL_INFO, "Name %s<%02x> found",
+       case INAME_FOUND:
+               col_add_fstr(pinfo->cinfo, COL_INFO, "Name %s<%02x> found",
                                        name, name_type);
-                       break;
+               break;
 
-               case IMSG_HANGUP:
-                       col_add_fstr(pinfo->cinfo, COL_INFO,
+       case IMSG_HANGUP:
+               col_add_fstr(pinfo->cinfo, COL_INFO,
                            "Messenger hangup on %s<%02x>", name, name_type);
-                       break;
+               break;
 
-               case IMSLOT_SEND:
-                       col_add_fstr(pinfo->cinfo, COL_INFO,
+       case IMSLOT_SEND:
+               col_add_fstr(pinfo->cinfo, COL_INFO,
                            "Mailslot write to %s<%02x>", name, name_type);
-                       break;
+               break;
 
-               case IMSLOT_FIND:
-                       col_add_fstr(pinfo->cinfo, COL_INFO,
+       case IMSLOT_FIND:
+               col_add_fstr(pinfo->cinfo, COL_INFO,
                            "Find mailslot name %s<%02x>", name, name_type);
-                       break;
+               break;
 
-               case IMSLOT_NAME:
-                       col_add_fstr(pinfo->cinfo, COL_INFO,
+       case IMSLOT_NAME:
+               col_add_fstr(pinfo->cinfo, COL_INFO,
                            "Mailslot name %s<%02x> found", name, name_type);
-                       break;
+               break;
 
-               default:
-                       col_add_fstr(pinfo->cinfo, COL_INFO,
+       default:
+               col_add_fstr(pinfo->cinfo, COL_INFO,
                            "Unknown NMPI op 0x%02x: name %s<%02x>",
                            opcode, name, name_type);
-                       break;
-               }
+               break;
        }
 
        if (tree) {
index ab3f07c8272f6f1738c312abbb574f01cb3b4fc3..5849b47a984aa5b8742ea7cf88b753bea2814156 100644 (file)
@@ -300,10 +300,9 @@ dissect_nmas_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, nc
 
     /* Fill in the INFO column. */
     col_set_str(pinfo->cinfo, COL_PROTOCOL, "NMAS");
-    if (check_col(pinfo->cinfo, COL_INFO)) {
-       col_add_fstr(pinfo->cinfo, COL_INFO, "C NMAS - %s",
-                    val_to_str(subfunc, nmas_func_enum, "Unknown (0x%02x)"));
-    }
+    col_add_fstr(pinfo->cinfo, COL_INFO, "C NMAS - %s",
+                val_to_str(subfunc, nmas_func_enum, "Unknown (0x%02x)"));
+
     aitem = proto_tree_add_text(ncp_tree, tvb, foffset, -1, "Packet Type: %s",
                                 val_to_str(subfunc, nmas_func_enum, "Unknown (0x%02x)"));
     atree = proto_item_add_subtree(aitem, ett_nmas);
@@ -334,10 +333,8 @@ dissect_nmas_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, nc
         }
         foffset += 4;
         msg_length -= 4;
-        if (check_col(pinfo->cinfo, COL_INFO)) {
-            col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
-                            val_to_str(subverb, nmas_subverb_enum, "Unknown subverb (%u)"));
-        }
+        col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
+                        val_to_str(subverb, nmas_subverb_enum, "Unknown subverb (%u)"));
         switch (subverb) {
         case 0:             /* Fragmented Ping */
             proto_tree_add_item(atree, hf_ping_version, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
@@ -362,10 +359,9 @@ dissect_nmas_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, nc
             }
             proto_tree_add_item(atree, hf_lsm_verb, tvb, foffset, 1, ENC_LITTLE_ENDIAN);
             foffset += 4;
-            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(msgverb, nmas_lsmverb_enum, "Unknown (%u)"));
-            }
+
             switch (msgverb)
             {
             case 1:
@@ -404,10 +400,9 @@ dissect_nmas_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, nc
             proto_tree_add_item(atree, hf_msg_verb, tvb, foffset, 1, ENC_BIG_ENDIAN);
             foffset += 1;
             msg_length -= 12;
-            if (check_col(pinfo->cinfo, COL_INFO)) {
-                col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
-                                val_to_str(msgverb, nmas_msgverb_enum, "Unknown (%u)"));
-            }
+            col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
+                            val_to_str(msgverb, nmas_msgverb_enum, "Unknown (%u)"));
+
             switch(msgverb)
             {
             case 1:
@@ -634,9 +629,7 @@ dissect_nmas_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, guin
             {
                 expert_item = proto_tree_add_item(atree, hf_return_code, tvb, roffset, 4, ENC_LITTLE_ENDIAN);
                 expert_add_info_format_text(pinfo, expert_item, &ei_return_error, "NMAS Error: 0x%08x is unknown", return_code);
-                if (check_col(pinfo->cinfo, COL_INFO)) {
-                   col_add_fstr(pinfo->cinfo, COL_INFO, "R Unknown NMAS Error - 0x%08x", return_code);
-                }
+                col_add_fstr(pinfo->cinfo, COL_INFO, "R Unknown NMAS Error - 0x%08x", return_code);
             }
         }
 
index dfadd074edaf710ad978bcf3042eb53cd66be9b2..bb8cfa66a8e41e00637ccb631c9b83d1ff4ed6c2 100644 (file)
@@ -540,9 +540,8 @@ dissect_sss_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, ncp
 
     /* Fill in the PROTOCOL & INFO  columns. */
     col_set_str(pinfo->cinfo, COL_PROTOCOL, "NSSS");
-    if (check_col(pinfo->cinfo, COL_INFO)) {
-       col_add_fstr(pinfo->cinfo, COL_INFO, "C SecretStore - %s", val_to_str(subfunc, sss_func_enum, "Unknown (%d)"));
-    }
+    col_add_fstr(pinfo->cinfo, COL_INFO, "C SecretStore - %s", val_to_str(subfunc, sss_func_enum, "Unknown (%d)"));
+
     switch (subfunc) {
     case 1:
         aitem = proto_tree_add_text(ncp_tree, tvb, foffset, tvb_length_remaining(tvb, foffset), "Packet Type: %s", val_to_str(subfunc, sss_func_enum, "Unknown (%d)"));
@@ -563,9 +562,8 @@ dissect_sss_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, ncp
             foffset += 4;
             foffset += 12; /* Blank Context */
             subverb = tvb_get_letohl(tvb, foffset);
-            if (check_col(pinfo->cinfo, COL_INFO)) {
-                col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str(subverb, sss_verb_enum, "Unknown (%d)"));
-            }
+            col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str(subverb, sss_verb_enum, "Unknown (%d)"));
+
             aitem = proto_tree_add_item(ncp_tree, hf_verb, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
             atree = proto_item_add_subtree(aitem, ett_sss);
             if (request_value) {
@@ -642,10 +640,9 @@ dissect_sss_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, ncp
         }
         else
         {
-            if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_set_str(pinfo->cinfo, COL_INFO, "C SecretStore - fragment");
-               proto_tree_add_text(ncp_tree, tvb, foffset, 4, "Fragment");
-            }
+            col_set_str(pinfo->cinfo, COL_INFO, "C SecretStore - fragment");
+            proto_tree_add_text(ncp_tree, tvb, foffset, 4, "Fragment");
+
             /* Fragments don't really carry a subverb so store 0xff as the subverb number */
             if (request_value) {
                 request_value->req_nds_flags=255;
index 9f77a3fc8db52da8c27bfdd568eb9f9a34b4a2f6..248523f96154e70fb255cbde1a40847f3b0f5afd 100644 (file)
@@ -460,10 +460,8 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
 
     tap_queue_packet(ncp_tap.hdr, pinfo, ncp_hdr);
 
-    if (check_col(pinfo->cinfo, COL_INFO)) {
-        col_add_str(pinfo->cinfo, COL_INFO,
-            val_to_str(header.type, ncp_type_vals, "Unknown type (0x%04x)"));
-    }
+    col_add_str(pinfo->cinfo, COL_INFO,
+        val_to_str(header.type, ncp_type_vals, "Unknown type (0x%04x)"));
 
     /*
      * Process the packet-type-specific header.
@@ -643,13 +641,11 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
             offset += 4;
             data_len -= 4;
 
-            if (check_col(pinfo->cinfo, COL_INFO)) {
-                col_add_fstr(pinfo->cinfo, COL_INFO,
-                    "%s %d bytes starting at offset %d in file 0x%08x",
-                    val_to_str(ncp_burst_command,
-                      burst_command, "Unknown (0x%08x)"),
-                     burst_len, burst_off, burst_file);
-            }
+            col_add_fstr(pinfo->cinfo, COL_INFO,
+                "%s %d bytes starting at offset %d in file 0x%08x",
+                val_to_str(ncp_burst_command,
+                    burst_command, "Unknown (0x%08x)"),
+                    burst_len, burst_off, burst_file);
             break;
         } else {
             if (tvb_get_guint8(tvb, commhdr + 2) & 0x10) {
index 5b51fac8e4300c5517a27cb3b086f4fc46df765c..28b28b947758b60887cad4ae2a883eaaa50efb1f 100644 (file)
@@ -661,7 +661,7 @@ dissect_error(tvbuff_t *tvb, int offset, packet_info *pinfo,
        /* error */
        err=tvb_get_ntohl(tvb, offset);
        proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, ENC_BIG_ENDIAN);
-       if(err && check_col(pinfo->cinfo, COL_INFO)) {
+       if(err) {
                col_append_fstr(pinfo->cinfo, COL_INFO,
                        " NDMP Error:%s ",
                        val_to_str(err, error_vals,
@@ -2387,17 +2387,13 @@ dissect_file_name(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *par
                /* file */
                offset = dissect_rpc_string(tvb, tree,
                                hf_ndmp_file_name, offset, &name);
-               if (check_col(pinfo->cinfo, COL_INFO)){
-                       col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
-               }
+               col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
                break;
        case NDMP_FS_NT:
                /* nt file */
                offset = dissect_rpc_string(tvb, tree,
                                hf_ndmp_nt_file_name, offset, &name);
-               if (check_col(pinfo->cinfo, COL_INFO)){
-                       col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
-               }
+               col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
 
                /* dos file */
                offset = dissect_rpc_string(tvb, tree,
@@ -2407,15 +2403,11 @@ dissect_file_name(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *par
                /* file */
                offset = dissect_rpc_string(tvb, tree,
                                hf_ndmp_file_name, offset, &name);
-               if (check_col(pinfo->cinfo, COL_INFO)){
-                       col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
-               }
+               col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
        }
 
-       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_const(type, file_fs_type_vals, "Unknown type") );
-       }
 
        proto_item_set_len(item, offset-old_offset);
        return offset;
@@ -3031,12 +3023,10 @@ dissect_ndmp_header(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *p
        /* error */
        offset=dissect_error(tvb, offset, pinfo, tree, nh->seq);
 
-       if (check_col(pinfo->cinfo, COL_INFO)){
-               col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s ",
+       col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s ",
                        val_to_str(nh->msg, msg_vals, "Unknown Message (0x%02x)"),
                        val_to_str(nh->type, msg_type_vals, "Unknown Type (0x%02x)")
                        );
-       }
 
        return offset;
 }
@@ -3266,10 +3256,8 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                         */
                        col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDMP");
 
-                       if (check_col(pinfo->cinfo, COL_INFO)) {
-                               col_clear(pinfo->cinfo, COL_INFO);
-                               col_append_fstr(pinfo->cinfo, COL_INFO, "[NDMP fragment] ");
-                       }
+                       col_clear(pinfo->cinfo, COL_INFO);
+                       col_append_fstr(pinfo->cinfo, COL_INFO, "[NDMP fragment] ");
 
                        /*
                         * Add the record marker information to the tree
index f62b341d5b12acb97a7a69405e55b488861ce324..752eddb0423271ccfcc31e57c784a765f20c01a4 100644 (file)
@@ -276,25 +276,22 @@ dissect_ndp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
        col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDP");
 
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               hello_type = "";
-               if (pinfo->dl_dst.type == AT_ETHER) {
-                       const guint8 *dstmac = (const guint8 *)pinfo->dl_dst.data;
+       hello_type = "";
+       if (pinfo->dl_dst.type == AT_ETHER) {
+               const guint8 *dstmac = (const guint8 *)pinfo->dl_dst.data;
 
-                       switch (dstmac[5]) {
+               switch (dstmac[5]) {
 
-                       case 0:
-                               hello_type = "Segment ";
-                               break;
+               case 0:
+                       hello_type = "Segment ";
+                       break;
 
-                       case 1:
-                               hello_type = "FlatNet ";
-                               break;
-                       }
+               case 1:
+                       hello_type = "FlatNet ";
+                       break;
                }
-               col_add_fstr(pinfo->cinfo, COL_INFO, "%sHello",
-                   hello_type);
        }
+       col_add_fstr(pinfo->cinfo, COL_INFO, "%sHello", hello_type);
 
        if (tree) {
                ti = proto_tree_add_protocol_format(tree, proto_ndp, tvb, 0, 11,
index 63e416a555c302c9d0f76f2247036ed2e02dfa58..7c404bf7ae68faa6a333bd7b9cc69b808b31df02 100644 (file)
@@ -4231,11 +4231,9 @@ dissect_ndps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree)
         {
             proto_tree_add_item(ndps_tree, hf_spx_ndps_program, tvb, foffset, 4, ENC_BIG_ENDIAN);
             foffset += 4;
-            if (check_col(pinfo->cinfo, COL_INFO))
-            {
-                col_append_str(pinfo->cinfo, COL_INFO, (const gchar*) ndps_program_string);
-                col_append_str(pinfo->cinfo, COL_INFO, ", ");
-            }
+            col_append_str(pinfo->cinfo, COL_INFO, (const gchar*) ndps_program_string);
+            col_append_str(pinfo->cinfo, COL_INFO, ", ");
+
             proto_tree_add_item(ndps_tree, hf_spx_ndps_version, tvb, foffset, 4, ENC_BIG_ENDIAN);
             foffset += 4;
             ndps_func = tvb_get_ntohl(tvb, foffset);
@@ -4275,8 +4273,7 @@ dissect_ndps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree)
                 proto_tree_add_item(ndps_tree, ndps_hfname, tvb, foffset, 4, ENC_BIG_ENDIAN);
                 if (ndps_func_string != NULL)
                 {
-                    if (check_col(pinfo->cinfo, COL_INFO))
-                        col_append_str(pinfo->cinfo, COL_INFO, (const gchar*) ndps_func_string);
+                    col_append_str(pinfo->cinfo, COL_INFO, (const gchar*) ndps_func_string);
 
                     foffset += 4;
                     proto_tree_add_item(ndps_tree, hf_ndps_auth_null, tvb, foffset, 16, ENC_NA);
@@ -4426,25 +4423,20 @@ ndps_defrag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                 {
                     /* This is either a beggining or middle fragment on second dissection */
                     next_tvb = tvb_new_subset_remaining(tvb, 0);
-                    if (check_col(pinfo->cinfo, COL_INFO))
+                    if (!spx_info_p->eom)
                     {
-                      if (!spx_info_p->eom)
-                      {
-                        col_append_str(pinfo->cinfo, COL_INFO, "[NDPS Fragment]");
-                      }
+                      col_append_str(pinfo->cinfo, COL_INFO, "[NDPS Fragment]");
                     }
                 }
             }
             else
             {
                 /* Fragment from first pass of dissection */
-                if (check_col(pinfo->cinfo, COL_INFO))
+                if (!spx_info_p->eom)
                 {
-                  if (!spx_info_p->eom)
-                  {
-                    col_append_str(pinfo->cinfo, COL_INFO, "[NDPS Fragment]");
-                  }
+                  col_append_str(pinfo->cinfo, COL_INFO, "[NDPS Fragment]");
                 }
+
                 next_tvb = NULL;
             }
         }
@@ -6940,7 +6932,7 @@ return_code(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int foffse
         expert_add_info_format_text(pinfo, expert_item, &ei_ndps_return_code, "Fault: %s", val_to_str(expert_status, ndps_error_types, "Unknown NDPS Error (0x%08x)"));
     }
     foffset += 4;
-    if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
+    if (tvb_get_ntohl(tvb, foffset-4) != 0)
         col_set_str(pinfo->cinfo, COL_INFO, "R NDPS - Error");
     if (tvb_get_ntohl(tvb, foffset-4) == 0)
     {
@@ -7955,7 +7947,7 @@ dissect_ndps_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int
         case 0x00000005:    /* List Resources */
             proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, ENC_BIG_ENDIAN);
             foffset += 4;
-            if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
+            if (tvb_get_ntohl(tvb, foffset-4) != 0)
                 col_set_str(pinfo->cinfo, COL_INFO, "R NDPS - Error");
             if (tvb_get_ntohl(tvb, foffset-4) != 0)
             {
@@ -8209,7 +8201,7 @@ dissect_ndps_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int
         case 0x00000006:    /* Get Resource File */
             proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, ENC_BIG_ENDIAN);
             foffset += 4;
-            if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
+            if (tvb_get_ntohl(tvb, foffset-4) != 0)
                 col_set_str(pinfo->cinfo, COL_INFO, "R NDPS - Error");
             if (tvb_get_ntohl(tvb, foffset-4) != 0)
             {
@@ -8224,7 +8216,7 @@ dissect_ndps_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int
         case 0x00000007:    /* Get Resource File Date */
             proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, ENC_BIG_ENDIAN);
             foffset += 4;
-            if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
+            if (tvb_get_ntohl(tvb, foffset-4) != 0)
                 col_set_str(pinfo->cinfo, COL_INFO, "R NDPS - Error");
             if (tvb_get_ntohl(tvb, foffset-4) != 0)
             {
@@ -8248,7 +8240,7 @@ dissect_ndps_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int
         case 0x0000000a:    /* Set Resource Language Context */
             proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, ENC_BIG_ENDIAN);
             foffset += 4;
-            if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
+            if (tvb_get_ntohl(tvb, foffset-4) != 0)
                 col_set_str(pinfo->cinfo, COL_INFO, "R NDPS - Error");
             if (tvb_get_ntohl(tvb, foffset-4) != 0)
             {
@@ -8267,7 +8259,7 @@ dissect_ndps_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int
         case 0x00000001:    /* Delivery Bind */
             proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, ENC_BIG_ENDIAN);
             foffset += 4;
-            if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
+            if (tvb_get_ntohl(tvb, foffset-4) != 0)
                 col_set_str(pinfo->cinfo, COL_INFO, "R NDPS - Error");
             break;
         case 0x00000002:    /* Delivery Unbind */
@@ -8277,7 +8269,7 @@ dissect_ndps_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int
         case 0x00000004:    /* Delivery Send2 */
             proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, ENC_BIG_ENDIAN);
             foffset += 4;
-            if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
+            if (tvb_get_ntohl(tvb, foffset-4) != 0)
                 col_set_str(pinfo->cinfo, COL_INFO, "R NDPS - Error");
             if (tvb_get_ntohl(tvb, foffset-4) != 0)
             {
index abaf5f80b711853903f483424a75dc6c871c019f..e774e7c91f2833eac85cb0e1a23f3919ee6871cc 100644 (file)
@@ -1099,28 +1099,24 @@ dissect_netbios(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                                        /* limit command so no table overflows */
        command = MIN( command, sizeof( dissect_netb)/ sizeof(void *));
 
-        if (check_col( pinfo->cinfo, COL_INFO)) {              /* print command name */
-               command_name = val_to_str(command, cmd_vals, "Unknown (0x%02x)");
-                switch ( command ) {
-                case NB_NAME_QUERY:
-                        name_type = get_netbios_name( tvb, offset + 12, name, (NETBIOS_NAME_LEN - 1)*4 + 1);
-                        col_add_fstr( pinfo->cinfo, COL_INFO, "%s for %s<%02x>",
-                            command_name, name, name_type);
-                        break;
-
-                case NB_NAME_RESP:
-                case NB_ADD_NAME:
-                case NB_ADD_GROUP:
-                        name_type = get_netbios_name( tvb, offset + 28, name, (NETBIOS_NAME_LEN - 1)*4 + 1);
-                        col_add_fstr( pinfo->cinfo, COL_INFO, "%s - %s<%02x>",
-                            command_name, name, name_type);
-                        break;
+               /* print command name */
+       command_name = val_to_str(command, cmd_vals, "Unknown (0x%02x)");
+       switch ( command ) {
+               case NB_NAME_QUERY:
+                       name_type = get_netbios_name( tvb, offset + 12, name, (NETBIOS_NAME_LEN - 1)*4 + 1);
+                       col_add_fstr( pinfo->cinfo, COL_INFO, "%s for %s<%02x>", command_name, name, name_type);
+                       break;
+
+               case NB_NAME_RESP:
+               case NB_ADD_NAME:
+               case NB_ADD_GROUP:
+                       name_type = get_netbios_name( tvb, offset + 28, name, (NETBIOS_NAME_LEN - 1)*4 + 1);
+                       col_add_fstr( pinfo->cinfo, COL_INFO, "%s - %s<%02x>", command_name, name, name_type);
+               break;
 
                default:
-                       col_add_str( pinfo->cinfo, COL_INFO,
-                           command_name);
+                       col_add_str( pinfo->cinfo, COL_INFO, command_name);
                        break;
-               }
        }
 
        if ( tree) {
index 6d454d6103d2a780f7f615accaf89f45c62c7b34..f9a3d80e748d8bcbcf4fb6f4d88b5a8a7daa69a0 100644 (file)
@@ -1664,25 +1664,23 @@ dissect_netflow(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
     /*
      * set something interesting in the display now that we have info
      */
-    if (check_col(pinfo->cinfo, COL_INFO)) {
-        if (ver == 9) {
-            col_add_fstr(pinfo->cinfo, COL_INFO,
-                         "total: %u (v%u) record%s", pdus, ver,
-                         plurality(pdus, "", "s"));
-        } else if (ver == 10) {
-            gint remaining = tvb_reported_length_remaining(tvb, offset)+4;
-
-            if(remaining == flow_len)
-                col_add_fstr(pinfo->cinfo, COL_INFO, "IPFIX flow (%d bytes)", flow_len);
-            else
-                col_add_fstr(pinfo->cinfo, COL_INFO,
-                             "IPFIX partial flow (%u/%u bytes)",
-                             remaining, flow_len);
-        } else {
+    if (ver == 9) {
+        col_add_fstr(pinfo->cinfo, COL_INFO,
+                        "total: %u (v%u) record%s", pdus, ver,
+                        plurality(pdus, "", "s"));
+    } else if (ver == 10) {
+        gint remaining = tvb_reported_length_remaining(tvb, offset)+4;
+
+        if(remaining == flow_len)
+            col_add_fstr(pinfo->cinfo, COL_INFO, "IPFIX flow (%d bytes)", flow_len);
+        else
             col_add_fstr(pinfo->cinfo, COL_INFO,
-                         "total: %u (v%u) flow%s", pdus, ver,
-                         plurality(pdus, "", "s"));
-        }
+                            "IPFIX partial flow (%u/%u bytes)",
+                            remaining, flow_len);
+    } else {
+        col_add_fstr(pinfo->cinfo, COL_INFO,
+                        "total: %u (v%u) flow%s", pdus, ver,
+                        plurality(pdus, "", "s"));
     }
 
     /*
index 269b7ac86d037ad08ffe64be7761433b3c512586..c8ff6279438a4a47c881cbbedcb0a66b8f8a867a 100644 (file)
@@ -379,9 +379,7 @@ dissect_npmp_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *npmp
   guint8 type;
 
   type = tvb_get_guint8(message_tvb, offset_message_type);
-  if (check_col(pinfo->cinfo, COL_INFO)) {
-    col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(type, message_type_values, "Unknown NetPerfMeterProtocol type"));
-  }
+  col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(type, message_type_values, "Unknown NetPerfMeterProtocol type"));
 
   ADD_FIELD_UINT(npmp_tree, message_type);
   ADD_FIELD_UINT(npmp_tree, message_flags);
index 5e3ade0e155342aa8bb2c1b584dc76a31e266c6c..87f890defd43cfe161cc0ad79efe0d46af3baedc 100644 (file)
@@ -281,11 +281,9 @@ dissect_nettl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
             break;
          default:
             col_set_str(pinfo->cinfo, COL_PROTOCOL, "UNKNOWN");
-            if (check_col(pinfo->cinfo, COL_INFO))
-                col_add_fstr(pinfo->cinfo, COL_INFO,
-               "Unsupported nettl subsytem: %d (%s)",
+            col_add_fstr(pinfo->cinfo, COL_INFO, "Unsupported nettl subsytem: %d (%s)",
                 pinfo->pseudo_header->nettl.subsys,
-               val_to_str_const(pinfo->pseudo_header->nettl.subsys, subsystem, "Unknown"));
+                       val_to_str_const(pinfo->pseudo_header->nettl.subsys, subsystem, "Unknown"));
             call_dissector(data_handle, tvb, pinfo, tree);
       }
 }
index cbdf52f3d30ae0161ca83df3a199e03fa2440e2d..aba8f53fd68d91f7651a9bb3eee2f2578c66b258 100644 (file)
@@ -381,17 +381,13 @@ dissect_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int version, i
        offset = dissect_rpc_string(tvb,lock_tree,
                        hf_nlm_lock_caller_name, offset, NULL);
        offset = dissect_nfs3_fh(tvb, offset, pinfo, lock_tree, "fh", &fh_hash);
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, " FH:0x%08x", fh_hash);
-       }
+       col_append_fstr(pinfo->cinfo, COL_INFO, " FH:0x%08x", fh_hash);
 
        offset = dissect_rpc_data(tvb, lock_tree, hf_nlm_lock_owner, offset);
 
        svid = tvb_get_ntohl(tvb, offset);
        offset = dissect_rpc_uint32(tvb, lock_tree, hf_nlm_lock_svid, offset);
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, " svid:%d", svid);
-       }
+       col_append_fstr(pinfo->cinfo, COL_INFO, " svid:%d", svid);
 
        if (version == 4) {
                start_offset = tvb_get_ntohl(tvb, offset);
@@ -406,9 +402,7 @@ dissect_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int version, i
                offset = dissect_rpc_uint32(tvb, lock_tree, hf_nlm_lock_l_len, offset);
        }
 
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, " pos:%d-%d", start_offset, end_offset);
-       }
+       col_append_fstr(pinfo->cinfo, COL_INFO, " pos:%d-%d", start_offset, end_offset);
 
        return offset;
 }
@@ -644,9 +638,7 @@ dissect_nlm_share(tvbuff_t *tvb, int offset, packet_info *pinfo,
                        hf_nlm_lock_caller_name, offset, NULL);
 
        offset = dissect_nfs3_fh(tvb, offset, pinfo, lock_tree, "fh", &fh_hash);
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, " FH:0x%08x", fh_hash);
-       }
+       col_append_fstr(pinfo->cinfo, COL_INFO, " FH:0x%08x", fh_hash);
 
        offset = dissect_rpc_data(tvb, lock_tree, hf_nlm_lock_owner, offset);
 
@@ -666,7 +658,7 @@ dissect_nlm_shareres(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
 
        offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
        nlm_stat = tvb_get_ntohl(tvb, offset);
-       if (nlm_stat && check_col(pinfo->cinfo, COL_INFO)) {
+       if (nlm_stat) {
                col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
                    val_to_str(nlm_stat, names_nlm_stats, "Unknown Status (%u)"));
        }
@@ -685,7 +677,7 @@ dissect_nlm_freeall(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
                        hf_nlm_share_name, offset, NULL);
 
        nlm_stat = tvb_get_ntohl(tvb, offset);
-       if (nlm_stat && check_col(pinfo->cinfo, COL_INFO)) {
+       if (nlm_stat) {
                col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
                    val_to_str(nlm_stat, names_nlm_stats, "Unknown Status (%u)"));
        }
@@ -727,7 +719,7 @@ dissect_nlm_gen_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
        offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
 
        nlm_stat = tvb_get_ntohl(tvb, offset);
-       if (nlm_stat && check_col(pinfo->cinfo, COL_INFO)) {
+       if (nlm_stat) {
                col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
                    val_to_str(nlm_stat, names_nlm_stats, "Unknown Status (%u)"));
        }
index 913a9a75e11c3c71a43c6dc98eb0ba0e5998d793..f726aa440772a11b679f6b4f1c8016ab8ce0bd1a 100644 (file)
@@ -462,10 +462,9 @@ nlsp_dissect_nlsp_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
                    "Sending Router System ID: %s",
                    tvb_ether_to_str(tvb, offset));
        }
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, ", System ID: %s",
+       col_append_fstr(pinfo->cinfo, COL_INFO, ", System ID: %s",
                    tvb_ether_to_str(tvb, offset));
-       }
+
        offset += 6;
 
        if (tree) {
@@ -1023,47 +1022,38 @@ nlsp_dissect_nlsp_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
        }
        offset += 2;
 
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, ", LSP ID: %s",
+       col_append_fstr(pinfo->cinfo, COL_INFO, ", LSP ID: %s",
                    tvb_ether_to_str(tvb, offset));
-       }
-       if (tree) {
-               proto_tree_add_text(tree, tvb, offset, 6,
+
+       proto_tree_add_text(tree, tvb, offset, 6,
                    "LSP ID system ID: %s",
                    tvb_ether_to_str(tvb, offset));
-       }
+
        offset += 6;
        /* XXX - append the pseudonode ID */
-       if (tree) {
-               proto_tree_add_text(tree, tvb, offset, 1,
+       proto_tree_add_text(tree, tvb, offset, 1,
                    "LSP ID pseudonode ID: %u",
                    tvb_get_guint8(tvb, offset));
-       }
+
        offset += 1;
-       if (tree) {
-               proto_tree_add_text(tree, tvb, offset, 1,
+       proto_tree_add_text(tree, tvb, offset, 1,
                    "LSP ID LSP number: %u",
                    tvb_get_guint8(tvb, offset));
-       }
        offset += 1;
 
        sequence_number = tvb_get_ntohl(tvb, offset);
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO,
+       col_append_fstr(pinfo->cinfo, COL_INFO,
                    ", Sequence: 0x%08x, Lifetime: %us",
                    sequence_number, remaining_lifetime);
-       }
-       if (tree) {
-               proto_tree_add_uint(tree, hf_nlsp_lsp_sequence_number, tvb,
+
+       proto_tree_add_uint(tree, hf_nlsp_lsp_sequence_number, tvb,
                        offset, 4, sequence_number);
-       }
        offset += 4;
 
-       if (tree) {
-               /* XXX -> we could validate the cksum here! */
-               proto_tree_add_item(tree, hf_nlsp_lsp_checksum, tvb,
-                       offset, 2, ENC_BIG_ENDIAN );
-       }
+       /* XXX -> we could validate the cksum here! */
+       proto_tree_add_item(tree, hf_nlsp_lsp_checksum, tvb,
+               offset, 2, ENC_BIG_ENDIAN );
+
        offset += 2;
 
        if (tree) {
@@ -1258,70 +1248,49 @@ nlsp_dissect_nlsp_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
        }
        offset += 2;
 
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, ", Source ID: %s",
+       col_append_fstr(pinfo->cinfo, COL_INFO, ", Source ID: %s",
                    tvb_ether_to_str(tvb, offset));
-       }
-       if (tree) {
-               proto_tree_add_text(tree, tvb, offset, 6,
+       proto_tree_add_text(tree, tvb, offset, 6,
                    "Source ID system ID: %s",
                    tvb_ether_to_str(tvb, offset));
-       }
        offset += 6;
        /* XXX - add the pseudonode ID */
-       if (tree) {
-               proto_tree_add_text(tree, tvb, offset, 1,
+       proto_tree_add_text(tree, tvb, offset, 1,
                    "Source ID pseudonode ID: %u",
                    tvb_get_guint8(tvb, offset));
-       }
        offset += 1;
 
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, ", Start LSP ID: %s",
+       col_append_fstr(pinfo->cinfo, COL_INFO, ", Start LSP ID: %s",
                    tvb_ether_to_str(tvb, offset));
-       }
-       if (tree) {
-               proto_tree_add_text(tree, tvb, offset, 6,
+       proto_tree_add_text(tree, tvb, offset, 6,
                    "Start LSP ID source ID: %s",
                    tvb_ether_to_str(tvb, offset));
-       }
        offset += 6;
        /* XXX - append the pseudonode ID */
-       if (tree) {
-               proto_tree_add_text(tree, tvb, offset, 1,
+       proto_tree_add_text(tree, tvb, offset, 1,
                    "Start LSP ID pseudonode ID: %u",
                    tvb_get_guint8(tvb, offset));
-       }
        offset += 1;
-       if (tree) {
-               proto_tree_add_text(tree, tvb, offset, 1,
+
+       proto_tree_add_text(tree, tvb, offset, 1,
                    "Start LSP ID LSP number: %u",
                    tvb_get_guint8(tvb, offset));
-       }
        offset += 1;
 
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, ", End LSP ID: %s",
+       col_append_fstr(pinfo->cinfo, COL_INFO, ", End LSP ID: %s",
                    tvb_ether_to_str(tvb, offset));
-       }
-       if (tree) {
-               proto_tree_add_text(tree, tvb, offset, 6,
+       proto_tree_add_text(tree, tvb, offset, 6,
                    "End LSP ID source ID: %s",
                    tvb_ether_to_str(tvb, offset));
-       }
        offset += 6;
        /* XXX - append the pseudonode ID */
-       if (tree) {
-               proto_tree_add_text(tree, tvb, offset, 1,
+       proto_tree_add_text(tree, tvb, offset, 1,
                    "End LSP ID pseudonode ID: %u",
                    tvb_get_guint8(tvb, offset));
-       }
        offset += 1;
-       if (tree) {
-               proto_tree_add_text(tree, tvb, offset, 1,
+       proto_tree_add_text(tree, tvb, offset, 1,
                    "End LSP ID LSP number: %u",
                    tvb_get_guint8(tvb, offset));
-       }
        offset += 1;
 
        len = packet_length - header_length;
@@ -1373,28 +1342,20 @@ nlsp_dissect_nlsp_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
        int             len;
 
        packet_length = tvb_get_ntohs(tvb, offset);
-       if (tree) {
-               proto_tree_add_uint(tree, hf_nlsp_packet_length, tvb,
+       proto_tree_add_uint(tree, hf_nlsp_packet_length, tvb,
                        offset, 2, packet_length);
-       }
        offset += 2;
 
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_append_fstr(pinfo->cinfo, COL_INFO, ", Source ID: %s",
+       col_append_fstr(pinfo->cinfo, COL_INFO, ", Source ID: %s",
                    tvb_ether_to_str(tvb, offset));
-       }
-       if (tree) {
-               proto_tree_add_text(tree, tvb, offset, 6,
+       proto_tree_add_text(tree, tvb, offset, 6,
                    "Source ID system ID: %s",
                    tvb_ether_to_str(tvb, offset));
-       }
        offset += 6;
        /* XXX - add the pseudonode ID */
-       if (tree) {
-               proto_tree_add_text(tree, tvb, offset, 1,
+       proto_tree_add_text(tree, tvb, offset, 1,
                    "Source ID pseudonode ID: %u",
                    tvb_get_guint8(tvb, offset));
-       }
        offset += 1;
 
        len = packet_length - header_length;
@@ -1425,7 +1386,7 @@ static void
 dissect_nlsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
        proto_item *ti;
-       proto_tree *nlsp_tree = NULL;
+       proto_tree *nlsp_tree;
        int offset = 0;
        guint8 nlsp_major_version;
        guint8 nlsp_header_length;
@@ -1437,63 +1398,48 @@ dissect_nlsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
        nlsp_major_version = tvb_get_guint8(tvb, 5);
        if (nlsp_major_version != 1){
-               if (check_col(pinfo->cinfo, COL_INFO)) {
-                       col_add_fstr(pinfo->cinfo, COL_INFO,
+               col_add_fstr(pinfo->cinfo, COL_INFO,
                                "Unknown NLSP version (%u vs 1)",
                                nlsp_major_version);
-               }
+
                nlsp_dissect_unknown(tvb, tree, 0,
                        "Unknown NLSP version (%d vs 1)",
                        nlsp_major_version, 1);
                return;
        }
 
-       if (tree) {
-               ti = proto_tree_add_item(tree, proto_nlsp, tvb, 0, -1, ENC_NA);
-               nlsp_tree = proto_item_add_subtree(ti, ett_nlsp);
-       }
+       ti = proto_tree_add_item(tree, proto_nlsp, tvb, 0, -1, ENC_NA);
+       nlsp_tree = proto_item_add_subtree(ti, ett_nlsp);
 
-       if (tree) {
-               proto_tree_add_item(nlsp_tree, hf_nlsp_irpd, tvb, offset, 1,
+       proto_tree_add_item(nlsp_tree, hf_nlsp_irpd, tvb, offset, 1,
                        ENC_BIG_ENDIAN );
-       }
        offset += 1;
 
        nlsp_header_length = tvb_get_guint8(tvb, 1);
-       if (tree) {
-               proto_tree_add_uint(nlsp_tree, hf_nlsp_header_length, tvb,
+       proto_tree_add_uint(nlsp_tree, hf_nlsp_header_length, tvb,
                        offset, 1, nlsp_header_length );
-       }
        offset += 1;
 
-       if (tree) {
-               proto_tree_add_item(nlsp_tree, hf_nlsp_minor_version, tvb,
+       proto_tree_add_item(nlsp_tree, hf_nlsp_minor_version, tvb,
                        offset, 1, ENC_BIG_ENDIAN );
-       }
        offset += 1;
 
        offset += 1;    /* Reserved */
 
        packet_type_flags = tvb_get_guint8(tvb, offset);
        packet_type = packet_type_flags & PACKET_TYPE_MASK;
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_add_str(pinfo->cinfo, COL_INFO,
+       col_add_str(pinfo->cinfo, COL_INFO,
                    val_to_str(packet_type, nlsp_packet_type_vals, "Unknown (%u)"));
-       }
-       if (tree) {
-               if (packet_type == NLSP_TYPE_L1_LSP) {
-                       proto_tree_add_boolean(nlsp_tree, hf_nlsp_nr, tvb, offset, 1,
+       if (packet_type == NLSP_TYPE_L1_LSP) {
+               proto_tree_add_boolean(nlsp_tree, hf_nlsp_nr, tvb, offset, 1,
                            packet_type_flags );
-               }
-               proto_tree_add_uint(nlsp_tree, hf_nlsp_type, tvb, offset, 1,
-                   packet_type_flags );
        }
+       proto_tree_add_uint(nlsp_tree, hf_nlsp_type, tvb, offset, 1,
+                   packet_type_flags );
        offset += 1;
 
-       if (tree) {
-               proto_tree_add_item(nlsp_tree, hf_nlsp_major_version, tvb,
+       proto_tree_add_item(nlsp_tree, hf_nlsp_major_version, tvb,
                        offset, 1, ENC_BIG_ENDIAN );
-       }
        offset += 1;
 
        offset += 2;    /* Reserved */
index 0deb8bb2aeca0b122ba3e5a7b6d880349cda7163..977db1e048154ef8e3324a7ddd956146be12d0fd 100644 (file)
@@ -54,20 +54,17 @@ dissect_nntp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
        col_set_str(pinfo->cinfo, COL_PROTOCOL, "NNTP");
 
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               /*
-                * Put the first line from the buffer into the summary
-                * (but leave out the line terminator).
-                *
-                * Note that "tvb_find_line_end()" will return a value that
-                * is not longer than what's in the buffer, so the
-                * "tvb_get_ptr()" call won't throw an exception.
-                */
-               linelen = tvb_find_line_end(tvb, offset, -1, &next_offset,
-                   FALSE);
-               col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s", type,
+       /*
+        * Put the first line from the buffer into the summary
+        * (but leave out the line terminator).
+        *
+        * Note that "tvb_find_line_end()" will return a value that
+        * is not longer than what's in the buffer, so the
+        * "tvb_get_ptr()" call won't throw an exception.
+        */
+       linelen = tvb_find_line_end(tvb, offset, -1, &next_offset, FALSE);
+       col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s", type,
                    tvb_format_text(tvb, offset, linelen));
-       }
 
        if (tree) {
                ti = proto_tree_add_item(tree, proto_nntp, tvb, offset, -1,
index e4475206ec137943f00195dc8338d17cd1d0a686..885655530eacdf0cf89a10b2da50f5e07b268aaa 100644 (file)
@@ -1075,8 +1075,7 @@ static void decode_evt(proto_tree  *tree,
     proto_tree_add_item(tree, hf_noe_event, tvb, offset, 1, ENC_BIG_ENDIAN);
 
     /* add text to the frame "INFO" column */
-    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_ext_const(event, &val_str_event_ext, "Unknown"));
     /* update text of the main proto item */
     proto_item_append_text(tree, ", %s",
@@ -1120,9 +1119,7 @@ static void decode_evt(proto_tree  *tree,
             g_snprintf(key_name, 30, "\"%s\"", decode_key_name((int)unicode_value));
 
             /* add text to the frame "INFO" column */
-            if (check_col(pinfo->cinfo, COL_INFO))
-                col_append_fstr(pinfo->cinfo, COL_INFO, ": %s",
-                key_name);
+            col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", key_name);
             /* update text of the main proto item */
             proto_item_append_text(tree, ", %s",
                 key_name);
@@ -1212,8 +1209,7 @@ static void decode_mtd(proto_tree  *tree,
     proto_tree_add_item(tree, hf_noe_class, tvb, offset, 1, ENC_BIG_ENDIAN);
 
     /* add text to the frame "INFO" column */
-    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_ext_const(noe_class, &val_str_class_ext, "Unknown"));
     /* update text of the main proto item */
     proto_item_append_text(tree, ", %s",
@@ -1291,8 +1287,7 @@ static void dissect_noe(tvbuff_t    *tvb,
     server = tvb_get_guint8(tvb, offset);
 
     /* add text to the frame "INFO" column */
-    if (check_col(pinfo->cinfo, COL_INFO))
-        col_append_fstr(pinfo->cinfo, COL_INFO, " - NOE Protocol (%s)",
+    col_append_fstr(pinfo->cinfo, COL_INFO, " - NOE Protocol (%s)",
         val_to_str_const(server, servers_short_vals, "Unknown"));
 
     proto_tree_add_uint(noe_tree,
@@ -1326,8 +1321,7 @@ static void dissect_noe(tvbuff_t    *tvb,
         return;
 
     /* add text to the frame "INFO" column */
-    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_const(method, methods_vals, "Unknown"));
 
     /* update text of the main proto item */
index c839a1d8153f6129f62dd1c73b0ccddc4743fac2..48cdecbdeba1fd900a07cccd07376f5b86a59287 100644 (file)
@@ -307,11 +307,10 @@ decode_iei_cause(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
                                "Cause: %s (%#02x)",
                                val_to_str_const(cause, tab_nsip_cause_values,
                                                 "Unknown"), cause);
-    if (check_col(bi->pinfo->cinfo, COL_INFO)) {
-        col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
-            "Cause: %s",
-            val_to_str(cause, tab_nsip_cause_values, "Unknown (0x%02x)"));
-    }
+    col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
+        "Cause: %s",
+        val_to_str(cause, tab_nsip_cause_values, "Unknown (0x%02x)"));
+
     proto_item_append_text(bi->ti, ", Cause: %s",
             val_to_str(cause, tab_nsip_cause_values, "Unknown (0x%02x)"));
   }
@@ -329,10 +328,8 @@ decode_iei_ns_vci(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
                                bi->tvb, ie_start_offset, ie->total_length,
                                ns_vci,
                                "NS VCI: %#04x", ns_vci);
-    if (check_col(bi->pinfo->cinfo, COL_INFO)) {
-        col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
-            "NS VCI: %#04x", ns_vci);
-    }
+    col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
+        "NS VCI: %#04x", ns_vci);
     proto_item_append_text(bi->ti, ", NS VCI: %#04x", ns_vci);
   }
   bi->offset += ie->value_length;
@@ -366,10 +363,9 @@ decode_iei_nsei(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
   }
   bi->offset += ie->value_length;
 
-  if (check_col(bi->pinfo->cinfo, COL_INFO)) {
-    col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
+  col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
                         "NSEI %u", nsei);
-  }
+
   proto_item_append_text(bi->ti, ", NSEI %u", nsei);
 }
 
@@ -383,10 +379,8 @@ decode_iei_bvci(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
   }
   bi->offset += ie->value_length;
 
-  if (check_col(bi->pinfo->cinfo, COL_INFO)) {
-    col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
+  col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
                         "BVCI %u", bvci);
-  }
   proto_item_append_text(bi->ti, ", BVCI %u", bvci);
 }
 
@@ -536,10 +530,8 @@ decode_iei_reset_flag(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
                            bi->offset, 1,
                            flag & NSIP_MASK_RESET_FLAG);
      if (flag & NSIP_MASK_RESET_FLAG) {
-         if (check_col(bi->pinfo->cinfo, COL_INFO)) {
-           col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
+         col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
                    "Reset");
-         }
          proto_item_append_text(bi->ti, ", Reset");
      }
      proto_tree_add_uint(field_tree, hf_nsip_reset_flag_spare,
@@ -590,10 +582,8 @@ decode_iei_transaction_id(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset)
     id = tvb_get_guint8(bi->tvb, bi->offset);
     proto_tree_add_uint(bi->nsip_tree, hf_nsip_transaction_id,
                         bi->tvb, ie_start_offset, ie->total_length, id);
-    if (check_col(bi->pinfo->cinfo, COL_INFO)) {
-      col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
+    col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
               "Transaction Id: %d", id);
-    }
   }
  bi->offset += 1;
 }
@@ -651,16 +641,14 @@ decode_iei_control_bits(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
   }
   bi->offset++;
 
-  if (check_col(bi->pinfo->cinfo, COL_INFO)) {
-    if (control_bits & NSIP_MASK_CONTROL_BITS_R) {
-      col_append_sep_str(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, "Req CF");
-      proto_item_append_text(bi->ti, ", Request Change Flow");
-    }
+  if (control_bits & NSIP_MASK_CONTROL_BITS_R) {
+    col_append_sep_str(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, "Req CF");
+    proto_item_append_text(bi->ti, ", Request Change Flow");
+  }
 
-    if (control_bits & NSIP_MASK_CONTROL_BITS_C) {
-      col_append_sep_str(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, "Conf CF");
-      proto_item_append_text(bi->ti, ", Confirm Change Flow");
-    }
+  if (control_bits & NSIP_MASK_CONTROL_BITS_C) {
+    col_append_sep_str(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, "Conf CF");
+    proto_item_append_text(bi->ti, ", Confirm Change Flow");
   }
 }
 
index 831738d77f55d72533de8895984d42982316c55c..cea56b79f76c0ac397a02a5bad6f808f7efc5f8e 100644 (file)
@@ -172,8 +172,7 @@ dissect_pgsql(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     /* cv = find_or_create_conversation(pinfo); */
 
     col_set_str(pinfo->cinfo, COL_PROTOCOL, "PGSQL");
-    if (check_col(pinfo->cinfo, COL_INFO))
-        col_set_str(pinfo->cinfo, COL_INFO,
+    col_set_str(pinfo->cinfo, COL_INFO,
                     (pinfo->match_uint == pinfo->destport) ?
                      ">" : "<");
 
index 664017d5e9489a244d3bb27151e30c577b493f7a..99e75067f22a840d2ea0fd82cbbdf9a27994f872 100644 (file)
@@ -1926,13 +1926,11 @@ dissect_q933(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                offset += call_ref_len;
        }
        message_type = tvb_get_guint8(tvb, offset);
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_add_str(pinfo->cinfo, COL_INFO,
+       col_add_str(pinfo->cinfo, COL_INFO,
                    val_to_str(message_type, q933_message_type_vals,
                      "Unknown message type (0x%02X)"));
-       }
-       if (q933_tree != NULL)
-               proto_tree_add_uint(q933_tree, hf_q933_message_type, tvb, offset, 1, message_type);
+
+       proto_tree_add_uint(q933_tree, hf_q933_message_type, tvb, offset, 1, message_type);
        offset += 1;
 
        /*
index 1be3219c118f127580c3015d24af4ec554796288..c23e8ea1cc71753f656a344e33a08232712642e2 100644 (file)
@@ -504,9 +504,8 @@ dissect_starteam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     if(tvb_get_ntohl(tvb, offset + 0) == STARTEAM_MAGIC){
       /* This packet is a response */
       bRequest = FALSE;
-      if(check_col(pinfo->cinfo, COL_INFO)){
-        col_append_fstr(pinfo->cinfo, COL_INFO, "Reply: %d bytes", tvb_length(tvb));
-      }
+      col_append_fstr(pinfo->cinfo, COL_INFO, "Reply: %d bytes", tvb_length(tvb));
+
     } else if(tvb_length_remaining(tvb, offset) >= 28 && tvb_get_ntohl(tvb, offset + 20) == STARTEAM_MAGIC){
       /* This packet is a request */
       bRequest = TRUE;
index de8c8dd4e07265187e7a6e4bae7480d19c27e3c7..0eb241805c9a48dc972d7de35c6d6c12866e48d7 100644 (file)
@@ -381,8 +381,7 @@ dissect_tr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
        frame_type = (trh->fc & 192) >> 6;
 
-       if (check_col(pinfo->cinfo, COL_INFO))
-               col_add_fstr(pinfo->cinfo, COL_INFO, "Token-Ring %s", fc[frame_type]);
+       col_add_fstr(pinfo->cinfo, COL_INFO, "Token-Ring %s", fc[frame_type]);
 
        trn_rif_bytes = tvb_get_guint8(tr_tvb, 14) & 31;
 
index 93145c3e4ed1ebf108195b492b7f253e98cf64b9..b6d53049d9af459173f2ae59264fbb4cecfb7688 100644 (file)
@@ -1902,10 +1902,8 @@ dissect_usb_setup_get_descriptor_request(packet_info *pinfo, proto_tree *tree,
     proto_tree_add_item(tree, hf_usb_bDescriptorType, tvb, offset, 1, ENC_LITTLE_ENDIAN);
     usb_trans_info->u.get_descriptor.type = tvb_get_guint8(tvb, offset);
     offset += 1;
-    if (check_col(pinfo->cinfo, COL_INFO)) {
-        col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
-            val_to_str_ext(usb_trans_info->u.get_descriptor.type, &descriptor_type_vals_ext, "Unknown type %u"));
-    }
+    col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
+        val_to_str_ext(usb_trans_info->u.get_descriptor.type, &descriptor_type_vals_ext, "Unknown type %u"));
 
     /* language id */
     proto_tree_add_item(tree, hf_usb_language_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
@@ -1926,10 +1924,9 @@ dissect_usb_setup_get_descriptor_response(packet_info *pinfo, proto_tree *tree,
                                           guint bus_id, guint device_address)
 {
 
-    if (check_col(pinfo->cinfo, COL_INFO)) {
-        col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
-            val_to_str_ext(usb_trans_info->u.get_descriptor.type, &descriptor_type_vals_ext, "Unknown type %u"));
-    }
+    col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
+        val_to_str_ext(usb_trans_info->u.get_descriptor.type, &descriptor_type_vals_ext, "Unknown type %u"));
+
     switch(usb_trans_info->u.get_descriptor.type) {
     case USB_DT_DEVICE:
         offset = dissect_usb_device_descriptor(pinfo, tree, tvb, offset, usb_trans_info, bus_id, device_address);
@@ -2400,13 +2397,11 @@ dissect_linux_usb_pseudo_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
         isprint(type) ? type : '.');
     proto_tree_add_item(tree, hf_usb_transfer_type, tvb, 9, 1, ENC_BIG_ENDIAN);
 
-    if (check_col(pinfo->cinfo, COL_INFO)) {
-        transfer_type   = tvb_get_guint8(tvb, 9);
-        endpoint_number = tvb_get_guint8(tvb, 10);
-        transfer_type_and_direction = (transfer_type & 0x7F) | (endpoint_number & 0x80);
-        col_append_str(pinfo->cinfo, COL_INFO,
-                       val_to_str(transfer_type_and_direction, usb_transfer_type_and_direction_vals, "Unknown type %x"));
-    }
+    transfer_type   = tvb_get_guint8(tvb, 9);
+    endpoint_number = tvb_get_guint8(tvb, 10);
+    transfer_type_and_direction = (transfer_type & 0x7F) | (endpoint_number & 0x80);
+    col_append_str(pinfo->cinfo, COL_INFO,
+                    val_to_str(transfer_type_and_direction, usb_transfer_type_and_direction_vals, "Unknown type %x"));
 
     proto_tree_add_bitmask(tree, tvb, 10, hf_usb_endpoint_number, ett_usb_endpoint, usb_endpoint_fields, ENC_BIG_ENDIAN);
     proto_tree_add_item(tree, hf_usb_device_address, tvb, 11, 1, ENC_BIG_ENDIAN);
@@ -2828,10 +2823,8 @@ dissect_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent,
                     proto_tree_add_item(setup_tree, hf_usb_request, tvb, offset, 1, ENC_LITTLE_ENDIAN);
                     offset += 1;
 
-                    if (check_col(pinfo->cinfo, COL_INFO)) {
-                        col_add_fstr(pinfo->cinfo, COL_INFO, "%s Request",
-                             val_to_str(usb_trans_info->setup.request, setup_request_names_vals, "Unknown type %x"));
-                    }
+                    col_add_fstr(pinfo->cinfo, COL_INFO, "%s Request",
+                            val_to_str(usb_trans_info->setup.request, setup_request_names_vals, "Unknown type %x"));
 
                     dissector = NULL;
                     for(tmp = setup_request_dissectors;tmp->dissector;tmp++) {
@@ -3010,11 +3003,9 @@ dissect_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent,
                      * This is a standard response which is managed by this
                      * dissector
                      */
-                    if (check_col(pinfo->cinfo, COL_INFO)) {
-                        col_add_fstr(pinfo->cinfo, COL_INFO, "%s Response",
-                            val_to_str(usb_conv_info->usb_trans_info->setup.request,
-                                setup_request_names_vals, "Unknown type %x"));
-                    }
+                    col_add_fstr(pinfo->cinfo, COL_INFO, "%s Response",
+                        val_to_str(usb_conv_info->usb_trans_info->setup.request,
+                            setup_request_names_vals, "Unknown type %x"));
 
                     dissector = NULL;
                     for(tmp = setup_response_dissectors;tmp->dissector;tmp++) {
index bef0fada79c24bcee4dcb3ba3b82a4f85167bfb3..3a187a4ec9cb9958f6f756bb9f860f4ba78ce888 100644 (file)
@@ -390,8 +390,7 @@ dissect_vines_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        col_clear(pinfo->cinfo, COL_INFO);
 
        ptype = tvb_get_guint8(tvb, 0);
-       if (check_col(pinfo->cinfo, COL_INFO))
-               col_add_str(pinfo->cinfo, COL_INFO,
+       col_add_str(pinfo->cinfo, COL_INFO,
                    val_to_str(ptype, vines_llc_ptype_vals,
                      "Unknown protocol 0x%02x"));
        if (tree) {
@@ -488,11 +487,9 @@ dissect_vines_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        vip_tctl = tvb_get_guint8(tvb, offset+3);
        vip_proto = tvb_get_guint8(tvb, offset+4);
 
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_add_fstr(pinfo->cinfo, COL_INFO, "%s (0x%02x)",
+       col_add_fstr(pinfo->cinfo, COL_INFO, "%s (0x%02x)",
                        val_to_str_const(vip_tctl, proto_vals, "Unknown VIP protocol"), 
                        vip_tctl);
-       }
 
        src_addr = tvb_get_ptr(tvb, offset+12, VINES_ADDR_LEN);
        SET_ADDRESS(&pinfo->net_src, AT_VINES, VINES_ADDR_LEN, src_addr);
@@ -758,19 +755,18 @@ dissect_vines_ipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        viph.vipc_err_len = g_ntohs(viph.vipc_err_len);
 
        col_set_str(pinfo->cinfo, COL_PROTOCOL, "Vines IPC");
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               switch (viph.vipc_pkttype) {
+       switch (viph.vipc_pkttype) {
 
-               case PKTTYPE_DGRAM:
-                       col_add_fstr(pinfo->cinfo, COL_INFO,
+       case PKTTYPE_DGRAM:
+               col_add_fstr(pinfo->cinfo, COL_INFO,
                                     "%s D=%04x S=%04x",
                                     val_to_str(viph.vipc_pkttype, pkttype_vals,
                                         "Unknown packet type (0x%02x)"),
                                     viph.vipc_dport, viph.vipc_sport);
-                       break;
+               break;
 
-               case PKTTYPE_ERR:
-                       col_add_fstr(pinfo->cinfo, COL_INFO,
+       case PKTTYPE_ERR:
+               col_add_fstr(pinfo->cinfo, COL_INFO,
                                     "%s NS=%u NR=%u Err=%s RID=%04x LID=%04x D=%04x S=%04x",
                                     val_to_str(viph.vipc_pkttype, pkttype_vals,
                                         "Unknown packet type (0x%02x)"),
@@ -779,10 +775,10 @@ dissect_vines_ipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                                         vipc_err_vals, "Unknown (%u)"),
                                     viph.vipc_rmtid, viph.vipc_lclid,
                                     viph.vipc_dport, viph.vipc_sport);
-                       break;
+               break;
 
-               default:
-                       col_add_fstr(pinfo->cinfo, COL_INFO,
+       default:
+               col_add_fstr(pinfo->cinfo, COL_INFO,
                                     "%s NS=%u NR=%u Len=%u RID=%04x LID=%04x D=%04x S=%04x",
                                     val_to_str(viph.vipc_pkttype, pkttype_vals,
                                         "Unknown packet type (0x%02x)"),
@@ -790,8 +786,7 @@ dissect_vines_ipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                                     viph.vipc_err_len, viph.vipc_rmtid,
                                     viph.vipc_lclid, viph.vipc_dport,
                                     viph.vipc_sport);
-                       break;
-               }
+               break;
        }
 
        ti = proto_tree_add_item(tree, proto_vines_ipc, tvb, offset,
@@ -975,8 +970,7 @@ dissect_vines_spp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        viph.vspp_win = g_ntohs(viph.vspp_win);
 
        col_set_str(pinfo->cinfo, COL_PROTOCOL, "Vines SPP");
-       if (check_col(pinfo->cinfo, COL_INFO))
-               col_add_fstr(pinfo->cinfo, COL_INFO,
+       col_add_fstr(pinfo->cinfo, COL_INFO,
                             "%s NS=%u NR=%u Window=%u RID=%04x LID=%04x D=%04x S=%04x",
                             val_to_str(viph.vspp_pkttype, pkttype_vals,
                                 "Unknown packet type (0x%02x)"),
@@ -1182,31 +1176,25 @@ dissect_vines_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                 */
                col_set_str(pinfo->cinfo, COL_PROTOCOL, "Vines SARP");
                packet_type = tvb_get_guint8(tvb, 1);
-               if (check_col(pinfo->cinfo, COL_INFO)) {
-                       col_add_str(pinfo->cinfo, COL_INFO,
+               col_add_str(pinfo->cinfo, COL_INFO,
                            val_to_str(packet_type, vines_arp_packet_type_vals,
                              "Unknown (0x%02x)"));
-               }
-               if (tree) {
-                       proto_tree_add_text(vines_arp_tree, tvb, 1, 1,
+
+               proto_tree_add_text(vines_arp_tree, tvb, 1, 1,
                                            "Packet Type: %s (0x%02x)",
                                            val_to_str_const(packet_type,
                                              vines_arp_packet_type_vals,
                                              "Unknown"),
                                            packet_type);
-               }
+
                if (packet_type == VARP_ASSIGNMENT_RESP) {
-                       if (check_col(pinfo->cinfo, COL_INFO)) {
-                               col_append_fstr(pinfo->cinfo, COL_INFO,
+                       col_append_fstr(pinfo->cinfo, COL_INFO,
                                            ", Address = %s",
                                            tvb_vines_addr_to_str(tvb, 2));
-                       }
-                       if (tree) {
-                               proto_tree_add_text(vines_arp_tree, tvb, 2,
+                       proto_tree_add_text(vines_arp_tree, tvb, 2,
                                                    VINES_ADDR_LEN,
                                                    "Address: %s",
                                                    tvb_vines_addr_to_str(tvb, 2));
-                       }
                }
                if (tree) {
                        proto_tree_add_text(vines_arp_tree, tvb,
@@ -1224,31 +1212,25 @@ dissect_vines_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                 * Non-sequenced ARP.
                 */
                packet_type = (guint8) tvb_get_ntohs(tvb, 0);
-               if (check_col(pinfo->cinfo, COL_INFO)) {
-                       col_add_str(pinfo->cinfo, COL_INFO,
+               col_add_str(pinfo->cinfo, COL_INFO,
                            val_to_str(packet_type, vines_arp_packet_type_vals,
                              "Unknown (0x%02x)"));
-               }
-               if (tree) {
-                       proto_tree_add_text(vines_arp_tree, tvb, 0, 2,
+               proto_tree_add_text(vines_arp_tree, tvb, 0, 2,
                                            "Packet Type: %s (0x%04x)",
                                            val_to_str_const(packet_type,
                                              vines_arp_packet_type_vals,
                                              "Unknown"),
                                            packet_type);
-               }
+
                if (packet_type == VARP_ASSIGNMENT_RESP) {
-                       if (check_col(pinfo->cinfo, COL_INFO)) {
-                               col_append_fstr(pinfo->cinfo, COL_INFO,
+                       col_append_fstr(pinfo->cinfo, COL_INFO,
                                            ", Address = %s",
                                            tvb_vines_addr_to_str(tvb, 2));
-                       }
-                       if (tree) {
-                               proto_tree_add_text(vines_arp_tree, tvb, 2,
+
+                       proto_tree_add_text(vines_arp_tree, tvb, 2,
                                                    VINES_ADDR_LEN,
                                                    "Address: %s",
                                                    tvb_vines_addr_to_str(tvb, 2));
-                       }
                }
        }
 }
@@ -1356,11 +1338,10 @@ dissect_vines_rtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                 * Non-sequenced RTP.
                 */
                operation_type = tvb_get_guint8(tvb, offset);
-               if (check_col(pinfo->cinfo, COL_INFO)) {
-                       col_add_str(pinfo->cinfo, COL_INFO,
+               col_add_str(pinfo->cinfo, COL_INFO,
                            val_to_str(operation_type, vines_rtp_operation_type_vals,
                              "Unknown (0x%02x)"));
-               }
+
                if (tree) {
                        proto_tree_add_text(vines_rtp_tree, tvb, offset, 1,
                                            "Operation Type: %s (0x%02x)",
@@ -1450,11 +1431,10 @@ dissect_vines_rtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                }
                offset += 2;
                operation_type = tvb_get_guint8(tvb, offset);
-               if (check_col(pinfo->cinfo, COL_INFO)) {
-                       col_add_str(pinfo->cinfo, COL_INFO,
+               col_add_str(pinfo->cinfo, COL_INFO,
                            val_to_str(operation_type, vines_rtp_operation_type_vals,
                              "Unknown (0x%02x)"));
-               }
+
                if (tree) {
                        proto_tree_add_text(vines_rtp_tree, tvb, offset, 1,
                                            "Operation Type: %s (0x%02x)",
@@ -1894,50 +1874,39 @@ dissect_vines_icp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        }
 
        packet_type = tvb_get_ntohs(tvb, offset);
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               col_add_str(pinfo->cinfo, COL_INFO,
+       col_add_str(pinfo->cinfo, COL_INFO,
                    val_to_str(packet_type, vines_icp_packet_type_vals,
                      "Unknown (0x%02x)"));
-       }
-       if (tree) {
-               proto_tree_add_text(vines_icp_tree, tvb, offset, 2,
+
+       proto_tree_add_text(vines_icp_tree, tvb, offset, 2,
                                    "Packet Type: %s (0x%04x)",
                                    val_to_str_const(packet_type,
                                      vines_icp_packet_type_vals,
                                      "Unknown"),
                                    packet_type);
-       }
        offset += 2;
 
        switch (packet_type) {
 
        case VICP_EXCEPTION_NOTIFICATION:
                exception_code = tvb_get_ntohs(tvb, offset);
-               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(exception_code, vipc_err_vals,
                                "Unknown exception code (%u)"));
-               }
-               if (tree) {
-                       proto_tree_add_text(vines_icp_tree, tvb, offset, 2,
+               proto_tree_add_text(vines_icp_tree, tvb, offset, 2,
                                            "Exception Code: %s (%u)",
                                            val_to_str_const(exception_code,
                                              vipc_err_vals,
                                              "Unknown"),
                                            exception_code);
-               }
                break;
 
        case VICP_METRIC_NOTIFICATION:
                metric = tvb_get_ntohs(tvb, offset);
-               if (check_col(pinfo->cinfo, COL_INFO)) {
-                       col_append_fstr(pinfo->cinfo, COL_INFO, ", metric %u",
+               col_append_fstr(pinfo->cinfo, COL_INFO, ", metric %u",
                            metric);
-               }
-               if (tree) {
-                       proto_tree_add_text(vines_icp_tree, tvb, offset, 2,
+               proto_tree_add_text(vines_icp_tree, tvb, offset, 2,
                                            "Metric: %u", metric);
-               }
                break;
        }
        offset += 2;
index 9d69b6b6bf0a26600b900c15192190fd3db92da2..c531d1f40645b1f682ac51f0e712925c72271240 100644 (file)
@@ -153,10 +153,6 @@ dissect_wol(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
    at the list of packets can tell what type of packet it is. See section 1.5
    for more information.
 
-   Before changing the contents of a column you should make sure the column is
-   active by calling "check_col(pinfo->cinfo, COL_*)". If it is not active
-   don't bother setting it.
-
    If you are setting the column to a constant string, use "col_set_str()",
    as it's more efficient than the other "col_set_XXX()" calls.
 
@@ -178,18 +174,15 @@ dissect_wol(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
 
    */
 
-    if ( check_col(pinfo->cinfo, COL_INFO) )
-    {
-        col_add_fstr(pinfo->cinfo, COL_INFO, "MagicPacket for %s (%s)",
-            get_ether_name(mac), ether_to_str(mac));
+    col_add_fstr(pinfo->cinfo, COL_INFO, "MagicPacket for %s (%s)",
+        get_ether_name(mac), ether_to_str(mac));
 
-        /* NOTE: ether-wake uses a dotted-decimal format for specifying a
-         * 4-byte password or an Ethernet mac address format for specifying
-         * a 6-byte password, so display them in that format, even if the
-         * password isn't really an IP or MAC address. */
-        if ( passwd )
-            col_append_fstr(pinfo->cinfo, COL_INFO, ", password %s", passwd);
-    }
+    /* NOTE: ether-wake uses a dotted-decimal format for specifying a
+        * 4-byte password or an Ethernet mac address format for specifying
+        * a 6-byte password, so display them in that format, even if the
+        * password isn't really an IP or MAC address. */
+    if ( passwd )
+        col_append_fstr(pinfo->cinfo, COL_INFO, ", password %s", passwd);
 
 /* A protocol dissector can be called in 2 different ways: