Remove check_col() and the occasional tree.

svn path=/trunk/; revision=49921
This commit is contained in:
Michael Mann 2013-06-14 01:56:28 +00:00
parent 0f0c111119
commit fa5b45834b
67 changed files with 611 additions and 896 deletions

View File

@ -130,8 +130,7 @@ dissect_tpcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tpcph.cport = g_ntohs(tpcph.cport);
tpcph.signature = g_ntohl(tpcph.signature);
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO,"%s id %d CPort %s CIP %s SIP %s",
col_add_fstr(pinfo->cinfo, COL_INFO,"%s id %d CPort %s CIP %s SIP %s",
val_to_str_const(tpcph.type, type_vals, "Unknown"),
tpcph.id,
get_udp_port(tpcph.cport),

View File

@ -531,17 +531,13 @@ static int dissect_olsr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
/* Does this packet have a valid message type at the beginning? */
if (tvb_length(tvb) < 4) {
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "OLSR Packet, Length: %u Bytes (not enough data in packet)",
col_add_fstr(pinfo->cinfo, COL_INFO, "OLSR Packet, Length: %u Bytes (not enough data in packet)",
tvb_length(tvb));
}
return 0; /* not enough bytes for the packet length */
}
packet_len = tvb_get_ntohs(tvb, 0);
if (packet_len > tvb_length(tvb)) {
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "OLSR Packet, Length: %u Bytes (not enough data in packet)", packet_len);
}
col_add_fstr(pinfo->cinfo, COL_INFO, "OLSR Packet, Length: %u Bytes (not enough data in packet)", packet_len);
return 0;
}
/*-------------Setting the Protocol and Info Columns in the Wireshark Display----------*/
@ -549,14 +545,12 @@ static int dissect_olsr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
col_clear(pinfo->cinfo, COL_INFO);
if ((pinfo->src.type != AT_IPv4) && (pinfo->src.type != AT_IPv6)) {
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "OLSR (unknown address type) Packet, Length: %u Bytes", packet_len);
}
col_add_fstr(pinfo->cinfo, COL_INFO, "OLSR (unknown address type) Packet, Length: %u Bytes", packet_len);
return 0;
}
if (check_col(pinfo->cinfo, COL_INFO) && (pinfo->src.type == AT_IPv4)) {
if (pinfo->src.type == AT_IPv4) {
col_add_fstr(pinfo->cinfo, COL_INFO, "OLSR (IPv4) Packet, Length: %u Bytes", packet_len);
} else if (check_col(pinfo->cinfo, COL_INFO) && (pinfo->src.type == AT_IPv6)) {
} else if (pinfo->src.type == AT_IPv6) {
col_add_fstr(pinfo->cinfo, COL_INFO, "OLSR (IPv6) Packet, Length: %u Bytes", packet_len);
}

View File

@ -136,10 +136,8 @@ dissect_omapi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ptvcursor_add(cursor, hf_omapi_version, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_omapi_hlength, 4, ENC_BIG_ENDIAN);
if (check_col(pinfo->cinfo, COL_INFO))
{
col_append_str(pinfo->cinfo, COL_INFO, "Status message");
}
col_append_str(pinfo->cinfo, COL_INFO, "Status message");
proto_item_append_text(ti, ", Status message");
}
@ -147,11 +145,9 @@ dissect_omapi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
authlength = tvb_get_ntohl(tvb, ptvcursor_current_offset(cursor));
ptvcursor_add(cursor, hf_omapi_auth_len, 4, ENC_BIG_ENDIAN);
if (check_col(pinfo->cinfo, COL_INFO))
{
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL,
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL,
val_to_str(tvb_get_ntohl(tvb, ptvcursor_current_offset(cursor)), omapi_opcode_vals, "Unknown opcode (0x%04x)"));
}
proto_item_append_text(ti, ", Opcode: %s",
val_to_str(tvb_get_ntohl(tvb, ptvcursor_current_offset(cursor)), omapi_opcode_vals, "Unknown opcode (0x%04x)"));

View File

@ -1125,16 +1125,12 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
icf_flags = tvb_get_guint8(tvb, offset);
if (icf_flags & 0x40) {
is_response = TRUE;
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Response : %s", cmd_str);
}
col_add_fstr(pinfo->cinfo, COL_INFO, "Response : %s", cmd_str);
}
else
{
is_command = TRUE;
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Command : %s", cmd_str);
}
col_add_fstr(pinfo->cinfo, COL_INFO, "Command : %s", cmd_str);
}
if (tree) { /* we are being asked for details */

View File

@ -1323,12 +1323,9 @@ dissect_openwire(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
iCommand = tvb_get_guint8(tvb, offset + 4);
if (check_col(pinfo->cinfo, COL_INFO))
{
col_append_sep_str(pinfo->cinfo, COL_INFO, " | ",
val_to_str_ext(iCommand, &openwire_opcode_vals_ext, "Unknown (0x%02x)"));
col_set_fence(pinfo->cinfo, COL_INFO);
}
col_append_sep_str(pinfo->cinfo, COL_INFO, " | ",
val_to_str_ext(iCommand, &openwire_opcode_vals_ext, "Unknown (0x%02x)"));
col_set_fence(pinfo->cinfo, COL_INFO);
detect_protocol_options(tvb, pinfo, offset, iCommand);

View File

@ -559,19 +559,17 @@ dissect_opsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "OPSI");
if (check_col(pinfo->cinfo, COL_INFO)) {
col_clear(pinfo->cinfo, COL_INFO);
if (tvb_length(tvb) < CODE_OFFSET+1) {
col_set_str(pinfo->cinfo, COL_INFO, "Open Policy Service Interface");
}
else {
col_add_fstr(pinfo->cinfo, COL_INFO, "Open Policy Service Interface, %s",
val_to_str(tvb_get_guint8(tvb, CODE_OFFSET), opsi_opcode,
"<Unknown opcode %d>"));
}
col_clear(pinfo->cinfo, COL_INFO);
if (tvb_length(tvb) < CODE_OFFSET+1) {
col_set_str(pinfo->cinfo, COL_INFO, "Open Policy Service Interface");
}
else {
col_add_fstr(pinfo->cinfo, COL_INFO, "Open Policy Service Interface, %s",
val_to_str(tvb_get_guint8(tvb, CODE_OFFSET), opsi_opcode,
"<Unknown opcode %d>"));
}
}
else if (check_col(pinfo->cinfo, COL_INFO) && (tvb_length(tvb) > CODE_OFFSET)) {
else if (tvb_length(tvb) > CODE_OFFSET) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
val_to_str(tvb_get_guint8(tvb, CODE_OFFSET), opsi_opcode,
"<Unknown opcode %d>"));

View File

@ -486,9 +486,8 @@ static void dissect_osi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
default:
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ISO");
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown ISO protocol (%02x)", nlpid);
}
col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown ISO protocol (%02x)", nlpid);
call_dissector(data_handle,tvb, pinfo, tree);
break;
}

View File

@ -876,8 +876,7 @@ static int ositp_decode_DR(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
default: return -1;
}
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO,
col_append_fstr(pinfo->cinfo, COL_INFO,
"DR TPDU src-ref: 0x%04x dst-ref: 0x%04x",
src_ref, dst_ref);
@ -1099,15 +1098,13 @@ static int ositp_decode_DT(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
pinfo->clnp_dstref = dst_ref;
pinfo->fragmented = fragment;
if (check_col(pinfo->cinfo, COL_INFO)) {
if (is_class_234) {
if (is_class_234) {
col_append_fstr(pinfo->cinfo, COL_INFO, "DT TPDU (%u) dst-ref: 0x%04x",
tpdu_nr,
dst_ref);
} else {
col_append_fstr(pinfo->cinfo, COL_INFO, "DT TPDU (%u)", tpdu_nr);
}
}
if (tree) {
ti = proto_tree_add_item(tree, proto_cotp, tvb, offset, li + 1, ENC_NA);
@ -1157,13 +1154,11 @@ static int ositp_decode_DT(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
next_tvb = tvb_new_subset_remaining(tvb, offset);
fragment_length = tvb_length(next_tvb);
if (check_col(pinfo->cinfo, COL_INFO)) {
if (fragment) {
col_append_fstr(pinfo->cinfo, COL_INFO, " [COTP fragment, %u byte%s]",
fragment_length, plurality(fragment_length, "", "s"));
} else {
col_append_fstr(pinfo->cinfo, COL_INFO, " EOT");
}
if (fragment) {
col_append_fstr(pinfo->cinfo, COL_INFO, " [COTP fragment, %u byte%s]",
fragment_length, plurality(fragment_length, "", "s"));
} else {
col_append_fstr(pinfo->cinfo, COL_INFO, " EOT");
}
if (cotp_reassemble) {
@ -1381,8 +1376,7 @@ static int ositp_decode_ED(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
dst_ref = tvb_get_ntohs(tvb, offset + P_DST_REF);
pinfo->clnp_dstref = dst_ref;
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, "ED TPDU (%u) dst-ref: 0x%04x",
col_append_fstr(pinfo->cinfo, COL_INFO, "ED TPDU (%u) dst-ref: 0x%04x",
tpdu_nr, dst_ref);
if (tree) {
@ -1486,8 +1480,7 @@ static int ositp_decode_RJ(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
dst_ref = tvb_get_ntohs(tvb, offset + P_DST_REF);
pinfo->clnp_dstref = dst_ref;
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, "RJ TPDU (%u) dst-ref: 0x%04x",
col_append_fstr(pinfo->cinfo, COL_INFO, "RJ TPDU (%u) dst-ref: 0x%04x",
tpdu_nr, dst_ref);
if (tree) {
@ -1551,8 +1544,7 @@ static int ositp_decode_CC(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
pinfo->clnp_srcref = src_ref;
pinfo->clnp_dstref = dst_ref;
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO,
col_append_fstr(pinfo->cinfo, COL_INFO,
"%s TPDU src-ref: 0x%04x dst-ref: 0x%04x",
(tpdu == CR_TPDU) ? "CR" : "CC",
src_ref,
@ -1675,8 +1667,7 @@ static int ositp_decode_DC(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
pinfo->clnp_dstref = dst_ref;
pinfo->clnp_dstref = src_ref;
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO,
col_append_fstr(pinfo->cinfo, COL_INFO,
"DC TPDU src-ref: 0x%04x dst-ref: 0x%04x",
src_ref,
dst_ref);
@ -1744,8 +1735,7 @@ static int ositp_decode_AK(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
tpdu_nr = tvb_get_guint8(tvb, offset + P_TPDU_NR_234);
pinfo->clnp_dstref = dst_ref;
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, "AK TPDU (%u) dst-ref: 0x%04x",
col_append_fstr(pinfo->cinfo, COL_INFO, "AK TPDU (%u) dst-ref: 0x%04x",
tpdu_nr, dst_ref);
if (tree) {
@ -1786,8 +1776,7 @@ static int ositp_decode_AK(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
cdt_in_ak = tvb_get_ntohs(tvb, offset + P_CDT_IN_AK);
pinfo->clnp_dstref = dst_ref;
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, "AK TPDU (%u) dst-ref: 0x%04x Credit: %u",
col_append_fstr(pinfo->cinfo, COL_INFO, "AK TPDU (%u) dst-ref: 0x%04x Credit: %u",
tpdu_nr, dst_ref, cdt_in_ak);
if (tree) {
@ -1968,8 +1957,7 @@ static int ositp_decode_EA(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
dst_ref = tvb_get_ntohs(tvb, offset + P_DST_REF);
pinfo->clnp_dstref = dst_ref;
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO,
col_append_fstr(pinfo->cinfo, COL_INFO,
"EA TPDU (%u) dst-ref: 0x%04x", tpdu_nr, dst_ref);
if (tree) {
@ -2055,8 +2043,7 @@ static int ositp_decode_ER(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
dst_ref = tvb_get_ntohs(tvb, offset + P_DST_REF);
pinfo->clnp_dstref = dst_ref;
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, "ER TPDU dst-ref: 0x%04x", dst_ref);
col_append_fstr(pinfo->cinfo, COL_INFO, "ER TPDU dst-ref: 0x%04x", dst_ref);
if (tree) {
ti = proto_tree_add_item(tree, proto_cotp, tvb, offset, li + 1, ENC_NA);
@ -2157,8 +2144,7 @@ static gint dissect_ositp_internal(tvbuff_t *tvb, packet_info *pinfo,
/* Initialize the COL_INFO field; each of the TPDUs will have its
information appended. */
if (check_col(pinfo->cinfo, COL_INFO))
col_set_str(pinfo->cinfo, COL_INFO, "");
col_set_str(pinfo->cinfo, COL_INFO, "");
while (tvb_offset_exists(tvb, offset)) {
if (!first_tpdu) {
@ -2217,7 +2203,7 @@ static gint dissect_ositp_internal(tvbuff_t *tvb, packet_info *pinfo,
is_cltp = TRUE;
break;
default :
if (first_tpdu && check_col(pinfo->cinfo, COL_INFO))
if (first_tpdu)
col_append_fstr(pinfo->cinfo, COL_INFO, "Unknown TPDU type (0x%x)", tpdu);
new_offset = -1; /* bad PDU type */
break;
@ -2233,7 +2219,7 @@ static gint dissect_ositp_internal(tvbuff_t *tvb, packet_info *pinfo,
if (first_tpdu) {
/* Well, we found at least one valid COTP or CLTP PDU, so I guess this
is either COTP or CLTP. */
if (!subdissector_found && check_col(pinfo->cinfo, COL_PROTOCOL))
if (!subdissector_found)
col_set_str(pinfo->cinfo, COL_PROTOCOL, is_cltp ? "CLTP" : "COTP");
found_ositp = TRUE;
}

View File

@ -1080,9 +1080,8 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
case Ack_PDU:
if (check_col (pinfo->cinfo, COL_INFO)) {
message_id_list = ep_strbuf_new_label("");
}
message_id_list = ep_strbuf_new_label("");
for (i = 0; i < count; i++) {
/* Ack Info Entry */
len = tvb_get_ntohs (tvb, offset);
@ -1124,12 +1123,10 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
offset += 4;
if (check_col (pinfo->cinfo, COL_INFO)) {
if (i == 0) {
ep_strbuf_printf (message_id_list, "%u", message_id);
} else {
ep_strbuf_append_printf (message_id_list, ",%u", message_id);
}
if (i == 0) {
ep_strbuf_printf (message_id_list, "%u", message_id);
} else {
ep_strbuf_append_printf (message_id_list, ",%u", message_id);
}
if (len > 10) {
@ -1254,37 +1251,35 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
message_id, seq_no, tot_no_missing);
}
if (check_col (pinfo->cinfo, COL_INFO)) {
/* Check if printing Ack-Ack */
if (pdu_type == Address_PDU && no_dest == 0) {
col_append_str (pinfo->cinfo, COL_INFO, get_type (Ack_Ack_PDU));
} else {
col_append_str (pinfo->cinfo, COL_INFO, get_type (pdu_type));
/* Check if printing Ack-Ack */
if (pdu_type == Address_PDU && no_dest == 0) {
col_append_str (pinfo->cinfo, COL_INFO, get_type (Ack_Ack_PDU));
} else {
col_append_str (pinfo->cinfo, COL_INFO, get_type (pdu_type));
}
if (pdu_type == Address_PDU || pdu_type == Extra_Address_PDU ||
pdu_type == FEC_Address_PDU || pdu_type == Extra_FEC_Address_PDU) {
col_append_fstr (pinfo->cinfo, COL_INFO, ", No PDUs: %u", no_pdus);
} else if (pdu_type == Data_PDU) {
col_append_fstr (pinfo->cinfo, COL_INFO, ", Seq no: %u", seq_no);
}
if (pdu_type == Address_PDU || pdu_type == Extra_Address_PDU ||
pdu_type == FEC_Address_PDU || pdu_type == Extra_FEC_Address_PDU) {
if (no_dest > 0) {
col_append_fstr (pinfo->cinfo, COL_INFO, ", Count of Dest: %u", no_dest);
}
if (pdu_type == Address_PDU || pdu_type == Extra_Address_PDU ||
pdu_type == FEC_Address_PDU || pdu_type == Extra_FEC_Address_PDU) {
col_append_fstr (pinfo->cinfo, COL_INFO, ", No PDUs: %u", no_pdus);
} else if (pdu_type == Data_PDU) {
col_append_fstr (pinfo->cinfo, COL_INFO, ", Seq no: %u", seq_no);
} else if (pdu_type == Ack_PDU) {
if (tot_no_missing) {
col_append_fstr (pinfo->cinfo, COL_INFO, ", Missing seq numbers: %u",
tot_no_missing);
}
if (pdu_type == Address_PDU || pdu_type == Extra_Address_PDU ||
pdu_type == FEC_Address_PDU || pdu_type == Extra_FEC_Address_PDU) {
if (no_dest > 0) {
col_append_fstr (pinfo->cinfo, COL_INFO, ", Count of Dest: %u", no_dest);
}
} else if (pdu_type == Ack_PDU) {
if (tot_no_missing) {
col_append_fstr (pinfo->cinfo, COL_INFO, ", Missing seq numbers: %u",
tot_no_missing);
}
col_append_fstr (pinfo->cinfo, COL_INFO, ", Count of Ack: %u", count);
}
if (pdu_type != Ack_PDU) {
col_append_fstr (pinfo->cinfo, COL_INFO, ", MSID: %u", message_id);
} else {
if (message_id_list && message_id_list->len > 0) {
col_append_fstr (pinfo->cinfo, COL_INFO, ", MSID: %s", message_id_list->str);
}
col_append_fstr (pinfo->cinfo, COL_INFO, ", Count of Ack: %u", count);
}
if (pdu_type != Ack_PDU) {
col_append_fstr (pinfo->cinfo, COL_INFO, ", MSID: %u", message_id);
} else {
if (message_id_list && message_id_list->len > 0) {
col_append_fstr (pinfo->cinfo, COL_INFO, ", MSID: %s", message_id_list->str);
}
}

View File

@ -192,49 +192,35 @@ dissect_pagp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(pagp_tree, hf_pagp_version_number, tvb,
PAGP_VERSION_NUMBER, 1, raw_octet);
}
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_str(pinfo->cinfo, COL_INFO,
val_to_str_const(raw_octet, pdu_vers, "Unknown PDU version"));
}
col_append_str(pinfo->cinfo, COL_INFO,
val_to_str_const(raw_octet, pdu_vers, "Unknown PDU version"));
if (raw_octet == PAGP_FLUSH_PDU) {
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, "; Local DevID: %s",
col_append_fstr(pinfo->cinfo, COL_INFO, "; Local DevID: %s",
tvb_ether_to_str(tvb, PAGP_FLUSH_LOCAL_DEVICE_ID));
}
if (tree) {
proto_tree_add_item(pagp_tree, hf_pagp_flush_local_device_id, tvb,
PAGP_FLUSH_LOCAL_DEVICE_ID, 6, ENC_NA);
}
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Partner DevID: %s",
proto_tree_add_item(pagp_tree, hf_pagp_flush_local_device_id, tvb,
PAGP_FLUSH_LOCAL_DEVICE_ID, 6, ENC_NA);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Partner DevID: %s",
tvb_ether_to_str(tvb, PAGP_FLUSH_PARTNER_DEVICE_ID));
}
if (tree) {
proto_tree_add_item(pagp_tree, hf_pagp_flush_partner_device_id, tvb,
PAGP_FLUSH_PARTNER_DEVICE_ID, 6, ENC_NA);
}
proto_tree_add_item(pagp_tree, hf_pagp_flush_partner_device_id, tvb,
PAGP_FLUSH_PARTNER_DEVICE_ID, 6, ENC_NA);
raw_word = tvb_get_ntohl(tvb, PAGP_FLUSH_TRANSACTION_ID);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO,
"; Transaction ID: 0x%x ", raw_word);
}
if (tree) {
proto_tree_add_uint(pagp_tree, hf_pagp_flush_transaction_id, tvb,
PAGP_FLUSH_TRANSACTION_ID, 4, raw_word);
}
col_append_fstr(pinfo->cinfo, COL_INFO, "; Transaction ID: 0x%x ", raw_word);
proto_tree_add_uint(pagp_tree, hf_pagp_flush_transaction_id, tvb,
PAGP_FLUSH_TRANSACTION_ID, 4, raw_word);
return;
}
/* Info PDU */
flags = tvb_get_guint8(tvb, PAGP_FLAGS);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, "; Flags 0x%x", flags);
}
col_append_fstr(pinfo->cinfo, COL_INFO, "; Flags 0x%x", flags);
if (tree) {
flags_item = proto_tree_add_uint(pagp_tree, hf_pagp_flags, tvb,
@ -263,14 +249,11 @@ dissect_pagp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, "; Local DevID: %s",
col_append_fstr(pinfo->cinfo, COL_INFO, "; Local DevID: %s",
tvb_ether_to_str(tvb, PAGP_LOCAL_DEVICE_ID));
}
if (tree) {
proto_tree_add_item(pagp_tree, hf_pagp_local_device_id, tvb,
proto_tree_add_item(pagp_tree, hf_pagp_local_device_id, tvb,
PAGP_LOCAL_DEVICE_ID, 6, ENC_NA);
}
if (tree) {
raw_octet = tvb_get_guint8(tvb, PAGP_LOCAL_LEARN_CAP);
@ -294,14 +277,11 @@ dissect_pagp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
PAGP_LOCAL_GROUP_IFINDEX, 4, raw_word);
}
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Partner DevID: %s",
col_append_fstr(pinfo->cinfo, COL_INFO, ", Partner DevID: %s",
tvb_ether_to_str(tvb, PAGP_PARTNER_DEVICE_ID));
}
if (tree) {
proto_tree_add_item(pagp_tree, hf_pagp_partner_device_id, tvb,
proto_tree_add_item(pagp_tree, hf_pagp_partner_device_id, tvb,
PAGP_PARTNER_DEVICE_ID, 6, ENC_NA);
}
if (tree) {
raw_octet = tvb_get_guint8(tvb, PAGP_PARTNER_LEARN_CAP);

View File

@ -518,11 +518,9 @@ dissect_pana_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
seq_num = tvb_get_ntohl(tvb, 12);
avp_length = msg_length - 16;
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Type %s-%s",
col_add_fstr(pinfo->cinfo, COL_INFO, "Type %s-%s",
val_to_str(msg_type, msg_type_names, "Unknown (%d)"),
val_to_str(flags & PANA_FLAG_R, msg_subtype_names, "Unknown (%d)"));
}
/* Make the protocol tree */
if (tree) {

View File

@ -2579,9 +2579,7 @@ dissect_pcep_msg_tree(tvbuff_t *tvb, proto_tree *tree, guint tree_mode, packet_i
message_type = tvb_get_guint8(tvb, 1);
msg_length = tvb_get_ntohs(tvb, 2);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(message_type, message_type_vals, "Unknown Message (%u). "));
}
col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(message_type, message_type_vals, "Unknown Message (%u). "));
ti = proto_tree_add_item(tree, proto_pcep, tvb, offset, msg_length, ENC_NA);
pcep_tree = proto_item_add_subtree(ti, tree_mode);

View File

@ -80,9 +80,7 @@ dissect_pcli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
cccid = tvb_get_ntohl(tvb,0);
/* Set the info column */
if(check_col(pinfo->cinfo,COL_INFO)){
col_add_fstr(pinfo->cinfo, COL_INFO, "CCCID: %u",cccid);
}
col_add_fstr(pinfo->cinfo, COL_INFO, "CCCID: %u",cccid);
/*
*If we have a non-null tree (ie we are building the proto_tree

View File

@ -299,12 +299,10 @@ dissect_pflog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
if (check_col(pinfo->cinfo, COL_INFO)) {
col_prepend_fstr(pinfo->cinfo, COL_INFO, "[%s %s/%u] ",
col_prepend_fstr(pinfo->cinfo, COL_INFO, "[%s %s/%u] ",
val_to_str(action, pflog_action_vals, "unknown (%u)"),
ifname,
rulenr);
}
}
void
@ -489,12 +487,11 @@ dissect_old_pflog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
break;
}
if (check_col(pinfo->cinfo, COL_INFO)) {
col_prepend_fstr(pinfo->cinfo, COL_INFO, "[%s %s/#%d] ",
col_prepend_fstr(pinfo->cinfo, COL_INFO, "[%s %s/#%d] ",
val_to_str(action, pflog_action_vals, "unknown (%u)"),
ifname,
rnr);
}
return offset;
}

View File

@ -825,13 +825,11 @@ dissect_pgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PGM");
if (check_col(pinfo->cinfo, COL_INFO)) {
col_clear(pinfo->cinfo, COL_INFO);
if (tvb_reported_length_remaining(tvb, 0) < 18) {
col_set_str(pinfo->cinfo, COL_INFO,
col_clear(pinfo->cinfo, COL_INFO);
if (tvb_reported_length_remaining(tvb, 0) < 18) {
col_set_str(pinfo->cinfo, COL_INFO,
"Packet too small");
return;
}
return;
}
pinfo->srcport = pgmhdr_sport = tvb_get_ntohs(tvb, 0);
@ -853,30 +851,25 @@ dissect_pgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case PGM_NCF_PCKT:
case PGM_POLR_PCKT:
case PGM_ACK_PCKT:
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO,
col_add_fstr(pinfo->cinfo, COL_INFO,
"%-5s sqn 0x%x gsi %s", pktname, sqn, gsi);
}
break;
case PGM_RDATA_PCKT:
case PGM_ODATA_PCKT:
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO,
col_add_fstr(pinfo->cinfo, COL_INFO,
"%-5s sqn 0x%x gsi %s tsdulen %d", pktname, sqn, gsi,
pgmhdr_tsdulen);
}
isdata = TRUE;
break;
case PGM_POLL_PCKT: {
guint16 poll_stype = tvb_get_ntohs(tvb, 22);
pollstname = val_to_str(poll_stype, poll_subtype_vals, "Unknown (0x%02x)");
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO,
col_add_fstr(pinfo->cinfo, COL_INFO,
"%-5s sqn 0x%x gsi %s subtype %s",
pktname, sqn, gsi, pollstname);
}
}
break;
default:
return;

View File

@ -196,8 +196,7 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 1;
pim_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(pim_type, type1vals, "Unknown (%u)"));
proto_tree_add_uint(pim_tree, hf_pim_code, tvb, offset, 1, pim_type);
@ -708,12 +707,9 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
break;
}
if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "PIMv%d",
col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "PIMv%d",
PIM_VER(pim_typever));
}
if (check_col(pinfo->cinfo, COL_INFO))
col_add_str(pinfo->cinfo, COL_INFO, typestr);
col_add_str(pinfo->cinfo, COL_INFO, typestr);
ti = proto_tree_add_item(tree, proto_pim, tvb, offset, -1, ENC_NA);
pim_tree = proto_item_add_subtree(ti, ett_pim);

View File

@ -121,9 +121,8 @@ dissect_pingpongprotocol_message(tvbuff_t *message_tvb, packet_info *pinfo, prot
guint8 type;
type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(type, message_type_values, "Unknown PingPongProtocol type"));
}
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(type, message_type_values, "Unknown PingPongProtocol type"));
proto_tree_add_item(pingpongprotocol_tree, hf_message_type, message_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(pingpongprotocol_tree, hf_message_flags, message_tvb, MESSAGE_FLAGS_OFFSET, MESSAGE_FLAGS_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(pingpongprotocol_tree, hf_message_length, message_tvb, MESSAGE_LENGTH_OFFSET, MESSAGE_LENGTH_LENGTH, ENC_BIG_ENDIAN);

View File

@ -487,8 +487,7 @@ dissect_pktc_mtafqdn_krbsafeuserdata(packet_info *pinfo, tvbuff_t *tvb, proto_tr
proto_tree_add_uint(tree, hf_pktc_mtafqdn_msgtype, tvb, offset, 1, msgtype);
offset+=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(msgtype, pktc_mtafqdn_msgtype_vals, "MsgType %u"));
/* enterprise */
@ -556,11 +555,8 @@ dissect_pktc_mtafqdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pktc_mtafqdn_tree = proto_item_add_subtree(item, ett_pktc_mtafqdn);
}
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "MTA FQDN %s",
col_add_fstr(pinfo->cinfo, COL_INFO, "MTA FQDN %s",
pinfo->srcport == pinfo->match_uint ? "Reply":"Request");
}
/* KRB_AP_RE[QP] */
pktc_mtafqdn_tvb = tvb_new_subset_remaining(tvb, offset);
@ -609,12 +605,10 @@ dissect_pktc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset+=1;
/* fill COL_INFO */
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_str(pinfo->cinfo, COL_INFO,
col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(kmmid, kmmid_types, "Unknown KMMID %#x"));
col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)",
val_to_str(doi, doi_types, "Unknown DOI %#x"));
}
switch(kmmid){
case KMMID_WAKEUP:

View File

@ -77,9 +77,7 @@ static gboolean dissect_pktgen(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PKTGEN");
if(check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Seq: %u", tvb_get_ntohl(tvb, 4));
}
if(tree) {

View File

@ -194,22 +194,20 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
is_continuation = response_is_continuation(line);
}
if (check_col(pinfo->cinfo, COL_INFO)) {
/*
* Put the first line from the buffer into the summary
* if it's a POP request or reply (but leave out the
* line terminator).
* Otherwise, just call it a continuation.
*/
if (is_continuation) {
length_remaining = tvb_length_remaining(tvb, offset);
col_add_fstr(pinfo->cinfo, COL_INFO, "S: DATA fragment, %d byte%s",
/*
* Put the first line from the buffer into the summary
* if it's a POP request or reply (but leave out the
* line terminator).
* Otherwise, just call it a continuation.
*/
if (is_continuation) {
length_remaining = tvb_length_remaining(tvb, offset);
col_add_fstr(pinfo->cinfo, COL_INFO, "S: DATA fragment, %d byte%s",
length_remaining, plurality (length_remaining, "", "s"));
}
else
col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s", is_request ? "C" : "S",
format_text(line, linelen));
}
else
col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s", is_request ? "C" : "S",
format_text(line, linelen));
ti = proto_tree_add_item(tree, proto_pop, tvb, offset, -1, ENC_NA);
pop_tree = proto_item_add_subtree(ti, ett_pop);

View File

@ -95,20 +95,17 @@ dissect_getport_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree_add_uint_format(tree, hf_portmap_prog, tvb,
offset, 4, prog, "Program: %s (%u)",
prog_name, prog);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, " %s(%u)", prog_name, prog);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s(%u)", prog_name, prog);
}
proto_item_append_text(tree, " GETPORT Call %s(%u)", prog_name, prog);
/* version */
version = tvb_get_ntohl(tvb, offset+4);
proto_tree_add_item(tree, hf_portmap_version, tvb,
offset+4, 4, ENC_BIG_ENDIAN);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, " V:%d", version);
col_append_fstr(pinfo->cinfo, COL_INFO, " V:%d", version);
}
proto_item_append_text(tree, " Version:%d", version);
@ -117,10 +114,8 @@ dissect_getport_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_name = ipprotostr(proto);
proto_tree_add_uint_format(tree, hf_portmap_proto, tvb,
offset+8, 4, proto, "Proto: %s (%u)", proto_name, proto);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", proto_name);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", proto_name);
}
proto_item_append_text(tree, " %s", proto_name);
/* port */
@ -159,9 +154,7 @@ dissect_getport_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
offset);
proto_item_append_text(tree, " GETPORT Reply Port:%d", portx);
if(portx){
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, " Port:%d", portx);
}
col_append_fstr(pinfo->cinfo, COL_INFO, " Port:%d", portx);
proto_item_append_text(tree, " Port:%d", portx);
} else {
col_append_str(pinfo->cinfo, COL_INFO, " PROGRAM_NOT_AVAILABLE");

View File

@ -137,8 +137,7 @@ dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
present = tvb_get_letohl(tvb, offset+4);
/* Setup basic column info */
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "PPI Antenna info v%u, Length %u",
col_add_fstr(pinfo->cinfo, COL_INFO, "PPI Antenna info v%u, Length %u",
version, length);

View File

@ -162,8 +162,7 @@ dissect_ppi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
present = tvb_get_letohl(tvb, offset+4);
/* Setup basic column info */
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "PPI_GPS Capture v%u, Length %u", version, length);
col_add_fstr(pinfo->cinfo, COL_INFO, "PPI_GPS Capture v%u, Length %u", version, length);
/* Create the basic dissection tree*/
if (tree) {

View File

@ -190,17 +190,15 @@ dissect_ppi_sensor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
/* Clear out stuff in the info column */
if (check_col(pinfo->cinfo,COL_INFO)) {
col_clear(pinfo->cinfo,COL_INFO);
}
col_clear(pinfo->cinfo,COL_INFO);
/* pull out the first three fields of the BASE-GEOTAG-HEADER */
version = tvb_get_guint8(tvb, offset);
length = tvb_get_letohs(tvb, offset+2);
present = tvb_get_letohl(tvb, offset+4);
/* Setup basic column info */
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "PPI Sensor info v%u, Length %u ",
col_add_fstr(pinfo->cinfo, COL_INFO, "PPI Sensor info v%u, Length %u ",
version, length);
/* Create the basic dissection tree*/

View File

@ -972,8 +972,7 @@ dissect_ppi_vector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
length = tvb_get_letohs(tvb, offset+2);
/* Setup basic column info */
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "PPI_Vector Capture v%u, Length %u",
col_add_fstr(pinfo->cinfo, COL_INFO, "PPI_Vector Capture v%u, Length %u",
version, length);
/* Create the basic dissection tree*/

View File

@ -504,18 +504,14 @@ dissect_80211_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
rate_kbps / 1000.0);
if (rate_kbps == 0)
proto_item_append_text(ti, " [invalid]");
if (check_col(pinfo->cinfo, COL_TX_RATE)) {
col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%.1f Mbps", rate_kbps / 1000.0);
}
col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%.1f Mbps", rate_kbps / 1000.0);
ptvcursor_advance(csr, 2);
common_frequency = tvb_get_letohs(ptvcursor_tvbuff(csr), ptvcursor_current_offset(csr));
chan_str = ieee80211_mhz_to_str(common_frequency);
proto_tree_add_uint_format(ptvcursor_tree(csr), hf_80211_common_chan_freq, ptvcursor_tvbuff(csr),
ptvcursor_current_offset(csr), 2, common_frequency, "Channel frequency: %s", chan_str);
if (check_col(pinfo->cinfo, COL_FREQ_CHAN)) {
col_add_fstr(pinfo->cinfo, COL_FREQ_CHAN, "%s", chan_str);
}
col_add_fstr(pinfo->cinfo, COL_FREQ_CHAN, "%s", chan_str);
g_free(chan_str);
ptvcursor_advance(csr, 2);
@ -535,10 +531,9 @@ dissect_80211_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
ptvcursor_add(csr, hf_80211_common_fhss_hopset, 1, ENC_LITTLE_ENDIAN);
ptvcursor_add(csr, hf_80211_common_fhss_pattern, 1, ENC_LITTLE_ENDIAN);
if (check_col(pinfo->cinfo, COL_RSSI)) {
col_add_fstr(pinfo->cinfo, COL_RSSI, "%d dBm",
col_add_fstr(pinfo->cinfo, COL_RSSI, "%d dBm",
(gint8) tvb_get_guint8(tvb, ptvcursor_current_offset(csr)));
}
ptvcursor_add_invalid_check(csr, hf_80211_common_dbm_antsignal, 1, 0x80); /* -128 */
ptvcursor_add_invalid_check(csr, hf_80211_common_dbm_antnoise, 1, 0x80);

View File

@ -4183,11 +4183,9 @@ dissect_bcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
mac_type = tvb_get_guint8(tvb, offset);
if (!(flags & BCP_IS_BCONTROL)) {
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_str(pinfo->cinfo, COL_INFO,
col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(mac_type, bcp_mac_type_vals,
"Unknown MAC type %u"));
}
}
if (tree) {
proto_tree_add_uint(bcp_tree, hf_bcp_mac_type, tvb, offset, 1,

View File

@ -481,11 +481,8 @@ dissect_pppoe_tags(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tr
proto_tree_add_item(pppoe_tree, hf_pppoed_tag_ac_name, tvb,
tagstart+4, poe_tag_length, ENC_ASCII|ENC_NA);
/* Show AC-Name in info column */
if (check_col(pinfo->cinfo, COL_INFO))
{
col_append_fstr(pinfo->cinfo, COL_INFO, " AC-Name='%s'",
col_append_fstr(pinfo->cinfo, COL_INFO, " AC-Name='%s'",
tvb_get_ephemeral_string(tvb, tagstart+4, poe_tag_length));
}
break;
case PPPOE_TAG_HOST_UNIQ:
proto_tree_add_item(pppoe_tree, hf_pppoed_tag_host_uniq, tvb,
@ -706,10 +703,7 @@ static void dissect_pppoed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Start Decoding Here. */
pppoe_code = tvb_get_guint8(tvb, 1);
if (check_col(pinfo->cinfo, COL_INFO))
{
col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(pppoe_code, code_vals, "Unknown"));
}
col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(pppoe_code, code_vals, "Unknown"));
/* Read length of payload */
reported_payload_length = tvb_get_ntohs(tvb, 4);
@ -1069,11 +1063,8 @@ static void dissect_pppoes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Start Decoding Here. */
pppoe_code = 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_const(pppoe_code, code_vals, "Unknown"));
}
reported_payload_length = tvb_get_ntohs(tvb, 4);
actual_payload_length = tvb_reported_length_remaining(tvb, 6);

View File

@ -1633,12 +1633,10 @@ dissect_ptp_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
case PTP_MANAGEMENT_MESSAGE:{
if (check_col(pinfo->cinfo, COL_INFO)){
col_add_fstr(pinfo->cinfo, COL_INFO, "Management Message (%s)",
col_add_fstr(pinfo->cinfo, COL_INFO, "Management Message (%s)",
val_to_str(ptp_mm_messagekey,
ptp_managementMessageKey_infocolumn_vals,
"Unknown message key %u"));
}
break;
}
default:{
@ -2337,41 +2335,38 @@ dissect_ptp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ptp_v2_messageid = 0x0F & tvb_get_guint8 (tvb, PTP_V2_TRANSPORT_SPECIFIC_MESSAGE_ID_OFFSET);
/* Extend Info column with managementId */
if (check_col(pinfo->cinfo, COL_INFO))
/* Create and set the string for "Info" column */
if ( ptp_v2_messageid == PTP_V2_MANAGEMENT_MESSAGE )
{
/* Create and set the string for "Info" column */
if ( ptp_v2_messageid == PTP_V2_MANAGEMENT_MESSAGE )
guint16 tlv_type;
/* Get TLV Type */
tlv_type = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_TYPE_OFFSET);
/* For management there are PTP_V2_TLV_TYPE_MANAGEMENT and PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS TLVs */
switch(tlv_type)
{
guint16 tlv_type;
/* Get TLV Type */
tlv_type = tvb_get_ntohs (tvb, PTP_V2_MM_TLV_TYPE_OFFSET);
/* For management there are PTP_V2_TLV_TYPE_MANAGEMENT and PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS TLVs */
switch(tlv_type)
{
case PTP_V2_TLV_TYPE_MANAGEMENT:
/* Get the managementId */
ptp_v2_mm_managementId = tvb_get_ntohs(tvb, PTP_V2_MM_TLV_MANAGEMENTID_OFFSET);
ptp_v2_management_action = 0x0F & tvb_get_guint8(tvb, PTP_V2_MM_ACTION_OFFSET);
col_add_fstr(pinfo->cinfo, COL_INFO, "Management (%s) %s",
val_to_str(ptp_v2_mm_managementId, ptp_v2_managementID_infocolumn_vals, "Unknown management Id %u"),
val_to_str(ptp_v2_management_action, ptp_v2_mm_action_vals, "Unknown Action %u"));
break;
case PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS:
/* Get the managementErrorId */
ptp_v2_mm_managementId = tvb_get_ntohs(tvb, PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET);
col_add_fstr(pinfo->cinfo, COL_INFO, "Management Error Message (%s)", val_to_str(ptp_v2_mm_managementId,
ptp2_managementErrorId_vals, "Unknown Error Id %u"));
break;
default:
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(ptp_v2_messageid, ptp_v2_messageid_vals, "Unknown PTP Message (%u)"));
break;
}
}
else
{
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(ptp_v2_messageid, ptp_v2_messageid_vals, "Unknown PTP Message (%u)"));
case PTP_V2_TLV_TYPE_MANAGEMENT:
/* Get the managementId */
ptp_v2_mm_managementId = tvb_get_ntohs(tvb, PTP_V2_MM_TLV_MANAGEMENTID_OFFSET);
ptp_v2_management_action = 0x0F & tvb_get_guint8(tvb, PTP_V2_MM_ACTION_OFFSET);
col_add_fstr(pinfo->cinfo, COL_INFO, "Management (%s) %s",
val_to_str(ptp_v2_mm_managementId, ptp_v2_managementID_infocolumn_vals, "Unknown management Id %u"),
val_to_str(ptp_v2_management_action, ptp_v2_mm_action_vals, "Unknown Action %u"));
break;
case PTP_V2_TLV_TYPE_MANAGEMENT_ERROR_STATUS:
/* Get the managementErrorId */
ptp_v2_mm_managementId = tvb_get_ntohs(tvb, PTP_V2_MM_TLV_MANAGEMENTERRORID_OFFSET);
col_add_fstr(pinfo->cinfo, COL_INFO, "Management Error Message (%s)", val_to_str(ptp_v2_mm_managementId,
ptp2_managementErrorId_vals, "Unknown Error Id %u"));
break;
default:
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(ptp_v2_messageid, ptp_v2_messageid_vals, "Unknown PTP Message (%u)"));
break;
}
}
else
{
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(ptp_v2_messageid, ptp_v2_messageid_vals, "Unknown PTP Message (%u)"));
}
if (tree) {

View File

@ -545,7 +545,7 @@ dissect_pvfs2_error(tvbuff_t *tvb, proto_tree *tree, int offset,
proto_tree_add_uint(tree, hf_pvfs_error, tvb, offset, 4, -err);
offset += 4;
if ((err != 0) && check_col(pinfo->cinfo, COL_INFO))
if (err != 0)
{
errmsg = val_to_str(-err, names_pvfs_error, "Unknown error: %u");
col_append_fstr(pinfo->cinfo, COL_INFO, " Error: %s", errmsg);

View File

@ -600,11 +600,8 @@ dissect_11_or_aal5_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
{
/* sub-dissectors _may_ overwrite columns in aal5_pdu mode */
col_set_str(pinfo->cinfo, COL_PROTOCOL, proto_name_column);
if (check_col(pinfo->cinfo, COL_INFO))
{
col_clear(pinfo->cinfo, COL_INFO);
col_append_pw_info(pinfo, payload_size, cells, 0);
}
col_clear(pinfo->cinfo, COL_INFO);
col_append_pw_info(pinfo, payload_size, cells, 0);
}
{
@ -679,11 +676,8 @@ dissect_11_or_aal5_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
{
/* overwrite everything written by sub-dissectors in 1:1 modes*/
col_set_str(pinfo->cinfo, COL_PROTOCOL, proto_name_column);
if (check_col(pinfo->cinfo, COL_INFO))
{
col_clear(pinfo->cinfo, COL_INFO);
col_append_pw_info(pinfo, payload_size, cells, 0);
}
col_clear(pinfo->cinfo, COL_INFO);
col_append_pw_info(pinfo, payload_size, cells, 0);
}
pinfo->private_data = pd_save;
@ -829,20 +823,14 @@ dissect_aal5_sdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
}
/* fill columns in Packet List */
if (check_col(pinfo->cinfo, COL_PROTOCOL))
col_set_str(pinfo->cinfo, COL_PROTOCOL, proto_name_column);
if (PWATM_SUBMODE_ADMIN_CELL == pd.submode)
{
col_set_str(pinfo->cinfo, COL_PROTOCOL, proto_name_column);
if (PWATM_SUBMODE_ADMIN_CELL == pd.submode)
{
col_append_str(pinfo->cinfo, COL_PROTOCOL, ", OAM cell");
}
col_append_str(pinfo->cinfo, COL_PROTOCOL, ", OAM cell");
}
if (check_col(pinfo->cinfo, COL_INFO))
{
col_clear(pinfo->cinfo, COL_INFO);
col_append_pw_info(pinfo, payload_size, cells, padding_size);
}
col_clear(pinfo->cinfo, COL_INFO);
col_append_pw_info(pinfo, payload_size, cells, padding_size);
{
proto_item* item;
@ -1060,11 +1048,8 @@ dissect_n1_cw(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
/* overwrite everything written by sub-dissectors */
col_set_str(pinfo->cinfo, COL_PROTOCOL, proto_name_column);
if (check_col(pinfo->cinfo, COL_INFO))
{
col_clear(pinfo->cinfo, COL_INFO);
col_append_pw_info(pinfo, payload_size, cells, padding_size);
}
col_clear(pinfo->cinfo, COL_INFO);
col_append_pw_info(pinfo, payload_size, cells, padding_size);
pinfo->private_data = pd_save;
return;
@ -1132,11 +1117,8 @@ dissect_n1_nocw(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
/* overwrite everything written by sub-dissectors */
col_set_str(pinfo->cinfo, COL_PROTOCOL, proto_name_column);
if (check_col(pinfo->cinfo, COL_INFO))
{
col_clear(pinfo->cinfo, COL_INFO);
col_append_pw_info(pinfo, payload_size, cells, 0);
}
col_clear(pinfo->cinfo, COL_INFO);
col_append_pw_info(pinfo, payload_size, cells, 0);
pinfo->private_data = pd_save;
return;

View File

@ -221,29 +221,26 @@ void dissect_pw_cesopsn( tvbuff_t * tvb_original
/* fill up columns*/
col_set_str(pinfo->cinfo, COL_PROTOCOL, shortname);
if (check_col(pinfo->cinfo, COL_INFO))
col_clear(pinfo->cinfo, COL_INFO);
if (properties & PWC_ANYOF_CW_BAD)
{
col_clear(pinfo->cinfo, COL_INFO);
if (properties & PWC_ANYOF_CW_BAD)
{
col_append_str(pinfo->cinfo, COL_INFO, "CW:Bad, ");
}
else if (properties & PWC_ANYOF_CW_SUSPECT)
{
col_append_str(pinfo->cinfo, COL_INFO, "CW:Suspect, ");
}
col_append_str(pinfo->cinfo, COL_INFO, "CW:Bad, ");
}
else if (properties & PWC_ANYOF_CW_SUSPECT)
{
col_append_str(pinfo->cinfo, COL_INFO, "CW:Suspect, ");
}
if (properties & PWC_PAY_SIZE_BAD)
{
col_append_str(pinfo->cinfo, COL_INFO, "Payload size:Bad, ");
}
if (properties & PWC_PAY_SIZE_BAD)
{
col_append_str(pinfo->cinfo, COL_INFO, "Payload size:Bad, ");
}
col_append_fstr(pinfo->cinfo, COL_INFO, "TDM octets:%d", (int)payload_size);
col_append_fstr(pinfo->cinfo, COL_INFO, "TDM octets:%d", (int)payload_size);
if (padding_size != 0)
{
col_append_fstr(pinfo->cinfo, COL_INFO, ", Padding:%d", (int)padding_size);
}
if (padding_size != 0)
{
col_append_fstr(pinfo->cinfo, COL_INFO, ", Padding:%d", (int)padding_size);
}
{

View File

@ -163,19 +163,16 @@ dissect_pw_fr( tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree )
}
col_set_str(pinfo->cinfo, COL_PROTOCOL, "FR PW");
if (check_col(pinfo->cinfo, COL_INFO))
col_clear(pinfo->cinfo, COL_INFO);
if (packet_quality & PQ_CW_BAD)
{
col_clear(pinfo->cinfo, COL_INFO);
if (packet_quality & PQ_CW_BAD)
{
col_append_str(pinfo->cinfo, COL_INFO, "CW:Malformed, ");
}
col_append_fstr(pinfo->cinfo, COL_INFO, "%d payload octets", (int)payload_size);
col_append_str(pinfo->cinfo, COL_INFO, "CW:Malformed, ");
}
col_append_fstr(pinfo->cinfo, COL_INFO, "%d payload octets", (int)payload_size);
if (payload_padding != 0)
{
col_append_fstr(pinfo->cinfo, COL_INFO, ", %d padding", (int)payload_padding);
}
if (payload_padding != 0)
{
col_append_fstr(pinfo->cinfo, COL_INFO, ", %d padding", (int)payload_padding);
}
{

View File

@ -220,27 +220,24 @@ void dissect_pw_satop(tvbuff_t * tvb_original
/* fill up columns*/
col_set_str(pinfo->cinfo, COL_PROTOCOL, shortname);
if (check_col(pinfo->cinfo, COL_INFO))
col_clear(pinfo->cinfo, COL_INFO);
if (properties & PWC_ANYOF_CW_BAD)
{
col_clear(pinfo->cinfo, COL_INFO);
if (properties & PWC_ANYOF_CW_BAD)
{
col_append_str(pinfo->cinfo, COL_INFO, "CW:Bad, ");
}
col_append_str(pinfo->cinfo, COL_INFO, "CW:Bad, ");
}
if (properties & PWC_PAY_SIZE_BAD)
{
col_append_str(pinfo->cinfo, COL_INFO, "Payload size:0 (Bad)");
}
else
{
col_append_fstr(pinfo->cinfo, COL_INFO, "TDM octets:%d", (int)payload_size);
}
if (properties & PWC_PAY_SIZE_BAD)
{
col_append_str(pinfo->cinfo, COL_INFO, "Payload size:0 (Bad)");
}
else
{
col_append_fstr(pinfo->cinfo, COL_INFO, "TDM octets:%d", (int)payload_size);
}
if (padding_size != 0)
{
col_append_fstr(pinfo->cinfo, COL_INFO, ", Padding:%d", (int)padding_size);
}
if (padding_size != 0)
{
col_append_fstr(pinfo->cinfo, COL_INFO, ", Padding:%d", (int)padding_size);
}

View File

@ -2056,11 +2056,10 @@ dissect_q2931(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, q2931_message_type_vals,
"Unknown message type (0x%02X)"));
}
if (q2931_tree != NULL)
proto_tree_add_uint(q2931_tree, hf_q2931_message_type, tvb, offset, 1, message_type);
offset += 1;

View File

@ -2626,15 +2626,13 @@ dissect_q931_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if(have_valid_q931_pi) {
q931_pi->message_type = message_type;
}
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_str(pinfo->cinfo, COL_INFO, get_message_name(prot_discr, message_type));
}
if (q931_tree != NULL){
if (prot_discr == NLPID_DMS)
proto_tree_add_item(q931_tree, hf_q931_maintenance_message_type, tvb, offset, 1, ENC_BIG_ENDIAN);
else
proto_tree_add_item(q931_tree, hf_q931_message_type, tvb, offset, 1, ENC_BIG_ENDIAN);
}
col_add_str(pinfo->cinfo, COL_INFO, get_message_name(prot_discr, message_type));
if (prot_discr == NLPID_DMS)
proto_tree_add_item(q931_tree, hf_q931_maintenance_message_type, tvb, offset, 1, ENC_BIG_ENDIAN);
else
proto_tree_add_item(q931_tree, hf_q931_message_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
/*
@ -2662,10 +2660,9 @@ dissect_q931_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
first_frag = (tvb_get_guint8(tvb, offset + 2) & 0x80) != 0;
more_frags = (tvb_get_guint8(tvb, offset + 2) & 0x7F) != 0;
segmented_message_type = tvb_get_guint8(tvb, offset + 3);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, " of %s",
col_append_fstr(pinfo->cinfo, COL_INFO, " of %s",
val_to_str_ext(segmented_message_type, &q931_message_type_vals_ext, "Unknown message type (0x%02X)"));
}
offset += 1 + 1 + info_element_len;
/* Reassembly */
frag_len = tvb_reported_length_remaining(tvb, offset);
@ -2689,10 +2686,10 @@ dissect_q931_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
} else { /* only 1 segment */
next_tvb = tvb_new_subset_remaining(tvb, offset);
}
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s [reassembled]",
col_add_fstr(pinfo->cinfo, COL_INFO, "%s [reassembled]",
val_to_str_ext(segmented_message_type, &q931_message_type_vals_ext, "Unknown message type (0x%02X)"));
}
} else {
if (tree) proto_tree_add_uint(q931_tree, hf_q931_reassembled_in, tvb, offset, frag_len, fd_head->reassembled_in);
}
@ -2938,10 +2935,9 @@ dissect_q931_IEs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root_tree,
if (((codeset << 8) | info_element) == (CS0 | Q931_IE_SEGMENTED_MESSAGE)) {
dissect_q931_segmented_message_ie(tvb, offset + 2, info_element_len, ie_tree);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, " of %s",
col_append_fstr(pinfo->cinfo, COL_INFO, " of %s",
val_to_str_ext(tvb_get_guint8(tvb, offset + 3), &q931_message_type_vals_ext, "Unknown message type (0x%02X)"));
}
if (tvb_get_guint8(tvb, offset + 2) & 0x80) { /* the 1st segment */
first_segment = TRUE;
} else { /* not the 1st segment */

View File

@ -140,15 +140,12 @@ dissect_qllc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
else {
/* Non-ambiguous control field value */
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_str(pinfo->cinfo, COL_INFO,
col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(ctrl, qllc_control_vals,
"Control Field: 0x%02x (unknown)"));
}
if (tree) {
proto_tree_add_uint(qllc_tree, hf_qllc_control, tvb,
proto_tree_add_uint(qllc_tree, hf_qllc_control, tvb,
1, 1, ctrl);
}
}
/* Do we have an I field ? */

View File

@ -365,11 +365,9 @@ dissect_quake_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
command = tvb_get_guint8(tvb, 0);
direction = (command & 0x80) ? CCREP : CCREQ;
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(command,names_control_command, "%u"),
val_to_str(direction,names_control_direction,"%u"));
}
if (tree) {
proto_item *control_item;
@ -475,13 +473,9 @@ dissect_quake(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
sequence = tvb_get_ntohl(tvb, 4);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "seq 0x%x", sequence);
}
if (quake_tree) {
proto_tree_add_uint(quake_tree, hf_quake_header_sequence,
col_add_fstr(pinfo->cinfo, COL_INFO, "seq 0x%x", sequence);
proto_tree_add_uint(quake_tree, hf_quake_header_sequence,
tvb, 4, 4, sequence);
}
rest_length = tvb_reported_length(tvb) - 8;
next_tvb = tvb_new_subset(tvb, 8, rest_length , rest_length);

View File

@ -685,8 +685,7 @@ dissect_quake2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
DIR_C2S : DIR_S2C;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "QUAKE2");
if (check_col(pinfo->cinfo, COL_INFO))
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(direction,
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(direction,
names_direction, "%u"));
if (tree) {

View File

@ -501,8 +501,7 @@ dissect_quake3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
val_to_str(direction,
names_direction, "%u"));
if (check_col(pinfo->cinfo, COL_INFO))
col_append_str(pinfo->cinfo, COL_INFO, val_to_str(direction,
col_append_str(pinfo->cinfo, COL_INFO, val_to_str(direction,
names_direction, "%u"));
}

View File

@ -532,11 +532,9 @@ dissect_quakeworld_ConnectionlessPacket(tvbuff_t *tvb, packet_info *pinfo,
}
}
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 (text_tree && !command_finished) {
if (!command_finished) {
proto_tree_add_string(text_tree, hf_quakeworld_connectionless_command,
tvb, offset, command_len, command);
}
@ -676,8 +674,7 @@ dissect_quakeworld(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
DIR_C2S : DIR_S2C;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "QUAKEWORLD");
if (check_col(pinfo->cinfo, COL_INFO))
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(direction,
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(direction,
names_direction, "%u"));
if (tree) {

View File

@ -1386,12 +1386,9 @@ dissect_radius(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
rad_info->ident = rh.rh_ident;
tap_queue_packet(radius_tap, pinfo, rad_info);
if (check_col(pinfo->cinfo, COL_INFO))
{
col_add_fstr(pinfo->cinfo,COL_INFO,"%s(%d) (id=%d, l=%d)",
col_add_fstr(pinfo->cinfo,COL_INFO,"%s(%d) (id=%d, l=%d)",
val_to_str_ext_const(rh.rh_code, &radius_pkt_type_codes_ext, "Unknown Packet"),
rh.rh_code, rh.rh_ident, rh.rh_pktlength);
}
if (tree)
{
@ -1493,11 +1490,9 @@ dissect_radius(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
/* No, so it's a duplicate request. Mark it as such. */
rad_info->is_duplicate = TRUE;
rad_info->req_num = radius_call->req_num;
if (check_col(pinfo->cinfo, COL_INFO))
{
col_append_fstr(pinfo->cinfo, COL_INFO,
col_append_fstr(pinfo->cinfo, COL_INFO,
", Duplicate Request ID:%u", rh.rh_ident);
}
if (tree)
{
proto_item* item;
@ -1632,11 +1627,9 @@ dissect_radius(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
{
/* No, so it's a duplicate response. Mark it as such. */
rad_info->is_duplicate = TRUE;
if (check_col(pinfo->cinfo, COL_INFO))
{
col_append_fstr(pinfo->cinfo, COL_INFO,
col_append_fstr(pinfo->cinfo, COL_INFO,
", Duplicate Response ID:%u", rh.rh_ident);
}
if (tree)
{
proto_item* item;

View File

@ -62,10 +62,7 @@ dissect_retix_bpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "R-STP");
col_clear(pinfo->cinfo, COL_INFO);
if (check_col(pinfo->cinfo, COL_INFO)){
col_add_fstr(pinfo->cinfo, COL_INFO, "Bridge MAC %s", tvb_ether_to_str(tvb, 10));
}
col_add_fstr(pinfo->cinfo, COL_INFO, "Bridge MAC %s", tvb_ether_to_str(tvb, 10));
retix_bpdu_tree = NULL;

View File

@ -79,10 +79,8 @@ dissect_rgmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int off
col_clear(pinfo->cinfo, COL_INFO);
type = tvb_get_guint8(tvb, offset);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(type, rgmp_types, "Unknown Type: 0x%02x"));
}
proto_tree_add_uint(tree, hf_type, tvb, offset, 1, type);
offset += 1;

View File

@ -124,11 +124,9 @@ dissect_rip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
command = tvb_get_guint8(tvb, 0);
version = tvb_get_guint8(tvb, 1);
if (check_col(pinfo->cinfo, COL_PROTOCOL))
col_add_str(pinfo->cinfo, COL_PROTOCOL,
col_add_str(pinfo->cinfo, COL_PROTOCOL,
val_to_str_const(version, version_vals, "RIP"));
if (check_col(pinfo->cinfo, COL_INFO))
col_add_str(pinfo->cinfo, COL_INFO,
col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(command, command_vals, "Unknown command (%u)"));
if (tree) {

View File

@ -66,12 +66,10 @@ dissect_ripng(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
proto_item *ti, *rte_ti;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RIPng");
if (check_col(pinfo->cinfo, COL_INFO)) {
col_clear(pinfo->cinfo, COL_INFO);
col_add_fstr(pinfo->cinfo, COL_INFO," Command %s, Version %u",
val_to_str(tvb_get_guint8(tvb, offset), cmdvals, "Unknown (%u)"),
tvb_get_guint8(tvb, offset +1));
}
if (tree) {
ti = proto_tree_add_item(tree, proto_ripng, tvb, offset, -1, ENC_NA);

View File

@ -225,11 +225,8 @@ static void rlogin_display(rlogin_hash_entry_t *hash_info,
proto_tree_add_item(rlogin_tree, hf_control_message, tvb,
urgent_offset, 1, ENC_BIG_ENDIAN);
control_byte = tvb_get_guint8(tvb, urgent_offset);
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_const(control_byte, control_message_vals, "Unknown"));
}
offset = urgent_offset + 1; /* adjust offset */
}
@ -366,11 +363,8 @@ static void rlogin_display(rlogin_hash_entry_t *hash_info,
offset += 2;
/* Show setting highlights in info column */
if (check_col(pinfo->cinfo, COL_INFO))
{
col_append_fstr(pinfo->cinfo, COL_INFO, " (rows=%u, cols=%u)",
col_append_fstr(pinfo->cinfo, COL_INFO, " (rows=%u, cols=%u)",
rows, columns);
}
}
if (tvb_offset_exists(tvb, offset))
@ -414,63 +408,60 @@ dissect_rlogin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Rlogin");
/* Set info column */
if (check_col(pinfo->cinfo, COL_INFO))
/* Show user-name if available */
if (hash_info->user_name[0])
{
/* Show user-name if available */
if (hash_info->user_name[0])
{
col_add_fstr(pinfo->cinfo, COL_INFO,
"User name: %s, ", hash_info->user_name);
}
else
{
col_clear(pinfo->cinfo, COL_INFO);
}
col_add_fstr(pinfo->cinfo, COL_INFO,
"User name: %s, ", hash_info->user_name);
}
else
{
col_clear(pinfo->cinfo, COL_INFO);
}
/* Work out packet content summary for display */
length = tvb_length(tvb);
if (length != 0)
/* Work out packet content summary for display */
length = tvb_length(tvb);
if (length != 0)
{
/* Initial NULL byte represents part of connection handshake */
if (tvb_get_guint8(tvb, 0) == '\0')
{
/* Initial NULL byte represents part of connection handshake */
if (tvb_get_guint8(tvb, 0) == '\0')
{
col_append_str(pinfo->cinfo, COL_INFO,
col_append_str(pinfo->cinfo, COL_INFO,
(pinfo->destport == RLOGIN_PORT) ?
"Start Handshake" :
"Startup info received");
}
else
if (tcpinfo->urgent && length >= tcpinfo->urgent_pointer)
}
else
if (tcpinfo->urgent && length >= tcpinfo->urgent_pointer)
{
/* Urgent pointer inside current data represents a control message */
col_append_str(pinfo->cinfo, COL_INFO, "Control Message");
}
else
{
/* Search for 2 consecutive ff bytes
(signifies window change control message) */
ti_offset = tvb_find_guint8(tvb, 0, -1, 0xff);
if (ti_offset != -1 &&
tvb_bytes_exist(tvb, ti_offset + 1, 1) &&
tvb_get_guint8(tvb, ti_offset + 1) == 0xff)
{
/* Urgent pointer inside current data represents a control message */
col_append_str(pinfo->cinfo, COL_INFO, "Control Message");
col_append_str(pinfo->cinfo, COL_INFO, "Terminal Info");
}
else
{
/* Search for 2 consecutive ff bytes
(signifies window change control message) */
ti_offset = tvb_find_guint8(tvb, 0, -1, 0xff);
if (ti_offset != -1 &&
tvb_bytes_exist(tvb, ti_offset + 1, 1) &&
tvb_get_guint8(tvb, ti_offset + 1) == 0xff)
/* Show any text data in the frame */
int bytes_to_copy = tvb_length(tvb);
if (bytes_to_copy > 128)
{
col_append_str(pinfo->cinfo, COL_INFO, "Terminal Info");
/* Truncate to 128 bytes for display */
bytes_to_copy = 128;
}
else
{
/* Show any text data in the frame */
int bytes_to_copy = tvb_length(tvb);
if (bytes_to_copy > 128)
{
/* Truncate to 128 bytes for display */
bytes_to_copy = 128;
}
/* Add data into info column */
col_append_fstr(pinfo->cinfo, COL_INFO,
"Data: %s",
tvb_format_text(tvb, 0, bytes_to_copy));
}
/* Add data into info column */
col_append_fstr(pinfo->cinfo, COL_INFO,
"Data: %s",
tvb_format_text(tvb, 0, bytes_to_copy));
}
}
}

View File

@ -109,8 +109,7 @@ dissect_rmcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
return 0; /* unknown class value */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RMCP");
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "%s, Class: %s",
col_add_fstr(pinfo->cinfo, COL_INFO, "%s, Class: %s",
val_to_str(type, rmcp_type_vals, "Unknown (0x%02x)"),
class_str);

View File

@ -132,7 +132,6 @@ dissect_rmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
rmitype = get_rmi_type(tvb, offset, datalen);
if (check_col(pinfo->cinfo, COL_INFO)) {
switch(rmitype) {
case RMI_OUTPUTSTREAM:
version = tvb_get_ntohs(tvb,4);
@ -169,7 +168,6 @@ dissect_rmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_INFO, "Continuation");
break;
}
}
if (tree) {
ti = proto_tree_add_item(tree, proto_rmi, tvb, 0, -1, ENC_NA);

View File

@ -110,10 +110,8 @@ dissect_rmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
type = 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_const(type, rmp_type_vals, "Unknown Type"));
}
if (tree) {
ti = proto_tree_add_item(tree, proto_rmp, tvb, 0, -1, ENC_NA);

View File

@ -199,8 +199,8 @@ static void dissect_roofnet_data(proto_tree *tree, tvbuff_t *tvb, packet_info *
*/
static void dissect_roofnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item * it= NULL;
proto_tree * roofnet_tree= NULL;
proto_item * it;
proto_tree * roofnet_tree;
guint offset= 0;
guint8 roofnet_msg_type= 0;
@ -211,15 +211,11 @@ static void dissect_roofnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
roofnet_msg_type = tvb_get_guint8(tvb, ROOFNET_OFFSET_TYPE);
/* Clear out stuff in the info column */
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %s",
col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %s",
val_to_str(roofnet_msg_type, roofnet_pt_vals, "Unknown (%d)"));
}
if (tree) {
it = proto_tree_add_item(tree, proto_roofnet, tvb, offset, -1, ENC_NA);
roofnet_tree = proto_item_add_subtree(it, ett_roofnet);
}
it = proto_tree_add_item(tree, proto_roofnet, tvb, offset, -1, ENC_NA);
roofnet_tree = proto_item_add_subtree(it, ett_roofnet);
dissect_roofnet_header(roofnet_tree, tvb, &offset);

View File

@ -932,10 +932,8 @@ dissect_rpcap (tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree)
proto_tree_add_item (tree, hf_type, tvb, offset, 1, ENC_BIG_ENDIAN);
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 (msg_type, message_type, "Unknown: %d"));
}
proto_item_append_text (ti, ", %s", val_to_str (msg_type, message_type, "Unknown: %d"));

View File

@ -275,10 +275,9 @@ dissect_rpl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
rpl_len = tvb_get_ntohs(tvb, 0);
rpl_type = tvb_get_ntohs(tvb, 2);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_set_str(pinfo->cinfo, COL_INFO,
col_set_str(pinfo->cinfo, COL_INFO,
val_to_str_const(rpl_type, rpl_type_vals, "Unknown Type"));
}
if (tree) {
ti = proto_tree_add_item(tree, proto_rpl, tvb, 0,
rpl_len, ENC_NA);

View File

@ -204,24 +204,22 @@ dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSH");
if(check_col(pinfo->cinfo, COL_INFO)){
/* First, clear the info column */
col_clear(pinfo->cinfo, COL_INFO);
/* First, clear the info column */
col_clear(pinfo->cinfo, COL_INFO);
/* Client username */
if(hash_info->client_username && preference_info_show_client_username == TRUE){
col_append_fstr(pinfo->cinfo, COL_INFO, "Client username:%s ", hash_info->client_username);
}
/* Client username */
if(hash_info->client_username && preference_info_show_client_username == TRUE){
col_append_fstr(pinfo->cinfo, COL_INFO, "Client username:%s ", hash_info->client_username);
}
/* Server username */
if(hash_info->server_username && preference_info_show_server_username == TRUE){
col_append_fstr(pinfo->cinfo, COL_INFO, "Server username:%s ", hash_info->server_username);
}
/* Server username */
if(hash_info->server_username && preference_info_show_server_username == TRUE){
col_append_fstr(pinfo->cinfo, COL_INFO, "Server username:%s ", hash_info->server_username);
}
/* Command */
if(hash_info->command && preference_info_show_command == TRUE){
col_append_fstr(pinfo->cinfo, COL_INFO, "Command:%s ", hash_info->command);
}
/* Command */
if(hash_info->command && preference_info_show_command == TRUE){
col_append_fstr(pinfo->cinfo, COL_INFO, "Command:%s ", hash_info->command);
}
/* create display subtree for the protocol */

View File

@ -1671,9 +1671,9 @@ dissect_rtmpt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_conv_t
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTMP");
RTMPT_DEBUG("Dissect: frame=%u visited=%d len=%d col=%d tree=%p\n",
RTMPT_DEBUG("Dissect: frame=%u visited=%d len=%d tree=%p\n",
pinfo->fd->num, pinfo->fd->flags.visited,
tvb_length_remaining(tvb, offset), check_col(pinfo->cinfo, COL_INFO), tree);
tvb_length_remaining(tvb, offset), tree);
/* Clear any previous data in Info column (RTMP packets are protected by a "fence") */
col_clear(pinfo->cinfo, COL_INFO);
@ -1713,25 +1713,22 @@ dissect_rtmpt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_conv_t
}
}
if ((check_col(pinfo->cinfo, COL_INFO) || tree) && tp->id<=RTMPT_ID_MAX)
if (tree && tp->id<=RTMPT_ID_MAX)
{
sDesc = rtmpt_get_packet_desc(tvb, iBodyOffset, iBodyRemain, rconv, cdir, tp, &deschasopcode);
}
if (check_col(pinfo->cinfo, COL_INFO))
{
if (tp->id>RTMPT_ID_MAX) {
col_append_sep_fstr(pinfo->cinfo, COL_INFO, "|", "%s",
val_to_str(tp->id, rtmpt_handshake_vals, "Unknown (0x%01x)"));
col_set_fence(pinfo->cinfo, COL_INFO);
} else if (sDesc) {
col_append_sep_fstr(pinfo->cinfo, COL_INFO, "|", "%s", sDesc);
col_set_fence(pinfo->cinfo, COL_INFO);
} else {
col_append_sep_fstr(pinfo->cinfo, COL_INFO, "|", "%s",
val_to_str(tp->cmd, rtmpt_opcode_vals, "Unknown (0x%01x)"));
col_set_fence(pinfo->cinfo, COL_INFO);
}
if (tp->id>RTMPT_ID_MAX) {
col_append_sep_fstr(pinfo->cinfo, COL_INFO, "|", "%s",
val_to_str(tp->id, rtmpt_handshake_vals, "Unknown (0x%01x)"));
col_set_fence(pinfo->cinfo, COL_INFO);
} else if (sDesc) {
col_append_sep_fstr(pinfo->cinfo, COL_INFO, "|", "%s", sDesc);
col_set_fence(pinfo->cinfo, COL_INFO);
} else {
col_append_sep_fstr(pinfo->cinfo, COL_INFO, "|", "%s",
val_to_str(tp->cmd, rtmpt_opcode_vals, "Unknown (0x%01x)"));
col_set_fence(pinfo->cinfo, COL_INFO);
}
if (tree)

View File

@ -398,10 +398,8 @@ dissect_rtnet_tdma_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root) {
col_set_str(pinfo->cinfo, COL_PROTOCOL, "TDMA-V1");
/* set the info column */
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s",
col_add_fstr(pinfo->cinfo, COL_INFO, "%s",
val_to_str(msg, tdma_v1_msg_vals, "Unknown (0x%04x)"));
}
if (root) {
ti = proto_tree_add_item(root, proto_tdma, tvb, 0, -1, ENC_NA);
@ -515,10 +513,8 @@ dissect_rtnet_tdma(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root) {
col_set_str(pinfo->cinfo, COL_PROTOCOL, "TDMA");
/* Set the info column */
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s",
col_add_fstr(pinfo->cinfo, COL_INFO, "%s",
val_to_str(msg, tdma_msg_vals, "Unknown (0x%04x)"));
}
if (root) {
ti = proto_tree_add_item(root, proto_tdma, tvb, 0, -1, ENC_NA);
@ -590,10 +586,8 @@ dissect_rtmac(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTmac");
/* set the info column */
if (check_col(pinfo->cinfo, COL_INFO)) {
col_clear(pinfo->cinfo,COL_INFO);
col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown (0x%04x)",type);
}
col_clear(pinfo->cinfo,COL_INFO);
col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown (0x%04x)",type);
if (rtmac_tree) {
if (ver == 1) {
@ -682,10 +676,8 @@ dissect_rtcfg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
vers_id = tvb_get_guint8(tvb, offset);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s",
col_add_fstr(pinfo->cinfo, COL_INFO, "%s",
val_to_str(vers_id, rtcfg_msg_vals, "Unknown (0x%04x)"));
}
if( rtcfg_tree )
{

View File

@ -106,12 +106,9 @@ dissect_rtp_events( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
rtp_event_info.info_setup_frame_num = 0;
if ( check_col( pinfo->cinfo, COL_INFO) )
{
col_add_fstr( pinfo->cinfo, COL_INFO,
"Payload type=RTP Event, %s",
val_to_str( rtp_evt, rtp_event_type_values, "Unknown (%u)" ));
}
col_add_fstr( pinfo->cinfo, COL_INFO,
"Payload type=RTP Event, %s",
val_to_str( rtp_evt, rtp_event_type_values, "Unknown (%u)" ));
ti = proto_tree_add_item( tree, proto_rtp_events, tvb, offset, -1, ENC_NA );
rtp_events_tree = proto_item_add_subtree( ti, ett_rtp_events );

View File

@ -819,8 +819,7 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
fragment_length = tvb_length_remaining (tvb, offset);
}
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, "[RTSE fragment, %u byte%s]",
col_append_fstr(pinfo->cinfo, COL_INFO, "[RTSE fragment, %u byte%s]",
fragment_length, plurality(fragment_length, "", "s"));
} else if (rtse_reassemble && session->spdu_type == SES_MAJOR_SYNC_POINT) {
if (next_tvb) {

View File

@ -343,8 +343,7 @@ dissect_rtspinterleaved(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
}
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO,
col_add_fstr(pinfo->cinfo, COL_INFO,
"Interleaved channel 0x%02x, %u bytes",
rf_chan, rf_len);
@ -795,32 +794,29 @@ dissect_rtspmessage(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTSP");
if (check_col(pinfo->cinfo, COL_INFO)) {
/*
* Put the first line from the buffer into the summary
* if it's an RTSP request or reply (but leave out the
* line terminator).
* Otherwise, just call it a continuation.
*
* 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.
*/
if (is_request_or_reply)
if ( rtsp_type == RTSP_REPLY ) {
col_set_str(pinfo->cinfo, COL_INFO, "Reply: ");
col_append_str(pinfo->cinfo, COL_INFO,
format_text(line, first_linelen));
}
else {
col_add_str(pinfo->cinfo, COL_INFO,
format_text(line, first_linelen));
}
/*
* Put the first line from the buffer into the summary
* if it's an RTSP request or reply (but leave out the
* line terminator).
* Otherwise, just call it a continuation.
*
* 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.
*/
if (is_request_or_reply)
if ( rtsp_type == RTSP_REPLY ) {
col_set_str(pinfo->cinfo, COL_INFO, "Reply: ");
col_append_str(pinfo->cinfo, COL_INFO,
format_text(line, first_linelen));
}
else {
col_add_str(pinfo->cinfo, COL_INFO,
format_text(line, first_linelen));
}
else
col_set_str(pinfo->cinfo, COL_INFO, "Continuation");
}
else
col_set_str(pinfo->cinfo, COL_INFO, "Continuation");
orig_offset = offset;
if (tree) {

View File

@ -196,8 +196,7 @@ dissect_rx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
guint32 version, tl;
int old_offset=offset;
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO,
col_add_fstr(pinfo->cinfo, COL_INFO,
"RESPONSE "
"Seq: %lu "
"Call: %lu "
@ -208,7 +207,6 @@ dissect_rx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
get_udp_port(pinfo->srcport),
get_udp_port(pinfo->destport)
);
}
item = proto_tree_add_item(parent_tree, hf_rx_response, tvb, offset, -1, ENC_NA);
tree = proto_item_add_subtree(item, ett_rx_response);
@ -251,8 +249,7 @@ dissect_rx_abort(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int
proto_item *item;
int old_offset=offset;
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO,
col_add_fstr(pinfo->cinfo, COL_INFO,
"ABORT "
"Seq: %lu "
"Call: %lu "
@ -263,7 +260,6 @@ dissect_rx_abort(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int
get_udp_port(pinfo->srcport),
get_udp_port(pinfo->destport)
);
}
item = proto_tree_add_item(parent_tree, hf_rx_abort, tvb, offset, -1, ENC_NA);
tree = proto_item_add_subtree(item, ett_rx_abort);
@ -285,8 +281,7 @@ dissect_rx_challenge(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
guint32 version;
int old_offset=offset;
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO,
col_add_fstr(pinfo->cinfo, COL_INFO,
"CHALLENGE "
"Seq: %lu "
"Call: %lu "
@ -297,7 +292,6 @@ dissect_rx_challenge(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
get_udp_port(pinfo->srcport),
get_udp_port(pinfo->destport)
);
}
item = proto_tree_add_item(parent_tree, hf_rx_challenge, tvb, offset, -1, ENC_NA);
tree = proto_item_add_subtree(item, ett_rx_challenge);
@ -327,8 +321,7 @@ dissect_rx_acks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int
guint8 num;
int old_offset = offset;
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO,
col_add_fstr(pinfo->cinfo, COL_INFO,
"ACK "
"Seq: %lu "
"Call: %lu "
@ -339,7 +332,6 @@ dissect_rx_acks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int
get_udp_port(pinfo->srcport),
get_udp_port(pinfo->destport)
);
}
item = proto_tree_add_item(parent_tree, hf_rx_ack, tvb, offset, -1, ENC_NA);
tree = proto_item_add_subtree(item, ett_rx_ack);
@ -550,8 +542,7 @@ dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *dat
break;
case RX_PACKET_TYPE_ACKALL:
/* does not contain any payload */
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO,
col_add_fstr(pinfo->cinfo, COL_INFO,
"ACKALL "
"Seq: %lu "
"Call: %lu "
@ -562,7 +553,6 @@ dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *dat
get_udp_port(pinfo->srcport),
get_udp_port(pinfo->destport)
);
}
break;
case RX_PACKET_TYPE_CHALLENGE:
dissect_rx_challenge(tvb, pinfo, tree, offset, seq, callnumber);

View File

@ -1299,9 +1299,7 @@ dissect_s5066_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "S5066");
/* Clear out stuff in the info column, the add PDU type */
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "PDU type %s", val_to_str(pdu_type, s5066_pdu_type, "Unknown (0x%02x)"));
}
col_add_fstr(pinfo->cinfo, COL_INFO, "PDU type %s", val_to_str(pdu_type, s5066_pdu_type, "Unknown (0x%02x)"));
if (tree) { /* We are being asked for details */
proto_tree *s5066_tree = NULL;

View File

@ -137,10 +137,8 @@ dissect_sap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
sap_version = (vers_flags&MCAST_SAP_VERSION_MASK)>>MCAST_SAP_VERSION_SHIFT;
addr_len = (is_ipv6) ? (int)sizeof(struct e_in6_addr) : 4;
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s (v%u)",
col_add_fstr(pinfo->cinfo, COL_INFO, "%s (v%u)",
(is_del) ? "Deletion" : "Announcement", sap_version);
}
if (tree) {
si = proto_tree_add_item(tree, proto_sap, tvb, offset, -1, ENC_NA);

View File

@ -750,138 +750,136 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
col_clear(pinfo->cinfo, COL_INFO);
offset = 0;
if (check_col(pinfo->cinfo, COL_INFO)) {
switch (sbus_attribut){
case SBUS_REQUEST:
sbus_cmd_code = tvb_get_guint8(tvb,10);
switch (sbus_cmd_code){
case SBUS_WEB_SERVER_SERIAL_COMM:
/* Special treatment of web server request
* as is is very helpful to see more information in the packetlist */
sbus_web_aid = tvb_get_guint8(tvb,12);
sbus_web_seq = tvb_get_guint8(tvb,13);
col_add_fstr(pinfo->cinfo, COL_INFO,
"Web Server Request: %s (Seq No: %d)",
val_to_str_const(sbus_web_aid,
webserver_aid_vals, "Unknown Request!"),
sbus_web_seq);
break;
case SBUS_RD_WR_PCD_BLOCK:
sbus_rdwr_type = tvb_get_guint8(tvb, 12);
col_add_fstr( pinfo->cinfo, COL_INFO,
"Request: %s", val_to_str_const( sbus_rdwr_type, rdwrblock_vals,
"This RD/WR block telegram is not implemented"));
/* Add name of file to be written in case of start of file stream */
if (sbus_rdwr_type == SBUS_WR_START_OF_STREAM) {
sbus_rdwr_block_type = tvb_get_guint8(tvb, 14);
if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) ||
(sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) {
sbus_quint8_helper0=0;
for (i=19; i<43; i++) { /*max length is 24 chars*/
/*find zero-termination of string*/
if ((tvb_get_guint8(tvb, i)) == 0x00) {
break;
}
sbus_quint8_helper0 += 1;
switch (sbus_attribut){
case SBUS_REQUEST:
sbus_cmd_code = tvb_get_guint8(tvb,10);
switch (sbus_cmd_code){
case SBUS_WEB_SERVER_SERIAL_COMM:
/* Special treatment of web server request
* as is is very helpful to see more information in the packetlist */
sbus_web_aid = tvb_get_guint8(tvb,12);
sbus_web_seq = tvb_get_guint8(tvb,13);
col_add_fstr(pinfo->cinfo, COL_INFO,
"Web Server Request: %s (Seq No: %d)",
val_to_str_const(sbus_web_aid,
webserver_aid_vals, "Unknown Request!"),
sbus_web_seq);
break;
case SBUS_RD_WR_PCD_BLOCK:
sbus_rdwr_type = tvb_get_guint8(tvb, 12);
col_add_fstr( pinfo->cinfo, COL_INFO,
"Request: %s", val_to_str_const( sbus_rdwr_type, rdwrblock_vals,
"This RD/WR block telegram is not implemented"));
/* Add name of file to be written in case of start of file stream */
if (sbus_rdwr_type == SBUS_WR_START_OF_STREAM) {
sbus_rdwr_block_type = tvb_get_guint8(tvb, 14);
if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) ||
(sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) {
sbus_quint8_helper0=0;
for (i=19; i<43; i++) { /*max length is 24 chars*/
/*find zero-termination of string*/
if ((tvb_get_guint8(tvb, i)) == 0x00) {
break;
}
tmp_string = tvb_get_ephemeral_string(tvb , 19,
sbus_quint8_helper0);
col_append_fstr(pinfo->cinfo, COL_INFO,
": (File: %s)", tmp_string);
}
} else if (sbus_rdwr_type == SBUS_RD_BLOCK_START_OF_STREAM) {
sbus_rdwr_block_type = tvb_get_guint8(tvb, 14);
if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) ||
(sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) {
sbus_quint8_helper0=0;
for (i=15; i<39; i++) { /*max length is 24 chars*/
/*find zero-termination of string*/
if ((tvb_get_guint8(tvb, i)) == 0x00) {
break;
}
sbus_quint8_helper0 += 1;
sbus_quint8_helper0 += 1;
}
tmp_string = tvb_get_ephemeral_string(tvb , 19,
sbus_quint8_helper0);
col_append_fstr(pinfo->cinfo, COL_INFO,
": (File: %s)", tmp_string);
}
} else if (sbus_rdwr_type == SBUS_RD_BLOCK_START_OF_STREAM) {
sbus_rdwr_block_type = tvb_get_guint8(tvb, 14);
if ((sbus_rdwr_block_type == SBUS_RD_WR_CONFIGURATION_FILE) ||
(sbus_rdwr_block_type == SBUS_RD_WR_PROGRAM_BLOCK_FILE)) {
sbus_quint8_helper0=0;
for (i=15; i<39; i++) { /*max length is 24 chars*/
/*find zero-termination of string*/
if ((tvb_get_guint8(tvb, i)) == 0x00) {
break;
}
tmp_string = tvb_get_ephemeral_string(tvb , 15,
sbus_quint8_helper0);
col_append_fstr(pinfo->cinfo, COL_INFO,
": (File: %s)", tmp_string);
}
}
sbus_quint8_helper0 += 1;
}
tmp_string = tvb_get_ephemeral_string(tvb , 15,
sbus_quint8_helper0);
col_append_fstr(pinfo->cinfo, COL_INFO,
": (File: %s)", tmp_string);
}
}
break;
break;
default:
/* All other requests */
col_add_fstr(pinfo->cinfo, COL_INFO,
"Request: %s", val_to_str_const(sbus_cmd_code,
sbus_command_vals, "Unknown Command!"));
break;
}
/*mark retries*/
if (request_val->retry_count>0) {
col_append_str(pinfo->cinfo, COL_INFO,
" (Retry)");
} /*no retry number as it is not always correctly calculated*/
break;
default:
/* All other requests */
col_add_fstr(pinfo->cinfo, COL_INFO,
"Request: %s", val_to_str_const(sbus_cmd_code,
sbus_command_vals, "Unknown Command!"));
break;
}
/*mark retries*/
if (request_val->retry_count>0) {
col_append_str(pinfo->cinfo, COL_INFO,
" (Retry)");
} /*no retry number as it is not always correctly calculated*/
break;
case SBUS_RESPONSE:
/* Special treatment of web server request
* as is is very helpful to see more information in the packetlist */
if (request_val && ((request_val->cmd_code) == SBUS_WEB_SERVER_SERIAL_COMM)) {
sbus_web_size = tvb_get_guint8(tvb,9);
sbus_web_aid = tvb_get_guint8(tvb,10);
col_add_fstr(pinfo->cinfo, COL_INFO,
"Response: %s",
val_to_str_const(sbus_web_aid,
webserver_aid_vals, "Unknown Request!"));
if (sbus_web_size > 1) {
sbus_web_seq = tvb_get_guint8(tvb,11);
col_append_fstr(pinfo->cinfo, COL_INFO,
" (Seq No: %d)",
sbus_web_seq);
}
} else if (request_val && ((request_val->cmd_code) == SBUS_RD_WR_PCD_BLOCK)) {
/* Treat the ACK/NAK telgrams in a special way*/
switch (request_val->block_tlg) {
case SBUS_WR_START_OF_STREAM:
case SBUS_WR_BLOCK_DATA_STREAM:
case SBUS_WR_BLOCK_END_OF_STREAM:
case SBUS_WR_ABORT_BLOCK_STREAM:
case SBUS_WR_BLOCK_DATA_BYTES:
case SBUS_DELETE_BLOCK:
case SBUS_RD_ABORT_BLOCK_STREAM:
sbus_rdwr_ack_nak = tvb_get_guint8(tvb, 10);
col_add_fstr( pinfo->cinfo, COL_INFO,
"Response: %s", val_to_str_const(sbus_rdwr_ack_nak,
rdwrblock_sts, "Unknown response!"));
break;
default:
sbus_rdwr_type = tvb_get_guint8(tvb, 9);
col_add_fstr( pinfo->cinfo, COL_INFO,
"Response: (%d byte)", sbus_rdwr_type);
break;
}
} else {
col_set_str(pinfo->cinfo, COL_INFO, "Response");
}
break;
case SBUS_ACKNAK:
sbus_ack_code = tvb_get_ntohs(tvb,9);
case SBUS_RESPONSE:
/* Special treatment of web server request
* as is is very helpful to see more information in the packetlist */
if (request_val && ((request_val->cmd_code) == SBUS_WEB_SERVER_SERIAL_COMM)) {
sbus_web_size = tvb_get_guint8(tvb,9);
sbus_web_aid = tvb_get_guint8(tvb,10);
col_add_fstr(pinfo->cinfo, COL_INFO,
"%s", val_to_str_const(sbus_ack_code,
sbus_ack_nak_vals,
"Unknown NAK response code!"));
break;
"Response: %s",
val_to_str_const(sbus_web_aid,
webserver_aid_vals, "Unknown Request!"));
if (sbus_web_size > 1) {
sbus_web_seq = tvb_get_guint8(tvb,11);
col_append_fstr(pinfo->cinfo, COL_INFO,
" (Seq No: %d)",
sbus_web_seq);
}
} else if (request_val && ((request_val->cmd_code) == SBUS_RD_WR_PCD_BLOCK)) {
/* Treat the ACK/NAK telgrams in a special way*/
switch (request_val->block_tlg) {
case SBUS_WR_START_OF_STREAM:
case SBUS_WR_BLOCK_DATA_STREAM:
case SBUS_WR_BLOCK_END_OF_STREAM:
case SBUS_WR_ABORT_BLOCK_STREAM:
case SBUS_WR_BLOCK_DATA_BYTES:
case SBUS_DELETE_BLOCK:
case SBUS_RD_ABORT_BLOCK_STREAM:
sbus_rdwr_ack_nak = tvb_get_guint8(tvb, 10);
col_add_fstr( pinfo->cinfo, COL_INFO,
"Response: %s", val_to_str_const(sbus_rdwr_ack_nak,
rdwrblock_sts, "Unknown response!"));
break;
default:
sbus_rdwr_type = tvb_get_guint8(tvb, 9);
col_add_fstr( pinfo->cinfo, COL_INFO,
"Response: (%d byte)", sbus_rdwr_type);
break;
}
default:
col_set_str(pinfo->cinfo, COL_INFO, "Unknown attribute");
break;
}
} else {
col_set_str(pinfo->cinfo, COL_INFO, "Response");
}
break;
case SBUS_ACKNAK:
sbus_ack_code = tvb_get_ntohs(tvb,9);
col_add_fstr(pinfo->cinfo, COL_INFO,
"%s", val_to_str_const(sbus_ack_code,
sbus_ack_nak_vals,
"Unknown NAK response code!"));
break;
default:
col_set_str(pinfo->cinfo, COL_INFO, "Unknown attribute");
break;
}
/* create display subtree for the protocol */
if (tree) {

View File

@ -118,9 +118,8 @@ dissect_ssprotocol_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree
guint total_length;
type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(type, message_type_values, "Unknown SSP type: %u"));
}
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(type, message_type_values, "Unknown SSP type: %u"));
proto_tree_add_item(ssprotocol_tree, hf_message_type, message_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, ENC_BIG_ENDIAN);
flags_item = proto_tree_add_item(ssprotocol_tree, hf_message_flags, message_tvb, MESSAGE_FLAGS_OFFSET, MESSAGE_FLAGS_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(ssprotocol_tree, hf_message_length, message_tvb, MESSAGE_LENGTH_OFFSET, MESSAGE_LENGTH_LENGTH, ENC_BIG_ENDIAN);

View File

@ -2672,10 +2672,9 @@ dissect_osd_opcode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset+=2;
if(check_col(pinfo->cinfo, COL_INFO)){
col_append_str(pinfo->cinfo, COL_INFO,
col_append_str(pinfo->cinfo, COL_INFO,
val_to_str_const(svcaction, scsi_osd_svcaction_vals, "Unknown OSD Serviceaction"));
}
dissector=find_svcaction_dissector(svcaction);
if(dissector){
(*dissector)(tvb, pinfo, tree, offset, isreq, iscdb, payload_len, cdata, conv_info, lun_info);
@ -2690,10 +2689,9 @@ dissect_osd_opcode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
scsi_osd_extra_data_t *extra_data=(scsi_osd_extra_data_t *)cdata->itlq->extra_data;
svcaction=extra_data->svcaction;
}
if(check_col(pinfo->cinfo, COL_INFO)){
col_append_str(pinfo->cinfo, COL_INFO,
col_append_str(pinfo->cinfo, COL_INFO,
val_to_str_const(svcaction, scsi_osd_svcaction_vals, "Unknown OSD Serviceaction"));
}
if(svcaction){
proto_item *it;
it=proto_tree_add_uint_format(tree, hf_scsi_osd_svcaction, tvb, 0, 0, svcaction, "Service Action: 0x%04x", svcaction);

View File

@ -224,8 +224,7 @@ dissect_sbc_read6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%06x, Len: %u)",
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%06x, Len: %u)",
tvb_get_ntoh24 (tvb, offset),
tvb_get_guint8 (tvb, offset+3));
}
@ -244,10 +243,9 @@ dissect_sbc_write6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%06x, Len: %u)",
tvb_get_ntoh24 (tvb, offset),
tvb_get_guint8 (tvb, offset+3));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%06x, Len: %u)",
tvb_get_ntoh24 (tvb, offset),
tvb_get_guint8 (tvb, offset+3));
}
if (tree && isreq && iscdb) {
@ -270,10 +268,9 @@ dissect_sbc_prefetch10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
@ -300,10 +297,9 @@ dissect_sbc_synchronizecache10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
@ -330,10 +326,9 @@ dissect_sbc_synchronizecache16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
}
if (tree && isreq && iscdb) {
@ -359,10 +354,9 @@ dissect_sbc_prefetch16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
}
if (tree && isreq && iscdb) {
@ -391,10 +385,9 @@ dissect_sbc_read10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
@ -420,10 +413,9 @@ dissect_sbc_xdread10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
@ -453,10 +445,9 @@ dissect_sbc_xdwrite10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
@ -487,10 +478,9 @@ dissect_sbc_xdwriteread10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
@ -519,10 +509,9 @@ dissect_sbc_xpwrite10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
@ -551,10 +540,9 @@ dissect_sbc_write10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
@ -582,10 +570,9 @@ dissect_sbc_read12 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohl (tvb, offset+5));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohl (tvb, offset+5));
}
if (tree && isreq && iscdb) {
@ -613,10 +600,9 @@ dissect_sbc_write12 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohl (tvb, offset+5));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohl (tvb, offset+5));
}
if (tree && isreq && iscdb) {
@ -644,10 +630,9 @@ dissect_sbc_read16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
}
if (tree && isreq && iscdb) {
@ -674,10 +659,9 @@ dissect_sbc_write16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
}
if (tree && isreq && iscdb) {
@ -705,10 +689,9 @@ dissect_sbc_orwrite (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
}
if (tree && isreq && iscdb) {
@ -736,10 +719,9 @@ dissect_sbc_comparenwrite (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
}
if (tree && isreq && iscdb) {
@ -826,10 +808,9 @@ dissect_sbc_verify10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
@ -857,10 +838,9 @@ dissect_sbc_verify12 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohl (tvb, offset+5));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohl (tvb, offset+5));
}
if (isreq && iscdb) {
@ -888,10 +868,9 @@ dissect_sbc_verify16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
}
if (isreq && iscdb) {
@ -921,10 +900,9 @@ dissect_sbc_wrverify10 (tvbuff_t *tvb, packet_info *pinfo _U_,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
@ -952,10 +930,9 @@ dissect_sbc_wrverify12 (tvbuff_t *tvb, packet_info *pinfo _U_,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohl (tvb, offset+5));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohl (tvb, offset+5));
}
if (tree && isreq && iscdb) {
@ -983,10 +960,9 @@ dissect_sbc_wrverify16 (tvbuff_t *tvb, packet_info *pinfo _U_,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
}
if (tree && isreq && iscdb) {

View File

@ -108,9 +108,8 @@ dissect_ssc_read6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
}
if (tree && isreq && iscdb) {
@ -134,9 +133,8 @@ dissect_ssc_recoverbuffereddata (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
};
if (isreq) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
}
if (tree && isreq && iscdb) {
@ -160,9 +158,8 @@ dissect_ssc_reportdensitysupport (tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
};
if (isreq) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
}
if(!tree)
@ -192,9 +189,8 @@ dissect_ssc_readreverse6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre
};
if (isreq) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
}
if (tree && isreq && iscdb) {
@ -218,9 +214,8 @@ dissect_ssc_read16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
}
if (tree && isreq && iscdb) {
@ -247,9 +242,8 @@ dissect_ssc_write16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
}
if (tree && isreq && iscdb) {
@ -276,9 +270,8 @@ dissect_ssc_writefilemarks16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
};
if (isreq) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
}
if (tree && isreq && iscdb) {
@ -305,9 +298,8 @@ dissect_ssc_verify16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
}
if (tree && isreq && iscdb) {
@ -334,9 +326,8 @@ dissect_ssc_verify6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
}
if (tree && isreq && iscdb) {
@ -361,9 +352,8 @@ dissect_ssc_readreverse16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr
};
if (isreq) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
}
if (tree && isreq && iscdb) {
@ -388,9 +378,8 @@ dissect_ssc_write6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
}
if (tree && isreq && iscdb) {
@ -413,9 +402,8 @@ dissect_ssc_writefilemarks6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
};
if (isreq) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
tvb_get_ntoh24 (tvb, offset+1));
}
if (tree && isreq && iscdb) {
@ -445,9 +433,8 @@ dissect_ssc_loadunload (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
};
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(Immed: %u)",
tvb_get_guint8 (tvb, offset) & 0x01);
col_append_fstr (pinfo->cinfo, COL_INFO, "(Immed: %u)",
tvb_get_guint8 (tvb, offset) & 0x01);
}
if (!tree)
@ -505,9 +492,8 @@ dissect_ssc_rewind (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
return;
if (isreq && iscdb) {
if (check_col (pinfo->cinfo, COL_INFO))
col_append_fstr (pinfo->cinfo, COL_INFO, "(Immed: %u)",
tvb_get_guint8 (tvb, offset) & 0x01);
col_append_fstr (pinfo->cinfo, COL_INFO, "(Immed: %u)",
tvb_get_guint8 (tvb, offset) & 0x01);
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_read6_flags, ett_scsi_read6, rewind_fields, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control,