diff options
author | Anders Broman <anders.broman@ericsson.com> | 2010-04-05 20:04:52 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2010-04-05 20:04:52 +0000 |
commit | 7cfa27b04bc8564d8f2c747e7f78fe55bfa67de3 (patch) | |
tree | 486aa000656218e8390a9a31345c7d45e33cc062 /plugins/ethercat | |
parent | a5b180a3a84b778bf361b86bb71d987885a02cf4 (diff) |
Get rid of a bunch of check_col().
svn path=/trunk/; revision=32388
Diffstat (limited to 'plugins/ethercat')
-rw-r--r-- | plugins/ethercat/packet-ams.c | 13 | ||||
-rw-r--r-- | plugins/ethercat/packet-ecatmb.c | 32 | ||||
-rw-r--r-- | plugins/ethercat/packet-ethercat-datagram.c | 3 | ||||
-rw-r--r-- | plugins/ethercat/packet-ethercat-frame.c | 7 | ||||
-rw-r--r-- | plugins/ethercat/packet-ioraw.c | 3 | ||||
-rw-r--r-- | plugins/ethercat/packet-nv.c | 3 |
6 files changed, 21 insertions, 40 deletions
diff --git a/plugins/ethercat/packet-ams.c b/plugins/ethercat/packet-ams.c index ca9653ade6..4793e813ad 100644 --- a/plugins/ethercat/packet-ams.c +++ b/plugins/ethercat/packet-ams.c @@ -822,14 +822,11 @@ static void dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } else { - if (check_col(pinfo->cinfo, COL_INFO)) - { - if ( (stateflags & AMSCMDSF_RESPONSE) == 0 ) - col_append_str(pinfo->cinfo, COL_INFO, "AMS Request"); - else - col_append_str(pinfo->cinfo, COL_INFO, "AMS Response"); - } - if( tree && ams_length-offset > 0 ) + if ( (stateflags & AMSCMDSF_RESPONSE) == 0 ) + col_append_str(pinfo->cinfo, COL_INFO, "AMS Request"); + else + col_append_str(pinfo->cinfo, COL_INFO, "AMS Response"); + if( tree && ams_length-offset > 0 ) proto_tree_add_item(ams_tree, hf_ams_data, tvb, offset, ams_length-offset, TRUE); } diff --git a/plugins/ethercat/packet-ecatmb.c b/plugins/ethercat/packet-ecatmb.c index 37b549c30a..fa46ea5f38 100644 --- a/plugins/ethercat/packet-ecatmb.c +++ b/plugins/ethercat/packet-ecatmb.c @@ -637,8 +637,7 @@ static void dissect_ecat_coe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro init_sdo_header(&sdo, tvb, offset); CANopenSdoReqFormatter(&sdo, szText, nMax); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_str(pinfo->cinfo, COL_INFO, szText); + col_append_str(pinfo->cinfo, COL_INFO, szText); if( tree ) { @@ -727,8 +726,7 @@ static void dissect_ecat_coe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro init_sdo_header(&sdo, tvb, offset); CANopenSdoResFormatter(&sdo, szText, nMax); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_str(pinfo->cinfo, COL_INFO, szText); + col_append_str(pinfo->cinfo, COL_INFO, szText); if( tree ) { @@ -805,8 +803,7 @@ static void dissect_ecat_coe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro init_sdo_info_header(&info, tvb, offset); CANopenSdoInfoFormatter(&info, szText, nMax); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_str(pinfo->cinfo, COL_INFO, szText); + col_append_str(pinfo->cinfo, COL_INFO, szText); if( tree ) { @@ -940,8 +937,7 @@ static void dissect_ecat_soe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro if( soe_length >= ETHERCAT_SOE_HEADER_LEN ) { SoeFormatter(tvb, offset, szText, nMax, soe_length); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_str(pinfo->cinfo, COL_INFO, szText); + col_append_str(pinfo->cinfo, COL_INFO, szText); if( tree ) { @@ -1034,14 +1030,11 @@ static void dissect_ecat_eoe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro { ETHERCAT_EOE_HEADER eoe; init_eoe_header(&eoe, tvb, offset); - if (check_col(pinfo->cinfo, COL_INFO)) - { - if ( eoe.anEoeHeaderInfoUnion.v.Type == EOE_TYPE_FRAME_FRAG ) - g_snprintf ( szText, nMax, "EoE-Frag %d", eoe.anEoeHeaderDataUnion.v.Fragment); - else - g_snprintf ( szText, nMax, "EoE"); + if ( eoe.anEoeHeaderInfoUnion.v.Type == EOE_TYPE_FRAME_FRAG ) + g_snprintf ( szText, nMax, "EoE-Frag %d", eoe.anEoeHeaderDataUnion.v.Fragment); + else + g_snprintf ( szText, nMax, "EoE"); col_append_str(pinfo->cinfo, COL_INFO, szText); - } { ecat_eoe_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_eoe); @@ -1177,11 +1170,9 @@ static void dissect_ecat_eoe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro } } - if (check_col(pinfo->cinfo, COL_INFO)) - col_prepend_fstr(pinfo->cinfo, COL_INFO, "EoE("); + col_prepend_fstr(pinfo->cinfo, COL_INFO, "EoE("); - if (check_col(pinfo->cinfo, COL_PROTOCOL)) - col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "EoE-"); + col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "EoE-"); } else { @@ -1211,8 +1202,7 @@ static void dissect_ecat_foe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro if( foe_length >= ETHERCAT_FOE_HEADER_LEN ) { FoeFormatter(tvb, offset, szText, nMax, foe_length); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_str(pinfo->cinfo, COL_INFO, szText); + col_append_str(pinfo->cinfo, COL_INFO, szText); if( tree ) { diff --git a/plugins/ethercat/packet-ethercat-datagram.c b/plugins/ethercat/packet-ethercat-datagram.c index cc577ccd89..564c100462 100644 --- a/plugins/ethercat/packet-ethercat-datagram.c +++ b/plugins/ethercat/packet-ethercat-datagram.c @@ -485,8 +485,7 @@ static void dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree datagram_padding_bytes = datagram_length - ecLength; EcSummaryFormater(ecLength, tvb, offset, szText, nMax); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_str(pinfo->cinfo, COL_INFO, szText); + col_append_str(pinfo->cinfo, COL_INFO, szText); if( tree ) { diff --git a/plugins/ethercat/packet-ethercat-frame.c b/plugins/ethercat/packet-ethercat-frame.c index b17af4afae..9ef143b9dc 100644 --- a/plugins/ethercat/packet-ethercat-frame.c +++ b/plugins/ethercat/packet-ethercat-frame.c @@ -97,12 +97,9 @@ static void dissect_ethercat_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree if (!dissector_try_port(ethercat_frame_dissector_table, hdr.v.protocol, next_tvb, pinfo, tree)) { - if (check_col (pinfo->cinfo, COL_PROTOCOL)) - { - col_add_fstr (pinfo->cinfo, COL_PROTOCOL, "0x%04x", hdr.v.protocol); - } + col_add_fstr (pinfo->cinfo, COL_PROTOCOL, "0x%04x", hdr.v.protocol); /* No sub dissector wanted to handle this payload, decode it as general - data instead. */ + data instead. */ call_dissector (ethercat_frame_data_handle, next_tvb, pinfo, tree); } } diff --git a/plugins/ethercat/packet-ioraw.c b/plugins/ethercat/packet-ioraw.c index 5f25db6c7c..cc1cf59a56 100644 --- a/plugins/ethercat/packet-ioraw.c +++ b/plugins/ethercat/packet-ioraw.c @@ -67,8 +67,7 @@ static void dissect_ioraw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) IoRawSummaryFormater(szText, nMax); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_str(pinfo->cinfo, COL_INFO, szText); + col_append_str(pinfo->cinfo, COL_INFO, szText); if (tree) { diff --git a/plugins/ethercat/packet-nv.c b/plugins/ethercat/packet-nv.c index 171d941871..6fee4f589e 100644 --- a/plugins/ethercat/packet-nv.c +++ b/plugins/ethercat/packet-nv.c @@ -107,8 +107,7 @@ static void dissect_nv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_clear(pinfo->cinfo, COL_INFO); NvSummaryFormater(tvb, offset, szText, nMax); - if (check_col(pinfo->cinfo, COL_INFO)) - col_append_str(pinfo->cinfo, COL_INFO, szText); + col_append_str(pinfo->cinfo, COL_INFO, szText); if (tree) { |