Upon 2nd thought: revert removal of 'if (check_col(...))' around col_add_fstr & etc.

svn path=/trunk/; revision=30133
This commit is contained in:
Bill Meier 2009-09-25 00:29:06 +00:00
parent 0d22e0acb4
commit 8ccb52de00
5 changed files with 71 additions and 46 deletions

View File

@ -577,7 +577,8 @@ dissect_njack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
packet_type = tvb_get_guint8(tvb, 5);
col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_SHORT_NAME);
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(packet_type, njack_type_vals, "Type 0x%02x"));
if (check_col(pinfo->cinfo, COL_INFO))
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(packet_type, njack_type_vals, "Type 0x%02x"));
if (tree) {
ti = proto_tree_add_item(tree, proto_njack, tvb, offset, -1,

View File

@ -534,12 +534,13 @@ static void dissect_actrace_cas(tvbuff_t *tvb, packet_info *pinfo, proto_tree *a
proto_tree_add_int(actrace_tree, hf_actrace_cas_function, tvb, offset, 4, function);
offset += 4;
col_append_fstr(pinfo->cinfo, COL_INFO, "%s|%d|%s|%d|%s|",
val_to_str(source, actrace_cas_source_vals_short, "ukn"),
curr_state,
val_to_str(event, actrace_cas_event_vals, "%d"),
next_state,
val_to_str(function, actrace_cas_function_vals, "%d"));
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, "%s|%d|%s|%d|%s|",
val_to_str(source, actrace_cas_source_vals_short, "ukn"),
curr_state,
val_to_str(event, actrace_cas_event_vals, "%d"),
next_state,
val_to_str(function, actrace_cas_function_vals, "%d"));
par0 = tvb_get_ntohl(tvb, offset);
switch (function)
@ -548,27 +549,31 @@ static void dissect_actrace_cas(tvbuff_t *tvb, packet_info *pinfo, proto_tree *a
proto_tree_add_text(actrace_tree, tvb, offset, 4,
"Parameter 0: %s", val_to_str(par0,
actrace_cas_pstn_event_vals, "Unknown (%d)"));
col_append_fstr(pinfo->cinfo, COL_INFO, "%s|",
val_to_str(par0, actrace_cas_pstn_event_vals, "%d"));
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, "%s|",
val_to_str(par0, actrace_cas_pstn_event_vals, "%d"));
break;
case CHANGE_COLLECT_TYPE:
proto_tree_add_text(actrace_tree, tvb, offset, 4,
"Parameter 0: %s", val_to_str(par0,
actrace_cas_collect_type_vals, "Unknown (%d)"));
col_append_fstr(pinfo->cinfo, COL_INFO, "%s|",
val_to_str(par0, actrace_cas_collect_type_vals, "%d"));
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, "%s|",
val_to_str(par0, actrace_cas_collect_type_vals, "%d"));
break;
case SEND_MF:
case SEND_DEST_NUM:
proto_tree_add_text(actrace_tree, tvb, offset, 4,
"Parameter 0: %s", val_to_str(par0,
actrace_cas_send_type_vals, "Unknown (%d)"));
col_append_fstr(pinfo->cinfo, COL_INFO, "%s|",
val_to_str(par0, actrace_cas_send_type_vals, "%d"));
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, "%s|",
val_to_str(par0, actrace_cas_send_type_vals, "%d"));
break;
default:
proto_tree_add_int(actrace_tree, hf_actrace_cas_par0, tvb, offset, 4, par0);
col_append_fstr(pinfo->cinfo, COL_INFO, "%d|", par0);
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, "%d|", par0);
}
offset += 4;
@ -576,17 +581,20 @@ static void dissect_actrace_cas(tvbuff_t *tvb, packet_info *pinfo, proto_tree *a
if (function == SEND_EVENT) {
proto_tree_add_text(actrace_tree, tvb, offset, 4,
"Parameter 1: %s", val_to_str(par1, actrace_cas_cause_vals, "Unknown (%d)"));
col_append_fstr(pinfo->cinfo, COL_INFO, "%s|",
val_to_str(par1, actrace_cas_cause_vals, "%d"));
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, "%s|",
val_to_str(par1, actrace_cas_cause_vals, "%d"));
} else {
proto_tree_add_int(actrace_tree, hf_actrace_cas_par1, tvb, offset, 4, par1);
col_append_fstr(pinfo->cinfo, COL_INFO, "%d|", par1);
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, "%d|", par1);
}
offset += 4;
par2 = tvb_get_ntohl(tvb, offset);
proto_tree_add_int(actrace_tree, hf_actrace_cas_par2, tvb, offset, 4, par2);
col_append_fstr(pinfo->cinfo, COL_INFO, "%d|", par2);
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, "%d|", par2);
offset += 4;
trunk = tvb_get_ntohl(tvb, offset);
@ -597,7 +605,8 @@ static void dissect_actrace_cas(tvbuff_t *tvb, packet_info *pinfo, proto_tree *a
proto_tree_add_int(actrace_tree, hf_actrace_cas_bchannel, tvb, offset, 4, bchannel);
offset += 4;
col_prepend_fstr(pinfo->cinfo, COL_INFO, "t%db%d|", trunk, bchannel);
if (check_col(pinfo->cinfo, COL_INFO))
col_prepend_fstr(pinfo->cinfo, COL_INFO, "t%db%d|", trunk, bchannel);
value = tvb_get_ntohl(tvb, offset);
proto_tree_add_int(actrace_tree, hf_actrace_cas_connection_id, tvb, offset, 4, value);
@ -696,8 +705,9 @@ static void dissect_actrace_isdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
call_dissector(lapd_handle, next_tvb, pinfo, tree);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "AC_ISDN");
col_prepend_fstr(pinfo->cinfo, COL_INFO, "Trunk:%d Blade %s PSTN "
, trunk, value==PSTN_TO_BLADE?"<--":"-->");
if (check_col(pinfo->cinfo, COL_INFO))
col_prepend_fstr(pinfo->cinfo, COL_INFO, "Trunk:%d Blade %s PSTN "
, trunk, value==PSTN_TO_BLADE?"<--":"-->");
}
/*

View File

@ -141,7 +141,8 @@ static void dissect_bat_batman(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
dissect_bat_batman_v5(tvb, pinfo, tree);
break;
default:
col_add_fstr(pinfo->cinfo, COL_INFO, "Unsupported Version %d", version);
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "Unsupported Version %d", version);
call_dissector(data_handle, tvb, pinfo, tree);
break;
}
@ -193,7 +194,8 @@ static void dissect_bat_batman_v5(tvbuff_t *tvb, packet_info *pinfo, proto_tree
batman_packeth->hna_len = tvb_get_guint8(tvb, 17);
/* Set info column */
col_add_fstr(pinfo->cinfo, COL_INFO, "Seq=%u", batman_packeth->seqno);
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "Seq=%u", batman_packeth->seqno);
/* Set tree info */
if (tree) {
@ -331,11 +333,13 @@ static void dissect_bat_gw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "BAT_GW");
/* Set info column */
col_add_fstr(pinfo->cinfo, COL_INFO, "Type=%s",
val_to_str(gw_packeth->type, gw_packettypenames, "Unknown (0x%02x)"));
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "Type=%s",
val_to_str(gw_packeth->type, gw_packettypenames, "Unknown (0x%02x)"));
if (ip != 0) {
col_append_fstr(pinfo->cinfo, COL_INFO, " IP: %s (%s)",
get_hostname(ip), ip_to_str(ip_addr));
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, " IP: %s (%s)",
get_hostname(ip), ip_to_str(ip_addr));
}
@ -394,7 +398,8 @@ static void dissect_bat_vis(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_bat_vis_v23(tvb, pinfo, tree);
break;
default:
col_add_fstr(pinfo->cinfo, COL_INFO, "Unsupported Version %d", version);
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "Unsupported Version %d", version);
call_dissector(data_handle, tvb, pinfo, tree);
break;
}
@ -424,8 +429,9 @@ static void dissect_bat_vis_v22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
col_set_str(pinfo->cinfo, COL_PROTOCOL, "BAT_VIS");
/* Set info column */
col_add_fstr(pinfo->cinfo, COL_INFO, "Src: %s (%s)",
get_hostname(sender_ip), ip_to_str(vis_packeth->sender_ip.data));
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "Src: %s (%s)",
get_hostname(sender_ip), ip_to_str(vis_packeth->sender_ip.data));
/* Set tree info */
if (tree) {
@ -554,8 +560,9 @@ static void dissect_bat_vis_v23(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
col_set_str(pinfo->cinfo, COL_PROTOCOL, "BAT_VIS");
/* Set info column */
col_add_fstr(pinfo->cinfo, COL_INFO, "Src: %s (%s)",
get_hostname(sender_ip), ip_to_str(vis_packeth->sender_ip.data));
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "Src: %s (%s)",
get_hostname(sender_ip), ip_to_str(vis_packeth->sender_ip.data));
/* Set tree info */
if (tree) {

View File

@ -3838,15 +3838,21 @@ dissect_bootp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case BOOTREQUEST:
if ((htype == ARPHRD_ETHER || htype == ARPHRD_IEEE802)
&& hlen == 6)
col_add_fstr(pinfo->cinfo, COL_INFO, "Boot Request from %s (%s)",
arphrdaddr_to_str(tvb_get_ptr(tvb, 28, hlen),
hlen, htype),
get_ether_name(tvb_get_ptr(tvb, 28, hlen)));
else
col_add_fstr(pinfo->cinfo, COL_INFO, "Boot Request from %s",
arphrdaddr_to_str(tvb_get_ptr(tvb, 28, hlen),
hlen, htype));
&& hlen == 6) {
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Boot Request from %s (%s)",
arphrdaddr_to_str(tvb_get_ptr(tvb, 28, hlen),
hlen, htype),
get_ether_name(tvb_get_ptr(tvb, 28, hlen)));
}
}
else {
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Boot Request from %s",
arphrdaddr_to_str(tvb_get_ptr(tvb, 28, hlen),
hlen, htype));
}
}
break;
case BOOTREPLY:
@ -3854,8 +3860,8 @@ dissect_bootp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
default:
col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown BOOTP message type (%u)",
op);
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown BOOTP message type (%u)", op);
break;
}
@ -3895,8 +3901,9 @@ dissect_bootp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* packet type.
*/
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DHCP");
col_add_fstr(pinfo->cinfo, COL_INFO, "DHCP %-8s - Transaction ID 0x%x",
dhcp_type, tvb_get_ntohl(tvb, 4));
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "DHCP %-8s - Transaction ID 0x%x",
dhcp_type, tvb_get_ntohl(tvb, 4));
tap_queue_packet( bootp_dhcp_tap, pinfo, dhcp_type);
}

View File

@ -186,7 +186,7 @@ dissect_componentstatusprotocol_message(tvbuff_t *message_tvb, packet_info *pinf
guint8 type;
type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET);
if (pinfo) {
if (pinfo && (check_col(pinfo->cinfo, COL_INFO))) {
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(type, message_type_values, "Unknown ComponentStatusProtocol type"));
}
proto_tree_add_item(componentstatusprotocol_tree, hf_message_type, message_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, FALSE);