type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET);
/* pinfo is NULL only if dissect_enrp_message is called via dissect_error_cause */
- if (pinfo && (check_col(pinfo->cinfo, COL_INFO)))
+ if (pinfo)
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(type, message_type_values, "Unknown ENRP Type"));
if (enrp_tree) {
"Unknown 0x%02x"));
}
- if(check_col(pinfo->cinfo, COL_INFO)){
- if(pinfo->p2p_dir == P2P_DIR_SENT ||
- pinfo->p2p_dir == P2P_DIR_RECV)
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
- val_to_str(pinfo->p2p_dir,
- hci_h1_direction_vals, "Unknown: %d"),
+ if(pinfo->p2p_dir == P2P_DIR_SENT ||
+ pinfo->p2p_dir == P2P_DIR_RECV)
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
+ val_to_str(pinfo->p2p_dir,
+ hci_h1_direction_vals, "Unknown: %d"),
val_to_str(type, hci_h1_type_vals,
- "Unknown 0x%02x"));
- else
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s",
- val_to_str(type, hci_h1_type_vals,
- "Unknown 0x%02x"));
- }
+ "Unknown 0x%02x"));
+ else
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s",
+ val_to_str(type, hci_h1_type_vals,
+ "Unknown 0x%02x"));
pd_save = pinfo->private_data;
hci_data = wmem_new(wmem_packet_scope(),hci_data_t);
"Source-ID: %s",
print_system_id( tvb_get_ptr(tvb, offset, id_length+1), id_length+1 ) );
}
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", Source-ID: %s",
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Source-ID: %s",
print_system_id( tvb_get_ptr(tvb, offset, id_length+1), id_length+1 ) );
- }
+
offset += id_length + 1;
- if (tree) {
- proto_tree_add_text(csnp_tree, tvb, offset, id_length + 2,
- "Start LSP-ID: %s",
- print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2 ) );
- }
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", Start LSP-ID: %s",
+ proto_tree_add_text(csnp_tree, tvb, offset, id_length + 2, "Start LSP-ID: %s",
+ print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2 ) );
+
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Start LSP-ID: %s",
print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2 ) );
- }
+
offset += id_length + 2;
- if (tree) {
- proto_tree_add_text(csnp_tree, tvb, offset, id_length + 2,
- "End LSP-ID: %s",
- print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2 ) );
- }
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", End LSP-ID: %s",
+ proto_tree_add_text(csnp_tree, tvb, offset, id_length + 2, "End LSP-ID: %s",
+ print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2 ) );
+
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", End LSP-ID: %s",
print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2 ) );
- }
+
offset += id_length + 2;
len = pdu_length - header_length;
}
offset += 2;
- if (tree) {
- proto_tree_add_text(psnp_tree, tvb, offset, id_length + 1,
- "Source-ID: %s",
+ proto_tree_add_text(psnp_tree, tvb, offset, id_length + 1, "Source-ID: %s",
print_system_id( tvb_get_ptr(tvb, offset, id_length+1), id_length + 1 ) );
- }
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", Source-ID: %s",
+
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Source-ID: %s",
print_system_id( tvb_get_ptr(tvb, offset, id_length+1), id_length+1 ) );
- }
+
offset += id_length + 1;
len = pdu_length - header_length;
}
if (set_version == V11){
- if (check_col(pinfo->cinfo, COL_PROTOCOL))
- col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_ISMACRYP_11);
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_ISMACRYP_11);
/* display mode */
if (pref_user_mode == FALSE){
- if (check_col( pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",val_to_str_const(mode, modetypenames, "user mode"));
- }
- if (pref_user_mode == TRUE){
- if ( check_col( pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, ", %s","user mode");
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",val_to_str_const(mode, modetypenames, "user mode"));
+ } else {
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", %s","user mode");
}
user_mode = pref_user_mode;
}
if (set_version == V20){
- if (check_col(pinfo->cinfo, COL_PROTOCOL))
- col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_ISMACRYP_20);
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_ISMACRYP_20);
user_mode = TRUE;
/* display mode */
- if (check_col( pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, ", %s","user mode");
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", %s","user mode");
}
/* select correct AU values depending on version & selected mode in preferences menu if not in user_mode */
if (user_mode == TRUE){ /* use values set in preference menu */
{
ismacryp_item = proto_tree_add_item(ismacryp_header_tree, hf_ismacryp_iv, tvb, poffset->offset_bytes, iv_length, ENC_NA);
proto_item_append_text(ismacryp_item, ": Length=%d bytes",iv_length); /* add IV info */
- if ( check_col( pinfo->cinfo, COL_INFO) ) {
- col_append_fstr( pinfo->cinfo, COL_INFO,
+ col_append_fstr( pinfo->cinfo, COL_INFO,
", IV=0x%s", tvb_bytes_to_str_punct(tvb, poffset->offset_bytes, iv_length,' '));
- }
+
poffset->offset_bytes+=iv_length; /* add IV length to offset_bytes */
}
/*Delta IV */
ismacryp_item = proto_tree_add_item(ismacryp_header_tree, hf_ismacryp_delta_iv,
tvb, poffset->offset_bytes, delta_iv_length, ENC_NA);
proto_item_append_text(ismacryp_item, ": Length=%d bytes",delta_iv_length); /* add delta IV info */
- if ( check_col( pinfo->cinfo, COL_INFO) ) {
- col_append_fstr( pinfo->cinfo, COL_INFO,
+ col_append_fstr( pinfo->cinfo, COL_INFO,
", Delta IV=0x%s", tvb_bytes_to_str_punct(tvb, poffset->offset_bytes, delta_iv_length,' '));
- }
poffset->offset_bytes+=iv_length; /* add IV length to offset_bytes */
}
/* Key Indicator */
ismacryp_item = proto_tree_add_item(ismacryp_header_tree, hf_ismacryp_key_indicator,
tvb, poffset->offset_bytes, key_indicator_length, ENC_NA);
proto_item_append_text(ismacryp_item,": Length=%d bytes",key_indicator_length); /* add KI info */
- if ( check_col( pinfo->cinfo, COL_INFO) ) {
- col_append_fstr( pinfo->cinfo, COL_INFO,
+ col_append_fstr( pinfo->cinfo, COL_INFO,
", KI=0x%s", tvb_bytes_to_str_punct(tvb, poffset->offset_bytes, key_indicator_length,' '));
- }
poffset->offset_bytes+=key_indicator_length; /* add KI length to offset_bytes */
}
/* AU size */
dissect_krb5_error_code(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_)
{
offset=dissect_ber_integer(FALSE, actx, tree, tvb, offset, hf_krb_error_code, &krb5_errorcode);
- if(krb5_errorcode && check_col(actx->pinfo->cinfo, COL_INFO)) {
+ if(krb5_errorcode) {
col_add_fstr(actx->pinfo->cinfo, COL_INFO,
"KRB Error: %s",
val_to_str(krb5_errorcode, krb5_error_codes,
offset=dissect_ber_integer(FALSE, actx, tree, tvb, offset, hf_krb_msg_type, &msgtype);
- if (gbl_do_col_info & check_col(actx->pinfo->cinfo, COL_INFO)) {
+ if (gbl_do_col_info) {
col_add_str(actx->pinfo->cinfo, COL_INFO,
val_to_str(msgtype, krb5_msg_types,
"Unknown msg type %#x"));
*/
proto_tree_add_item(tree, hf_krb_smb_nt_status, tvb, offset, 4, ENC_LITTLE_ENDIAN);
nt_status=tvb_get_letohl(tvb, offset);
- if(nt_status && check_col(actx->pinfo->cinfo, COL_INFO)) {
+ if(nt_status) {
col_append_fstr(actx->pinfo->cinfo, COL_INFO,
" NT Status: %s",
val_to_str(nt_status, NT_errors,
/* m_type */
proto_tree_add_item(tree, hf_krb4_m_type, tvb, offset, 1, ENC_BIG_ENDIAN);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s%s",
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s%s",
(version==TRANSARC_SPECIAL_VERSION)?"TRANSARC-":"",
val_to_str(auth_msg_type>>1, m_type_vals, "Unknown (0x%04x)"));
proto_item_append_text(item, " %s%s",
result = tvb_get_ntohs(tvb, offset);
proto_tree_add_uint(tree, hf_kpasswd_result, tvb, offset, 2, result);
offset+=2;
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_str(pinfo->cinfo, COL_INFO,
- val_to_str(result, kpasswd_result_types, "Result: %u"));
+ col_add_str(pinfo->cinfo, COL_INFO,
+ val_to_str(result, kpasswd_result_types, "Result: %u"));
/* optional result string */
proto_tree_add_uint(kpasswd_tree, hf_kpasswd_message_len, tvb, offset, 2, message_len);
proto_tree_add_uint(kpasswd_tree, hf_kpasswd_version, tvb, offset+2, 2, version);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(version, vers_vals, "Unknown command"));
+ col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(version, vers_vals, "Unknown command"));
proto_tree_add_uint(kpasswd_tree, hf_kpasswd_ap_req_len, tvb, offset+4, 2, ap_req_len);
offset+=6;
}
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Layer1");
- if (check_col(pinfo->cinfo, COL_DEF_SRC))
- col_set_str(pinfo->cinfo, COL_DEF_SRC,
+ col_set_str(pinfo->cinfo, COL_DEF_SRC,
pinfo->pseudo_header->l1event.uton? "TE" : "NT");
- if (check_col(pinfo->cinfo, COL_INFO)) {
- len = tvb_find_line_end(tvb, 0,
- tvb_ensure_length_remaining(tvb, 0),
+ len = tvb_find_line_end(tvb, 0, tvb_ensure_length_remaining(tvb, 0),
&next_offset, FALSE);
- if(len>0)
- col_add_str(pinfo->cinfo, COL_INFO,
- tvb_format_text(tvb, 0, len));
- }
+ if(len>0)
+ col_add_str(pinfo->cinfo, COL_INFO, tvb_format_text(tvb, 0, len));
+
if (tree) {
ti = proto_tree_add_item(tree, proto_l1_events,
tvb, 0, -1, ENC_NA);
if (cookie_len == -1)
cookie_len = L2TPv3_COOKIE_DEFAULT;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo,COL_INFO,
- "%s (session id=%u)",
- data_msg, sid);
- }
+ col_add_fstr(pinfo->cinfo,COL_INFO,
+ "%s (session id=%u)",
+ data_msg, sid);
if (tree) {
proto_tree_add_item(l2tp_tree, hf_l2tp_sid, tvb, idx-4, 4, ENC_BIG_ENDIAN);
ccid = tvb_get_ntohl(tvb, idx);
idx += 4;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- tmp_idx = idx;
+ tmp_idx = idx;
- if ((LENGTH_BIT(control))&&(length==12)) /* ZLB Message */
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "%s - ZLB (tunnel id=%u)",
- control_msg , ccid);
- else
- {
- if (SEQUENCE_BIT(control)) {
- tmp_idx += 4;
- }
+ if ((LENGTH_BIT(control))&&(length==12)) /* ZLB Message */
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "%s - ZLB (tunnel id=%u)",
+ control_msg , ccid);
+ else
+ {
+ if (SEQUENCE_BIT(control)) {
+ tmp_idx += 4;
+ }
- tmp_idx+=4;
+ tmp_idx+=4;
- avp_type = tvb_get_ntohs(tvb, tmp_idx);
- tmp_idx += 2;
+ avp_type = tvb_get_ntohs(tvb, tmp_idx);
+ tmp_idx += 2;
- if (avp_type == CONTROL_MESSAGE) {
- /* We print message type */
- msg_type = tvb_get_ntohs(tvb, tmp_idx);
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "%s - %s (tunnel id=%u)",
- control_msg ,
- val_to_str(msg_type, l2tp_message_type_short_str_vals, "Unknown (%u)"),
- ccid);
- }
- else {
- /*
- * This is not a control message.
- * We never pass here except in case of bad l2tp packet!
- */
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "%s (tunnel id=%u)",
- control_msg, ccid);
- }
+ if (avp_type == CONTROL_MESSAGE) {
+ /* We print message type */
+ msg_type = tvb_get_ntohs(tvb, tmp_idx);
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "%s - %s (tunnel id=%u)",
+ control_msg ,
+ val_to_str(msg_type, l2tp_message_type_short_str_vals, "Unknown (%u)"),
+ ccid);
+ }
+ else {
+ /*
+ * This is not a control message.
+ * We never pass here except in case of bad l2tp packet!
+ */
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "%s (tunnel id=%u)",
+ control_msg, ccid);
}
}
idx += 2;
cid = tvb_get_ntohs(tvb, idx);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- if (CONTROL_BIT(control)) {
- /* CONTROL MESSAGE */
- tmp_idx = idx;
+ if (CONTROL_BIT(control)) {
+ /* CONTROL MESSAGE */
+ tmp_idx = idx;
- if ((LENGTH_BIT(control))&&(length==12)) /* ZLB Message */
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "%s - ZLB (tunnel id=%d, session id=%u)",
- control_msg, tid, cid);
- else
- {
- if (SEQUENCE_BIT(control)) {
- tmp_idx += 4;
- }
+ if ((LENGTH_BIT(control))&&(length==12)) /* ZLB Message */
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "%s - ZLB (tunnel id=%d, session id=%u)",
+ control_msg, tid, cid);
+ else
+ {
+ if (SEQUENCE_BIT(control)) {
+ tmp_idx += 4;
+ }
- tmp_idx+=4;
+ tmp_idx+=4;
- avp_type = tvb_get_ntohs(tvb, (tmp_idx+=2));
+ avp_type = tvb_get_ntohs(tvb, (tmp_idx+=2));
- if (avp_type == CONTROL_MESSAGE) {
- /* We print message type */
- msg_type = tvb_get_ntohs(tvb, tmp_idx+2);
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "%s - %s (tunnel id=%u, session id=%u)",
- control_msg,
- val_to_str(msg_type, l2tp_message_type_short_str_vals, "Unknown (%u)"),
- tid, cid);
- }
- else
- {
- /*
- * This is not a control message.
- * We never pass here except in case of bad l2tp packet!
- */
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "%s (tunnel id=%u, session id=%u)",
- control_msg, tid, cid);
+ if (avp_type == CONTROL_MESSAGE) {
+ /* We print message type */
+ msg_type = tvb_get_ntohs(tvb, tmp_idx+2);
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "%s - %s (tunnel id=%u, session id=%u)",
+ control_msg,
+ val_to_str(msg_type, l2tp_message_type_short_str_vals, "Unknown (%u)"),
+ tid, cid);
+ }
+ else
+ {
+ /*
+ * This is not a control message.
+ * We never pass here except in case of bad l2tp packet!
+ */
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "%s (tunnel id=%u, session id=%u)",
+ control_msg, tid, cid);
- }
}
}
- else {
- /* DATA Message */
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "%s (tunnel id=%u, session id=%u)",
- data_msg, tid, cid);
- }
+ }
+ else {
+ /* DATA Message */
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "%s (tunnel id=%u, session id=%u)",
+ data_msg, tid, cid);
}
if (LENGTH_BIT(control)) {
col_set_str(pinfo->cinfo, COL_PROTOCOL, "LANforge");
- if(check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "Seq: %u", tvb_get_ntohl(tvb, 16));
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Seq: %u", tvb_get_ntohl(tvb, 16));
if(tree) {
sapi = (addr & LAPD_SAPI) >> LAPD_SAPI_SHIFT;
lapd_header_len = 2; /* addr */
- if (check_col(pinfo->cinfo, COL_TEI))
- col_add_fstr(pinfo->cinfo, COL_TEI, "%u", tei);
+ col_add_fstr(pinfo->cinfo, COL_TEI, "%u", tei);
/* Append TEI to info field */
col_append_fstr(pinfo->cinfo, COL_INFO, "TEI:%02u ", tei);
/* Make entries in Protocol column and Info column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Laplink");
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_str(pinfo->cinfo, COL_INFO, udp_ident_string);
+ col_add_str(pinfo->cinfo, COL_INFO, udp_ident_string);
if (tree){
ti = proto_tree_add_item(tree, proto_laplink, tvb, 0, -1, ENC_NA);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Laplink");
tcp_ident = tvb_get_ntohl(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(tcp_ident, laplink_tcp_magic, "TCP TBA (%u)"));
- }
if (tree){
ti = proto_tree_add_item(tree, proto_laplink, tvb, 0, -1, ENC_NA);
}
/* Add info */
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_str(pinfo->cinfo, COL_INFO, info);
+ col_add_str(pinfo->cinfo, COL_INFO, info);
/* Create item & subtree */
ctl_ti = proto_tree_add_uint_format_value(
rem -= 4;
length = MIN(length, rem); /* Don't go haywire if a problem ... */
- if( check_col(pinfo->cinfo, COL_INFO) ){
- switch (type) {
- case LDP_VENDOR_PRIVATE_START:
- col_append_fstr(pinfo->cinfo, COL_INFO, "Vendor-Private Message (0x%04X) ", typebak);
- break;
- case LDP_EXPERIMENTAL_MESSAGE_START:
- col_append_fstr(pinfo->cinfo, COL_INFO, "Experimental Message (0x%04X) ", typebak);
- break;
- default:
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(type, ldp_message_types, "Unknown Message (0x%04X)"));
- }
+ switch (type) {
+ case LDP_VENDOR_PRIVATE_START:
+ col_append_fstr(pinfo->cinfo, COL_INFO, "Vendor-Private Message (0x%04X) ", typebak);
+ break;
+ case LDP_EXPERIMENTAL_MESSAGE_START:
+ col_append_fstr(pinfo->cinfo, COL_INFO, "Experimental Message (0x%04X) ", typebak);
+ break;
+ default:
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(type, ldp_message_types, "Unknown Message (0x%04X)"));
}
if (tree) {
packet_detail = val_to_str_const(messageDetail, ldss_inferred_info, "unknown");
/* Set the info column */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "LDSS Broadcast (%s%s)",
+ col_add_fstr(pinfo->cinfo, COL_INFO, "LDSS Broadcast (%s%s)",
packet_type,
packet_detail);
- }
/* If we have a non-null tree (ie we are building the proto_tree
* instead of just filling out the columns), then give more detail. */
transfer_info->resp_num = pinfo->fd->num;
transfer_info->resp_ts = pinfo->fd->abs_ts;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "LDSS File Transfer (Sending file - %s)",
+ col_add_fstr(pinfo->cinfo, COL_INFO, "LDSS File Transfer (Sending file - %s)",
transfer_info->broadcast->message_id == MESSAGE_ID_WILLSEND
? "pull"
: "push");
- }
if (tree) {
ti = proto_tree_add_item(tree, proto_ldss,
proto_tree_add_uint(xid_tree, hf_llc_xid_types, tvb, 1,
1, types & TYPES_MASK);
}
- 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(types & TYPES_MASK, type_vals, "0x%02x")
);
- }
+
wsize = tvb_get_guint8(tvb, 2);
if (tree) {
proto_tree_add_uint(xid_tree, hf_llc_xid_wsize, tvb, 2,
1, (wsize & 0xFE) >> 1);
}
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO,
+ col_append_fstr(pinfo->cinfo, COL_INFO,
"; Window Size %d", (wsize & 0xFE) >> 1);
- }
}
static void
hf_llc_oui, hf_llc_type, hf_llc_pid, 2);
}
else {
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO,
+ col_append_fstr(pinfo->cinfo, COL_INFO,
"; DSAP %s %s, SSAP %s %s",
val_to_str(dsap & SAP_MASK, sap_vals, "0x%02x"),
dsap & DSAP_GI_BIT ?
ssap & SSAP_CR_BIT ?
"Response" : "Command"
);
- }
if (tvb_length_remaining(tvb, llc_header_len) > 0) {
next_tvb = tvb_new_subset_remaining(tvb, llc_header_len);
oui = tvb_get_ntoh24(tvb, offset);
etype = tvb_get_ntohs(tvb, offset+3);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO,
+ col_append_fstr(pinfo->cinfo, COL_INFO,
"; SNAP, OUI 0x%06X (%s), PID 0x%04X",
oui, val_to_str_const(oui, oui_vals, "Unknown"), etype);
- }
- if (tree) {
- proto_tree_add_uint(snap_tree, hf_oui, tvb, offset, 3, oui);
- }
+
+ proto_tree_add_uint(snap_tree, hf_oui, tvb, offset, 3, oui);
switch (oui) {
return -1;
}
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "Chassis Id = %s ", strPtr);
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Chassis Id = %s ", strPtr);
if (tree)
{
}
}
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, "Port Id = %s ", strPtr);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "Port Id = %s ", strPtr);
if (tree)
{
tempLen = TLV_INFO_LEN(tempShort);
tempShort = tvb_get_ntohs(tvb, (offset+2));
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, "TTL = %u ", tempShort);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "TTL = %u ", tempShort);
if (tree)
{
/* Set system name tree */
if (tempType == SYSTEM_NAME_TLV_TYPE) {
tf = proto_tree_add_text(tree, tvb, offset, (tempLen + 2), "System Name = %s", strPtr);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, "System Name = %s ", strPtr);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "System Name = %s ", strPtr);
} else
tf = proto_tree_add_text(tree, tvb, offset, (tempLen + 2), "System Description = %s", strPtr);
system_name_tree = proto_item_add_subtree(tf, ett_system_name);
dissect_llt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
/* Set up structures needed to add the protocol subtree and manage it */
- proto_item *ti=NULL;
- proto_tree *llt_tree=NULL;
+ proto_item *ti;
+ proto_tree *llt_tree;
guint8 message_type;
/* Make entries in Protocol column and Info column on summary display */
message_type = tvb_get_guint8(tvb, 3);
- if(check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "Message type: %s", val_to_str(message_type, message_type_vs, "Unknown (0x%02x)"));
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Message type: %s", val_to_str(message_type, message_type_vs, "Unknown (0x%02x)"));
- if (tree) {
- ti = proto_tree_add_item(tree, proto_llt, tvb, 0, -1, ENC_NA);
- llt_tree = proto_item_add_subtree(ti, ett_llt);
- }
+ ti = proto_tree_add_item(tree, proto_llt, tvb, 0, -1, ENC_NA);
+ llt_tree = proto_item_add_subtree(ti, ett_llt);
proto_tree_add_item(llt_tree, hf_llt_cluster_num, tvb, 2, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(llt_tree, hf_llt_message_type, tvb, 3, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(lmi_tree, hf_lmi_call_ref, tvb, 0, 1, ENC_BIG_ENDIAN);
}
msg_type = 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(msg_type, msg_type_str, "Unknown message type (0x%02x)"));
- }
+
if (tree) {
proto_tree_add_uint(lmi_tree, hf_lmi_msg_type, tvb, 1, 1, msg_type);
proto_tree *ti;
proto_item *pi;
proto_tree *lon_tree;
+ gint npdu, type;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "LON");
col_clear(pinfo->cinfo, COL_INFO);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- gint npdu, type;
- npdu = tvb_get_guint8(tvb, 0);
- type = tvb_get_guint8(tvb, 1);
- type = (type&0x30)>>4;
- col_add_fstr(pinfo->cinfo, COL_INFO,
+ npdu = tvb_get_guint8(tvb, 0);
+ type = tvb_get_guint8(tvb, 1);
+ type = (type&0x30)>>4;
+ col_add_fstr(pinfo->cinfo, COL_INFO,
"%sDelta_BL: %i Type: %s",
npdu&0x80?"Priority ":"",
npdu&0x3F,
val_to_str_const(type, pdu_fmt_vs, "Unknown"));
- }
-
ti = proto_tree_add_item(tree, proto_lon, tvb, offset, -1, ENC_NA);
lon_tree = proto_item_add_subtree(ti, ett_lon);
do {
function = tvb_get_letohs(tvb, offset);
if (offset == skip_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(function, function_vals, "Unknown function (%u)"));
- }
- if (tree)
- proto_tree_add_text(loop_tree, tvb, offset, 2, "Relevant function:");
+
+ proto_tree_add_text(loop_tree, tvb, offset, 2, "Relevant function:");
set_info = FALSE;
}
if (tree)
lpr_packet_type = unknown;
}
- if (check_col(pinfo->cinfo, COL_INFO)) {
- if (lpr_packet_type == request && code !=0) {
- col_add_str(pinfo->cinfo, COL_INFO, val_to_str(code, lpd_client_code, "Unknown client code: %u"));
- }
- else if (lpr_packet_type == response) {
- col_set_str(pinfo->cinfo, COL_INFO, "LPD response");
- }
- else {
- col_set_str(pinfo->cinfo, COL_INFO, "LPD continuation");
- }
+ if (lpr_packet_type == request && code !=0) {
+ col_add_str(pinfo->cinfo, COL_INFO, val_to_str(code, lpd_client_code, "Unknown client code: %u"));
+ }
+ else if (lpr_packet_type == response) {
+ col_set_str(pinfo->cinfo, COL_INFO, "LPD response");
+ }
+ else {
+ col_set_str(pinfo->cinfo, COL_INFO, "LPD continuation");
}
if (tree) {
}
/* Display the op code in the summary */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s, session %.8u",
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s, session %.8u",
val_to_str(op_code, op_code_vals, "Unknown op code (0x%x)"),
stream);
- if (tvb_length(tvb) < expected_len)
- col_append_str(pinfo->cinfo, COL_INFO, " [Too short]");
- else if (tvb_length(tvb) > expected_len)
- col_append_str(pinfo->cinfo, COL_INFO, " [Too long]");
- }
+ if (tvb_length(tvb) < expected_len)
+ col_append_str(pinfo->cinfo, COL_INFO, " [Too short]");
+ else if (tvb_length(tvb) > expected_len)
+ col_append_str(pinfo->cinfo, COL_INFO, " [Too long]");
if (tree) {
/* Create display subtree for the protocol */
*/
header.length = g_ntohs(header.length);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO,
- val_to_str_ext(header.type, &control_msg_vals_ext, "Bad Type: 0x%02x"));
- }
+ col_append_str(pinfo->cinfo, COL_INFO,
+ val_to_str_ext(header.type, &control_msg_vals_ext, "Bad Type: 0x%02x"));
/* In the interest of speed, if "tree" is NULL, don't do any work not
necessary to generate protocol tree items. */
version = (header.flags & 0xc0) >> 6;
slotId = (header.flags & 0x38) >> 3;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- if ((header.flags & LWAPP_FLAGS_T) != 0)
- col_append_str(pinfo->cinfo, COL_INFO,
- " Control Packet");
- else
- col_append_str(pinfo->cinfo, COL_INFO,
- " 802.11 Packet");
- }
+ if ((header.flags & LWAPP_FLAGS_T) != 0)
+ col_append_str(pinfo->cinfo, COL_INFO,
+ " Control Packet");
+ else
+ col_append_str(pinfo->cinfo, COL_INFO,
+ " 802.11 Packet");
/* In the interest of speed, if "tree" is NULL, don't do any work not
necessary to generate protocol tree items. */
message_type = (flags & LWRES_LWPACKETFLAG_RESPONSE) ? 2 : 1;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_clear(pinfo->cinfo, COL_INFO);
+ col_clear(pinfo->cinfo, COL_INFO);
- if(flags & LWRES_LWPACKETFLAG_RESPONSE)
- {
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "%s, opcode=%s, serial=0x%x, result=%s",
- val_to_str_const((guint32)message_type,message_types_values,"unknown"),
- val_to_str_const(opcode, opcode_values, "unknown"),
- serial,
- val_to_str_const(result,result_values,"unknown"));
- }
- else
- {
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "%s, opcode=%s, serial=0x%x",
- val_to_str_const((guint32)message_type,message_types_values,"unknown"),
- val_to_str_const(opcode, opcode_values, "unknown"),
- serial);
- }
+ if(flags & LWRES_LWPACKETFLAG_RESPONSE)
+ {
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "%s, opcode=%s, serial=0x%x, result=%s",
+ val_to_str_const((guint32)message_type,message_types_values,"unknown"),
+ val_to_str_const(opcode, opcode_values, "unknown"),
+ serial,
+ val_to_str_const(result,result_values,"unknown"));
+ }
+ else
+ {
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "%s, opcode=%s, serial=0x%x",
+ val_to_str_const((guint32)message_type,message_types_values,"unknown"),
+ val_to_str_const(opcode, opcode_values, "unknown"),
+ serial);
}
if(tree)
message_type = tvb_get_ntohs(header_tvb, V2_TYPE_OFFSET);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_type, v2_message_type_values, "reserved"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_type, v2_message_type_values, "reserved"));
if (m2pa_tree) {
proto_tree_add_item(m2pa_tree, hf_version, header_tvb, VERSION_OFFSET, VERSION_LENGTH, ENC_BIG_ENDIAN);
message_type = tvb_get_guint8(header_tvb, V8_TYPE_OFFSET);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_type, v8_message_type_values, "Unknown"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_type, v8_message_type_values, "Unknown"));
if (m2pa_tree) {
proto_tree_add_item(m2pa_tree, hf_version, header_tvb, VERSION_OFFSET, VERSION_LENGTH, ENC_BIG_ENDIAN);
message_type = tvb_get_guint8(header_tvb, V8_TYPE_OFFSET);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_type, v8_message_type_values, "Unknown"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_type, v8_message_type_values, "Unknown"));
if (m2pa_tree) {
proto_tree_add_item(m2pa_tree, hf_version, header_tvb, VERSION_OFFSET, VERSION_LENGTH, ENC_BIG_ENDIAN);
static void
dissect_v2_link_status_message(tvbuff_t *message_data_tvb, packet_info *pinfo, proto_tree *m2pa_tree)
{
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str_const(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), v2_link_status_values, "Unknown"));
- if (m2pa_tree)
- proto_tree_add_item(m2pa_tree, hf_v2_status, message_data_tvb, STATUS_OFFSET, STATUS_LENGTH, ENC_BIG_ENDIAN);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str_const(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), v2_link_status_values, "Unknown"));
+ proto_tree_add_item(m2pa_tree, hf_v2_status, message_data_tvb, STATUS_OFFSET, STATUS_LENGTH, ENC_BIG_ENDIAN);
}
static const value_string v8_link_status_values[] = {
{
guint16 filler_length;
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str_const(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), v8_link_status_values, "Unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str_const(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), v8_link_status_values, "Unknown"));
filler_length = tvb_length(message_data_tvb) - STATUS_LENGTH;
{
guint16 filler_length;
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str_const(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), link_status_values, "Unknown"));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ", val_to_str_const(tvb_get_ntohl(message_data_tvb, STATUS_OFFSET), link_status_values, "Unknown"));
filler_length = tvb_length(message_data_tvb) - STATUS_LENGTH;
proto_item *m2pa_item;
proto_tree *m2pa_tree;
- if (check_col(pinfo->cinfo, COL_PROTOCOL))
- switch(m2pa_version) {
- case M2PA_V02:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "M2PA (ID 02)");
- break;
- case M2PA_V08:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "M2PA (ID 08)");
- break;
- case M2PA_RFC4165:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "M2PA");
- break;
- };
+ switch(m2pa_version) {
+ case M2PA_V02:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "M2PA (ID 02)");
+ break;
+ case M2PA_V08:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "M2PA (ID 08)");
+ break;
+ case M2PA_RFC4165:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "M2PA");
+ break;
+ };
- if (tree) {
- m2pa_item = proto_tree_add_item(tree, proto_m2pa, tvb, 0, -1, ENC_NA);
- m2pa_tree = proto_item_add_subtree(m2pa_item, ett_m2pa);
- } else {
- m2pa_item = NULL;
- m2pa_tree = NULL;
- }
+ m2pa_item = proto_tree_add_item(tree, proto_m2pa, tvb, 0, -1, ENC_NA);
+ m2pa_tree = proto_item_add_subtree(m2pa_item, ett_m2pa);
switch(m2pa_version) {
case M2PA_V02:
message_type = tvb_get_guint8(common_header_tvb, MESSAGE_TYPE_OFFSET);
message_length = tvb_get_ntohl (common_header_tvb, MESSAGE_LENGTH_OFFSET);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_class * 256 + message_type, m2tp_message_class_type_acro_values, "reserved"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_class * 256 + message_type, m2tp_message_class_type_acro_values, "reserved"));
if (m2tp_tree) {
/* add the components of the common header to the protocol tree */
message_class = tvb_get_guint8(common_header_tvb, MESSAGE_CLASS_OFFSET);
message_type = tvb_get_guint8(common_header_tvb, MESSAGE_TYPE_OFFSET);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_class * 256 + message_type, message_class_type_acro_values, "reserved"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_class * 256 + message_type, message_class_type_acro_values, "reserved"));
if (m2ua_tree) {
/* add the components of the common header to the protocol tree */
message_class = tvb_get_guint8(common_header_tvb, MESSAGE_CLASS_OFFSET);
message_type = tvb_get_guint8(common_header_tvb, MESSAGE_TYPE_OFFSET);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_class * 256 + message_type, v5_message_class_type_acro_values, "reserved"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(message_class * 256 + message_type, v5_message_class_type_acro_values, "reserved"));
if (m3ua_tree) {
/* add the components of the common header to the protocol tree */
message_class = tvb_get_guint8(common_header_tvb, MESSAGE_CLASS_OFFSET);
message_type = tvb_get_guint8(common_header_tvb, MESSAGE_TYPE_OFFSET);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO,"%s ", val_to_str_const(message_class * 256 + message_type, message_class_type_acro_values, "reserved"));
+ col_add_fstr(pinfo->cinfo, COL_INFO,"%s ", val_to_str_const(message_class * 256 + message_type, message_class_type_acro_values, "reserved"));
if (m3ua_tree) {
/* add the components of the common header to the protocol tree */
/* make entry in the Protocol column on summary display */
- if (check_col(pinfo->cinfo, COL_PROTOCOL))
- switch(version) {
+ switch(version) {
case M3UA_V5:
col_set_str(pinfo->cinfo, COL_PROTOCOL, "M3UA (ID 05)");
break;
case M3UA_RFC:
col_set_str(pinfo->cinfo, COL_PROTOCOL, "M3UA (RFC 4666)");
break;
- };
-
- /* In the interest of speed, if "tree" is NULL, don't do any work not
- necessary to generate protocol tree items. */
- if (tree) {
- /* create the m3ua protocol tree */
- m3ua_item = proto_tree_add_item(tree, proto_m3ua, message_tvb, 0, -1, ENC_NA);
- m3ua_tree = proto_item_add_subtree(m3ua_item, ett_m3ua);
- } else {
- m3ua_tree = NULL;
};
+ /* create the m3ua protocol tree */
+ m3ua_item = proto_tree_add_item(tree, proto_m3ua, message_tvb, 0, -1, ENC_NA);
+ m3ua_tree = proto_item_add_subtree(m3ua_item, ett_m3ua);
+
/* dissect the message */
dissect_message(message_tvb, pinfo, tree, m3ua_tree);
-
}
/* Register the protocol with Wireshark */
/* Make entries in Protocol column and Info column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_MACTELNET);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s > %s Direction: %s Type: %s",
- tvb_ether_to_str(tvb, 2),
- tvb_ether_to_str(tvb, 8),
- ((foundclient >= 0) || (type == 4) ? "Client->Server" : "Server->Client" ),
- val_to_str(type, packettypenames, "Unknown Type:0x%02x")
- );
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s > %s Direction: %s Type: %s",
+ tvb_ether_to_str(tvb, 2),
+ tvb_ether_to_str(tvb, 8),
+ ((foundclient >= 0) || (type == 4) ? "Client->Server" : "Server->Client" ),
+ val_to_str(type, packettypenames, "Unknown Type:0x%02x")
+ );
if (tree) {
guint32 offset = 0;
/* "Request" or "Response" */
packet_type = classify_mbtcp_packet(pinfo);
- if (check_col(pinfo->cinfo, COL_INFO))
- {
- switch ( packet_type ) {
- case QUERY_PACKET :
- pkt_type_str="Query";
- break;
- case RESPONSE_PACKET :
- pkt_type_str="Response";
- break;
- case CANNOT_CLASSIFY :
- err_str="Unable to classify as query or response.";
- pkt_type_str="unknown";
- break;
- default :
- break;
+ switch ( packet_type ) {
+ case QUERY_PACKET :
+ pkt_type_str="Query";
+ break;
+ case RESPONSE_PACKET :
+ pkt_type_str="Response";
+ break;
+ case CANNOT_CLASSIFY :
+ err_str="Unable to classify as query or response.";
+ pkt_type_str="unknown";
+ break;
+ default :
+ break;
+ }
+ if ( exception_code != 0 )
+ err_str="Exception returned ";
+
+ if (subfunction_code == 0) {
+ if (strlen(err_str) > 0) {
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "%8s: Trans: %5u; Unit: %3u, Func: %3u: %s. %s",
+ pkt_type_str, transaction_id, unit_id,
+ function_code, func_string, err_str);
}
- if ( exception_code != 0 )
- err_str="Exception returned ";
-
- if (subfunction_code == 0) {
- if (strlen(err_str) > 0) {
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "%8s: Trans: %5u; Unit: %3u, Func: %3u: %s. %s",
- pkt_type_str, transaction_id, unit_id,
- function_code, func_string, err_str);
- }
- else {
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "%8s: Trans: %5u; Unit: %3u, Func: %3u: %s",
- pkt_type_str, transaction_id, unit_id,
- function_code, func_string);
- }
+ else {
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "%8s: Trans: %5u; Unit: %3u, Func: %3u: %s",
+ pkt_type_str, transaction_id, unit_id,
+ function_code, func_string);
+ }
+ }
+ else {
+ if (strlen(err_str) > 0) {
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "%8s: Trans: %5u; Unit: %3u, Func: %3u/%3u: %s. %s",
+ pkt_type_str, transaction_id, unit_id,
+ function_code, subfunction_code, func_string, err_str);
}
else {
- if (strlen(err_str) > 0) {
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "%8s: Trans: %5u; Unit: %3u, Func: %3u/%3u: %s. %s",
- pkt_type_str, transaction_id, unit_id,
- function_code, subfunction_code, func_string, err_str);
- }
- else {
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "%8s: Trans: %5u; Unit: %3u, Func: %3u/%3u: %s",
- pkt_type_str, transaction_id, unit_id,
- function_code, subfunction_code, func_string);
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "%8s: Trans: %5u; Unit: %3u, Func: %3u/%3u: %s",
+ pkt_type_str, transaction_id, unit_id,
+ function_code, subfunction_code, func_string);
}
}
/* "Request" or "Response" */
packet_type = classify_mbrtu_packet(pinfo);
- if (check_col(pinfo->cinfo, COL_INFO))
- {
- switch ( packet_type ) {
- case QUERY_PACKET :
- pkt_type_str="Query";
- break;
- case RESPONSE_PACKET :
- pkt_type_str="Response";
- break;
- case CANNOT_CLASSIFY :
- err_str="Unable to classify as query or response.";
- pkt_type_str="unknown";
- break;
- default :
- break;
+ switch ( packet_type ) {
+ case QUERY_PACKET :
+ pkt_type_str="Query";
+ break;
+ case RESPONSE_PACKET :
+ pkt_type_str="Response";
+ break;
+ case CANNOT_CLASSIFY :
+ err_str="Unable to classify as query or response.";
+ pkt_type_str="unknown";
+ break;
+ default :
+ break;
+ }
+ if ( exception_code != 0 )
+ err_str="Exception returned ";
+
+ if (subfunction_code == 0) {
+ if (strlen(err_str) > 0) {
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "%8s: Unit: %3u, Func: %3u: %s. %s",
+ pkt_type_str, unit_id,
+ function_code, func_string, err_str);
}
- if ( exception_code != 0 )
- err_str="Exception returned ";
-
- if (subfunction_code == 0) {
- if (strlen(err_str) > 0) {
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "%8s: Unit: %3u, Func: %3u: %s. %s",
- pkt_type_str, unit_id,
- function_code, func_string, err_str);
- }
- else {
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "%8s: Unit: %3u, Func: %3u: %s",
- pkt_type_str, unit_id,
- function_code, func_string);
- }
+ else {
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "%8s: Unit: %3u, Func: %3u: %s",
+ pkt_type_str, unit_id,
+ function_code, func_string);
+ }
+ }
+ else {
+ if (strlen(err_str) > 0) {
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "%8s: Unit: %3u, Func: %3u/%3u: %s. %s",
+ pkt_type_str, unit_id,
+ function_code, subfunction_code, func_string, err_str);
}
else {
- if (strlen(err_str) > 0) {
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "%8s: Unit: %3u, Func: %3u/%3u: %s. %s",
- pkt_type_str, unit_id,
- function_code, subfunction_code, func_string, err_str);
- }
- else {
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "%8s: Unit: %3u, Func: %3u/%3u: %s",
- pkt_type_str, unit_id,
- function_code, subfunction_code, func_string);
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "%8s: Unit: %3u, Func: %3u/%3u: %s",
+ pkt_type_str, unit_id,
+ function_code, subfunction_code, func_string);
}
}
}
/* Add media type to the INFO column if it is visible */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", (pinfo->match_string) ? pinfo->match_string : "");
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", (pinfo->match_string) ? pinfo->match_string : "");
if (tree) {
if ( (bytes = tvb_length(tvb)) > 0 )
if (!first) {
col_append_str(pinfo->cinfo, COL_INFO, " ");
}
- if (check_col(pinfo->cinfo, COL_INFO) )
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s TransactionResponseAck",
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s TransactionResponseAck",
tvb_format_text(tvb,tvb_previous_offset,len));
if(tree)
if (!first) {
col_append_str(pinfo->cinfo, COL_INFO, " ");
}
- if (check_col(pinfo->cinfo, COL_INFO) )
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s Pending",
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s Pending",
tvb_format_text(tvb,tvb_offset,len));
if(tree)
tvb_current_offset = megaco_tvb_skip_wsp_return(tvb, tvb_LBRKT-1);
len = tvb_current_offset - tvb_offset;
- if (check_col(pinfo->cinfo, COL_INFO) )
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s Reply ",
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s Reply ",
tvb_format_text(tvb,tvb_offset,len));
trx_id = (guint)strtoul(tvb_format_text(tvb,tvb_offset,len),NULL,10);
if (!first) {
col_append_str(pinfo->cinfo, COL_INFO, " ");
}
- if (check_col(pinfo->cinfo, COL_INFO) )
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s Request",
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s Request",
tvb_format_text(tvb,tvb_offset,len));
trx_id = (guint)strtoul(tvb_format_text(tvb,tvb_offset,len),NULL,10);
if(tree)
tokenlen));
ctx_id = (guint)strtoul(tvb_format_text(tvb, tvb_previous_offset, tokenlen),NULL,10);
- if (check_col(pinfo->cinfo, COL_INFO) )
- col_append_fstr(pinfo->cinfo, COL_INFO, " |=%s",tvb_format_text(tvb, tvb_previous_offset,tokenlen));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " |=%s",tvb_format_text(tvb, tvb_previous_offset,tokenlen));
}
ctx = gcp_ctx(msg,trx,ctx_id,keep_persistent_data);
tvb_command_start_offset, tokenlen,
tvb_format_text(tvb, tvb_command_start_offset,
tokenlen));
- 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 (cmd_type == GCP_CMD_NONE && trx_type == GCP_TRX_REPLY) {
gcp_cmd_add_term(msg, trx, cmd, term, wild_term, keep_persistent_data);
- if (check_col(pinfo->cinfo, COL_INFO) )
- col_append_fstr(pinfo->cinfo, COL_INFO, "=%s",tvb_format_text(tvb, tvb_offset,tokenlen));
+ col_append_fstr(pinfo->cinfo, COL_INFO, "=%s",tvb_format_text(tvb, tvb_offset,tokenlen));
break;
}
tvb_current_offset = tvb_LBRKT;
tvb_next_offset = megaco_tvb_skip_wsp(tvb, tvb_current_offset+1);
- if (check_col(pinfo->cinfo, COL_INFO) )
- col_append_fstr(pinfo->cinfo, COL_INFO, " (Signal:%s)",tvb_format_text(tvb, tvb_current_offset,tokenlen-tvb_current_offset+tvb_previous_offset));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " (Signal:%s)",tvb_format_text(tvb, tvb_current_offset,tokenlen-tvb_current_offset+tvb_previous_offset));
if ( tvb_current_offset < tvb_signals_end_offset && tvb_current_offset != -1 && tvb_next_offset != tvb_signals_end_offset){
tvb_current_offset, tokenlen,
tvb_format_text(tvb, tvb_current_offset,
tokenlen));
- if (check_col(pinfo->cinfo, COL_INFO) )
- col_append_fstr(pinfo->cinfo, COL_INFO, " (Mode:%s)",tvb_format_text(tvb, tvb_current_offset,tokenlen));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " (Mode:%s)",tvb_format_text(tvb, tvb_current_offset,tokenlen));
tvb_current_offset = megaco_tvb_skip_wsp(tvb, tvb_offset +1);
break;
col_append_str(pinfo->cinfo, COL_PROTOCOL, "/MIKEY");
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, ", Mikey: %s",
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Mikey: %s",
val_to_str_ext_const(mikey->type, &data_type_vals_ext, "Unknown"));
/* Return the amount of data this dissector was able to dissect */
/* Make entries in Protocol column and Info column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MMSE");
- if (check_col(pinfo->cinfo, COL_INFO)) {
col_clear(pinfo->cinfo, COL_INFO);
col_add_fstr(pinfo->cinfo, COL_INFO, "MMS %s", message_type);
- }
dissect_mmse(tvb, pinfo, tree, pdut, message_type);
}
message_type = val_to_str(pdut, vals_message_type, "Unknown type %u");
/* Make entries in Info column on summary display */
- if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "(MMS %s)",
message_type);
- }
dissect_mmse(tvb, pinfo, tree, pdut, message_type);
}
break;
default:
/* void */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(
+ col_append_fstr(
pinfo->cinfo, COL_INFO, " Error:%s",
val_to_str(status, mount3_mountstat3,
"Unknown (0x%08X)"));
- }
break;
}
}
offset = dissect_rpc_string(tvb,tree,hf_mount_path,offset,&mountpoint);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO," %s", mountpoint);
- }
-
+ col_append_fstr(pinfo->cinfo, COL_INFO," %s", mountpoint);
return offset;
}
mountstat3 = tvb_get_ntohl(tvb, offset);
if(mountstat3){
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(
+ col_append_fstr(
pinfo->cinfo, COL_INFO, " Error:%s",
val_to_str(mountstat3, mount3_mountstat3,
"Unknown (0x%08X)"));
- }
}
offset = dissect_rpc_uint32(tvb,tree,hfindex,offset);
return 0;
}
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_str(pinfo->cinfo, COL_INFO,
- val_to_str(msgtype, mpls_echo_msgtype, "Unknown Message Type (0x%02X)"));
+ col_add_str(pinfo->cinfo, COL_INFO,
+ val_to_str(msgtype, mpls_echo_msgtype, "Unknown Message Type (0x%02X)"));
if (tree) {
0x00, 0x00, 0x00, 0x00, 0x00 };
functype = tvb_get_guint8(tvb, offset);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " (Y.1711: %s)",
- (functype == 0x01) ? "CV" :
- (functype == 0x02) ? "FDI" :
- (functype == 0x03) ? "BDI" :
- (functype == 0x07) ? "FDD" :
- "reserved/unknown");
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " (Y.1711: %s)",
+ (functype == 0x01) ? "CV" :
+ (functype == 0x02) ? "FDI" :
+ (functype == 0x03) ? "BDI" :
+ (functype == 0x07) ? "FDD" :
+ "reserved/unknown");
/* sanity checks */
if (tvb_reported_length(tvb) < 44) {
gint iSizeMQCFH = 36;
guint32 iCommand = tvb_get_guint32_endian(tvb, offset + 12, bLittleEndian);
- if (check_col(pinfo->cinfo, COL_INFO))
- {
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(iCommand, mqpcf_opcode_vals, "Unknown (0x%02x)"));
- }
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str(iCommand, mqpcf_opcode_vals, "Unknown (0x%02x)"));
if (tree)
{
if (iSizeGMO != 0 && tvb_length_remaining(tvb, offset) >= iSizeGMO)
{
- if (check_col(pinfo->cinfo, COL_INFO))
+ guint8* sQueue;
+ sQueue = tvb_get_ephemeral_string_enc(tvb, offset + 24, 48, string_rep);
+ if (strip_trailing_blanks(sQueue, 48) != 0)
{
- guint8* sQueue;
- sQueue = tvb_get_ephemeral_string_enc(tvb, offset + 24, 48, string_rep);
- if (strip_trailing_blanks(sQueue, 48) != 0)
- {
- col_append_fstr(pinfo->cinfo, COL_INFO, " Q=%s", sQueue);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " Q=%s", sQueue);
}
if (tree)
{
gint iNbrRecords = 0;
guint32 iRecFlags = 0;
+ guint8* sQueue;
if (iVersionPMO >= 2)
{
iNbrRecords = tvb_get_guint32_endian(tvb, offset + 128, int_rep);
iRecFlags = tvb_get_guint32_endian(tvb, offset + 132, int_rep);
}
- if (check_col(pinfo->cinfo, COL_INFO))
+ sQueue = tvb_get_ephemeral_string_enc(tvb, offset + 32, 48, string_rep);
+ if (strip_trailing_blanks(sQueue, 48) != 0)
{
- guint8* sQueue;
- sQueue = tvb_get_ephemeral_string_enc(tvb, offset + 32, 48, string_rep);
- if (strip_trailing_blanks(sQueue, 48) != 0)
- {
- col_append_fstr(pinfo->cinfo, COL_INFO, " Q=%s", sQueue);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " Q=%s", sQueue);
}
if (tree)
int_rep = (tvb_get_guint8(tvb, offset + iSizeMultiplexFields + 8) == MQ_LITTLE_ENDIAN ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN);
iControlFlags = tvb_get_guint8(tvb, offset + iSizeMultiplexFields + 10);
- if (check_col(pinfo->cinfo, COL_INFO))
- {
- col_clear(pinfo->cinfo, COL_INFO);
- col_append_sep_str(pinfo->cinfo, COL_INFO, " | ", val_to_str_ext(opcode, &mq_opcode_vals_ext, "Unknown (0x%02x)"));
- col_set_fence(pinfo->cinfo, COL_INFO);
- }
+ col_clear(pinfo->cinfo, COL_INFO);
+ col_append_sep_str(pinfo->cinfo, COL_INFO, " | ", val_to_str_ext(opcode, &mq_opcode_vals_ext, "Unknown (0x%02x)"));
+ col_set_fence(pinfo->cinfo, COL_INFO);
if (tree)
{
{
guint32 iReturnCode = 0;
iReturnCode = tvb_get_guint32_endian(tvb, offset + 8, int_rep);
- if (check_col(pinfo->cinfo, COL_INFO))
- {
- if (iReturnCode != 0)
- col_append_fstr(pinfo->cinfo, COL_INFO, " [RC=%d]", iReturnCode);
- }
+ if (iReturnCode != 0)
+ col_append_fstr(pinfo->cinfo, COL_INFO, " [RC=%d]", iReturnCode);
if (tree)
{
if (tvb_length_remaining(tvb, offset) >= iStatusLength)
{
- if (check_col(pinfo->cinfo, COL_INFO))
- {
- if (iStatus != 0)
- col_append_fstr(pinfo->cinfo, COL_INFO, ": Code=%s", val_to_str(iStatus, mq_status_vals, "Unknown (0x%08x)"));
- }
+ if (iStatus != 0)
+ col_append_fstr(pinfo->cinfo, COL_INFO, ": Code=%s", val_to_str(iStatus, mq_status_vals, "Unknown (0x%08x)"));
+
if (tree)
{
ti = proto_tree_add_text(mqroot_tree, tvb, offset, 8, MQ_TEXT_STAT);
if (iSizeCONN != 0 && tvb_length_remaining(tvb, offset) >= iSizeCONN)
{
- if (check_col(pinfo->cinfo, COL_INFO))
+ guint8* sApplicationName;
+ guint8* sQueueManager;
+ sApplicationName = tvb_get_ephemeral_string_enc(tvb, offset + 48, 28, string_rep);
+ if (strip_trailing_blanks(sApplicationName, 28) != 0)
{
- guint8* sApplicationName;
- guint8* sQueueManager;
- sApplicationName = tvb_get_ephemeral_string_enc(tvb, offset + 48, 28, string_rep);
- if (strip_trailing_blanks(sApplicationName, 28) != 0)
- {
- col_append_fstr(pinfo->cinfo, COL_INFO, ": App=%s", sApplicationName);
- }
- sQueueManager = tvb_get_ephemeral_string_enc(tvb, offset, 48, string_rep);
- if (strip_trailing_blanks(sQueueManager, 48) != 0)
- {
- col_append_fstr(pinfo->cinfo, COL_INFO, " QM=%s", sQueueManager);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, ": App=%s", sApplicationName);
+ }
+ sQueueManager = tvb_get_ephemeral_string_enc(tvb, offset, 48, string_rep);
+ if (strip_trailing_blanks(sQueueManager, 48) != 0)
+ {
+ col_append_fstr(pinfo->cinfo, COL_INFO, " QM=%s", sQueueManager);
}
-
if (tree)
{
guint32 iSpiVerb = 0;
iSpiVerb = tvb_get_guint32_endian(tvb, offset, int_rep);
- if (check_col(pinfo->cinfo, COL_INFO))
- {
- col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", val_to_str(iSpiVerb, mq_spi_verbs_vals, "Unknown (0x%08x)"));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", val_to_str(iSpiVerb, mq_spi_verbs_vals, "Unknown (0x%08x)"));
if (tree)
{
if (iSizeID != 0 && tvb_length_remaining(tvb, offset) >= iSizeID)
{
- if (check_col(pinfo->cinfo, COL_INFO))
+ guint8* sChannel;
+ sChannel = tvb_get_ephemeral_string_enc(tvb, offset + 24, 20, string_rep);
+ if (strip_trailing_blanks(sChannel, 20) != 0)
{
- guint8* sChannel;
- sChannel = tvb_get_ephemeral_string_enc(tvb, offset + 24, 20, string_rep);
- if (strip_trailing_blanks(sChannel, 20) != 0)
- {
- col_append_fstr(pinfo->cinfo, COL_INFO, ": CHL=%s", sChannel);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, ": CHL=%s", sChannel);
}
if (tree)
if (iVersionID >= 4)
{
- if (check_col(pinfo->cinfo, COL_INFO))
+ guint8* sQueueManager;
+ sQueueManager = tvb_get_ephemeral_string_enc(tvb, offset + 48, 48, string_rep);
+ if (strip_trailing_blanks(sQueueManager,48) != 0)
{
- guint8* sQueueManager;
- sQueueManager = tvb_get_ephemeral_string_enc(tvb, offset + 48, 48, string_rep);
- if (strip_trailing_blanks(sQueueManager,48) != 0)
- {
- col_append_fstr(pinfo->cinfo, COL_INFO, " QM=%s", sQueueManager);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " QM=%s", sQueueManager);
}
if (tree)
if (iSizeUID != 0 && tvb_length_remaining(tvb, offset) >= iSizeUID)
{
- if (check_col(pinfo->cinfo, COL_INFO))
+ guint8* sUserId;
+ sUserId = tvb_get_ephemeral_string_enc(tvb, offset + 4, 12, string_rep);
+ if (strip_trailing_blanks(sUserId, 12) != 0)
{
- guint8* sUserId;
- sUserId = tvb_get_ephemeral_string_enc(tvb, offset + 4, 12, string_rep);
- if (strip_trailing_blanks(sUserId, 12) != 0)
- {
- col_append_fstr(pinfo->cinfo, COL_INFO, ": User=%s", sUserId);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, ": User=%s", sUserId);
}
if (tree)
if (iSizeOD != 0 && tvb_length_remaining(tvb, offset) >= iSizeOD)
{
gint iNbrRecords = 0;
+ guint8* sQueue;
if (iVersionOD >= 2)
iNbrRecords = tvb_get_guint32_endian(tvb, offset + 168, int_rep);
- if (check_col(pinfo->cinfo, COL_INFO))
+ sQueue = tvb_get_ephemeral_string_enc(tvb, offset + 12, 48, string_rep);
+ if (strip_trailing_blanks(sQueue,48) != 0)
{
- guint8* sQueue;
- sQueue = tvb_get_ephemeral_string_enc(tvb, offset + 12, 48, string_rep);
- if (strip_trailing_blanks(sQueue,48) != 0)
- {
- col_append_fstr(pinfo->cinfo, COL_INFO, " Obj=%s", sQueue);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " Obj=%s", sQueue);
}
if (tree)
}
if (iDistributionListSize > 0)
{
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, " (Distribution List, Size=%d)", iDistributionListSize);
+ col_append_fstr(pinfo->cinfo, COL_INFO, " (Distribution List, Size=%d)", iDistributionListSize);
}
if (bPayload == TRUE)
{
PROTO_ITEM_SET_HIDDEN(hidden_item);
}
}
- if (check_col(pinfo->cinfo, COL_INFO))
- {
- col_append_fstr(pinfo->cinfo, COL_INFO, " (%d bytes)", iSizePayload - iHeadersLength);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " (%d bytes)", iSizePayload - iHeadersLength);
{
/* Call subdissector for the payload */
{
/* Reassembly in progress */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MQ");
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s [Reassembled MQ]", val_to_str(opcode, mq_opcode_vals, "Unknown (0x%02x)"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s [Reassembled MQ]", val_to_str(opcode, mq_opcode_vals, "Unknown (0x%02x)"));
if (tree)
{
proto_item* ti = NULL;
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(type, mrdisc_types,
"Unknown Type:0x%02x"));
- }
/* type of command */
proto_tree_add_uint(tree, hf_type, tvb, offset, 1, type);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MSDP");
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(tvb, 0),
+ col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(tvb, 0),
msdp_types,
"<Unknown MSDP message type>"));
line = tvb_get_ptr(tvb, offset, linelen);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- /*
- * Put the first line from the buffer into the summary.
- */
- col_add_str(pinfo->cinfo, COL_INFO,
+ /*
+ * Put the first line from the buffer into the summary.
+ */
+ col_add_str(pinfo->cinfo, COL_INFO,
format_text(line, linelen));
- }
if (tree) {
ti = proto_tree_add_item(tree, proto_msnms, tvb, offset, -1,
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(type, msnip_types,
"Unknown Type:0x%02x"));
- }
/* type of command */
proto_tree_add_uint(tree, hf_type, tvb, offset, 1, type);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MS Proxy");
- if (check_col(pinfo->cinfo, COL_INFO))
- col_set_str(pinfo->cinfo, COL_INFO,
+ col_set_str(pinfo->cinfo, COL_INFO,
(( redirect_info->proto == PT_TCP) ? "TCP stream" :
"UDP packets"));
static void dissect_msproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
- proto_tree *msproxy_tree = NULL;
+ proto_tree *msproxy_tree;
proto_item *ti;
unsigned int cmd;
hash_info);
}
- if (check_col(pinfo->cinfo, COL_INFO)){
+ cmd = tvb_get_ntohs( tvb, 36);
- cmd = tvb_get_ntohs( tvb, 36);
-
- if ( pinfo->srcport == UDP_PORT_MSPROXY)
- col_add_fstr( pinfo->cinfo, COL_INFO, "Server message: %s",
- get_msproxy_cmd_name( cmd, FROM_SERVER));
- else
- col_add_fstr(pinfo->cinfo, COL_INFO, "Client message: %s",
- get_msproxy_cmd_name( cmd, FROM_CLIENT));
-
- }
-
- if (tree) { /* if proto tree, decode data */
- ti = proto_tree_add_item( tree, proto_msproxy, tvb, 0, -1,
- ENC_NA );
+ if ( pinfo->srcport == UDP_PORT_MSPROXY)
+ col_add_fstr( pinfo->cinfo, COL_INFO, "Server message: %s",
+ get_msproxy_cmd_name( cmd, FROM_SERVER));
+ else
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Client message: %s",
+ get_msproxy_cmd_name( cmd, FROM_CLIENT));
- msproxy_tree = proto_item_add_subtree(ti, ett_msproxy);
- }
+ ti = proto_tree_add_item( tree, proto_msproxy, tvb, 0, -1, ENC_NA );
+ msproxy_tree = proto_item_add_subtree(ti, ett_msproxy);
if ( pinfo->srcport == UDP_PORT_MSPROXY)
dissect_msproxy_response( tvb, pinfo, msproxy_tree, hash_info);
col_set_str(pinfo->cinfo, COL_INFO, "BACnet MS/TP");
mstp_frame_type = tvb_get_guint8(tvb, offset);
mstp_frame_pdu_len = tvb_get_ntohs(tvb, offset+3);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
mstp_frame_type_text(mstp_frame_type));
- }
+
/* Add the items to the tree */
proto_tree_add_item(subtree, hf_mstp_frame_type, tvb,
offset, 1, ENC_LITTLE_ENDIAN);
conn_data->state= LOGIN;
- if (tree) {
- tf = proto_tree_add_item(tree, hf_mysql_server_greeting, tvb, offset, -1, ENC_NA);
- greeting_tree = proto_item_add_subtree(tf, ett_server_greeting);
- }
+ tf = proto_tree_add_item(tree, hf_mysql_server_greeting, tvb, offset, -1, ENC_NA);
+ greeting_tree = proto_item_add_subtree(tf, ett_server_greeting);
+
+ col_append_fstr(pinfo->cinfo, COL_INFO, " proto=%d", protocol) ;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " proto=%d", protocol) ;
- }
proto_tree_add_item(greeting_tree, hf_mysql_protocol, tvb, offset, 1, ENC_NA);
offset += 1;
/* version string */
lenstr = tvb_strsize(tvb,offset);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " version=%s", tvb_get_ephemeral_string(tvb, offset, lenstr));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " version=%s", tvb_get_ephemeral_string(tvb, offset, lenstr));
+
proto_tree_add_item(greeting_tree, hf_mysql_version, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
conn_data->major_version = 0;
for (ver_offset = 0; ver_offset < lenstr; ver_offset++) {
/* User name */
lenstr = my_tvb_strsize(tvb, offset);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " user=%s", tvb_get_ephemeral_string(tvb, offset, lenstr));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " user=%s", tvb_get_ephemeral_string(tvb, offset, lenstr));
proto_tree_add_item(login_tree, hf_mysql_user, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
offset += lenstr;
return offset;
}
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " db=%s", tvb_get_ephemeral_string(tvb, offset, lenstr));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " db=%s", tvb_get_ephemeral_string(tvb, offset, lenstr));
+
proto_tree_add_item(login_tree, hf_mysql_schema, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
offset += lenstr;
}
}
opcode = tvb_get_guint8(tvb, offset);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(opcode, mysql_command_vals, "Unknown (%u)"));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(opcode, mysql_command_vals, "Unknown (%u)"));
+
proto_tree_add_item(req_tree, hf_mysql_command, tvb, offset, 1, ENC_NA);
proto_item_append_text(tf, " %s", val_to_str(opcode, mysql_command_vals, "Unknown (%u)"));
offset += 1;
lenstr = my_tvb_strsize(tvb, offset);
proto_tree_add_item(req_tree, hf_mysql_query, tvb, offset, lenstr, ENC_ASCII|ENC_NA);
if (mysql_showquery) {
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, " { %s } ", tvb_get_ephemeral_string(tvb, offset, lenstr));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " { %s } ", tvb_get_ephemeral_string(tvb, offset, lenstr));
}
offset += lenstr;
conn_data->state = RESPONSE_TABULAR;
mysql_dissect_error_packet(tvbuff_t *tvb, packet_info *pinfo,
int offset, proto_tree *tree)
{
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " Error %d", tvb_get_letohs(tvb, offset));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " Error %d", tvb_get_letohs(tvb, offset));
+
proto_tree_add_item(tree, hf_mysql_error_code, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
int linelen;
gint next_offset;
int offset = 0;
- gint col_info;
gint counter = 0;
- col_info = check_col(pinfo->cinfo, COL_INFO);
while (tvb_offset_exists(tvb, offset)) {
/* there's only a \n no \r */
linelen = tvb_find_line_end(tvb, offset, -1, &next_offset, nasdaq_soup_desegment && pinfo->can_desegment);
nasdaq_soup_type = tvb_get_guint8(tvb, offset);
if (counter == 0) {
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Nasdaq-SOUP");
- if (col_info)
- col_clear(pinfo->cinfo, COL_INFO);
+ col_clear(pinfo->cinfo, COL_INFO);
}
- if (col_info ) {
- if (counter) {
- col_append_str(pinfo->cinfo, COL_INFO, "; ");
- col_set_fence(pinfo->cinfo, COL_INFO);
- }
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(nasdaq_soup_type, message_types_val, "Unknown packet type (0x%02x)"));
+ if (counter) {
+ col_append_str(pinfo->cinfo, COL_INFO, "; ");
+ col_set_fence(pinfo->cinfo, COL_INFO);
}
+ col_append_str(pinfo->cinfo, COL_INFO, val_to_str(nasdaq_soup_type, message_types_val, "Unknown packet type (0x%02x)"));
+
counter++;
- if (tree) {
- ti = proto_tree_add_item(tree, proto_nasdaq_soup, tvb, offset, linelen +1, ENC_NA);
- nasdaq_soup_tree = proto_item_add_subtree(ti, ett_nasdaq_soup);
- }
+ ti = proto_tree_add_item(tree, proto_nasdaq_soup, tvb, offset, linelen +1, ENC_NA);
+ nasdaq_soup_tree = proto_item_add_subtree(ti, ett_nasdaq_soup);
+
dissect_nasdaq_soup_packet(tvb, pinfo, tree, nasdaq_soup_tree, offset, linelen);
offset = next_offset;
}
proto_tree_add_item(tree, hf_nbd_len, tvb, offset, 4, ENC_BIG_ENDIAN);
offset+=4;
- if(check_col(pinfo->cinfo, COL_INFO)){
- switch(nbd_trans->type){
- case NBD_CMD_WRITE:
- col_add_fstr(pinfo->cinfo, COL_INFO, "Write Request Offset:0x%" G_GINT64_MODIFIER "x Length:%d", from, nbd_trans->datalen);
- break;
- case NBD_CMD_READ:
- col_add_fstr(pinfo->cinfo, COL_INFO, "Read Request Offset:0x%" G_GINT64_MODIFIER "x Length:%d", from, nbd_trans->datalen);
- break;
- case NBD_CMD_DISC:
- col_set_str(pinfo->cinfo, COL_INFO, "Disconnect Request");
- break;
- }
+ switch(nbd_trans->type){
+ case NBD_CMD_WRITE:
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Write Request Offset:0x%" G_GINT64_MODIFIER "x Length:%d", from, nbd_trans->datalen);
+ break;
+ case NBD_CMD_READ:
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Read Request Offset:0x%" G_GINT64_MODIFIER "x Length:%d", from, nbd_trans->datalen);
+ break;
+ case NBD_CMD_DISC:
+ col_set_str(pinfo->cinfo, COL_INFO, "Disconnect Request");
+ break;
}
if(nbd_trans->type==NBD_CMD_WRITE){
proto_tree_add_item(tree, hf_nbd_handle, tvb, offset, 8, ENC_BIG_ENDIAN);
offset+=8;
- if(check_col(pinfo->cinfo, COL_INFO)){
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s Response Error:%d", (nbd_trans->type==NBD_CMD_WRITE)?"Write":"Read", error);
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s Response Error:%d", (nbd_trans->type==NBD_CMD_WRITE)?"Write":"Read", error);
if(nbd_trans->type==NBD_CMD_READ){
proto_tree_add_item(tree, hf_nbd_data, tvb, offset, nbd_trans->datalen, ENC_NA);
case NBIPX_NAME_IN_USE:
case NBIPX_DEREGISTER_NAME:
name_type = get_netbios_name(tvb, offset+2, name, (NETBIOS_NAME_LEN - 1)*4 + 1);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s<%02x>",
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s<%02x>",
val_to_str_const(packet_type, nbipx_data_stream_type_vals, "Unknown"),
name, name_type);
- }
+
if (nbipx_tree) {
tf = proto_tree_add_item(nbipx_tree, hf_nbipx_name_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
name_type_flag_tree = proto_item_add_subtree(tf, ett_nbipx_name_type_flags);
case NBIPX_SESSION_DATA:
case NBIPX_SESSION_END:
case NBIPX_SESSION_END_ACK:
- 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(packet_type, nbipx_data_stream_type_vals, "Unknown"));
- }
+
dissect_conn_control(tvb, offset, nbipx_tree);
offset += 1;
break;
case NBIPX_DIRECTED_DATAGRAM:
- 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(packet_type, nbipx_data_stream_type_vals, "Unknown"));
- }
+
dissect_conn_control(tvb, offset, nbipx_tree);
offset += 1;
break;
default:
- 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(packet_type, nbipx_data_stream_type_vals, "Unknown"));
- }
/*
* We don't know what the first byte is.
name_type = get_netbios_name(tvb, offset+4, name, (NETBIOS_NAME_LEN - 1)*4 + 1);
/*node_name_type = */get_netbios_name(tvb, offset+20, node_name, (NETBIOS_NAME_LEN - 1)*4 + 1);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- switch (opcode) {
+ switch (opcode) {
- case INAME_CLAIM:
- col_add_fstr(pinfo->cinfo, COL_INFO, "Claim name %s<%02x>",
+ case INAME_CLAIM:
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Claim name %s<%02x>",
name, name_type);
- break;
+ break;
- case INAME_DELETE:
- col_add_fstr(pinfo->cinfo, COL_INFO, "Delete name %s<%02x>",
+ case INAME_DELETE:
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Delete name %s<%02x>",
name, name_type);
- break;
+ break;
- case INAME_QUERY:
- col_add_fstr(pinfo->cinfo, COL_INFO, "Query name %s<%02x>",
+ case INAME_QUERY:
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Query name %s<%02x>",
name, name_type);
- break;
+ break;
- case INAME_FOUND:
- col_add_fstr(pinfo->cinfo, COL_INFO, "Name %s<%02x> found",
+ case INAME_FOUND:
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Name %s<%02x> found",
name, name_type);
- break;
+ break;
- case IMSG_HANGUP:
- col_add_fstr(pinfo->cinfo, COL_INFO,
+ case IMSG_HANGUP:
+ col_add_fstr(pinfo->cinfo, COL_INFO,
"Messenger hangup on %s<%02x>", name, name_type);
- break;
+ break;
- case IMSLOT_SEND:
- col_add_fstr(pinfo->cinfo, COL_INFO,
+ case IMSLOT_SEND:
+ col_add_fstr(pinfo->cinfo, COL_INFO,
"Mailslot write to %s<%02x>", name, name_type);
- break;
+ break;
- case IMSLOT_FIND:
- col_add_fstr(pinfo->cinfo, COL_INFO,
+ case IMSLOT_FIND:
+ col_add_fstr(pinfo->cinfo, COL_INFO,
"Find mailslot name %s<%02x>", name, name_type);
- break;
+ break;
- case IMSLOT_NAME:
- col_add_fstr(pinfo->cinfo, COL_INFO,
+ case IMSLOT_NAME:
+ col_add_fstr(pinfo->cinfo, COL_INFO,
"Mailslot name %s<%02x> found", name, name_type);
- break;
+ break;
- default:
- col_add_fstr(pinfo->cinfo, COL_INFO,
+ default:
+ col_add_fstr(pinfo->cinfo, COL_INFO,
"Unknown NMPI op 0x%02x: name %s<%02x>",
opcode, name, name_type);
- break;
- }
+ break;
}
if (tree) {
/* Fill in the INFO column. */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "NMAS");
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "C NMAS - %s",
- val_to_str(subfunc, nmas_func_enum, "Unknown (0x%02x)"));
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO, "C NMAS - %s",
+ val_to_str(subfunc, nmas_func_enum, "Unknown (0x%02x)"));
+
aitem = proto_tree_add_text(ncp_tree, tvb, foffset, -1, "Packet Type: %s",
val_to_str(subfunc, nmas_func_enum, "Unknown (0x%02x)"));
atree = proto_item_add_subtree(aitem, ett_nmas);
}
foffset += 4;
msg_length -= 4;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
- val_to_str(subverb, nmas_subverb_enum, "Unknown subverb (%u)"));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
+ val_to_str(subverb, nmas_subverb_enum, "Unknown subverb (%u)"));
switch (subverb) {
case 0: /* Fragmented Ping */
proto_tree_add_item(atree, hf_ping_version, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
}
proto_tree_add_item(atree, hf_lsm_verb, tvb, foffset, 1, ENC_LITTLE_ENDIAN);
foffset += 4;
- 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(msgverb, nmas_lsmverb_enum, "Unknown (%u)"));
- }
+
switch (msgverb)
{
case 1:
proto_tree_add_item(atree, hf_msg_verb, tvb, foffset, 1, ENC_BIG_ENDIAN);
foffset += 1;
msg_length -= 12;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
- val_to_str(msgverb, nmas_msgverb_enum, "Unknown (%u)"));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
+ val_to_str(msgverb, nmas_msgverb_enum, "Unknown (%u)"));
+
switch(msgverb)
{
case 1:
{
expert_item = proto_tree_add_item(atree, hf_return_code, tvb, roffset, 4, ENC_LITTLE_ENDIAN);
expert_add_info_format_text(pinfo, expert_item, &ei_return_error, "NMAS Error: 0x%08x is unknown", return_code);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "R Unknown NMAS Error - 0x%08x", return_code);
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO, "R Unknown NMAS Error - 0x%08x", return_code);
}
}
/* Fill in the PROTOCOL & INFO columns. */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "NSSS");
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "C SecretStore - %s", val_to_str(subfunc, sss_func_enum, "Unknown (%d)"));
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO, "C SecretStore - %s", val_to_str(subfunc, sss_func_enum, "Unknown (%d)"));
+
switch (subfunc) {
case 1:
aitem = proto_tree_add_text(ncp_tree, tvb, foffset, tvb_length_remaining(tvb, foffset), "Packet Type: %s", val_to_str(subfunc, sss_func_enum, "Unknown (%d)"));
foffset += 4;
foffset += 12; /* Blank Context */
subverb = tvb_get_letohl(tvb, foffset);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str(subverb, sss_verb_enum, "Unknown (%d)"));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str(subverb, sss_verb_enum, "Unknown (%d)"));
+
aitem = proto_tree_add_item(ncp_tree, hf_verb, tvb, foffset, 4, ENC_LITTLE_ENDIAN);
atree = proto_item_add_subtree(aitem, ett_sss);
if (request_value) {
}
else
{
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_set_str(pinfo->cinfo, COL_INFO, "C SecretStore - fragment");
- proto_tree_add_text(ncp_tree, tvb, foffset, 4, "Fragment");
- }
+ col_set_str(pinfo->cinfo, COL_INFO, "C SecretStore - fragment");
+ proto_tree_add_text(ncp_tree, tvb, foffset, 4, "Fragment");
+
/* Fragments don't really carry a subverb so store 0xff as the subverb number */
if (request_value) {
request_value->req_nds_flags=255;
tap_queue_packet(ncp_tap.hdr, pinfo, ncp_hdr);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_str(pinfo->cinfo, COL_INFO,
- val_to_str(header.type, ncp_type_vals, "Unknown type (0x%04x)"));
- }
+ col_add_str(pinfo->cinfo, COL_INFO,
+ val_to_str(header.type, ncp_type_vals, "Unknown type (0x%04x)"));
/*
* Process the packet-type-specific header.
offset += 4;
data_len -= 4;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "%s %d bytes starting at offset %d in file 0x%08x",
- val_to_str(ncp_burst_command,
- burst_command, "Unknown (0x%08x)"),
- burst_len, burst_off, burst_file);
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "%s %d bytes starting at offset %d in file 0x%08x",
+ val_to_str(ncp_burst_command,
+ burst_command, "Unknown (0x%08x)"),
+ burst_len, burst_off, burst_file);
break;
} else {
if (tvb_get_guint8(tvb, commhdr + 2) & 0x10) {
/* error */
err=tvb_get_ntohl(tvb, offset);
proto_tree_add_item(tree, hf_ndmp_error, tvb, offset, 4, ENC_BIG_ENDIAN);
- if(err && check_col(pinfo->cinfo, COL_INFO)) {
+ if(err) {
col_append_fstr(pinfo->cinfo, COL_INFO,
" NDMP Error:%s ",
val_to_str(err, error_vals,
/* file */
offset = dissect_rpc_string(tvb, tree,
hf_ndmp_file_name, offset, &name);
- if (check_col(pinfo->cinfo, COL_INFO)){
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
break;
case NDMP_FS_NT:
/* nt file */
offset = dissect_rpc_string(tvb, tree,
hf_ndmp_nt_file_name, offset, &name);
- if (check_col(pinfo->cinfo, COL_INFO)){
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
/* dos file */
offset = dissect_rpc_string(tvb, tree,
/* file */
offset = dissect_rpc_string(tvb, tree,
hf_ndmp_file_name, offset, &name);
- if (check_col(pinfo->cinfo, COL_INFO)){
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name);
}
- 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_const(type, file_fs_type_vals, "Unknown type") );
- }
proto_item_set_len(item, offset-old_offset);
return offset;
/* error */
offset=dissect_error(tvb, offset, pinfo, tree, nh->seq);
- if (check_col(pinfo->cinfo, COL_INFO)){
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s ",
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s ",
val_to_str(nh->msg, msg_vals, "Unknown Message (0x%02x)"),
val_to_str(nh->type, msg_type_vals, "Unknown Type (0x%02x)")
);
- }
return offset;
}
*/
col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDMP");
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_clear(pinfo->cinfo, COL_INFO);
- col_append_fstr(pinfo->cinfo, COL_INFO, "[NDMP fragment] ");
- }
+ col_clear(pinfo->cinfo, COL_INFO);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "[NDMP fragment] ");
/*
* Add the record marker information to the tree
col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDP");
- if (check_col(pinfo->cinfo, COL_INFO)) {
- hello_type = "";
- if (pinfo->dl_dst.type == AT_ETHER) {
- const guint8 *dstmac = (const guint8 *)pinfo->dl_dst.data;
+ hello_type = "";
+ if (pinfo->dl_dst.type == AT_ETHER) {
+ const guint8 *dstmac = (const guint8 *)pinfo->dl_dst.data;
- switch (dstmac[5]) {
+ switch (dstmac[5]) {
- case 0:
- hello_type = "Segment ";
- break;
+ case 0:
+ hello_type = "Segment ";
+ break;
- case 1:
- hello_type = "FlatNet ";
- break;
- }
+ case 1:
+ hello_type = "FlatNet ";
+ break;
}
- col_add_fstr(pinfo->cinfo, COL_INFO, "%sHello",
- hello_type);
}
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%sHello", hello_type);
if (tree) {
ti = proto_tree_add_protocol_format(tree, proto_ndp, tvb, 0, 11,
{
proto_tree_add_item(ndps_tree, hf_spx_ndps_program, tvb, foffset, 4, ENC_BIG_ENDIAN);
foffset += 4;
- if (check_col(pinfo->cinfo, COL_INFO))
- {
- col_append_str(pinfo->cinfo, COL_INFO, (const gchar*) ndps_program_string);
- col_append_str(pinfo->cinfo, COL_INFO, ", ");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, (const gchar*) ndps_program_string);
+ col_append_str(pinfo->cinfo, COL_INFO, ", ");
+
proto_tree_add_item(ndps_tree, hf_spx_ndps_version, tvb, foffset, 4, ENC_BIG_ENDIAN);
foffset += 4;
ndps_func = tvb_get_ntohl(tvb, foffset);
proto_tree_add_item(ndps_tree, ndps_hfname, tvb, foffset, 4, ENC_BIG_ENDIAN);
if (ndps_func_string != NULL)
{
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_str(pinfo->cinfo, COL_INFO, (const gchar*) ndps_func_string);
+ col_append_str(pinfo->cinfo, COL_INFO, (const gchar*) ndps_func_string);
foffset += 4;
proto_tree_add_item(ndps_tree, hf_ndps_auth_null, tvb, foffset, 16, ENC_NA);
{
/* This is either a beggining or middle fragment on second dissection */
next_tvb = tvb_new_subset_remaining(tvb, 0);
- if (check_col(pinfo->cinfo, COL_INFO))
+ if (!spx_info_p->eom)
{
- if (!spx_info_p->eom)
- {
- col_append_str(pinfo->cinfo, COL_INFO, "[NDPS Fragment]");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, "[NDPS Fragment]");
}
}
}
else
{
/* Fragment from first pass of dissection */
- if (check_col(pinfo->cinfo, COL_INFO))
+ if (!spx_info_p->eom)
{
- if (!spx_info_p->eom)
- {
- col_append_str(pinfo->cinfo, COL_INFO, "[NDPS Fragment]");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, "[NDPS Fragment]");
}
+
next_tvb = NULL;
}
}
expert_add_info_format_text(pinfo, expert_item, &ei_ndps_return_code, "Fault: %s", val_to_str(expert_status, ndps_error_types, "Unknown NDPS Error (0x%08x)"));
}
foffset += 4;
- if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
+ if (tvb_get_ntohl(tvb, foffset-4) != 0)
col_set_str(pinfo->cinfo, COL_INFO, "R NDPS - Error");
if (tvb_get_ntohl(tvb, foffset-4) == 0)
{
case 0x00000005: /* List Resources */
proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, ENC_BIG_ENDIAN);
foffset += 4;
- if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
+ if (tvb_get_ntohl(tvb, foffset-4) != 0)
col_set_str(pinfo->cinfo, COL_INFO, "R NDPS - Error");
if (tvb_get_ntohl(tvb, foffset-4) != 0)
{
case 0x00000006: /* Get Resource File */
proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, ENC_BIG_ENDIAN);
foffset += 4;
- if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
+ if (tvb_get_ntohl(tvb, foffset-4) != 0)
col_set_str(pinfo->cinfo, COL_INFO, "R NDPS - Error");
if (tvb_get_ntohl(tvb, foffset-4) != 0)
{
case 0x00000007: /* Get Resource File Date */
proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, ENC_BIG_ENDIAN);
foffset += 4;
- if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
+ if (tvb_get_ntohl(tvb, foffset-4) != 0)
col_set_str(pinfo->cinfo, COL_INFO, "R NDPS - Error");
if (tvb_get_ntohl(tvb, foffset-4) != 0)
{
case 0x0000000a: /* Set Resource Language Context */
proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, ENC_BIG_ENDIAN);
foffset += 4;
- if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
+ if (tvb_get_ntohl(tvb, foffset-4) != 0)
col_set_str(pinfo->cinfo, COL_INFO, "R NDPS - Error");
if (tvb_get_ntohl(tvb, foffset-4) != 0)
{
case 0x00000001: /* Delivery Bind */
proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, ENC_BIG_ENDIAN);
foffset += 4;
- if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
+ if (tvb_get_ntohl(tvb, foffset-4) != 0)
col_set_str(pinfo->cinfo, COL_INFO, "R NDPS - Error");
break;
case 0x00000002: /* Delivery Unbind */
case 0x00000004: /* Delivery Send2 */
proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, ENC_BIG_ENDIAN);
foffset += 4;
- if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
+ if (tvb_get_ntohl(tvb, foffset-4) != 0)
col_set_str(pinfo->cinfo, COL_INFO, "R NDPS - Error");
if (tvb_get_ntohl(tvb, foffset-4) != 0)
{
/* limit command so no table overflows */
command = MIN( command, sizeof( dissect_netb)/ sizeof(void *));
- if (check_col( pinfo->cinfo, COL_INFO)) { /* print command name */
- command_name = val_to_str(command, cmd_vals, "Unknown (0x%02x)");
- switch ( command ) {
- case NB_NAME_QUERY:
- name_type = get_netbios_name( tvb, offset + 12, name, (NETBIOS_NAME_LEN - 1)*4 + 1);
- col_add_fstr( pinfo->cinfo, COL_INFO, "%s for %s<%02x>",
- command_name, name, name_type);
- break;
-
- case NB_NAME_RESP:
- case NB_ADD_NAME:
- case NB_ADD_GROUP:
- name_type = get_netbios_name( tvb, offset + 28, name, (NETBIOS_NAME_LEN - 1)*4 + 1);
- col_add_fstr( pinfo->cinfo, COL_INFO, "%s - %s<%02x>",
- command_name, name, name_type);
- break;
+ /* print command name */
+ command_name = val_to_str(command, cmd_vals, "Unknown (0x%02x)");
+ switch ( command ) {
+ case NB_NAME_QUERY:
+ name_type = get_netbios_name( tvb, offset + 12, name, (NETBIOS_NAME_LEN - 1)*4 + 1);
+ col_add_fstr( pinfo->cinfo, COL_INFO, "%s for %s<%02x>", command_name, name, name_type);
+ break;
+
+ case NB_NAME_RESP:
+ case NB_ADD_NAME:
+ case NB_ADD_GROUP:
+ name_type = get_netbios_name( tvb, offset + 28, name, (NETBIOS_NAME_LEN - 1)*4 + 1);
+ col_add_fstr( pinfo->cinfo, COL_INFO, "%s - %s<%02x>", command_name, name, name_type);
+ break;
default:
- col_add_str( pinfo->cinfo, COL_INFO,
- command_name);
+ col_add_str( pinfo->cinfo, COL_INFO, command_name);
break;
- }
}
if ( tree) {
/*
* set something interesting in the display now that we have info
*/
- if (check_col(pinfo->cinfo, COL_INFO)) {
- if (ver == 9) {
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "total: %u (v%u) record%s", pdus, ver,
- plurality(pdus, "", "s"));
- } else if (ver == 10) {
- gint remaining = tvb_reported_length_remaining(tvb, offset)+4;
-
- if(remaining == flow_len)
- col_add_fstr(pinfo->cinfo, COL_INFO, "IPFIX flow (%d bytes)", flow_len);
- else
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "IPFIX partial flow (%u/%u bytes)",
- remaining, flow_len);
- } else {
+ if (ver == 9) {
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "total: %u (v%u) record%s", pdus, ver,
+ plurality(pdus, "", "s"));
+ } else if (ver == 10) {
+ gint remaining = tvb_reported_length_remaining(tvb, offset)+4;
+
+ if(remaining == flow_len)
+ col_add_fstr(pinfo->cinfo, COL_INFO, "IPFIX flow (%d bytes)", flow_len);
+ else
col_add_fstr(pinfo->cinfo, COL_INFO,
- "total: %u (v%u) flow%s", pdus, ver,
- plurality(pdus, "", "s"));
- }
+ "IPFIX partial flow (%u/%u bytes)",
+ remaining, flow_len);
+ } else {
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "total: %u (v%u) flow%s", pdus, ver,
+ plurality(pdus, "", "s"));
}
/*
guint8 type;
type = tvb_get_guint8(message_tvb, offset_message_type);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(type, message_type_values, "Unknown NetPerfMeterProtocol type"));
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(type, message_type_values, "Unknown NetPerfMeterProtocol type"));
ADD_FIELD_UINT(npmp_tree, message_type);
ADD_FIELD_UINT(npmp_tree, message_flags);
break;
default:
col_set_str(pinfo->cinfo, COL_PROTOCOL, "UNKNOWN");
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "Unsupported nettl subsytem: %d (%s)",
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Unsupported nettl subsytem: %d (%s)",
pinfo->pseudo_header->nettl.subsys,
- val_to_str_const(pinfo->pseudo_header->nettl.subsys, subsystem, "Unknown"));
+ val_to_str_const(pinfo->pseudo_header->nettl.subsys, subsystem, "Unknown"));
call_dissector(data_handle, tvb, pinfo, tree);
}
}
offset = dissect_rpc_string(tvb,lock_tree,
hf_nlm_lock_caller_name, offset, NULL);
offset = dissect_nfs3_fh(tvb, offset, pinfo, lock_tree, "fh", &fh_hash);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " FH:0x%08x", fh_hash);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " FH:0x%08x", fh_hash);
offset = dissect_rpc_data(tvb, lock_tree, hf_nlm_lock_owner, offset);
svid = tvb_get_ntohl(tvb, offset);
offset = dissect_rpc_uint32(tvb, lock_tree, hf_nlm_lock_svid, offset);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " svid:%d", svid);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " svid:%d", svid);
if (version == 4) {
start_offset = tvb_get_ntohl(tvb, offset);
offset = dissect_rpc_uint32(tvb, lock_tree, hf_nlm_lock_l_len, offset);
}
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " pos:%d-%d", start_offset, end_offset);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " pos:%d-%d", start_offset, end_offset);
return offset;
}
hf_nlm_lock_caller_name, offset, NULL);
offset = dissect_nfs3_fh(tvb, offset, pinfo, lock_tree, "fh", &fh_hash);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " FH:0x%08x", fh_hash);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " FH:0x%08x", fh_hash);
offset = dissect_rpc_data(tvb, lock_tree, hf_nlm_lock_owner, offset);
offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
nlm_stat = tvb_get_ntohl(tvb, offset);
- if (nlm_stat && check_col(pinfo->cinfo, COL_INFO)) {
+ if (nlm_stat) {
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
val_to_str(nlm_stat, names_nlm_stats, "Unknown Status (%u)"));
}
hf_nlm_share_name, offset, NULL);
nlm_stat = tvb_get_ntohl(tvb, offset);
- if (nlm_stat && check_col(pinfo->cinfo, COL_INFO)) {
+ if (nlm_stat) {
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
val_to_str(nlm_stat, names_nlm_stats, "Unknown Status (%u)"));
}
offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
nlm_stat = tvb_get_ntohl(tvb, offset);
- if (nlm_stat && check_col(pinfo->cinfo, COL_INFO)) {
+ if (nlm_stat) {
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
val_to_str(nlm_stat, names_nlm_stats, "Unknown Status (%u)"));
}
"Sending Router System ID: %s",
tvb_ether_to_str(tvb, offset));
}
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", System ID: %s",
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", System ID: %s",
tvb_ether_to_str(tvb, offset));
- }
+
offset += 6;
if (tree) {
}
offset += 2;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", LSP ID: %s",
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", LSP ID: %s",
tvb_ether_to_str(tvb, offset));
- }
- if (tree) {
- proto_tree_add_text(tree, tvb, offset, 6,
+
+ proto_tree_add_text(tree, tvb, offset, 6,
"LSP ID system ID: %s",
tvb_ether_to_str(tvb, offset));
- }
+
offset += 6;
/* XXX - append the pseudonode ID */
- if (tree) {
- proto_tree_add_text(tree, tvb, offset, 1,
+ proto_tree_add_text(tree, tvb, offset, 1,
"LSP ID pseudonode ID: %u",
tvb_get_guint8(tvb, offset));
- }
+
offset += 1;
- if (tree) {
- proto_tree_add_text(tree, tvb, offset, 1,
+ proto_tree_add_text(tree, tvb, offset, 1,
"LSP ID LSP number: %u",
tvb_get_guint8(tvb, offset));
- }
offset += 1;
sequence_number = tvb_get_ntohl(tvb, offset);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO,
+ col_append_fstr(pinfo->cinfo, COL_INFO,
", Sequence: 0x%08x, Lifetime: %us",
sequence_number, remaining_lifetime);
- }
- if (tree) {
- proto_tree_add_uint(tree, hf_nlsp_lsp_sequence_number, tvb,
+
+ proto_tree_add_uint(tree, hf_nlsp_lsp_sequence_number, tvb,
offset, 4, sequence_number);
- }
offset += 4;
- if (tree) {
- /* XXX -> we could validate the cksum here! */
- proto_tree_add_item(tree, hf_nlsp_lsp_checksum, tvb,
- offset, 2, ENC_BIG_ENDIAN );
- }
+ /* XXX -> we could validate the cksum here! */
+ proto_tree_add_item(tree, hf_nlsp_lsp_checksum, tvb,
+ offset, 2, ENC_BIG_ENDIAN );
+
offset += 2;
if (tree) {
}
offset += 2;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", Source ID: %s",
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Source ID: %s",
tvb_ether_to_str(tvb, offset));
- }
- if (tree) {
- proto_tree_add_text(tree, tvb, offset, 6,
+ proto_tree_add_text(tree, tvb, offset, 6,
"Source ID system ID: %s",
tvb_ether_to_str(tvb, offset));
- }
offset += 6;
/* XXX - add the pseudonode ID */
- if (tree) {
- proto_tree_add_text(tree, tvb, offset, 1,
+ proto_tree_add_text(tree, tvb, offset, 1,
"Source ID pseudonode ID: %u",
tvb_get_guint8(tvb, offset));
- }
offset += 1;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", Start LSP ID: %s",
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Start LSP ID: %s",
tvb_ether_to_str(tvb, offset));
- }
- if (tree) {
- proto_tree_add_text(tree, tvb, offset, 6,
+ proto_tree_add_text(tree, tvb, offset, 6,
"Start LSP ID source ID: %s",
tvb_ether_to_str(tvb, offset));
- }
offset += 6;
/* XXX - append the pseudonode ID */
- if (tree) {
- proto_tree_add_text(tree, tvb, offset, 1,
+ proto_tree_add_text(tree, tvb, offset, 1,
"Start LSP ID pseudonode ID: %u",
tvb_get_guint8(tvb, offset));
- }
offset += 1;
- if (tree) {
- proto_tree_add_text(tree, tvb, offset, 1,
+
+ proto_tree_add_text(tree, tvb, offset, 1,
"Start LSP ID LSP number: %u",
tvb_get_guint8(tvb, offset));
- }
offset += 1;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", End LSP ID: %s",
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", End LSP ID: %s",
tvb_ether_to_str(tvb, offset));
- }
- if (tree) {
- proto_tree_add_text(tree, tvb, offset, 6,
+ proto_tree_add_text(tree, tvb, offset, 6,
"End LSP ID source ID: %s",
tvb_ether_to_str(tvb, offset));
- }
offset += 6;
/* XXX - append the pseudonode ID */
- if (tree) {
- proto_tree_add_text(tree, tvb, offset, 1,
+ proto_tree_add_text(tree, tvb, offset, 1,
"End LSP ID pseudonode ID: %u",
tvb_get_guint8(tvb, offset));
- }
offset += 1;
- if (tree) {
- proto_tree_add_text(tree, tvb, offset, 1,
+ proto_tree_add_text(tree, tvb, offset, 1,
"End LSP ID LSP number: %u",
tvb_get_guint8(tvb, offset));
- }
offset += 1;
len = packet_length - header_length;
int len;
packet_length = tvb_get_ntohs(tvb, offset);
- if (tree) {
- proto_tree_add_uint(tree, hf_nlsp_packet_length, tvb,
+ proto_tree_add_uint(tree, hf_nlsp_packet_length, tvb,
offset, 2, packet_length);
- }
offset += 2;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", Source ID: %s",
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Source ID: %s",
tvb_ether_to_str(tvb, offset));
- }
- if (tree) {
- proto_tree_add_text(tree, tvb, offset, 6,
+ proto_tree_add_text(tree, tvb, offset, 6,
"Source ID system ID: %s",
tvb_ether_to_str(tvb, offset));
- }
offset += 6;
/* XXX - add the pseudonode ID */
- if (tree) {
- proto_tree_add_text(tree, tvb, offset, 1,
+ proto_tree_add_text(tree, tvb, offset, 1,
"Source ID pseudonode ID: %u",
tvb_get_guint8(tvb, offset));
- }
offset += 1;
len = packet_length - header_length;
dissect_nlsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *ti;
- proto_tree *nlsp_tree = NULL;
+ proto_tree *nlsp_tree;
int offset = 0;
guint8 nlsp_major_version;
guint8 nlsp_header_length;
nlsp_major_version = tvb_get_guint8(tvb, 5);
if (nlsp_major_version != 1){
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO,
+ col_add_fstr(pinfo->cinfo, COL_INFO,
"Unknown NLSP version (%u vs 1)",
nlsp_major_version);
- }
+
nlsp_dissect_unknown(tvb, tree, 0,
"Unknown NLSP version (%d vs 1)",
nlsp_major_version, 1);
return;
}
- if (tree) {
- ti = proto_tree_add_item(tree, proto_nlsp, tvb, 0, -1, ENC_NA);
- nlsp_tree = proto_item_add_subtree(ti, ett_nlsp);
- }
+ ti = proto_tree_add_item(tree, proto_nlsp, tvb, 0, -1, ENC_NA);
+ nlsp_tree = proto_item_add_subtree(ti, ett_nlsp);
- if (tree) {
- proto_tree_add_item(nlsp_tree, hf_nlsp_irpd, tvb, offset, 1,
+ proto_tree_add_item(nlsp_tree, hf_nlsp_irpd, tvb, offset, 1,
ENC_BIG_ENDIAN );
- }
offset += 1;
nlsp_header_length = tvb_get_guint8(tvb, 1);
- if (tree) {
- proto_tree_add_uint(nlsp_tree, hf_nlsp_header_length, tvb,
+ proto_tree_add_uint(nlsp_tree, hf_nlsp_header_length, tvb,
offset, 1, nlsp_header_length );
- }
offset += 1;
- if (tree) {
- proto_tree_add_item(nlsp_tree, hf_nlsp_minor_version, tvb,
+ proto_tree_add_item(nlsp_tree, hf_nlsp_minor_version, tvb,
offset, 1, ENC_BIG_ENDIAN );
- }
offset += 1;
offset += 1; /* Reserved */
packet_type_flags = tvb_get_guint8(tvb, offset);
packet_type = packet_type_flags & PACKET_TYPE_MASK;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_str(pinfo->cinfo, COL_INFO,
+ col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(packet_type, nlsp_packet_type_vals, "Unknown (%u)"));
- }
- if (tree) {
- if (packet_type == NLSP_TYPE_L1_LSP) {
- proto_tree_add_boolean(nlsp_tree, hf_nlsp_nr, tvb, offset, 1,
+ if (packet_type == NLSP_TYPE_L1_LSP) {
+ proto_tree_add_boolean(nlsp_tree, hf_nlsp_nr, tvb, offset, 1,
packet_type_flags );
- }
- proto_tree_add_uint(nlsp_tree, hf_nlsp_type, tvb, offset, 1,
- packet_type_flags );
}
+ proto_tree_add_uint(nlsp_tree, hf_nlsp_type, tvb, offset, 1,
+ packet_type_flags );
offset += 1;
- if (tree) {
- proto_tree_add_item(nlsp_tree, hf_nlsp_major_version, tvb,
+ proto_tree_add_item(nlsp_tree, hf_nlsp_major_version, tvb,
offset, 1, ENC_BIG_ENDIAN );
- }
offset += 1;
offset += 2; /* Reserved */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "NNTP");
- if (check_col(pinfo->cinfo, COL_INFO)) {
- /*
- * Put the first line from the buffer into the summary
- * (but leave out the line terminator).
- *
- * 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.
- */
- linelen = tvb_find_line_end(tvb, offset, -1, &next_offset,
- FALSE);
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s", type,
+ /*
+ * Put the first line from the buffer into the summary
+ * (but leave out the line terminator).
+ *
+ * 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.
+ */
+ linelen = tvb_find_line_end(tvb, offset, -1, &next_offset, FALSE);
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s", type,
tvb_format_text(tvb, offset, linelen));
- }
if (tree) {
ti = proto_tree_add_item(tree, proto_nntp, tvb, offset, -1,
proto_tree_add_item(tree, hf_noe_event, tvb, offset, 1, ENC_BIG_ENDIAN);
/* add text to the frame "INFO" column */
- 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_ext_const(event, &val_str_event_ext, "Unknown"));
/* update text of the main proto item */
proto_item_append_text(tree, ", %s",
g_snprintf(key_name, 30, "\"%s\"", decode_key_name((int)unicode_value));
/* add text to the frame "INFO" column */
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, ": %s",
- key_name);
+ col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", key_name);
/* update text of the main proto item */
proto_item_append_text(tree, ", %s",
key_name);
proto_tree_add_item(tree, hf_noe_class, tvb, offset, 1, ENC_BIG_ENDIAN);
/* add text to the frame "INFO" column */
- 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_ext_const(noe_class, &val_str_class_ext, "Unknown"));
/* update text of the main proto item */
proto_item_append_text(tree, ", %s",
server = tvb_get_guint8(tvb, offset);
/* add text to the frame "INFO" column */
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, " - NOE Protocol (%s)",
+ col_append_fstr(pinfo->cinfo, COL_INFO, " - NOE Protocol (%s)",
val_to_str_const(server, servers_short_vals, "Unknown"));
proto_tree_add_uint(noe_tree,
return;
/* add text to the frame "INFO" column */
- 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_const(method, methods_vals, "Unknown"));
/* update text of the main proto item */
"Cause: %s (%#02x)",
val_to_str_const(cause, tab_nsip_cause_values,
"Unknown"), cause);
- if (check_col(bi->pinfo->cinfo, COL_INFO)) {
- col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
- "Cause: %s",
- val_to_str(cause, tab_nsip_cause_values, "Unknown (0x%02x)"));
- }
+ col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
+ "Cause: %s",
+ val_to_str(cause, tab_nsip_cause_values, "Unknown (0x%02x)"));
+
proto_item_append_text(bi->ti, ", Cause: %s",
val_to_str(cause, tab_nsip_cause_values, "Unknown (0x%02x)"));
}
bi->tvb, ie_start_offset, ie->total_length,
ns_vci,
"NS VCI: %#04x", ns_vci);
- if (check_col(bi->pinfo->cinfo, COL_INFO)) {
- col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
- "NS VCI: %#04x", ns_vci);
- }
+ col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
+ "NS VCI: %#04x", ns_vci);
proto_item_append_text(bi->ti, ", NS VCI: %#04x", ns_vci);
}
bi->offset += ie->value_length;
}
bi->offset += ie->value_length;
- if (check_col(bi->pinfo->cinfo, COL_INFO)) {
- col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
+ col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
"NSEI %u", nsei);
- }
+
proto_item_append_text(bi->ti, ", NSEI %u", nsei);
}
}
bi->offset += ie->value_length;
- if (check_col(bi->pinfo->cinfo, COL_INFO)) {
- col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
+ col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
"BVCI %u", bvci);
- }
proto_item_append_text(bi->ti, ", BVCI %u", bvci);
}
bi->offset, 1,
flag & NSIP_MASK_RESET_FLAG);
if (flag & NSIP_MASK_RESET_FLAG) {
- if (check_col(bi->pinfo->cinfo, COL_INFO)) {
- col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
+ col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
"Reset");
- }
proto_item_append_text(bi->ti, ", Reset");
}
proto_tree_add_uint(field_tree, hf_nsip_reset_flag_spare,
id = tvb_get_guint8(bi->tvb, bi->offset);
proto_tree_add_uint(bi->nsip_tree, hf_nsip_transaction_id,
bi->tvb, ie_start_offset, ie->total_length, id);
- if (check_col(bi->pinfo->cinfo, COL_INFO)) {
- col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
+ col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
"Transaction Id: %d", id);
- }
}
bi->offset += 1;
}
}
bi->offset++;
- if (check_col(bi->pinfo->cinfo, COL_INFO)) {
- if (control_bits & NSIP_MASK_CONTROL_BITS_R) {
- col_append_sep_str(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, "Req CF");
- proto_item_append_text(bi->ti, ", Request Change Flow");
- }
+ if (control_bits & NSIP_MASK_CONTROL_BITS_R) {
+ col_append_sep_str(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, "Req CF");
+ proto_item_append_text(bi->ti, ", Request Change Flow");
+ }
- if (control_bits & NSIP_MASK_CONTROL_BITS_C) {
- col_append_sep_str(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, "Conf CF");
- proto_item_append_text(bi->ti, ", Confirm Change Flow");
- }
+ if (control_bits & NSIP_MASK_CONTROL_BITS_C) {
+ col_append_sep_str(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, "Conf CF");
+ proto_item_append_text(bi->ti, ", Confirm Change Flow");
}
}
/* cv = find_or_create_conversation(pinfo); */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PGSQL");
- if (check_col(pinfo->cinfo, COL_INFO))
- col_set_str(pinfo->cinfo, COL_INFO,
+ col_set_str(pinfo->cinfo, COL_INFO,
(pinfo->match_uint == pinfo->destport) ?
">" : "<");
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, q933_message_type_vals,
"Unknown message type (0x%02X)"));
- }
- if (q933_tree != NULL)
- proto_tree_add_uint(q933_tree, hf_q933_message_type, tvb, offset, 1, message_type);
+
+ proto_tree_add_uint(q933_tree, hf_q933_message_type, tvb, offset, 1, message_type);
offset += 1;
/*
if(tvb_get_ntohl(tvb, offset + 0) == STARTEAM_MAGIC){
/* This packet is a response */
bRequest = FALSE;
- if(check_col(pinfo->cinfo, COL_INFO)){
- col_append_fstr(pinfo->cinfo, COL_INFO, "Reply: %d bytes", tvb_length(tvb));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, "Reply: %d bytes", tvb_length(tvb));
+
} else if(tvb_length_remaining(tvb, offset) >= 28 && tvb_get_ntohl(tvb, offset + 20) == STARTEAM_MAGIC){
/* This packet is a request */
bRequest = TRUE;
frame_type = (trh->fc & 192) >> 6;
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "Token-Ring %s", fc[frame_type]);
+ col_add_fstr(pinfo->cinfo, COL_INFO, "Token-Ring %s", fc[frame_type]);
trn_rif_bytes = tvb_get_guint8(tr_tvb, 14) & 31;
proto_tree_add_item(tree, hf_usb_bDescriptorType, tvb, offset, 1, ENC_LITTLE_ENDIAN);
usb_trans_info->u.get_descriptor.type = tvb_get_guint8(tvb, offset);
offset += 1;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
- val_to_str_ext(usb_trans_info->u.get_descriptor.type, &descriptor_type_vals_ext, "Unknown type %u"));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
+ val_to_str_ext(usb_trans_info->u.get_descriptor.type, &descriptor_type_vals_ext, "Unknown type %u"));
/* language id */
proto_tree_add_item(tree, hf_usb_language_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
guint bus_id, guint device_address)
{
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
- val_to_str_ext(usb_trans_info->u.get_descriptor.type, &descriptor_type_vals_ext, "Unknown type %u"));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
+ val_to_str_ext(usb_trans_info->u.get_descriptor.type, &descriptor_type_vals_ext, "Unknown type %u"));
+
switch(usb_trans_info->u.get_descriptor.type) {
case USB_DT_DEVICE:
offset = dissect_usb_device_descriptor(pinfo, tree, tvb, offset, usb_trans_info, bus_id, device_address);
isprint(type) ? type : '.');
proto_tree_add_item(tree, hf_usb_transfer_type, tvb, 9, 1, ENC_BIG_ENDIAN);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- transfer_type = tvb_get_guint8(tvb, 9);
- endpoint_number = tvb_get_guint8(tvb, 10);
- transfer_type_and_direction = (transfer_type & 0x7F) | (endpoint_number & 0x80);
- col_append_str(pinfo->cinfo, COL_INFO,
- val_to_str(transfer_type_and_direction, usb_transfer_type_and_direction_vals, "Unknown type %x"));
- }
+ transfer_type = tvb_get_guint8(tvb, 9);
+ endpoint_number = tvb_get_guint8(tvb, 10);
+ transfer_type_and_direction = (transfer_type & 0x7F) | (endpoint_number & 0x80);
+ col_append_str(pinfo->cinfo, COL_INFO,
+ val_to_str(transfer_type_and_direction, usb_transfer_type_and_direction_vals, "Unknown type %x"));
proto_tree_add_bitmask(tree, tvb, 10, hf_usb_endpoint_number, ett_usb_endpoint, usb_endpoint_fields, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_usb_device_address, tvb, 11, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(setup_tree, hf_usb_request, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s Request",
- val_to_str(usb_trans_info->setup.request, setup_request_names_vals, "Unknown type %x"));
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s Request",
+ val_to_str(usb_trans_info->setup.request, setup_request_names_vals, "Unknown type %x"));
dissector = NULL;
for(tmp = setup_request_dissectors;tmp->dissector;tmp++) {
* This is a standard response which is managed by this
* dissector
*/
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s Response",
- val_to_str(usb_conv_info->usb_trans_info->setup.request,
- setup_request_names_vals, "Unknown type %x"));
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s Response",
+ val_to_str(usb_conv_info->usb_trans_info->setup.request,
+ setup_request_names_vals, "Unknown type %x"));
dissector = NULL;
for(tmp = setup_response_dissectors;tmp->dissector;tmp++) {
col_clear(pinfo->cinfo, COL_INFO);
ptype = 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(ptype, vines_llc_ptype_vals,
"Unknown protocol 0x%02x"));
if (tree) {
vip_tctl = tvb_get_guint8(tvb, offset+3);
vip_proto = tvb_get_guint8(tvb, offset+4);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s (0x%02x)",
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s (0x%02x)",
val_to_str_const(vip_tctl, proto_vals, "Unknown VIP protocol"),
vip_tctl);
- }
src_addr = tvb_get_ptr(tvb, offset+12, VINES_ADDR_LEN);
SET_ADDRESS(&pinfo->net_src, AT_VINES, VINES_ADDR_LEN, src_addr);
viph.vipc_err_len = g_ntohs(viph.vipc_err_len);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Vines IPC");
- if (check_col(pinfo->cinfo, COL_INFO)) {
- switch (viph.vipc_pkttype) {
+ switch (viph.vipc_pkttype) {
- case PKTTYPE_DGRAM:
- col_add_fstr(pinfo->cinfo, COL_INFO,
+ case PKTTYPE_DGRAM:
+ col_add_fstr(pinfo->cinfo, COL_INFO,
"%s D=%04x S=%04x",
val_to_str(viph.vipc_pkttype, pkttype_vals,
"Unknown packet type (0x%02x)"),
viph.vipc_dport, viph.vipc_sport);
- break;
+ break;
- case PKTTYPE_ERR:
- col_add_fstr(pinfo->cinfo, COL_INFO,
+ case PKTTYPE_ERR:
+ col_add_fstr(pinfo->cinfo, COL_INFO,
"%s NS=%u NR=%u Err=%s RID=%04x LID=%04x D=%04x S=%04x",
val_to_str(viph.vipc_pkttype, pkttype_vals,
"Unknown packet type (0x%02x)"),
vipc_err_vals, "Unknown (%u)"),
viph.vipc_rmtid, viph.vipc_lclid,
viph.vipc_dport, viph.vipc_sport);
- break;
+ break;
- default:
- col_add_fstr(pinfo->cinfo, COL_INFO,
+ default:
+ col_add_fstr(pinfo->cinfo, COL_INFO,
"%s NS=%u NR=%u Len=%u RID=%04x LID=%04x D=%04x S=%04x",
val_to_str(viph.vipc_pkttype, pkttype_vals,
"Unknown packet type (0x%02x)"),
viph.vipc_err_len, viph.vipc_rmtid,
viph.vipc_lclid, viph.vipc_dport,
viph.vipc_sport);
- break;
- }
+ break;
}
ti = proto_tree_add_item(tree, proto_vines_ipc, tvb, offset,
viph.vspp_win = g_ntohs(viph.vspp_win);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Vines SPP");
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO,
+ col_add_fstr(pinfo->cinfo, COL_INFO,
"%s NS=%u NR=%u Window=%u RID=%04x LID=%04x D=%04x S=%04x",
val_to_str(viph.vspp_pkttype, pkttype_vals,
"Unknown packet type (0x%02x)"),
*/
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Vines SARP");
packet_type = 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(packet_type, vines_arp_packet_type_vals,
"Unknown (0x%02x)"));
- }
- if (tree) {
- proto_tree_add_text(vines_arp_tree, tvb, 1, 1,
+
+ proto_tree_add_text(vines_arp_tree, tvb, 1, 1,
"Packet Type: %s (0x%02x)",
val_to_str_const(packet_type,
vines_arp_packet_type_vals,
"Unknown"),
packet_type);
- }
+
if (packet_type == VARP_ASSIGNMENT_RESP) {
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO,
+ col_append_fstr(pinfo->cinfo, COL_INFO,
", Address = %s",
tvb_vines_addr_to_str(tvb, 2));
- }
- if (tree) {
- proto_tree_add_text(vines_arp_tree, tvb, 2,
+ proto_tree_add_text(vines_arp_tree, tvb, 2,
VINES_ADDR_LEN,
"Address: %s",
tvb_vines_addr_to_str(tvb, 2));
- }
}
if (tree) {
proto_tree_add_text(vines_arp_tree, tvb,
* Non-sequenced ARP.
*/
packet_type = (guint8) tvb_get_ntohs(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(packet_type, vines_arp_packet_type_vals,
"Unknown (0x%02x)"));
- }
- if (tree) {
- proto_tree_add_text(vines_arp_tree, tvb, 0, 2,
+ proto_tree_add_text(vines_arp_tree, tvb, 0, 2,
"Packet Type: %s (0x%04x)",
val_to_str_const(packet_type,
vines_arp_packet_type_vals,
"Unknown"),
packet_type);
- }
+
if (packet_type == VARP_ASSIGNMENT_RESP) {
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO,
+ col_append_fstr(pinfo->cinfo, COL_INFO,
", Address = %s",
tvb_vines_addr_to_str(tvb, 2));
- }
- if (tree) {
- proto_tree_add_text(vines_arp_tree, tvb, 2,
+
+ proto_tree_add_text(vines_arp_tree, tvb, 2,
VINES_ADDR_LEN,
"Address: %s",
tvb_vines_addr_to_str(tvb, 2));
- }
}
}
}
* Non-sequenced RTP.
*/
operation_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(operation_type, vines_rtp_operation_type_vals,
"Unknown (0x%02x)"));
- }
+
if (tree) {
proto_tree_add_text(vines_rtp_tree, tvb, offset, 1,
"Operation Type: %s (0x%02x)",
}
offset += 2;
operation_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(operation_type, vines_rtp_operation_type_vals,
"Unknown (0x%02x)"));
- }
+
if (tree) {
proto_tree_add_text(vines_rtp_tree, tvb, offset, 1,
"Operation Type: %s (0x%02x)",
}
packet_type = tvb_get_ntohs(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(packet_type, vines_icp_packet_type_vals,
"Unknown (0x%02x)"));
- }
- if (tree) {
- proto_tree_add_text(vines_icp_tree, tvb, offset, 2,
+
+ proto_tree_add_text(vines_icp_tree, tvb, offset, 2,
"Packet Type: %s (0x%04x)",
val_to_str_const(packet_type,
vines_icp_packet_type_vals,
"Unknown"),
packet_type);
- }
offset += 2;
switch (packet_type) {
case VICP_EXCEPTION_NOTIFICATION:
exception_code = tvb_get_ntohs(tvb, 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(exception_code, vipc_err_vals,
"Unknown exception code (%u)"));
- }
- if (tree) {
- proto_tree_add_text(vines_icp_tree, tvb, offset, 2,
+ proto_tree_add_text(vines_icp_tree, tvb, offset, 2,
"Exception Code: %s (%u)",
val_to_str_const(exception_code,
vipc_err_vals,
"Unknown"),
exception_code);
- }
break;
case VICP_METRIC_NOTIFICATION:
metric = tvb_get_ntohs(tvb, offset);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", metric %u",
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", metric %u",
metric);
- }
- if (tree) {
- proto_tree_add_text(vines_icp_tree, tvb, offset, 2,
+ proto_tree_add_text(vines_icp_tree, tvb, offset, 2,
"Metric: %u", metric);
- }
break;
}
offset += 2;
at the list of packets can tell what type of packet it is. See section 1.5
for more information.
- Before changing the contents of a column you should make sure the column is
- active by calling "check_col(pinfo->cinfo, COL_*)". If it is not active
- don't bother setting it.
-
If you are setting the column to a constant string, use "col_set_str()",
as it's more efficient than the other "col_set_XXX()" calls.
*/
- if ( check_col(pinfo->cinfo, COL_INFO) )
- {
- col_add_fstr(pinfo->cinfo, COL_INFO, "MagicPacket for %s (%s)",
- get_ether_name(mac), ether_to_str(mac));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "MagicPacket for %s (%s)",
+ get_ether_name(mac), ether_to_str(mac));
- /* NOTE: ether-wake uses a dotted-decimal format for specifying a
- * 4-byte password or an Ethernet mac address format for specifying
- * a 6-byte password, so display them in that format, even if the
- * password isn't really an IP or MAC address. */
- if ( passwd )
- col_append_fstr(pinfo->cinfo, COL_INFO, ", password %s", passwd);
- }
+ /* NOTE: ether-wake uses a dotted-decimal format for specifying a
+ * 4-byte password or an Ethernet mac address format for specifying
+ * a 6-byte password, so display them in that format, even if the
+ * password isn't really an IP or MAC address. */
+ if ( passwd )
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", password %s", passwd);
/* A protocol dissector can be called in 2 different ways: