aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-06-14 19:46:54 +0000
committerMichael Mann <mmann78@netscape.net>2013-06-14 19:46:54 +0000
commitf42e5bc9c0eb6c0e228018711694c80cdc5bc5c1 (patch)
treec84185fcaa21ac4b694206b5d263a78a22bea491 /epan/dissectors
parentc5d092ec3a228d55fcedd88d86f78006abbd7064 (diff)
Remove check_col() and the occasional tree.
This leaves just the Pidl dissectors remaining for removal of check_col() in the dissectors directory. A small handful of check_col() calls remain outside of the dissectors. svn path=/trunk/; revision=49941
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-arp.c120
-rw-r--r--epan/dissectors/packet-brp.c10
-rw-r--r--epan/dissectors/packet-dns.c25
-rw-r--r--epan/dissectors/packet-nasdaq-itch.c91
-rw-r--r--epan/dissectors/packet-nbns.c21
-rw-r--r--epan/dissectors/packet-ncp2222.inc135
-rw-r--r--epan/dissectors/packet-pcap.c7
-rw-r--r--epan/dissectors/packet-pgsql.c15
-rw-r--r--epan/dissectors/packet-wassp.c18
-rw-r--r--epan/dissectors/packet-wsp.c40
-rw-r--r--epan/dissectors/packet-wtp.c33
-rw-r--r--epan/dissectors/packet-x11.c38
-rw-r--r--epan/dissectors/packet-x224.c4
-rw-r--r--epan/dissectors/packet-x29.c5
-rw-r--r--epan/dissectors/packet-xcsl.c22
-rw-r--r--epan/dissectors/packet-xdmcp.c11
-rw-r--r--epan/dissectors/packet-xmcp.c34
-rw-r--r--epan/dissectors/packet-xmpp-core.c6
-rw-r--r--epan/dissectors/packet-xot.c7
-rw-r--r--epan/dissectors/packet-xtp.c31
-rw-r--r--epan/dissectors/packet-xyplex.c20
-rw-r--r--epan/dissectors/packet-yhoo.c4
-rw-r--r--epan/dissectors/packet-ymsg.c4
-rw-r--r--epan/dissectors/packet-ypserv.c33
-rw-r--r--epan/dissectors/packet-zbee-zcl.c18
-rw-r--r--epan/dissectors/packet-zbee-zdp.c8
-rw-r--r--epan/dissectors/packet-zebra.c5
-rw-r--r--epan/dissectors/packet-zep.c14
28 files changed, 296 insertions, 483 deletions
diff --git a/epan/dissectors/packet-arp.c b/epan/dissectors/packet-arp.c
index 2c6e5e5aae..490b0298e3 100644
--- a/epan/dissectors/packet-arp.c
+++ b/epan/dissectors/packet-arp.c
@@ -1252,28 +1252,26 @@ dissect_ax25arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
was padding. */
tvb_set_reported_length(tvb, tot_len);
- if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
- switch (ar_op) {
+ switch (ar_op) {
- case ARPOP_REQUEST:
- if (global_arp_detect_request_storm)
- request_seen(pinfo);
+ case ARPOP_REQUEST:
+ if (global_arp_detect_request_storm)
+ request_seen(pinfo);
/* fall-through */
- case ARPOP_REPLY:
- default:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "ARP");
- break;
+ case ARPOP_REPLY:
+ default:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "ARP");
+ break;
- case ARPOP_RREQUEST:
- case ARPOP_RREPLY:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "RARP");
- break;
+ case ARPOP_RREQUEST:
+ case ARPOP_RREPLY:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "RARP");
+ break;
- case ARPOP_IREQUEST:
- case ARPOP_IREPLY:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "Inverse ARP");
- break;
- }
+ case ARPOP_IREQUEST:
+ case ARPOP_IREPLY:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "Inverse ARP");
+ break;
}
/* Get the offsets of the addresses. */
@@ -1286,12 +1284,6 @@ dissect_ax25arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Target Protocol Address */
tpa_offset = tha_offset + ar_hln;
- if (!tree && !check_col(pinfo->cinfo, COL_INFO)) {
- /* We're not building a protocol tree and we're not setting the Info
- column, so we don't have any more work to do. */
- return;
- }
-
/* sha_val = tvb_get_ptr(tvb, sha_offset, ar_hln); */
spa_val = tvb_get_ptr(tvb, spa_offset, ar_pln);
/* tha_val = tvb_get_ptr(tvb, tha_offset, ar_hln); */
@@ -1309,51 +1301,49 @@ dissect_ax25arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
is_gratuitous = FALSE;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- switch (ar_op) {
- case ARPOP_REQUEST:
- if (is_gratuitous)
+ switch (ar_op) {
+ case ARPOP_REQUEST:
+ if (is_gratuitous)
col_add_fstr(pinfo->cinfo, COL_INFO, "Gratuitous ARP for %s (Request)",
arpproaddr_to_str(tpa_val, ar_pln, ar_pro));
- else
- col_add_fstr(pinfo->cinfo, COL_INFO, "Who has %s? Tell %s",
- arpproaddr_to_str(tpa_val, ar_pln, ar_pro),
- arpproaddr_to_str(spa_val, ar_pln, ar_pro));
- break;
- case ARPOP_REPLY:
- if (is_gratuitous)
- col_add_fstr(pinfo->cinfo, COL_INFO, "Gratuitous ARP for %s (Reply)",
- arpproaddr_to_str(spa_val, ar_pln, ar_pro));
- else
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s is at %s",
- arpproaddr_to_str(spa_val, ar_pln, ar_pro),
-/* arphrdaddr_to_str(sha_val, ar_hln, ar_hrd)); */
- tvb_arphrdaddr_to_str(tvb, sha_offset, ar_hln, ar_hrd));
- break;
- case ARPOP_RREQUEST:
- case ARPOP_IREQUEST:
- col_add_fstr(pinfo->cinfo, COL_INFO, "Who is %s? Tell %s",
-/* arphrdaddr_to_str(tha_val, ar_hln, ar_hrd), */
- tvb_arphrdaddr_to_str(tvb, tha_offset, ar_hln, ar_hrd),
+ else
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Who has %s? Tell %s",
+ arpproaddr_to_str(tpa_val, ar_pln, ar_pro),
+ arpproaddr_to_str(spa_val, ar_pln, ar_pro));
+ break;
+ case ARPOP_REPLY:
+ if (is_gratuitous)
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Gratuitous ARP for %s (Reply)",
+ arpproaddr_to_str(spa_val, ar_pln, ar_pro));
+ else
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s is at %s",
+ arpproaddr_to_str(spa_val, ar_pln, ar_pro),
/* arphrdaddr_to_str(sha_val, ar_hln, ar_hrd)); */
tvb_arphrdaddr_to_str(tvb, sha_offset, ar_hln, ar_hrd));
- break;
- case ARPOP_RREPLY:
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s is at %s",
-/* arphrdaddr_to_str(tha_val, ar_hln, ar_hrd), */
- tvb_arphrdaddr_to_str(tvb, tha_offset, ar_hln, ar_hrd),
- arpproaddr_to_str(tpa_val, ar_pln, ar_pro));
- break;
- case ARPOP_IREPLY:
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s is at %s",
-/* arphrdaddr_to_str(sha_val, ar_hln, ar_hrd), */
- tvb_arphrdaddr_to_str(tvb, sha_offset, ar_hln, ar_hrd),
- arpproaddr_to_str(spa_val, ar_pln, ar_pro));
- break;
- default:
- col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown ARP opcode 0x%04x", ar_op);
- break;
- }
+ break;
+ case ARPOP_RREQUEST:
+ case ARPOP_IREQUEST:
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Who is %s? Tell %s",
+/* arphrdaddr_to_str(tha_val, ar_hln, ar_hrd), */
+ tvb_arphrdaddr_to_str(tvb, tha_offset, ar_hln, ar_hrd),
+/* arphrdaddr_to_str(sha_val, ar_hln, ar_hrd)); */
+ tvb_arphrdaddr_to_str(tvb, sha_offset, ar_hln, ar_hrd));
+ break;
+ case ARPOP_RREPLY:
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s is at %s",
+/* arphrdaddr_to_str(tha_val, ar_hln, ar_hrd), */
+ tvb_arphrdaddr_to_str(tvb, tha_offset, ar_hln, ar_hrd),
+ arpproaddr_to_str(tpa_val, ar_pln, ar_pro));
+ break;
+ case ARPOP_IREPLY:
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s is at %s",
+/* arphrdaddr_to_str(sha_val, ar_hln, ar_hrd), */
+ tvb_arphrdaddr_to_str(tvb, sha_offset, ar_hln, ar_hrd),
+ arpproaddr_to_str(spa_val, ar_pln, ar_pro));
+ break;
+ default:
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown ARP opcode 0x%04x", ar_op);
+ break;
}
if (tree) {
diff --git a/epan/dissectors/packet-brp.c b/epan/dissectors/packet-brp.c
index a5f32719e9..13ac9e7f49 100644
--- a/epan/dissectors/packet-brp.c
+++ b/epan/dissectors/packet-brp.c
@@ -144,12 +144,10 @@ dissect_brp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
/* If there is a "tree" requested, we handle that request. */
col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_BRP);
- if(check_col(pinfo->cinfo,COL_INFO)){
- /* We add some snazzy bizness to the info field to quickly ascertain
- what type of message was sent to/from the BRS/BRC. */
- col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type - %s",
- val_to_str(packet_type, brp_packettype_names, "Unknown (0x%02x)"));
- }
+ /* We add some snazzy bizness to the info field to quickly ascertain
+ what type of message was sent to/from the BRS/BRC. */
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type - %s",
+ val_to_str(packet_type, brp_packettype_names, "Unknown (0x%02x)"));
/* This call adds our tree to the main dissection tree. */
diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c
index 89146ac1db..81fe81dedb 100644
--- a/epan/dissectors/packet-dns.c
+++ b/epan/dissectors/packet-dns.c
@@ -3457,7 +3457,6 @@ dissect_dns_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
int offset = is_tcp ? 2 : 0;
int dns_data_offset;
- column_info *cinfo;
proto_tree *dns_tree = NULL, *field_tree;
proto_item *ti, *tf;
guint16 id, flags, opcode, rcode, quest, ans, auth, add;
@@ -3478,25 +3477,17 @@ dissect_dns_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
opcode = (guint16) ((flags & F_OPCODE) >> OPCODE_SHIFT);
rcode = (guint16) (flags & F_RCODE);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s%s 0x%04x ",
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s%s 0x%04x ",
val_to_str(opcode, opcode_vals, "Unknown operation (%u)"),
(flags&F_RESPONSE)?" response":"", id);
- if (flags & F_RESPONSE) {
- if (rcode != RCODE_NOERROR) {
- col_append_str(pinfo-> cinfo,COL_INFO,
- val_to_str(rcode, rcode_vals, "Unknown error (%u)"));
- }
+ if (flags & F_RESPONSE) {
+ if (rcode != RCODE_NOERROR) {
+ col_append_str(pinfo-> cinfo,COL_INFO,
+ val_to_str(rcode, rcode_vals, "Unknown error (%u)"));
}
- cinfo = pinfo->cinfo;
- } else {
- /* Set "cinfo" to NULL; we pass a NULL "cinfo" to the query and answer
- dissectors, as a way of saying that they shouldn't add stuff
- to the COL_INFO column (a call to "check_col(cinfo, COL_INFO)"
- is more expensive than a check that a pointer isn't NULL). */
- cinfo = NULL;
}
+
if (opcode == OPCODE_UPDATE) {
isupdate = TRUE;
} else {
@@ -3689,7 +3680,7 @@ dissect_dns_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* If this is a response, don't add information about the queries
to the summary, just add information about the answers. */
cur_off += dissect_query_records(tvb, cur_off, dns_data_offset, quest,
- (!(flags & F_RESPONSE) ? cinfo : NULL),
+ (!(flags & F_RESPONSE) ? pinfo->cinfo : NULL),
dns_tree, isupdate, is_mdns);
}
@@ -3697,7 +3688,7 @@ dissect_dns_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* If this is a request, don't add information about the answers
to the summary, just add information about the queries. */
cur_off += dissect_answer_records(tvb, cur_off, dns_data_offset, ans,
- ((flags & F_RESPONSE) ? cinfo : NULL),
+ ((flags & F_RESPONSE) ? pinfo->cinfo : NULL),
dns_tree, (isupdate ?
"Prerequisites" : "Answers"),
pinfo, is_mdns);
diff --git a/epan/dissectors/packet-nasdaq-itch.c b/epan/dissectors/packet-nasdaq-itch.c
index 5fe9776bfd..07bf985237 100644
--- a/epan/dissectors/packet-nasdaq-itch.c
+++ b/epan/dissectors/packet-nasdaq-itch.c
@@ -147,23 +147,16 @@ static int hf_nasdaq_itch_execution_price = -1;
static int hf_nasdaq_itch_canceled = -1;
static int hf_nasdaq_itch_cross = -1;
-#define PINFO_COL(a) (check_col((a)->cinfo, COL_INFO))
-
/* ---------------------- */
static int
order_ref_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int offset)
{
- gint col_info = PINFO_COL(pinfo);
+ const char *str_value = tvb_get_ephemeral_string(tvb, offset, 9);
+ guint32 value = (guint32)strtoul(str_value, NULL, 10);
- if (nasdaq_itch_tree || col_info) {
- const char *str_value = tvb_get_ephemeral_string(tvb, offset, 9);
- guint32 value = (guint32)strtoul(str_value, NULL, 10);
+ proto_tree_add_uint(nasdaq_itch_tree, hf_nasdaq_itch_order_reference, tvb, offset, 9, value);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%u ", value);
- proto_tree_add_uint(nasdaq_itch_tree, hf_nasdaq_itch_order_reference, tvb, offset, 9, value);
- if (col_info) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "%u ", value);
- }
- }
return offset+9;
}
@@ -198,18 +191,14 @@ time_stamp(tvbuff_t *tvb, proto_tree *nasdaq_itch_tree, int id, int offset, int
static int
number_of_shares(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int id, int offset, int big)
{
- gint col_info = PINFO_COL(pinfo);
gint size = (big)?10:6;
+ const char *str_value = tvb_get_ephemeral_string(tvb, offset, size);
- if (nasdaq_itch_tree || col_info) {
- const char *str_value = tvb_get_ephemeral_string(tvb, offset, size);
- guint32 value = (guint32)strtoul(str_value, NULL, 10);
+ guint32 value = (guint32)strtoul(str_value, NULL, 10);
+
+ proto_tree_add_uint(nasdaq_itch_tree, id, tvb, offset, size, value);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "qty %u ", value);
- proto_tree_add_uint(nasdaq_itch_tree, id, tvb, offset, size, value);
- if (col_info) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "qty %u ", value);
- }
- }
return offset +size;
}
@@ -217,18 +206,14 @@ number_of_shares(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree
static int
price(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int id, int offset, int big)
{
- gint col_info = PINFO_COL(pinfo);
gint size = (big)?19:10;
- if (nasdaq_itch_tree || col_info) {
- const char *str_value = tvb_get_ephemeral_string(tvb, offset, size);
- gdouble value = guint64_to_gdouble(g_ascii_strtoull(str_value, NULL, 10))/((big)?1000000.0:10000.0);
+ const char *str_value = tvb_get_ephemeral_string(tvb, offset, size);
+ gdouble value = guint64_to_gdouble(g_ascii_strtoull(str_value, NULL, 10))/((big)?1000000.0:10000.0);
+
+ proto_tree_add_double(nasdaq_itch_tree, id, tvb, offset, size, value);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "price %g ", value);
- proto_tree_add_double(nasdaq_itch_tree, id, tvb, offset, size, value);
- if (col_info) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "price %g ", value);
- }
- }
return offset+size;
}
@@ -236,15 +221,11 @@ price(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int id, i
static int
stock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int offset)
{
- gint col_info = PINFO_COL(pinfo);
- if (nasdaq_itch_tree || col_info) {
- char *stock_p = tvb_get_ephemeral_string(tvb, offset, 6);
+ char *stock_p = tvb_get_ephemeral_string(tvb, offset, 6);
+
+ proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_stock, tvb, offset, 6, ENC_ASCII|ENC_NA);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "<%s> ", stock_p);
- proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_stock, tvb, offset, 6, ENC_ASCII|ENC_NA);
- if (col_info) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "<%s> ", stock_p);
- }
- }
return offset+6;
}
@@ -252,15 +233,13 @@ stock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int offse
static int
order(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int offset, int big)
{
- gint col_info = PINFO_COL(pinfo);
guint8 value;
offset = order_ref_number(tvb, pinfo, nasdaq_itch_tree, offset);
value = tvb_get_guint8(tvb, offset);
- if (col_info) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "%c ", value);
- }
+
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%c ", value);
proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_buy_sell, tvb, offset, 1, ENC_ASCII|ENC_NA);
offset += 1;
@@ -293,11 +272,9 @@ dissect_nasdaq_itch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *nasdaq_itch_tree = NULL;
guint8 nasdaq_itch_type;
int offset = 0;
- gint col_info;
int version = 3;
int big = 0;
-
- col_info = PINFO_COL(pinfo);
+ const gchar *rep;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Nasdaq-ITCH");
@@ -310,23 +287,21 @@ dissect_nasdaq_itch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if ((!nasdaq_itch_chi_x || version == 3) && strchr(chix_msg, nasdaq_itch_type)) {
nasdaq_itch_type = 0; /* unknown */
}
- if (col_info || tree) {
- const gchar *rep = val_to_str(nasdaq_itch_type, message_types_val, "Unknown packet type (0x%02x) ");
- if (col_info ) {
- col_clear(pinfo->cinfo, COL_INFO);
- col_add_str(pinfo->cinfo, COL_INFO, rep);
- }
- if (tree) {
- proto_item *item;
- ti = proto_tree_add_protocol_format(tree, proto_nasdaq_itch, tvb, offset, -1, "Nasdaq TotalView-ITCH %s, %s",
- version == 2?"2.0":"3.0", rep);
+ rep = val_to_str(nasdaq_itch_type, message_types_val, "Unknown packet type (0x%02x) ");
+ col_clear(pinfo->cinfo, COL_INFO);
+ col_add_str(pinfo->cinfo, COL_INFO, rep);
- nasdaq_itch_tree = proto_item_add_subtree(ti, ett_nasdaq_itch);
+ if (tree) {
+ proto_item *item;
- item=proto_tree_add_uint(nasdaq_itch_tree, hf_nasdaq_itch_version, tvb, 0, 0, version);
- PROTO_ITEM_SET_GENERATED(item);
- }
+ ti = proto_tree_add_protocol_format(tree, proto_nasdaq_itch, tvb, offset, -1, "Nasdaq TotalView-ITCH %s, %s",
+ version == 2?"2.0":"3.0", rep);
+
+ nasdaq_itch_tree = proto_item_add_subtree(ti, ett_nasdaq_itch);
+
+ item=proto_tree_add_uint(nasdaq_itch_tree, hf_nasdaq_itch_version, tvb, 0, 0, version);
+ PROTO_ITEM_SET_GENERATED(item);
}
if (version == 2) {
diff --git a/epan/dissectors/packet-nbns.c b/epan/dissectors/packet-nbns.c
index f271b74006..1ff0eebd74 100644
--- a/epan/dissectors/packet-nbns.c
+++ b/epan/dissectors/packet-nbns.c
@@ -1064,7 +1064,6 @@ dissect_nbns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
int offset = 0;
int nbns_data_offset;
- column_info *cinfo;
proto_tree *nbns_tree = NULL;
proto_item *ti;
guint16 id, flags, opcode, quest, ans, auth, add;
@@ -1080,19 +1079,9 @@ dissect_nbns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
flags = tvb_get_ntohs(tvb, offset + NBNS_FLAGS);
opcode = (guint16) ((flags & F_OPCODE) >> OPCODE_SHIFT);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s%s",
- val_to_str(opcode, opcode_vals, "Unknown operation (%u)"),
- (flags & F_RESPONSE) ? " response" : "");
- cinfo = pinfo->cinfo;
- } else {
- /* Set "cinfo" to NULL; we pass a NULL "cinfo" to the query
- and answer dissectors, as a way of saying that they
- shouldn't add stuff to the COL_INFO column (a call to
- "check_col(cinfo, COL_INFO)" is more expensive than
- a check that a pointer isn't NULL). */
- cinfo = NULL;
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s%s",
+ val_to_str(opcode, opcode_vals, "Unknown operation (%u)"),
+ (flags & F_RESPONSE) ? " response" : "");
if (tree) {
ti = proto_tree_add_item(tree, proto_nbns, tvb, offset, -1,
@@ -1135,7 +1124,7 @@ dissect_nbns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
answers. */
cur_off += dissect_query_records(tvb, cur_off,
nbns_data_offset, quest,
- (!(flags & F_RESPONSE) ? cinfo : NULL), nbns_tree);
+ (!(flags & F_RESPONSE) ? pinfo->cinfo : NULL), nbns_tree);
}
if (ans > 0) {
@@ -1144,7 +1133,7 @@ dissect_nbns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
queries. */
cur_off += dissect_answer_records(tvb, cur_off,
nbns_data_offset, ans,
- ((flags & F_RESPONSE) ? cinfo : NULL), nbns_tree,
+ ((flags & F_RESPONSE) ? pinfo->cinfo : NULL), nbns_tree,
opcode, "Answers");
}
diff --git a/epan/dissectors/packet-ncp2222.inc b/epan/dissectors/packet-ncp2222.inc
index 0cf794c2ba..0396134023 100644
--- a/epan/dissectors/packet-ncp2222.inc
+++ b/epan/dissectors/packet-ncp2222.inc
@@ -7256,9 +7256,7 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint32 nw_connection, guint8 sequ
}
else
{
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "[Retransmitted NDS Fragment 0x%08x]", frags[frag_count].nds_frag);
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO, "[Retransmitted NDS Fragment 0x%08x]", frags[frag_count].nds_frag);
return;
}
}
@@ -7325,25 +7323,20 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint32 nw_connection, guint8 sequ
{
/* This is either a beggining or middle fragment on second dissection */
frag_tvb = tvb_new_subset(tvb, 0, -1, -1);
- if (check_col(pinfo->cinfo, COL_INFO))
+ if (request_value->nds_frag)
{
- if (request_value->nds_frag)
- {
- col_add_fstr(pinfo->cinfo, COL_INFO, "[NDS Fragment 0x%08x]", frags[frag_count].nds_frag);
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO, "[NDS Fragment 0x%08x]", frags[frag_count].nds_frag);
}
}
}
else
{
/* Fragment from first pass of dissection */
- if (check_col(pinfo->cinfo, COL_INFO))
+ if (request_value->nds_frag)
{
- if (request_value->nds_frag)
- {
- col_add_fstr(pinfo->cinfo, COL_INFO, "[NDS Fragment 0x%08x]", frags[frag_count].nds_frag);
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO, "[NDS Fragment 0x%08x]", frags[frag_count].nds_frag);
}
+
frag_tvb = NULL;
}
}
@@ -7376,9 +7369,7 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint32 nw_connection, guint8 sequ
request_value->nds_frag = FALSE;
/* Trap for retransmitted end fragment */
if (request_value->nds_end_frag < pinfo->fd->num) {
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "[Retransmitted end of NDS Fragment 0x%08x, see packet #%d for details.]", request_value->nds_frag_num, request_value->nds_end_frag);
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO, "[Retransmitted end of NDS Fragment 0x%08x, see packet #%d for details.]", request_value->nds_frag_num, request_value->nds_end_frag);
}
else
{
@@ -7494,30 +7485,29 @@ dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo,
}
/* Fill in the INFO column. */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- if (ncp_rec) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "C %s", ncp_rec->name);
- if (ncp_rec->req_info_str) {
- /* We want to add more stuff to the Info
- column. */
- run_info_str = TRUE;
- }
+ if (ncp_rec) {
+ col_add_fstr(pinfo->cinfo, COL_INFO, "C %s", ncp_rec->name);
+ if (ncp_rec->req_info_str) {
+ /* We want to add more stuff to the Info
+ column. */
+ run_info_str = TRUE;
+ }
+ }
+ else {
+ if (requires_subfunc) {
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "C Unknown Function %u %u (0x%02X/0x%02x)",
+ func, subfunc, func, subfunc);
+ return;
}
else {
- if (requires_subfunc) {
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "C Unknown Function %u %u (0x%02X/0x%02x)",
- func, subfunc, func, subfunc);
- return;
- }
- else {
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "C Unknown Function %u (0x%02x)",
- func, func);
- return;
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "C Unknown Function %u (0x%02x)",
+ func, func);
+ return;
}
}
+
if (!pinfo->fd->flags.visited) {
/* This is the first time we've looked at this packet.
Keep track of the address and connection whence the request
@@ -8950,11 +8940,9 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
*/
tap_queue_packet(ncp_tap->stat, pinfo, request_value);
- if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
- if (ncp_rec && ncp_rec->func==0x68 &&
- (ncp_rec->subfunc==0x02 || ncp_rec->subfunc==0x01)) {
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS");
- }
+ if (ncp_rec && ncp_rec->func==0x68 &&
+ (ncp_rec->subfunc==0x02 || ncp_rec->subfunc==0x01)) {
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS");
}
/* A completion code of 0 always means OK. Non-zero means failure,
@@ -8999,11 +8987,9 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
nds_error_string = val_to_str_const(nds_error_code, nds_reply_errors, "NDS Error - No Definition Found");
}
}
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
- type == NCP_SERVICE_REPLY ? "R" : "ACK",
- nds_error_string ? nds_error_string : error_string);
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
+ type == NCP_SERVICE_REPLY ? "R" : "ACK",
+ nds_error_string ? nds_error_string : error_string);
if (ncp_tree) {
@@ -11543,24 +11529,22 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
}
}
/* Fill in the INFO column. */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- if (ncp_rec) {
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS");
- if (nds_frag != 0xffffffff) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "C Continue NDS Fragment 0x%08x", nds_frag);
- }
- else {
- col_add_fstr(pinfo->cinfo, COL_INFO, "C NDS %s", verb_string);
- }
- run_info_str = TRUE;
+ if (ncp_rec) {
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS");
+ if (nds_frag != 0xffffffff) {
+ col_add_fstr(pinfo->cinfo, COL_INFO, "C Continue NDS Fragment 0x%08x", nds_frag);
}
else {
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "C Unknown Function %d (0x%02x)",
- func, func);
+ col_add_fstr(pinfo->cinfo, COL_INFO, "C NDS %s", verb_string);
}
-
+ run_info_str = TRUE;
+ }
+ else {
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "C Unknown Function %d (0x%02x)",
+ func, func);
}
+
/* Keep track of the address and connection whence the request
came, and the address and connection to which the request
is being sent, so that we can match up calls with replies.
@@ -11741,13 +11725,11 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
* for MVTYPE_PROC_ENTRY_SPECIFIERS,
* to add string to columninfo
*/
- if (check_col(pinfo->cinfo, COL_INFO)) {
- if (!added_arrow) {
- col_append_str(pinfo->cinfo, COL_INFO, " -> ");
- added_arrow = TRUE;
- }
- col_append_str(pinfo->cinfo, COL_INFO, pvalues[i].vstring);
+ if (!added_arrow) {
+ col_append_str(pinfo->cinfo, COL_INFO, " -> ");
+ added_arrow = TRUE;
}
+ col_append_str(pinfo->cinfo, COL_INFO, pvalues[i].vstring);
}
break;
@@ -11771,15 +11753,13 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
* and the last string for MVTYPE_ATTR_REQUEST,
* by "process_multivalues()".
*/
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, pvalues[i].vstring);
- if (pvalues[i].mvtype != MVTYPE_PROCESS_ITERATOR) {
- if (!added_arrow) {
- col_append_str(pinfo->cinfo, COL_INFO, " -> ");
- added_arrow = TRUE;
- }
- col_append_str(pinfo->cinfo, COL_INFO, mv_resolve_name_string);
+ col_append_str(pinfo->cinfo, COL_INFO, pvalues[i].vstring);
+ if (pvalues[i].mvtype != MVTYPE_PROCESS_ITERATOR) {
+ if (!added_arrow) {
+ col_append_str(pinfo->cinfo, COL_INFO, " -> ");
+ added_arrow = TRUE;
}
+ col_append_str(pinfo->cinfo, COL_INFO, mv_resolve_name_string);
}
}
break;
@@ -11805,11 +11785,8 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
if(resolve_eid) {
if (request_eid_value) {
g_strlcpy(global_object_name, request_eid_value->object_name, 256);
- if (check_col(pinfo->cinfo, COL_INFO))
- {
- col_append_str(pinfo->cinfo, COL_INFO, ", Object Name - ");
- col_append_str(pinfo->cinfo, COL_INFO, global_object_name);
- }
+ col_append_str(pinfo->cinfo, COL_INFO, ", Object Name - ");
+ col_append_str(pinfo->cinfo, COL_INFO, global_object_name);
}
}
if (request_value)
diff --git a/epan/dissectors/packet-pcap.c b/epan/dissectors/packet-pcap.c
index 423c97f616..8f3c813b3e 100644
--- a/epan/dissectors/packet-pcap.c
+++ b/epan/dissectors/packet-pcap.c
@@ -1917,10 +1917,9 @@ dissect_pcap_ProcedureCode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
0U, 255U, &ProcedureCode, FALSE);
- if (check_col(actx->pinfo->cinfo, COL_INFO))
- col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%s ",
- val_to_str(ProcedureCode, pcap_ProcedureCode_vals,
- "unknown message"));
+ col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%s ",
+ val_to_str(ProcedureCode, pcap_ProcedureCode_vals,
+ "unknown message"));
return offset;
}
diff --git a/epan/dissectors/packet-pgsql.c b/epan/dissectors/packet-pgsql.c
index cea56b79f7..e2b5f229b6 100644
--- a/epan/dissectors/packet-pgsql.c
+++ b/epan/dissectors/packet-pgsql.c
@@ -213,7 +213,6 @@ dissect_pgsql_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guchar type;
const char *typestr;
guint length;
- gboolean info = check_col(pinfo->cinfo, COL_INFO);
gboolean fe = (pinfo->match_uint == pinfo->destport);
n = 0;
@@ -247,14 +246,12 @@ dissect_pgsql_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
typestr = val_to_str_const(type, be_messages, "Unknown");
}
- if (info) {
- /* This is a terrible hack. It makes the "Info" column reflect
- the contents of every message in a TCP packet. Could it be
- done any better? */
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s%c",
- ( first_message ? "" : "/" ), type);
- first_message = FALSE;
- }
+ /* This is a terrible hack. It makes the "Info" column reflect
+ the contents of every message in a TCP packet. Could it be
+ done any better? */
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s%c",
+ ( first_message ? "" : "/" ), type);
+ first_message = FALSE;
if (tree) {
ti = proto_tree_add_item(tree, proto_pgsql, tvb, 0, -1, ENC_NA);
diff --git a/epan/dissectors/packet-wassp.c b/epan/dissectors/packet-wassp.c
index 9cc9f0dad5..31d780a71c 100644
--- a/epan/dissectors/packet-wassp.c
+++ b/epan/dissectors/packet-wassp.c
@@ -774,8 +774,7 @@ dissect_snmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *wassp_tree,
tvbuff_t *snmp_tvb;
/* Don't add SNMP stuff to the info column */
- if (check_col(pinfo->cinfo, COL_INFO))
- col_set_writable(pinfo->cinfo, FALSE);
+ col_set_writable(pinfo->cinfo, FALSE);
snmp_tvb = tvb_new_subset(tvb, offset, length, length);
@@ -786,8 +785,7 @@ dissect_snmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *wassp_tree,
show_exception(snmp_tvb, pinfo, wassp_tree, EXCEPT_CODE, GET_MESSAGE);
} ENDTRY;
- if (check_col(pinfo->cinfo, COL_INFO))
- col_set_writable(pinfo->cinfo, TRUE);
+ col_set_writable(pinfo->cinfo, TRUE);
offset += length;
@@ -801,8 +799,7 @@ dissect_ieee80211(tvbuff_t *tvb, packet_info *pinfo, proto_tree *wassp_tree,
tvbuff_t *ieee80211_tvb;
/* Don't add IEEE 802.11 stuff to the info column */
- if (check_col(pinfo->cinfo, COL_INFO))
- col_set_writable(pinfo->cinfo, FALSE);
+ col_set_writable(pinfo->cinfo, FALSE);
ieee80211_tvb = tvb_new_subset(tvb, offset, length, length);
@@ -813,8 +810,7 @@ dissect_ieee80211(tvbuff_t *tvb, packet_info *pinfo, proto_tree *wassp_tree,
show_exception(ieee80211_tvb, pinfo, wassp_tree, EXCEPT_CODE, GET_MESSAGE);
} ENDTRY;
- if (check_col(pinfo->cinfo, COL_INFO))
- col_set_writable(pinfo->cinfo, TRUE);
+ col_set_writable(pinfo->cinfo, TRUE);
offset += length;
@@ -895,10 +891,8 @@ dissect_wassp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint32 subtype;
packet_type = tvb_get_guint8(tvb, 1);
- if (check_col(pinfo->cinfo, COL_PROTOCOL))
- col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_SHORT_NAME);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_str(pinfo->cinfo, COL_INFO, val_to_str(packet_type,
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_SHORT_NAME);
+ col_add_str(pinfo->cinfo, COL_INFO, val_to_str(packet_type,
wassp_tunnel_pdu_type, "Type 0x%02x"));
if (tree) {
diff --git a/epan/dissectors/packet-wsp.c b/epan/dissectors/packet-wsp.c
index d7d000602a..299a4c6352 100644
--- a/epan/dissectors/packet-wsp.c
+++ b/epan/dissectors/packet-wsp.c
@@ -4792,11 +4792,9 @@ dissect_sir(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *subtree;
proto_item *ti;
- if (check_col(pinfo->cinfo, COL_INFO))
- { /* Append status code to INFO column */
- col_append_str(pinfo->cinfo, COL_INFO,
- ": WAP Session Initiation Request");
- }
+ /* Append status code to INFO column */
+ col_append_str(pinfo->cinfo, COL_INFO,
+ ": WAP Session Initiation Request");
/* The remainder of the code adds items to the protocol tree */
if (! tree)
@@ -4935,12 +4933,9 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
pdut = tvb_get_guint8 (tvb, offset);
/* Develop the string to put in the Info column */
- if (check_col(pinfo->cinfo, COL_INFO))
- {
- col_append_fstr(pinfo->cinfo, COL_INFO, "WSP %s (0x%02x)",
- val_to_str_ext (pdut, &wsp_vals_pdu_type_ext, "Unknown PDU type (0x%02x)"),
- pdut);
- };
+ col_append_fstr(pinfo->cinfo, COL_INFO, "WSP %s (0x%02x)",
+ val_to_str_ext (pdut, &wsp_vals_pdu_type_ext, "Unknown PDU type (0x%02x)"),
+ pdut);
/* In the interest of speed, if "tree" is NULL, don't do any work not
* necessary to generate protocol tree items. */
@@ -5187,12 +5182,10 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
reply_status_str, reply_status);
}
stat_info->status_code = (gint) reply_status;
- if (check_col(pinfo->cinfo, COL_INFO))
- { /* Append status code to INFO column */
- col_append_fstr(pinfo->cinfo, COL_INFO,
+ /* Append status code to INFO column */
+ col_append_fstr(pinfo->cinfo, COL_INFO,
": %s (0x%02x)",
reply_status_str, reply_status);
- }
}
nextOffset = offset + 1 + count;
if (tree)
@@ -5408,24 +5401,21 @@ add_uri (proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
{
guint count = 0;
guint uriLen = tvb_get_guintvar (tvb, URILenOffset, &count);
- gchar *str = NULL;
+ gchar *str;
- if (tree)
- proto_tree_add_uint (tree, hf_wsp_header_uri_len,
- tvb, URILenOffset, count, uriLen);
+ proto_tree_add_uint (tree, hf_wsp_header_uri_len,
+ tvb, URILenOffset, count, uriLen);
tvb_ensure_bytes_exist(tvb, URIOffset, uriLen);
- if (tree)
- proto_tree_add_item (tree, hf_wsp_header_uri,
- tvb, URIOffset, uriLen, ENC_ASCII|ENC_NA);
+ proto_tree_add_item (tree, hf_wsp_header_uri,
+ tvb, URIOffset, uriLen, ENC_ASCII|ENC_NA);
str = tvb_format_text (tvb, URIOffset, uriLen);
/* XXX - tvb_format_text() returns a pointer to a static text string
* so please DO NOT attempt at g_free()ing it!
*/
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s", str);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s", str);
+
if (proto_ti)
proto_item_append_text(proto_ti, ", URI: %s", str);
}
diff --git a/epan/dissectors/packet-wtp.c b/epan/dissectors/packet-wtp.c
index 4c2fe24e2f..946b9fb1de 100644
--- a/epan/dissectors/packet-wtp.c
+++ b/epan/dissectors/packet-wtp.c
@@ -733,27 +733,18 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
call_dissector(wsp_handle, wsp_tvb, pinfo, tree);
} else {
/* Not reassembled in this packet */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO,
- "%s (WTP payload reassembled in packet %u)",
- szInfo, fd_wtp->reassembled_in);
- }
- if (tree) {
- proto_tree_add_text(wtp_tree, tvb, dataOffset, -1,
- "Payload");
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO,
+ "%s (WTP payload reassembled in packet %u)",
+ szInfo, fd_wtp->reassembled_in);
+
+ proto_tree_add_text(wtp_tree, tvb, dataOffset, -1, "Payload");
}
} else {
/* Not reassembled yet, or not reassembled at all */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO,
- "%s (Unreassembled fragment %u)",
- szInfo, psn);
- }
- if (tree) {
- proto_tree_add_text(wtp_tree, tvb, dataOffset, -1,
- "Payload");
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO,
+ "%s (Unreassembled fragment %u)",
+ szInfo, psn);
+ proto_tree_add_text(wtp_tree, tvb, dataOffset, -1, "Payload");
}
/* Now reset fragmentation information in pinfo */
pinfo->fragmented = save_fragmented;
@@ -768,15 +759,13 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
{
/* Nothing to hand to subdissector */
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_str(pinfo->cinfo, COL_INFO, szInfo);
+ col_append_str(pinfo->cinfo, COL_INFO, szInfo);
}
}
else
{
/* Nothing to hand to subdissector */
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_str(pinfo->cinfo, COL_INFO, szInfo);
+ col_append_str(pinfo->cinfo, COL_INFO, szInfo);
}
}
diff --git a/epan/dissectors/packet-x11.c b/epan/dissectors/packet-x11.c
index 9591e07de0..ec83fea59c 100644
--- a/epan/dissectors/packet-x11.c
+++ b/epan/dissectors/packet-x11.c
@@ -1265,8 +1265,7 @@ static const value_string zero_is_none_vals[] = {
next_tvb = tvb_new_subset(tvb, offset, length_remaining, plen); \
\
if (sep == NULL) { \
- if (check_col(pinfo->cinfo, COL_INFO)) \
- col_set_str(pinfo->cinfo, COL_INFO, str); \
+ col_set_str(pinfo->cinfo, COL_INFO, str); \
sep = ":"; \
} \
\
@@ -3162,10 +3161,9 @@ static void dissect_x11_request(tvbuff_t *tvb, packet_info *pinfo,
OPCODE();
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s", sep,
- val_to_str(opcode, state->opcode_vals,
- "<Unknown opcode %d>"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s", sep,
+ val_to_str(opcode, state->opcode_vals,
+ "<Unknown opcode %d>"));
proto_item_append_text(ti, ", Request, opcode: %d (%s)",
opcode, val_to_str(opcode, state->opcode_vals,
@@ -4794,16 +4792,14 @@ dissect_x11_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
if (opcode == UNKNOWN_OPCODE) {
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO,
- "%s to unknown request", sep);
+ col_append_fstr(pinfo->cinfo, COL_INFO,
+ "%s to unknown request", sep);
proto_item_append_text(ti, ", Reply to unknown request");
} else {
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s",
- sep,
- val_to_str(opcode & 0xFF, state->opcode_vals,
- "<Unknown opcode %d>"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s",
+ sep,
+ val_to_str(opcode & 0xFF, state->opcode_vals,
+ "<Unknown opcode %d>"));
if (opcode > 0xFF)
proto_item_append_text(ti, ", Reply, opcode: %d.%d (%s)",
@@ -5158,11 +5154,10 @@ dissect_x11_event(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
eventcode = tvb_get_guint8(tvb, 0);
sent = (eventcode & 0x80) ? "Sent-" : "";
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s%s",
- sep, sent,
- val_to_str(eventcode & 0x7F, state->eventcode_vals,
- "<Unknown eventcode %u>"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s%s",
+ sep, sent,
+ val_to_str(eventcode & 0x7F, state->eventcode_vals,
+ "<Unknown eventcode %u>"));
proto_item_append_text(ti, ", Event, eventcode: %d (%s%s)",
eventcode, sent,
@@ -5503,9 +5498,8 @@ dissect_x11_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
CARD8(error);
errorcode = tvb_get_guint8(tvb, offset);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s",
- sep, val_to_str(errorcode, state->errorcode_vals, "<Unknown errorcode %u>"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s",
+ sep, val_to_str(errorcode, state->errorcode_vals, "<Unknown errorcode %u>"));
proto_tree_add_uint_format(t, hf_x11_errorcode, tvb, offset, 1,
errorcode,
diff --git a/epan/dissectors/packet-x224.c b/epan/dissectors/packet-x224.c
index 14ee05cbec..c9ed77cfe8 100644
--- a/epan/dissectors/packet-x224.c
+++ b/epan/dissectors/packet-x224.c
@@ -207,11 +207,9 @@ dissect_x224(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *d
proto_tree_add_item(tree, hf_x224_code, tvb, offset, 1, ENC_BIG_ENDIAN);
offset+=1;
- 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(code>>4, code_vals, "Unknown code :%x"),
code);
- }
diff --git a/epan/dissectors/packet-x29.c b/epan/dissectors/packet-x29.c
index 135c1c57ee..1c91d45cba 100644
--- a/epan/dissectors/packet-x29.c
+++ b/epan/dissectors/packet-x29.c
@@ -100,11 +100,10 @@ dissect_x29(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* Q bit set - this is a PAD message.
*/
msg_code = tvb_get_guint8(tvb, offset);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s PAD message",
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s PAD message",
val_to_str(msg_code, message_code_vals,
"Unknown (0x%02x)"));
- }
+
proto_tree_add_uint(x29_tree, hf_msg_code, tvb,
offset, 1, msg_code);
offset++;
diff --git a/epan/dissectors/packet-xcsl.c b/epan/dissectors/packet-xcsl.c
index 3217979450..6990e1154c 100644
--- a/epan/dissectors/packet-xcsl.c
+++ b/epan/dissectors/packet-xcsl.c
@@ -204,8 +204,7 @@ static void dissect_xcsl_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
} else {
proto_tree_add_item(xcsl_tree, hf_xcsl_information, tvb, offset, len, ENC_ASCII|ENC_NA);
}
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",str);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",str);
break;
/* Starting with non-digit -> Command, if it starts with a digit -> reply */
@@ -224,7 +223,7 @@ static void dissect_xcsl_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
xcsl_item = proto_tree_add_item(xcsl_tree, hf_xcsl_result, tvb, offset, len, ENC_ASCII|ENC_NA);
proto_item_append_text(xcsl_item, " (%s)", code);
- if (result != 0 && check_col(pinfo->cinfo, COL_INFO))
+ if (result != 0)
col_append_fstr(pinfo->cinfo, COL_INFO, "[%s] ", code);
} else {
@@ -232,8 +231,7 @@ static void dissect_xcsl_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
request = TRUE;
proto_tree_add_item(xcsl_tree, hf_xcsl_command, tvb, offset, len, ENC_ASCII|ENC_NA);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", str);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", str);
}
break;
@@ -242,15 +240,13 @@ static void dissect_xcsl_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
default:
proto_tree_add_item(xcsl_tree, hf_xcsl_parameter, tvb, offset, len, ENC_ASCII|ENC_NA);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- if ( request == TRUE ) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ": %s ",str);
+ if ( request == TRUE ) {
+ col_append_fstr(pinfo->cinfo, COL_INFO, ": %s ",str);
+ } else {
+ if (par == 0) {
+ col_append_fstr(pinfo->cinfo, COL_INFO, "reply: %s ",str);
} else {
- if (par == 0) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "reply: %s ",str);
- } else {
- col_append_fstr(pinfo->cinfo, COL_INFO, ": %s ",str);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, ": %s ",str);
}
}
diff --git a/epan/dissectors/packet-xdmcp.c b/epan/dissectors/packet-xdmcp.c
index a0425bbe12..7535b614e9 100644
--- a/epan/dissectors/packet-xdmcp.c
+++ b/epan/dissectors/packet-xdmcp.c
@@ -231,16 +231,13 @@ static int dissect_xdmcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
offset, 2, opcode);
}
offset += 2;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_str(pinfo->cinfo, COL_INFO,
- val_to_str(opcode, opcode_vals, "Unknown (0x%04x)"));
- }
+ col_add_str(pinfo->cinfo, COL_INFO,
+ val_to_str(opcode, opcode_vals, "Unknown (0x%04x)"));
- if (tree) {
- proto_tree_add_item(xdmcp_tree, hf_xdmcp_length, tvb,
+ proto_tree_add_item(xdmcp_tree, hf_xdmcp_length, tvb,
offset, 2, ENC_BIG_ENDIAN);
- }
+
offset += 2;
switch (opcode) {
diff --git a/epan/dissectors/packet-xmcp.c b/epan/dissectors/packet-xmcp.c
index 05c09baf23..8eb3e2e43a 100644
--- a/epan/dissectors/packet-xmcp.c
+++ b/epan/dissectors/packet-xmcp.c
@@ -427,8 +427,7 @@ decode_xmcp_attr_value (proto_tree *attr_tree, guint16 attr_type,
* Many message methods may include this attribute,
* but it's only interesting when Registering at first
*/
- if (xmcp_msg_type_method == XMCP_METHOD_REGISTER &&
- check_col(pinfo->cinfo, COL_INFO)) {
+ if (xmcp_msg_type_method == XMCP_METHOD_REGISTER) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", user \"%s\"",
tvb_get_ephemeral_string(tvb, offset, attr_length));
}
@@ -471,10 +470,8 @@ decode_xmcp_attr_value (proto_tree *attr_tree, guint16 attr_type,
"Unknown"));
PROTO_ITEM_SET_GENERATED(it);
proto_item_append_text(attr_tree, ": %d", error_code);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", error %d (%s)", error_code,
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", error %d (%s)", error_code,
val_to_str_const(error_code, error_codes, "Unknown"));
- }
/*
* All error responses default to a PI_NOTE severity.
@@ -531,10 +528,8 @@ decode_xmcp_attr_value (proto_tree *attr_tree, guint16 attr_type,
attr_length, ENC_ASCII|ENC_NA);
proto_item_append_text(attr_tree, ": %s",
tvb_get_ephemeral_string(tvb, offset, attr_length));
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", name \"%s\"",
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", name \"%s\"",
tvb_get_ephemeral_string(tvb, offset, attr_length));
- }
break;
case XMCP_CLIENT_HANDLE:
if (attr_length < 4)
@@ -542,10 +537,8 @@ decode_xmcp_attr_value (proto_tree *attr_tree, guint16 attr_type,
proto_tree_add_item(attr_tree, xmcp_attr_client_handle, tvb, offset,
4, ENC_BIG_ENDIAN);
proto_item_append_text(attr_tree, ": %u", tvb_get_ntohl(tvb, offset));
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", handle %u",
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", handle %u",
tvb_get_ntohl(tvb, offset));
- }
/*
* A Register request containing a Client-Handle is considered
* to be a Keepalive.
@@ -578,10 +571,8 @@ decode_xmcp_attr_value (proto_tree *attr_tree, guint16 attr_type,
attr_length, ENC_ASCII|ENC_NA);
proto_item_append_text(attr_tree, ": %s",
tvb_get_ephemeral_string(tvb, offset, attr_length));
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", label \"%s\"",
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", label \"%s\"",
tvb_get_ephemeral_string(tvb, offset, attr_length));
- }
break;
case XMCP_KEEPALIVE:
if (attr_length < 4)
@@ -610,11 +601,9 @@ decode_xmcp_attr_value (proto_tree *attr_tree, guint16 attr_type,
proto_item_append_text(attr_tree, ": %u:%u:%s",
tvb_get_ntohs(tvb, offset),
tvb_get_ntohs(tvb, (offset+2)), buf);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", service %u:%u:%s",
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", service %u:%u:%s",
tvb_get_ntohs(tvb, offset),
tvb_get_ntohs(tvb, (offset+2)), buf);
- }
}
break;
case XMCP_SERVICE_TRANSPORT:
@@ -797,10 +786,8 @@ decode_xmcp_attr_value (proto_tree *attr_tree, guint16 attr_type,
proto_tree_add_item(attr_tree, xmcp_attr_subscription_id, tvb, offset,
4, ENC_BIG_ENDIAN);
proto_item_append_text(attr_tree, ": %u", tvb_get_ntohl(tvb, offset));
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", subscription %u",
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", subscription %u",
tvb_get_ntohl(tvb, offset));
- }
break;
case XMCP_SERVICE_REMOVED_REASON:
if (attr_length < 4)
@@ -873,11 +860,9 @@ dissect_xmcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* As in STUN, the first 2 bytes contain the message class and method */
xmcp_msg_type_class = ((msg_type & XMCP_TYPE_CLASS) >> 4);
xmcp_msg_type_method = (msg_type & XMCP_TYPE_METHOD);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
val_to_str_const(xmcp_msg_type_method, methods, "Unknown"),
val_to_str_const(xmcp_msg_type_class, classes, "Unknown"));
- }
/* Get the transaction ID */
transaction_id[0] = tvb_get_ntohl(tvb, 8);
@@ -1061,8 +1046,7 @@ dissect_xmcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_none_format(xmcp_tree, hf_xmcp_msg_is_keepalive, tvb,
0, 0, "This is a Keepalive message");
PROTO_ITEM_SET_GENERATED(ti);
- if ((xmcp_msg_type_method != XMCP_METHOD_KEEPALIVE) &&
- check_col(pinfo->cinfo, COL_INFO)) {
+ if (xmcp_msg_type_method != XMCP_METHOD_KEEPALIVE) {
col_prepend_fstr(pinfo->cinfo, COL_INFO, "[Keepalive] ");
}
if (xmcp_msg_type_class == XMCP_CLASS_REQUEST) {
diff --git a/epan/dissectors/packet-xmpp-core.c b/epan/dissectors/packet-xmpp-core.c
index b7c6c2ee67..c7d5a6fa97 100644
--- a/epan/dissectors/packet-xmpp-core.c
+++ b/epan/dissectors/packet-xmpp-core.c
@@ -520,8 +520,7 @@ xmpp_auth(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *p
{"http://www.google.com/talk/protocol/auth", {"client-uses-full-bind-result", -1, TRUE, TRUE, NULL, NULL}},
};
- if (check_col(pinfo->cinfo, COL_INFO))
- col_set_str(pinfo->cinfo, COL_INFO, "AUTH");
+ col_set_str(pinfo->cinfo, COL_INFO, "AUTH");
auth_item = proto_tree_add_item(tree, hf_xmpp_auth, tvb, packet->offset, packet->length, ENC_BIG_ENDIAN);
auth_tree = proto_item_add_subtree(auth_item, ett_xmpp_auth);
@@ -544,8 +543,7 @@ xmpp_challenge_response_success(proto_tree *tree, tvbuff_t *tvb,
{"xmlns", hf_xmpp_xmlns, TRUE, TRUE, NULL, NULL}
};
- if (check_col(pinfo->cinfo, COL_INFO))
- col_set_str(pinfo->cinfo, COL_INFO, col_info);
+ col_set_str(pinfo->cinfo, COL_INFO, col_info);
item = proto_tree_add_item(tree, hf, tvb, packet->offset, packet->length, ENC_BIG_ENDIAN);
subtree = proto_item_add_subtree(item, ett);
diff --git a/epan/dissectors/packet-xot.c b/epan/dissectors/packet-xot.c
index cd1e98dd6d..5dcd134539 100644
--- a/epan/dissectors/packet-xot.c
+++ b/epan/dissectors/packet-xot.c
@@ -198,10 +198,9 @@ static void dissect_xot_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "XOT");
version = tvb_get_ntohs(tvb, offset + 0);
plen = tvb_get_ntohs(tvb, offset + 2);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "XOT Version = %u, size = %u",
- version, plen);
- if (check_col(pinfo->cinfo, COL_INFO) && offset == 0 &&
+ col_add_fstr(pinfo->cinfo, COL_INFO, "XOT Version = %u, size = %u",
+ version, plen);
+ if (offset == 0 &&
tvb_length_remaining(tvb, offset) > XOT_HEADER_LENGTH + plen )
col_append_fstr(pinfo->cinfo, COL_INFO, " TotX25: %d",
tvb_length_remaining(tvb, offset));
diff --git a/epan/dissectors/packet-xtp.c b/epan/dissectors/packet-xtp.c
index 297be19ae5..51844c87b0 100644
--- a/epan/dissectors/packet-xtp.c
+++ b/epan/dissectors/packet-xtp.c
@@ -479,12 +479,11 @@ dissect_xtp_traffic_cntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
tcntl->xkey += tvb_get_ntohl(tvb, offset+4);
/** add summary **/
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO,
+ col_append_fstr(pinfo->cinfo, COL_INFO,
" Recv-Seq=%" G_GINT64_MODIFIER "u", tcntl->rseq);
- col_append_fstr(pinfo->cinfo, COL_INFO,
+ col_append_fstr(pinfo->cinfo, COL_INFO,
" Alloc=%" G_GINT64_MODIFIER "u", tcntl->alloc);
- }
+
proto_item_append_text(top_ti,
", Recv-Seq: %" G_GINT64_MODIFIER "u", tcntl->rseq);
@@ -690,12 +689,11 @@ dissect_xtp_cntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
cntl->echo = tvb_get_ntohl(tvb, offset);
/** add summary **/
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO,
+ col_append_fstr(pinfo->cinfo, COL_INFO,
" Recv-Seq=%" G_GINT64_MODIFIER "u", cntl->rseq);
- col_append_fstr(pinfo->cinfo, COL_INFO,
+ col_append_fstr(pinfo->cinfo, COL_INFO,
" Alloc=%" G_GINT64_MODIFIER "u", cntl->alloc);
- }
+
proto_item_append_text(top_ti,
", Recv-Seq: %" G_GINT64_MODIFIER "u", cntl->rseq);
@@ -782,12 +780,11 @@ dissect_xtp_ecntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/** add summary **/
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO,
+ col_append_fstr(pinfo->cinfo, COL_INFO,
" Recv-Seq=%" G_GINT64_MODIFIER "u", ecntl->rseq);
- col_append_fstr(pinfo->cinfo, COL_INFO,
+ col_append_fstr(pinfo->cinfo, COL_INFO,
" Alloc=%" G_GINT64_MODIFIER "u", ecntl->alloc);
- }
+
proto_item_append_text(top_ti,
", Recv-Seq: %" G_GINT64_MODIFIER "u", ecntl->rseq);
@@ -971,15 +968,13 @@ dissect_xtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
}
}
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_str(pinfo->cinfo, COL_INFO,
+ col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(xtph->cmd_ptype_pformat,
pformat_vals, "Unknown pformat (%u)"));
- col_append_fstr(pinfo->cinfo, COL_INFO, " [%s]", options);
- col_append_fstr(pinfo->cinfo, COL_INFO,
+ col_append_fstr(pinfo->cinfo, COL_INFO, " [%s]", options);
+ col_append_fstr(pinfo->cinfo, COL_INFO,
" Seq=%" G_GINT64_MODIFIER "u", xtph->seq);
- col_append_fstr(pinfo->cinfo, COL_INFO, " Len=%u", xtph->dlen);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " Len=%u", xtph->dlen);
if (tree) {
ti = proto_tree_add_item(tree, proto_xtp, tvb, 0, -1, ENC_NA);
diff --git a/epan/dissectors/packet-xyplex.c b/epan/dissectors/packet-xyplex.c
index 584683ee76..2d06f741c9 100644
--- a/epan/dissectors/packet-xyplex.c
+++ b/epan/dissectors/packet-xyplex.c
@@ -89,11 +89,10 @@ dissect_xyplex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
server_port = tvb_get_ntohs(tvb, offset+2);
return_port = tvb_get_ntohs(tvb, offset+4);
reserved = tvb_get_ntohs(tvb, offset+6);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO,
+ col_add_fstr(pinfo->cinfo, COL_INFO,
"Registration Request: %d Return: %d",
server_port, return_port);
- }
+
if (tree) {
proto_tree_add_uint(xyplex_tree, hf_xyplex_type, tvb,
offset, 1, prototype);
@@ -126,10 +125,9 @@ dissect_xyplex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
prototype = tvb_get_guint8(tvb, offset);
padding = tvb_get_guint8(tvb, offset+1);
reply = tvb_get_ntohs(tvb, offset+2);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "Registration Reply: %s",
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Registration Reply: %s",
val_to_str(reply, xyplex_reg_vals, "Unknown (0x%02x)"));
- }
+
if (tree) {
proto_tree_add_uint(xyplex_tree, hf_xyplex_type, tvb,
offset, 1, prototype);
@@ -147,14 +145,12 @@ dissect_xyplex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
* the raw data being transfered from the remote server
* and the Xyplex serial port.
*/
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%d > %d Data",
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%d > %d Data",
pinfo->srcport, pinfo->destport);
- }
- if (tree) {
- proto_tree_add_text(xyplex_tree, tvb, offset, -1,
+
+ proto_tree_add_text(xyplex_tree, tvb, offset, -1,
"Data (%d bytes)", tvb_reported_length_remaining(tvb, offset));
- }
+
return tvb_reported_length_remaining(tvb, offset);
}
diff --git a/epan/dissectors/packet-yhoo.c b/epan/dissectors/packet-yhoo.c
index 658b2a8474..9abee75f1e 100644
--- a/epan/dissectors/packet-yhoo.c
+++ b/epan/dissectors/packet-yhoo.c
@@ -200,12 +200,10 @@ dissect_yhoo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
col_set_str(pinfo->cinfo, COL_PROTOCOL, "YHOO");
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s",
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s",
( tvb_memeql(tvb, offset + 0, "YPNS", 4) == 0 ) ? "Request" : "Response",
val_to_str(tvb_get_letohl(tvb, offset + 12),
yhoo_service_vals, "Unknown Service: %u"));
- }
if (tree) {
ti = proto_tree_add_item(tree, proto_yhoo, tvb,
diff --git a/epan/dissectors/packet-ymsg.c b/epan/dissectors/packet-ymsg.c
index 1a997f6c3b..63c21c89f5 100644
--- a/epan/dissectors/packet-ymsg.c
+++ b/epan/dissectors/packet-ymsg.c
@@ -390,15 +390,13 @@ dissect_ymsg_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "YMSG");
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO,
+ col_add_fstr(pinfo->cinfo, COL_INFO,
"%s (status=%s) ",
val_to_str(tvb_get_ntohs(tvb, offset + 10),
ymsg_service_vals, "Unknown Service: %u"),
val_to_str(tvb_get_ntohl(tvb, offset + 12),
ymsg_status_vals, "Unknown Status: %u")
);
- }
if (tree) {
ti = proto_tree_add_item(tree, proto_ymsg, tvb, offset, -1, ENC_NA);
diff --git a/epan/dissectors/packet-ypserv.c b/epan/dissectors/packet-ypserv.c
index e7be63d432..59559d6371 100644
--- a/epan/dissectors/packet-ypserv.c
+++ b/epan/dissectors/packet-ypserv.c
@@ -106,9 +106,8 @@ dissect_ypserv_status(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_t
if(status<0){
err=val_to_str(status, ypstat, "Unknown error:%u");
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO," %s", err);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO," %s", err);
+
proto_item_append_text(tree, " Error:%s", err);
}
@@ -193,23 +192,17 @@ dissect_match_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree
/*domain*/
offset = dissect_rpc_string(tvb, tree, hf_ypserv_domain, offset, &str);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO," %s/", str);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO," %s/", str);
proto_item_append_text(tree, " %s/", str);
/*map*/
offset = dissect_rpc_string(tvb, tree, hf_ypserv_map, offset, &str);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO,"%s/", str);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO,"%s/", str);
proto_item_append_text(tree, "%s/", str);
/*key*/
offset = dissect_rpc_string(tvb, tree, hf_ypserv_key, offset, &str);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO,"%s", str);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO,"%s", str);
proto_item_append_text(tree, "%s", str);
return offset;
@@ -229,9 +222,7 @@ dissect_match_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t
if(status>=0){
offset = dissect_rpc_string(tvb, tree, hf_ypserv_value,offset, &str);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO," %s", str);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO," %s", str);
proto_item_append_text(tree, " %s", str);
} else {
@@ -398,16 +389,12 @@ dissect_order_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree
/*domain*/
offset = dissect_rpc_string(tvb, tree, hf_ypserv_domain, offset, &str);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO," %s/", str);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO," %s/", str);
proto_item_append_text(tree, " %s/", str);
/*map*/
offset = dissect_rpc_string(tvb, tree, hf_ypserv_map, offset, &str);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, str);
- }
+ col_append_str(pinfo->cinfo, COL_INFO, str);
proto_item_append_text(tree, "%s", str);
return offset;
@@ -484,9 +471,7 @@ dissect_order_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t
/*order number*/
num=tvb_get_ntohl(tvb, offset);
offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_ordernum, offset);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO," 0x%08x", num);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO," 0x%08x", num);
proto_item_append_text(tree, " 0x%08x", num);
return offset;
diff --git a/epan/dissectors/packet-zbee-zcl.c b/epan/dissectors/packet-zbee-zcl.c
index ab02a62fdd..552ab7b9c9 100644
--- a/epan/dissectors/packet-zbee-zcl.c
+++ b/epan/dissectors/packet-zbee-zcl.c
@@ -823,20 +823,14 @@ static void dissect_zbee_zcl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
call_dissector(cluster_handle, payload_tvb, pinfo, zcl_tree);
}
else {
- if ( tree ) {
- proto_item_append_text(proto_root, ", Cluster-specific Command: 0x%02x, Seq: %u",
- packet.cmd_id, packet.tran_seqno);
- }
+ proto_item_append_text(proto_root, ", Cluster-specific Command: 0x%02x, Seq: %u",
+ packet.cmd_id, packet.tran_seqno);
- if ( check_col(pinfo->cinfo, COL_INFO) ) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "Command: 0x%02x, Seq: %u",
- packet.cmd_id, packet.tran_seqno);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, "Command: 0x%02x, Seq: %u",
+ packet.cmd_id, packet.tran_seqno);
- if ( zcl_tree ) {
- proto_tree_add_uint(zcl_tree, hf_zbee_zcl_cs_cmd_id, tvb, offset, (int)sizeof(guint8),
- packet.cmd_id);
- }
+ proto_tree_add_uint(zcl_tree, hf_zbee_zcl_cs_cmd_id, tvb, offset, (int)sizeof(guint8),
+ packet.cmd_id);
offset += (int)sizeof(guint8);
/* Don't decode cluster-specific commands */
diff --git a/epan/dissectors/packet-zbee-zdp.c b/epan/dissectors/packet-zbee-zdp.c
index 71b545385a..79705f3416 100644
--- a/epan/dissectors/packet-zbee-zdp.c
+++ b/epan/dissectors/packet-zbee-zdp.c
@@ -1110,12 +1110,8 @@ dissect_zbee_zdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Update info. */
- if (tree) {
- proto_item_append_text(zdp_tree, ", %s", val_to_str_const(cluster, zbee_zdp_cluster_names, "Unknown Cluster"));
- }
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(cluster, zbee_zdp_cluster_names, "Unknown Cluster"));
- }
+ proto_item_append_text(zdp_tree, ", %s", val_to_str_const(cluster, zbee_zdp_cluster_names, "Unknown Cluster"));
+ col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(cluster, zbee_zdp_cluster_names, "Unknown Cluster"));
/* Create a new tvb for the zdp message. */
zdp_tvb = tvb_new_subset_remaining(tvb, offset);
diff --git a/epan/dissectors/packet-zebra.c b/epan/dissectors/packet-zebra.c
index e1364be181..9d3d9d6112 100644
--- a/epan/dissectors/packet-zebra.c
+++ b/epan/dissectors/packet-zebra.c
@@ -442,10 +442,9 @@ dissect_zebra(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
left = tvb_reported_length(tvb);
offset = 0;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_set_str(pinfo->cinfo, COL_INFO,
+ col_set_str(pinfo->cinfo, COL_INFO,
request? "ZEBRA Request" : "ZEBRA Reply");
- }
+
if (tree) {
ti = proto_tree_add_item(tree, proto_zebra, tvb, offset, -1,
ENC_NA);
diff --git a/epan/dissectors/packet-zep.c b/epan/dissectors/packet-zep.c
index d397be2d9a..a135755ea6 100644
--- a/epan/dissectors/packet-zep.c
+++ b/epan/dissectors/packet-zep.c
@@ -170,16 +170,14 @@ static void dissect_zep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Enter name info protocol field */
- if(check_col(pinfo->cinfo, COL_PROTOCOL)){
- col_set_str(pinfo->cinfo, COL_PROTOCOL, (zep_data.version==1)?"ZEP":"ZEPv2");
- }
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, (zep_data.version==1)?"ZEP":"ZEPv2");
/* Enter name info protocol field */
- if(check_col(pinfo->cinfo, COL_INFO)){
- col_clear(pinfo->cinfo, COL_INFO);
- if (!((zep_data.version>=2) && (zep_data.type==ZEP_V2_TYPE_ACK))) col_add_fstr(pinfo->cinfo, COL_INFO, "Encapsulated ZigBee Packet [Channel]=%i [Length]=%i", zep_data.channel_id, ieee_packet_len);
- else col_add_fstr(pinfo->cinfo, COL_INFO, "Ack, Sequence Number: %i", zep_data.seqno);
- }
+ col_clear(pinfo->cinfo, COL_INFO);
+ if (!((zep_data.version>=2) && (zep_data.type==ZEP_V2_TYPE_ACK)))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Encapsulated ZigBee Packet [Channel]=%i [Length]=%i", zep_data.channel_id, ieee_packet_len);
+ else
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Ack, Sequence Number: %i", zep_data.seqno);
if(tree){
/* Create subtree for the ZEP Header */