void dissect_umts_cell_broadcast_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { guint8 sms_encoding; guint32 offset = 0; guint32 len; proto_item *cbs_item; proto_tree *cbs_tree, *cbs_subtree; guint msg_len; guint8 *msg; tvbuff_t * cbs_msg_tvb = NULL; len = tvb_length(tvb); col_append_str(pinfo->cinfo, COL_PROTOCOL, " Cell Broadcast"); col_append_str(pinfo->cinfo, COL_INFO, " (CBS Message)"); cbs_item = proto_tree_add_protocol_format(proto_tree_get_root(tree), proto_cell_broadcast, tvb, 0, len, "Cell Broadcast"); cbs_tree = proto_item_add_subtree(cbs_item, ett_cbs_msg); sms_encoding = dissect_cbs_data_coding_scheme(tvb, pinfo, cbs_tree, 0); offset++; cbs_msg_tvb = dissect_cbs_data(sms_encoding, tvb, cbs_tree, pinfo, offset ); msg_len = tvb_length(cbs_msg_tvb); cbs_subtree = proto_tree_add_subtree_format(cbs_tree, tvb, offset, -1, ett_cbs_msg, NULL, "Cell Broadcast Message Contents (length: %d)", msg_len); msg = tvb_get_string_enc(wmem_packet_scope(), cbs_msg_tvb, 0, msg_len, ENC_ASCII); proto_tree_add_string_format(cbs_subtree, hf_gsm_cbs_message_content, cbs_msg_tvb, 0, -1, msg, "%s", msg); }
void dissect_umts_cell_broadcast_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { guint8 sms_encoding; guint32 offset = 0; guint32 len; proto_item *cbs_item = NULL, *cbs_item2 = NULL; proto_tree *cbs_tree = NULL, *cbs_subtree = NULL; guint16 msg_len; tvbuff_t * cbs_msg_tvb = NULL; len = tvb_length(tvb); col_append_str(pinfo->cinfo, COL_PROTOCOL, " Cell Broadcast"); col_append_str(pinfo->cinfo, COL_INFO, " (CBS Message)"); cbs_item = proto_tree_add_protocol_format(proto_tree_get_root(tree), proto_cell_broadcast, tvb, 0, len, "Cell Broadcast"); cbs_tree = proto_item_add_subtree(cbs_item, ett_cbs_msg); sms_encoding = dissect_cbs_data_coding_scheme(tvb, pinfo, cbs_tree, 0); offset++; cbs_msg_tvb = dissect_cbs_data(sms_encoding, tvb, cbs_tree, pinfo, offset ); msg_len = tvb_length(cbs_msg_tvb); cbs_item2 = proto_tree_add_text(cbs_tree, tvb, offset, -1, "Cell Broadcast Message Contents (length: %d)", msg_len); cbs_subtree = proto_item_add_subtree(cbs_item2, ett_cbs_msg); proto_tree_add_text(cbs_subtree, cbs_msg_tvb , 0, tvb_length(cbs_msg_tvb), "%s", tvb_get_ephemeral_string(cbs_msg_tvb, 0, msg_len)); }
guint32 offset = 0; guint len, text_len; guint32 msg_key; proto_item *cbs_page_item = NULL; proto_tree *cbs_page_tree = NULL; guint16 serial_number, message_id; tvbuff_t *cbs_page_tvb = NULL; tvbuff_t *cbs_msg_tvb = NULL; fragment_head * frag_data = NULL; len = tvb_reported_length(tvb); col_append_str(pinfo->cinfo, COL_PROTOCOL, " Cell Broadcast"); col_append_str(pinfo->cinfo, COL_INFO, " (CBS Page)"); cbs_page_item = proto_tree_add_protocol_format(proto_tree_get_root(tree), proto_cell_broadcast, tvb, 0, len, "GSM Cell Broadcast"); cbs_page_tree = proto_item_add_subtree(cbs_page_item, ett_gsm_cbs_page); serial_number = tvb_get_ntohs(tvb, offset); offset = dissect_cbs_serial_number(tvb, cbs_page_tree, offset); message_id = tvb_get_ntohs(tvb, offset); offset = dissect_cbs_message_identifier(tvb, cbs_page_tree, offset); sms_encoding = dissect_cbs_data_coding_scheme(tvb, pinfo, cbs_page_tree, offset++); total_pages = tvb_get_guint8(tvb, offset); current_page = (total_pages & 0xF0) >> 4; total_pages &= 0x0F; proto_tree_add_item(cbs_page_tree, hf_gsm_cbs_current_page, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cbs_page_tree, hf_gsm_cbs_total_pages, tvb, offset++, 1, ENC_BIG_ENDIAN); cbs_page_tvb = dissect_cbs_data(sms_encoding, tvb, cbs_page_tree, pinfo, offset ); if (cbs_page_tvb != NULL)
static void dissect_gsm_cell_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { guint8 sms_encoding, total_pages, current_page; guint32 offset = 0; guint len, text_len; guint32 msg_key; proto_item *cbs_page_item = NULL; proto_tree *cbs_page_tree = NULL; guint16 serial_number, message_id; tvbuff_t *cbs_page_tvb = NULL; tvbuff_t *cbs_msg_tvb = NULL; fragment_head * frag_data = NULL; len = tvb_length(tvb); col_append_str(pinfo->cinfo, COL_PROTOCOL, " Cell Broadcast"); col_append_str(pinfo->cinfo, COL_INFO, " (CBS Page)"); cbs_page_item = proto_tree_add_protocol_format(proto_tree_get_root(tree), proto_cell_broadcast, tvb, 0, len, "GSM Cell Broadcast"); cbs_page_tree = proto_item_add_subtree(cbs_page_item, ett_gsm_cbs_page); serial_number = tvb_get_ntohs(tvb, offset); offset = dissect_cbs_serial_number(tvb, cbs_page_tree, offset); message_id = tvb_get_ntohs(tvb, offset); offset = dissect_cbs_message_identifier(tvb, cbs_page_tree, offset); sms_encoding = dissect_cbs_data_coding_scheme(tvb, pinfo, cbs_page_tree, offset++); total_pages = tvb_get_guint8(tvb, offset); current_page = (total_pages & 0xF0) >> 4; total_pages &= 0x0F; proto_tree_add_item(cbs_page_tree, hf_gsm_cbs_current_page, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cbs_page_tree, hf_gsm_cbs_total_pages, tvb, offset++, 1, ENC_BIG_ENDIAN); cbs_page_tvb = dissect_cbs_data(sms_encoding, tvb, cbs_page_tree, pinfo, offset ); if (cbs_page_tvb != NULL) { text_len = tvb_length(cbs_page_tvb); while (text_len && (tvb_get_guint8(cbs_page_tvb, text_len-1) == '\r')) { text_len--; } if (tree != NULL) { proto_tree *cbs_page_subtree = proto_tree_add_subtree(cbs_page_tree, tvb, offset, -1, ett_gsm_cbs_page_content, NULL, "Cell Broadcast Page Contents"); len = tvb_length(cbs_page_tvb); proto_tree_add_string(cbs_page_subtree, hf_gsm_cbs_page_content, cbs_page_tvb, 0, text_len, tvb_get_string_enc(wmem_packet_scope(), cbs_page_tvb, 0, text_len, ENC_ASCII)); len -= text_len; if (len) { proto_tree_add_string(cbs_page_subtree, hf_gsm_cbs_page_content_padding, cbs_page_tvb, text_len, len, tvb_get_string_enc(wmem_packet_scope(), cbs_page_tvb, text_len, len, ENC_ASCII)); } } if (text_len) { cbs_page_tvb = tvb_new_subset_length(cbs_page_tvb, 0, text_len); if (total_pages == 1) { /* no need for reassembly */ cbs_msg_tvb = cbs_page_tvb; } else { /* now we have a complete page, try to concatenate the full message */ /* we can use the serial number and message ID as keys, as they are the same for all pages of a message */ msg_key = (serial_number << 16) + message_id; frag_data = fragment_add_seq_check(&gsm_cbs_reassembly_table, cbs_page_tvb, 0, pinfo, msg_key, NULL, (current_page -1), text_len, (current_page!=total_pages)); cbs_msg_tvb = process_reassembled_data(cbs_page_tvb, 0, pinfo, "Reassembled Cell Broadcast message", frag_data, &gsm_page_items, NULL, cbs_page_tree); } } } if (cbs_msg_tvb != NULL) { proto_item *cbs_msg_item = NULL; proto_tree *cbs_msg_tree = NULL; len = tvb_length(cbs_msg_tvb); col_append_str(pinfo->cinfo, COL_INFO, " (CBS Message)"); cbs_msg_item = proto_tree_add_protocol_format(proto_tree_get_root(tree), proto_cell_broadcast, cbs_msg_tvb, 0, len, "GSM Cell Broadcast Message"); cbs_msg_tree = proto_item_add_subtree(cbs_msg_item, ett_cbs_msg); proto_tree_add_string(cbs_msg_tree, hf_gsm_cbs_message_content, cbs_msg_tvb, 0, len, tvb_get_string_enc(wmem_packet_scope(), cbs_msg_tvb, 0, len, ENC_ASCII)); } }
const char *eof_str; const char *sof_str; const char *crc_msg; const char *len_msg; proto_item *ti; proto_item *item; proto_tree *fcoib_tree; proto_tree *crc_tree; tvbuff_t *next_tvb; gboolean crc_exists; guint32 crc_computed = 0; guint32 crc = 0; gboolean packet_match_manual; fc_data_t fc_data; tree = proto_tree_get_root(tree); /* we don't want to add FCoIB under the Infiniband tree */ frame_len = tvb_reported_length_remaining(tvb, 0) - FCOIB_HEADER_LEN - FCOIB_TRAILER_LEN; crc_offset = FCOIB_HEADER_LEN + frame_len; eof_offset = crc_offset + 4; sof_offset = FCOIB_HEADER_LEN - 1; if (frame_len <= 0) return FALSE; /* this packet isn't even long enough to contain the header+trailer w/o FC payload! */ packet_match_manual = manual_addr_match(pinfo); if (!packet_match_manual && !gPREF_HEUR_EN) return FALSE; /* user doesn't want us trying to automatically identify FCoIB packets */
static dissector_handle_t opa_mad_handle; static range_t *global_fe_ssl_range = NULL; static range_t *fe_ssl_range = NULL; static int dissect_opa_fe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { gint offset = 0; /* Current Offset */ proto_item *FE_item; proto_tree *FE_tree; col_set_str(pinfo->cinfo, COL_PROTOCOL, "Omni-Path"); col_clear(pinfo->cinfo, COL_INFO); tree = proto_tree_get_root(tree); FE_item = proto_tree_add_item(tree, proto_opa_fe, tvb, offset, 24, ENC_NA); FE_tree = proto_item_add_subtree(FE_item, ett_fe); proto_tree_add_item(FE_tree, hf_opa_fe_magicnumber, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(FE_tree, hf_opa_fe_length_oob, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(FE_tree, hf_opa_fe_headerversion, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(FE_tree, hf_opa_fe_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(FE_tree, hf_opa_fe_Reserved64, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8;