Use col_set_str instead of col_add_fstr when adding constant strings to COL_INFO

svn path=/trunk/; revision=30082
This commit is contained in:
Kovarththanan Rajaratnam 2009-09-22 21:18:11 +00:00
parent a05517fd21
commit c28bafe341
17 changed files with 39 additions and 42 deletions

View File

@ -1028,7 +1028,7 @@ static void dissect_dplay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Clear out stuff in the info column */
col_clear(pinfo->cinfo, COL_INFO);
if(check_col(pinfo->cinfo,COL_INFO))
col_add_fstr(pinfo->cinfo,COL_INFO, "DPlay data packet");
col_set_str(pinfo->cinfo, COL_INFO, "DPlay data packet");
return;
}
@ -1141,7 +1141,7 @@ static void dissect_dplay_player_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tr
/* Clear out stuff in the info column */
col_clear(pinfo->cinfo, COL_INFO);
if(check_col(pinfo->cinfo,COL_INFO))
col_add_fstr(pinfo->cinfo,COL_INFO, "DPlay player to player message");
col_set_str(pinfo->cinfo, COL_INFO, "DPlay player to player message");
if(tree)
{

View File

@ -297,13 +297,13 @@ static void dissect_tcp_bundle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* Only Start and End flags (bits 0 & 1) are valid in Data Segment */
if((conv_hdr & ~(TCP_CONVERGENCE_TYPE_MASK | TCP_CONVERGENCE_DATA_FLAGS)) != 0) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Invalid TCP CL Data Segment Flags");
col_set_str(pinfo->cinfo, COL_INFO, "Invalid TCP CL Data Segment Flags");
return;
}
fixed = 1;
segment_length = evaluate_sdnv(tvb, fixed + frame_offset, &sdnv_length);
if(segment_length < 0) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Protocol Error (Length)");
col_set_str(pinfo->cinfo, COL_INFO, "Protocol Error (Length)");
return;
}
convergence_hdr_size = sdnv_length + fixed;
@ -357,7 +357,7 @@ static void dissect_tcp_bundle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if(new_tvb){
bundle_size = dissect_complete_bundle(new_tvb, pinfo, bundle_tree);
if(bundle_size == 0) { /*Couldn't parse bundle*/
col_add_fstr(pinfo->cinfo, COL_INFO, "Dissection Failed");
col_set_str(pinfo->cinfo, COL_INFO, "Dissection Failed");
return; /*Give up*/
}
}
@ -373,7 +373,7 @@ static void dissect_tcp_bundle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
* 2-segment case.
*/
col_add_fstr(pinfo->cinfo, COL_INFO, "[Reassembled Segment of a Bundle]");
col_set_str(pinfo->cinfo, COL_INFO, "[Reassembled Segment of a Bundle]");
}
/*
@ -528,7 +528,7 @@ dissect_udp_bundle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
primary_tree = proto_item_add_subtree(primary_item, ett_primary_hdr);
hdr_offset = dissect_primary_header(pinfo, primary_tree, tvb);
if(hdr_offset == 0) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Protocol Error");
col_set_str(pinfo->cinfo, COL_INFO, "Protocol Error");
return;
}
proto_item_set_len(primary_item, hdr_offset);
@ -549,7 +549,7 @@ dissect_udp_bundle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hdr_offset, &lasthdrflag);
}
if(hdr_offset == 0) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Protocol Error");
col_set_str(pinfo->cinfo, COL_INFO, "Protocol Error");
return;
}
if(lasthdrflag) {
@ -612,7 +612,7 @@ dissect_complete_bundle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
primary_tree = proto_item_add_subtree(primary_item, ett_primary_hdr);
primary_header_size = dissect_primary_header(pinfo, primary_tree, tvb);
if(primary_header_size == 0) { /*Couldn't parse primary header*/
col_add_fstr(pinfo->cinfo, COL_INFO, "Protocol Error");
col_set_str(pinfo->cinfo, COL_INFO, "Protocol Error");
return(0); /*Give up*/
}
proto_item_set_len(primary_item, primary_header_size);
@ -638,7 +638,7 @@ dissect_complete_bundle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if(payload_size == 0) { /*Payload header parse failed*/
col_add_fstr(pinfo->cinfo, COL_INFO, "Dissection Failed");
col_set_str(pinfo->cinfo, COL_INFO, "Dissection Failed");
return (0);
}
offset += payload_size;
@ -1692,7 +1692,7 @@ dissect_contact_header(tvbuff_t *tvb, packet_info *pinfo,
eid_length = evaluate_sdnv(tvb, 8, &sdnv_length);
if(eid_length < 0) {
if(check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Protocol Error (Local EID Length)");
col_set_str(pinfo->cinfo, COL_INFO, "Protocol Error (Local EID Length)");
}
return 0;
}

View File

@ -197,7 +197,7 @@ static void dissect_kdp(tvbuff_t *tvb,
print more detailed summary info */
if (check_col(pinfo->cinfo, COL_INFO)) {
if (version != 2) {
col_add_fstr(pinfo->cinfo, COL_INFO, "SDDP message");
col_set_str(pinfo->cinfo, COL_INFO, "SDDP message");
} else {
char ack_string[BUFFER_SIZE];
char seq_num_string[BUFFER_SIZE];

View File

@ -394,7 +394,7 @@ socks_udp_dissector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Socks");
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "Version: 5, UDP Associated packet");
col_set_str(pinfo->cinfo, COL_INFO, "Version: 5, UDP Associated packet");
if ( tree) {
ti = proto_tree_add_protocol_format( tree, proto_socks, tvb,

View File

@ -439,7 +439,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* two first bits not NULL => should be a channel-data message*/
/* Clear out stuff in the info column */
col_add_fstr(pinfo->cinfo, COL_INFO, "ChannelData TURN Message");
col_set_str(pinfo->cinfo, COL_INFO, "ChannelData TURN Message");
if (!tree)
return tvb_length(tvb);

View File

@ -88,7 +88,7 @@ static int testchar(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, int op, g
}
} else {
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown Message Format");
col_set_str(pinfo->cinfo, COL_INFO, "Unknown Message Format");
return 0;
}
}

View File

@ -234,7 +234,7 @@ static void dissect_xot_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gint hdr_offset = offset;
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "XOT PVC Setup");
col_set_str(pinfo->cinfo, COL_INFO, "XOT PVC Setup");
proto_item_set_len(ti, XOT_HEADER_LENGTH + plen);
/* These fields are in overlay with packet-x25.c */

View File

@ -325,7 +325,7 @@ dissect_zrtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ZRTP");
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown ZRTP Packet");
col_set_str(pinfo->cinfo, COL_INFO, "Unknown ZRTP Packet");
ti = proto_tree_add_protocol_format(tree,proto_zrtp,tvb,0,-1,"ZRTP protocol");
zrtp_tree = proto_item_add_subtree(ti,ett_zrtp);
@ -438,35 +438,35 @@ dissect_zrtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
static void
dissect_ErrorACK(packet_info *pinfo) {
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "ErrorACK Packet");
col_set_str(pinfo->cinfo, COL_INFO, "ErrorACK Packet");
}
}
static void
dissect_ClearACK(packet_info *pinfo) {
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "ClearACK Packet");
col_set_str(pinfo->cinfo, COL_INFO, "ClearACK Packet");
}
}
static void
dissect_RelayACK(packet_info *pinfo) {
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "RelayACK Packet");
col_set_str(pinfo->cinfo, COL_INFO, "RelayACK Packet");
}
}
static void
dissect_Conf2ACK(packet_info *pinfo) {
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Conf2ACK Packet");
col_set_str(pinfo->cinfo, COL_INFO, "Conf2ACK Packet");
}
}
static void
dissect_HelloACK(packet_info *pinfo) {
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "HelloACK Packet");
col_set_str(pinfo->cinfo, COL_INFO, "HelloACK Packet");
}
}
@ -475,7 +475,7 @@ dissect_Ping(tvbuff_t *tvb, packet_info *pinfo, proto_tree *zrtp_tree) {
unsigned int data_offset=24;
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Ping Packet");
col_set_str(pinfo->cinfo, COL_INFO, "Ping Packet");
}
proto_tree_add_item(zrtp_tree,hf_zrtp_msg_ping_version,tvb,data_offset,4,FALSE);
@ -487,7 +487,7 @@ dissect_PingACK(tvbuff_t *tvb, packet_info *pinfo, proto_tree *zrtp_tree) {
unsigned int data_offset=24;
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "PingACK Packet");
col_set_str(pinfo->cinfo, COL_INFO, "PingACK Packet");
}
proto_tree_add_item(zrtp_tree,hf_zrtp_msg_ping_version,tvb,data_offset,4,FALSE);
@ -501,7 +501,7 @@ dissect_GoClear(tvbuff_t *tvb, packet_info *pinfo, proto_tree *zrtp_tree) {
unsigned int data_offset=24;
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "GoClear Packet");
col_set_str(pinfo->cinfo, COL_INFO, "GoClear Packet");
}
proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hmac,tvb,data_offset+0,8,FALSE);
@ -512,7 +512,7 @@ dissect_Error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *zrtp_tree) {
unsigned int data_offset=24;
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Error Packet");
col_set_str(pinfo->cinfo, COL_INFO, "Error Packet");
}
proto_tree_add_item(zrtp_tree,hf_zrtp_msg_error,tvb,data_offset,4,FALSE);
@ -544,7 +544,7 @@ dissect_SASrelay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *zrtp_tree) {
int linelen;
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "SASrelay Packet");
col_set_str(pinfo->cinfo, COL_INFO, "SASrelay Packet");
}
proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hmac,tvb,data_offset+0,8,FALSE);
@ -592,7 +592,7 @@ dissect_Commit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *zrtp_tree) {
unsigned int offset;
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Commit Packet");
col_set_str(pinfo->cinfo, COL_INFO, "Commit Packet");
}
proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hash_image,tvb,msg_offset+12,32,FALSE);
@ -665,14 +665,14 @@ dissect_Hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *zrtp_tree) {
proto_tree *tmp_tree;
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Hello Packet");
col_set_str(pinfo->cinfo, COL_INFO, "Hello Packet");
}
tvb_memcpy(tvb,version_str,msg_offset+12,4);
version_str[4]='\0';
if (check_valid_version(version_str) == NULL){
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Unsupported version of ZRTP protocol");
col_set_str(pinfo->cinfo, COL_INFO, "Unsupported version of ZRTP protocol");
}
}
proto_tree_add_item(zrtp_tree,hf_zrtp_msg_version,tvb,msg_offset+12,4,FALSE);

View File

@ -58,7 +58,7 @@ dissect_dccack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
if (check_col (pinfo->cinfo, COL_INFO))
{
col_clear (pinfo->cinfo, COL_INFO);
col_add_fstr (pinfo->cinfo, COL_INFO,"DCC-ACK Message: ");
col_set_str(pinfo->cinfo, COL_INFO, "DCC-ACK Message: ");
}
if (tree)

View File

@ -268,7 +268,7 @@ dissect_dccreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
if (check_col (pinfo->cinfo, COL_INFO))
{
col_clear (pinfo->cinfo, COL_INFO);
col_add_fstr (pinfo->cinfo, COL_INFO,"DCC-REQ Message: ");
col_set_str(pinfo->cinfo, COL_INFO, "DCC-REQ Message: ");
}
if (tree)

View File

@ -114,7 +114,7 @@ dissect_dccrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
if (check_col (pinfo->cinfo, COL_INFO))
{
col_clear (pinfo->cinfo, COL_INFO);
col_add_fstr (pinfo->cinfo, COL_INFO,"DCC-RSP Message: ");
col_set_str(pinfo->cinfo, COL_INFO, "DCC-RSP Message: ");
}
if (tree)

View File

@ -516,7 +516,7 @@ dissect_dcd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
if (check_col (pinfo->cinfo, COL_INFO))
{
col_clear (pinfo->cinfo, COL_INFO);
col_add_fstr (pinfo->cinfo, COL_INFO,"DCD Message: ");
col_set_str(pinfo->cinfo, COL_INFO, "DCD Message: ");
}
if (tree)

View File

@ -325,7 +325,7 @@ dissect_mdd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
if (check_col (pinfo->cinfo, COL_INFO))
{
col_clear (pinfo->cinfo, COL_INFO);
col_add_fstr (pinfo->cinfo, COL_INFO, "MDD Message:");
col_set_str(pinfo->cinfo, COL_INFO, "MDD Message:");
}
if (tree)

View File

@ -58,8 +58,7 @@ dissect_regreqmp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
if (check_col (pinfo->cinfo, COL_INFO))
{
col_clear (pinfo->cinfo, COL_INFO);
col_add_fstr (pinfo->cinfo, COL_INFO,
"REG-REQ-MP Message:");
col_set_str(pinfo->cinfo, COL_INFO, "REG-REQ-MP Message:");
}
if (tree)

View File

@ -63,8 +63,7 @@ dissect_regrspmp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
if (check_col (pinfo->cinfo, COL_INFO))
{
col_clear (pinfo->cinfo, COL_INFO);
col_add_fstr (pinfo->cinfo, COL_INFO,
"REG-RSP-MP Message:");
col_set_str(pinfo->cinfo, COL_INFO, "REG-RSP-MP Message:");
}
if (tree)

View File

@ -48,8 +48,7 @@ dissect_sync (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
if (check_col (pinfo->cinfo, COL_INFO))
{
col_clear (pinfo->cinfo, COL_INFO);
col_add_fstr (pinfo->cinfo, COL_INFO,
"Sync Message:");
col_set_str(pinfo->cinfo, COL_INFO, "Sync Message:");
}
if (tree)

View File

@ -676,7 +676,7 @@ dissect_pn_rt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* ask heuristics, if some sub-dissector is interested in this packet payload */
if(!dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree)) {
/*if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown");*/
col_set_str(pinfo->cinfo, COL_INFO, "Unknown");*/
/* Oh, well, we don't know this; dissect it as data. */
dissect_pn_undecoded(next_tvb, 0, pinfo, tree, tvb_length(next_tvb));