Eliminate proto_tree_add_text from some dissectors.

Change-Id: I979990e9385182870ce4809a7e6fa16e598cb2be
Reviewed-on: https://code.wireshark.org/review/9016
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Michael Mann 2015-06-21 15:06:47 -04:00 committed by Anders Broman
parent d729d8055b
commit e8a238fce2
5 changed files with 262 additions and 99 deletions

View File

@ -1664,6 +1664,17 @@ static gint hf_r3_dumpm41t81_reg12_notused = -1;
static gint hf_r3_dumpm41t81_reg13_rs = -1;
static gint hf_r3_dumpm41t81_reg13_notused = -1;
static gint hf_r3_sn_manufacturer = -1;
static gint hf_r3_sn_year = -1;
static gint hf_r3_sn_week = -1;
static gint hf_r3_sn_model = -1;
static gint hf_r3_sn_sequence = -1;
static gint hf_r3_sn_group = -1;
static gint hf_r3_sn_nid = -1;
static gint hf_r3_sn_hid = -1;
static gint hf_r3_sn_power_supply = -1;
static gint hf_r3_sn_mortise = -1;
static gint hf_r3_debuglog_recordnumber = -1;
static gint hf_r3_debuglog_flags = -1;
static gint hf_r3_debuglog_tick = -1;
@ -3561,25 +3572,23 @@ dissect_serialnumber (tvbuff_t *tvb, guint32 start_offset, guint32 length _U_, p
sn_tree = proto_item_add_subtree (sn_item, ett_r3serialnumber);
s = tvb_get_string_enc (wmem_packet_scope(), tvb, start_offset + 0, 2, ENC_ASCII|ENC_NA);
proto_tree_add_text (sn_tree, tvb, start_offset + 0, 2, "Manufacturer .. : %s (%s)", s, str_to_str (s, r3_snmanufacturernames, "[Unknown]"));
proto_tree_add_string_format_value(sn_tree, hf_r3_sn_manufacturer, tvb, start_offset + 0, 2, s, "%s (%s)", s, str_to_str (s, r3_snmanufacturernames, "[Unknown]"));
s = tvb_get_string_enc (wmem_packet_scope(), tvb, start_offset + 2, 1, ENC_ASCII|ENC_NA);
proto_tree_add_text (sn_tree, tvb, start_offset + 2, 1, "Year .......... : %s (%s)", s, str_to_str (s, r3_snyearnames, "[Unknown]"));
s = tvb_get_string_enc (wmem_packet_scope(), tvb, start_offset + 3, 2, ENC_ASCII|ENC_NA);
proto_tree_add_text (sn_tree, tvb, start_offset + 3, 2, "Week .......... : %s", s);
proto_tree_add_string_format_value(sn_tree, hf_r3_sn_year, tvb, start_offset + 2, 1, s, "%s (%s)", s, str_to_str (s, r3_snyearnames, "[Unknown]"));
proto_tree_add_item(sn_tree, hf_r3_sn_week, tvb, start_offset + 3, 2, ENC_ASCII|ENC_NA);
s = tvb_get_string_enc (wmem_packet_scope(), tvb, start_offset + 5, 1, ENC_ASCII|ENC_NA);
proto_tree_add_text (sn_tree, tvb, start_offset + 5, 1, "Model ......... : %s (%s)", s, str_to_str (s, r3_snmodelnames, "[Unknown]"));
s = tvb_get_string_enc (wmem_packet_scope(), tvb, start_offset + 6, 4, ENC_ASCII|ENC_NA);
proto_tree_add_text (sn_tree, tvb, start_offset + 6, 4, "Sequence ...... : %s", s);
proto_tree_add_string_format_value(sn_tree, hf_r3_sn_model, tvb, start_offset + 5, 1, s, "%s (%s)", s, str_to_str (s, r3_snmodelnames, "[Unknown]"));
proto_tree_add_item(sn_tree, hf_r3_sn_sequence, tvb, start_offset + 6, 4, ENC_ASCII|ENC_NA);
s = tvb_get_string_enc (wmem_packet_scope(), tvb, start_offset + 10, 1, ENC_ASCII|ENC_NA);
proto_tree_add_text (sn_tree, tvb, start_offset + 10, 1, "Group ......... : %s (%s)", s, str_to_str (s, r3_sngroupnames, "[Unknown]"));
proto_tree_add_string_format_value(sn_tree, hf_r3_sn_group, tvb, start_offset + 10, 1, s, "%s (%s)", s, str_to_str (s, r3_sngroupnames, "[Unknown]"));
s = tvb_get_string_enc (wmem_packet_scope(), tvb, start_offset + 11, 1, ENC_ASCII|ENC_NA);
proto_tree_add_text (sn_tree, tvb, start_offset + 11, 1, "NID ........... : %s (%s)", s, str_to_str (s, r3_snnidnames, "[Unknown]"));
proto_tree_add_string_format_value(sn_tree, hf_r3_sn_nid, tvb, start_offset + 11, 1, s, "%s (%s)", s, str_to_str (s, r3_snnidnames, "[Unknown]"));
s = tvb_get_string_enc (wmem_packet_scope(), tvb, start_offset + 12, 2, ENC_ASCII|ENC_NA);
proto_tree_add_text (sn_tree, tvb, start_offset + 12, 2, "HID ........... : %s (%s)", s, str_to_str (s, r3_snhidnames, "[Unknown]"));
proto_tree_add_string_format_value(sn_tree, hf_r3_sn_hid, tvb, start_offset + 12, 2, s, "%s (%s)", s, str_to_str (s, r3_snhidnames, "[Unknown]"));
s = tvb_get_string_enc (wmem_packet_scope(), tvb, start_offset + 14, 1, ENC_ASCII|ENC_NA);
proto_tree_add_text (sn_tree, tvb, start_offset + 14, 1, "Power Supply .. : %s (%s)", s, str_to_str (s, r3_snpowersupplynames, "[Unknown]"));
proto_tree_add_string_format_value(sn_tree, hf_r3_sn_power_supply, tvb, start_offset + 14, 1, s, "%s (%s)", s, str_to_str (s, r3_snpowersupplynames, "[Unknown]"));
s = tvb_get_string_enc (wmem_packet_scope(), tvb, start_offset + 15, 1, ENC_ASCII|ENC_NA);
proto_tree_add_text (sn_tree, tvb, start_offset + 15, 1, "Mortise ....... : %s (%s)", s, str_to_str (s, r3_snmortisenames, "[Unknown]"));
proto_tree_add_string_format_value(sn_tree, hf_r3_sn_mortise, tvb, start_offset + 15, 1, s, "%s (%s)", s, str_to_str (s, r3_snmortisenames, "[Unknown]"));
}
/*
@ -5274,7 +5283,8 @@ dissect_r3_cmd_setconfig (tvbuff_t *tvb, guint32 start_offset, guint32 length _U
}
}
else {
proto_tree_add_text (sc_tree, payload_tvb, offset + 2, item_length - 2, "[Unknown Field Type]");
proto_tree_add_none_format (sc_tree, hf_r3_upstreamfielderror, payload_tvb, offset + 2,
item_length - 2, "Unknown Field Type");
}
offset += item_length;
@ -9830,7 +9840,56 @@ void proto_register_r3 (void)
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_r3_sn_manufacturer,
{ "Manufacturer", "r3.sn.manufacturer",
FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_r3_sn_year,
{ "Year", "r3.sn.year",
FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_r3_sn_week,
{ "Week", "r3.sn.week",
FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_r3_sn_model,
{ "Model", "r3.sn.model",
FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_r3_sn_sequence,
{ "Sequence", "r3.sn.sequence",
FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_r3_sn_group,
{ "Group", "r3.sn.group",
FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_r3_sn_nid,
{ "NID", "r3.sn.nid",
FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_r3_sn_hid,
{ "HID", "r3.sn.hid",
FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_r3_sn_power_supply,
{ "Power Supply", "r3.sn.power_supply",
FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_r3_sn_mortise,
{ "Mortise", "r3.sn.mortise",
FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_r3_debuglog_recordnumber,
{ "Record Number", "r3.debuglog.recordnumber",
FT_UINT16, BASE_HEX_DEC, NULL, 0x0,

View File

@ -729,6 +729,20 @@ static int hf_dnp3_al_da_length = -1;
static int hf_dnp3_al_da_int8 = -1;
static int hf_dnp3_al_da_int32 = -1;
/* Generated from convert_proto_tree_add_text.pl */
static int hf_dnp3_al_point_index = -1;
static int hf_dnp3_al_da_value = -1;
static int hf_dnp3_al_count = -1;
static int hf_dnp3_al_on_time = -1;
static int hf_dnp3_al_off_time = -1;
static int hf_dnp3_al_time_delay = -1;
static int hf_dnp3_al_file_string_offset = -1;
static int hf_dnp3_al_file_string_length = -1;
static int hf_dnp3_al_file_name = -1;
static int hf_dnp3_al_octet_string = -1;
static int hf_dnp3_unknown_data_chunk = -1;
static int hf_dnp3_application_chunk = -1;
/***************************************************************************/
/* Value String Look-Ups */
/***************************************************************************/
@ -1272,6 +1286,9 @@ static gint ett_dnp3_al_obj_point_perms = -1;
static expert_field ei_dnp_num_items_neg = EI_INIT;
static expert_field ei_dnp_invalid_length = EI_INIT;
static expert_field ei_dnp_iin_abnormal = EI_INIT;
/* Generated from convert_proto_tree_add_text.pl */
static expert_field ei_dnp3_crc_failed = EI_INIT;
static expert_field ei_dnp3_buffering_user_data_until_final_frame_is_received = EI_INIT;
/* Tables for reassembly of fragments. */
static reassembly_table al_reassembly_table;
@ -1470,7 +1487,7 @@ dnp3_al_obj_procindex(tvbuff_t *tvb, int offset, guint8 al_objq_index, guint32 *
{
case AL_OBJQL_IDX_NI: /* No Index */
indexbytes = 0;
index_item = proto_tree_add_text(item_tree, tvb, offset, 0, "Point Index: %u", *al_ptaddr);
index_item = proto_tree_add_uint(item_tree, hf_dnp3_al_point_index, tvb, offset, 0, *al_ptaddr);
PROTO_ITEM_SET_GENERATED(index_item);
break;
case AL_OBJQL_IDX_1O:
@ -1820,12 +1837,12 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset,
data_pos += indexbytes;
if (!header_only || (AL_OBJQL_IDX_1OS <= al_objq_index && al_objq_index <= AL_OBJQL_IDX_4OS)) {
guint8 al_2bit, al_ptflags, al_ctlobj_count, al_bi_val, al_tcc_code, da_len;
guint8 al_2bit, al_ptflags, al_bi_val, al_tcc_code, da_len;
gint16 al_val_int16;
guint16 al_val_uint16, al_ctlobj_stat;
guint16 al_relms, al_filename_offs, al_filename_len, al_file_ctrl_mode;
gint32 al_val_int32;
guint32 al_val_uint32, al_ctlobj_on, al_ctlobj_off, file_data_size;
guint32 al_val_uint32, file_data_size;
nstime_t al_reltime, al_abstime;
gboolean al_bit;
gfloat al_valflt;
@ -1919,7 +1936,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset,
da_len = tvb_get_guint8(tvb, offset+1);
proto_tree_add_item(point_tree, hf_dnp3_al_da_length, tvb, offset+1, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_text(point_tree, tvb, offset+2, da_len, "Value: %s", tvb_get_string_enc(wmem_packet_scope(), tvb, offset+2, da_len, ENC_ASCII));
proto_tree_add_item(point_tree, hf_dnp3_al_da_value, tvb, offset+2, da_len, ENC_ASCII|ENC_NA);
proto_item_append_text(object_item, ", Value: %s", tvb_get_string_enc(wmem_packet_scope(), tvb, offset+2, da_len, ENC_ASCII));
offset += 2 + da_len;
@ -2144,22 +2161,17 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset,
data_pos += 1;
/* Get "Count" Field */
al_ctlobj_count = tvb_get_guint8(tvb, data_pos);
proto_tree_add_item(point_tree, hf_dnp3_al_count, tvb, data_pos, 1, ENC_LITTLE_ENDIAN);
data_pos += 1;
/* Get "On Time" Field */
al_ctlobj_on = tvb_get_letohl(tvb, data_pos);
proto_tree_add_item(point_tree, hf_dnp3_al_on_time, tvb, data_pos, 4, ENC_LITTLE_ENDIAN);
data_pos += 4;
/* Get "Off Time" Field */
al_ctlobj_off = tvb_get_letohl(tvb, data_pos);
proto_tree_add_item(point_tree, hf_dnp3_al_off_time, tvb, data_pos, 4, ENC_LITTLE_ENDIAN);
data_pos += 4;
/* Print "Count", "On Time" and "Off Time" to tree */
proto_tree_add_text(point_tree, tvb, data_pos - 9, 9,
"[Count: %u] [On-Time: %u] [Off-Time: %u]",
al_ctlobj_count, al_ctlobj_on, al_ctlobj_off);
/* Get "Control Status" Field */
proto_tree_add_item(point_tree, hf_dnp3_al_ctrlstatus, tvb, data_pos, 1, ENC_LITTLE_ENDIAN);
data_pos += 1;
@ -2641,7 +2653,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset,
case AL_OBJ_TDELAYF: /* Time Delay - Fine (Obj:52, Var:02) */
al_val_uint16 = tvb_get_letohs(tvb, data_pos);
proto_tree_add_text(object_tree, tvb, data_pos, 2, "Time Delay: %u ms", al_val_uint16);
proto_tree_add_uint_format_value(object_tree, hf_dnp3_al_time_delay, tvb, data_pos, 2, al_val_uint16, "%u ms", al_val_uint16);
data_pos += 2;
proto_item_set_len(point_item, data_pos - offset);
@ -2660,10 +2672,10 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset,
case AL_OBJ_FILE_CMD: /* File Control - File Command (Obj:70, Var:03) */
/* File name offset and length */
al_filename_offs = tvb_get_letohs(tvb, data_pos);
proto_tree_add_text(point_tree, tvb, data_pos, 2, "File String Offset: %u", al_filename_offs);
proto_tree_add_item(point_tree, hf_dnp3_al_file_string_offset, tvb, data_pos, 2, ENC_LITTLE_ENDIAN);
data_pos += 2;
al_filename_len = tvb_get_letohs(tvb, data_pos);
proto_tree_add_text(point_tree, tvb, data_pos, 2, "File String Length: %u", al_filename_len);
proto_tree_add_item(point_tree, hf_dnp3_al_file_string_length, tvb, data_pos, 2, ENC_LITTLE_ENDIAN);
data_pos += 2;
/* Grab the mode as it determines if some of the following fields are relevant */
@ -2723,7 +2735,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset,
const gchar *al_filename;
al_filename = tvb_get_string_enc(wmem_packet_scope(), tvb, data_pos, al_filename_len, ENC_ASCII);
proto_tree_add_text(point_tree, tvb, data_pos, al_filename_len, "File Name: %s", al_filename);
proto_tree_add_item(point_tree, hf_dnp3_al_file_name, tvb, data_pos, al_filename_len, ENC_ASCII|ENC_NA);
}
data_pos += al_filename_len;
proto_item_set_len(point_item, data_pos - offset);
@ -2820,7 +2832,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset,
/* read the number of bytes defined by the variation */
if (al_oct_len > 0) {
proto_tree_add_text(object_tree, tvb, data_pos, al_oct_len, "Octet String (%u bytes)", al_oct_len);
proto_tree_add_item(object_tree, hf_dnp3_al_octet_string, tvb, data_pos, al_oct_len, ENC_NA);
data_pos += al_oct_len;
proto_item_set_len(point_item, data_pos - offset);
}
@ -2830,8 +2842,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset,
default: /* In case of unknown object */
proto_tree_add_text(object_tree, tvb, offset, -1,
"Unknown Data Chunk, %u Bytes", tvb_reported_length_remaining(tvb, offset));
proto_tree_add_item(object_tree, hf_dnp3_unknown_data_chunk, tvb, offset, -1, ENC_NA);
offset = tvb_length(tvb); /* Finish decoding if unknown object is encountered... */
break;
}
@ -2909,7 +2920,7 @@ dissect_dnp3_al(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* If this packet is NOT the final Application Layer Message, exit and continue
processing the remaining data in the fragment. */
if (!(al_ctl & DNP3_AL_FIN)) {
t_robj = proto_tree_add_text(al_tree, tvb, offset, -1, "Buffering User Data Until Final Frame is Received..");
t_robj = proto_tree_add_expert(al_tree, pinfo, &ei_dnp3_buffering_user_data_until_final_frame_is_received, tvb, offset, -1);
return 1;
}
#endif
@ -3299,15 +3310,15 @@ dissect_dnp3_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
crc_OK = calc_crc == act_crc;
if (crc_OK)
{
proto_tree_add_text(al_tree, tvb, offset - (chk_size + 2), chk_size + 2,
"Application Chunk %u Len: %u CRC 0x%04x",
proto_tree_add_bytes_format(al_tree, hf_dnp3_application_chunk, tvb, offset - (chk_size + 2), chk_size + 2,
NULL, "Application Chunk %u Len: %u CRC 0x%04x",
i, chk_size, act_crc);
data_len -= chk_size;
}
else
{
proto_tree_add_text(al_tree, tvb, offset - (chk_size + 2), chk_size + 2,
"Application Chunk %u Len: %u Bad CRC got 0x%04x expected 0x%04x",
proto_tree_add_bytes_format(al_tree, hf_dnp3_application_chunk, tvb, offset - (chk_size + 2), chk_size + 2,
NULL, "Application Chunk %u Len: %u Bad CRC got 0x%04x expected 0x%04x",
i, chk_size, act_crc, calc_crc);
break;
}
@ -3407,7 +3418,7 @@ dissect_dnp3_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
{
/* CRC error - throw away the data. */
next_tvb = NULL;
proto_tree_add_text(dnp3_tree, tvb, 11, -1, "CRC failed, %u chunks", i);
proto_tree_add_expert_format(dnp3_tree, pinfo, &ei_dnp3_crc_failed, tvb, 11, -1, "CRC failed, %u chunks", i);
}
/* Dissect any completed Application Layer message */
@ -4468,7 +4479,21 @@ proto_register_dnp3(void)
{ "Reassembled DNP length", "dnp3.al.fragment.reassembled.length",
FT_UINT32, BASE_DEC, NULL, 0x0,
"The total length of the reassembled payload", HFILL }
}
},
/* Generated from convert_proto_tree_add_text.pl */
{ &hf_dnp3_al_point_index, { "Point Index", "dnp3.al.point_index", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_dnp3_al_da_value, { "Value", "dnp3.al.da.value", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_dnp3_al_count, { "Count", "dnp3.al.count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_dnp3_al_on_time, { "On Time", "dnp3.al.on_time", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_dnp3_al_off_time, { "Off Time", "dnp3.al.off_time", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_dnp3_al_time_delay, { "Time Delay", "dnp3.al.time_delay", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_dnp3_al_file_string_offset, { "File String Offset", "dnp3.al.file_string_offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_dnp3_al_file_string_length, { "File String Length", "dnp3.al.file_string_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_dnp3_al_file_name, { "File Name", "dnp3.al.file_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_dnp3_al_octet_string, { "Octet String", "dnp3.al.octet_string", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_dnp3_unknown_data_chunk, { "Unknown Data Chunk", "dnp3.al.unknown_data_chunk", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_dnp3_application_chunk, { "Application Chunk", "dnp.application_chunk", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
};
/* Setup protocol subtree array */
@ -4496,6 +4521,9 @@ proto_register_dnp3(void)
{ &ei_dnp_num_items_neg, { "dnp3.num_items_neg", PI_MALFORMED, PI_ERROR, "Negative number of items", EXPFILL }},
{ &ei_dnp_invalid_length, { "dnp3.invalid_length", PI_MALFORMED, PI_ERROR, "Invalid length", EXPFILL }},
{ &ei_dnp_iin_abnormal, { "dnp3.iin_abnormal", PI_PROTOCOL, PI_WARN, "IIN Abnormality", EXPFILL }},
/* Generated from convert_proto_tree_add_text.pl */
{ &ei_dnp3_buffering_user_data_until_final_frame_is_received, { "dnp3.buffering_user_data_until_final_frame_is_received", PI_PROTOCOL, PI_WARN, "Buffering User Data Until Final Frame is Received..", EXPFILL }},
{ &ei_dnp3_crc_failed, { "dnp.crc_failed", PI_PROTOCOL, PI_WARN, "CRC failed", EXPFILL }},
};
module_t *dnp3_module;
expert_module_t* expert_dnp3;

View File

@ -201,6 +201,10 @@ static int hf_l2tp_avp_framing_errors = -1;
static int hf_l2tp_cisco_remote_end_id = -1;
static int hf_l2tp_avp_tx_connect_speed_v3 = -1;
static int hf_l2tp_avp_rx_connect_speed_v3 = -1;
static int hf_l2tp_lapd_info = -1;
static int hf_l2tp_session_id = -1;
static int hf_l2tp_zero_length_bit_message = -1;
static int hf_l2tp_offset_padding = -1;
static dissector_table_t l2tp_vendor_avp_dissector_table;
@ -234,6 +238,9 @@ static gint ett_l2tp_lcp = -1;
static gint ett_l2tp_l2_spec = -1;
static expert_field ei_l2tp_incorrect_digest = EI_INIT;
/* Generated from convert_proto_tree_add_text.pl */
static expert_field ei_l2tp_vendor_specific_avp_data = EI_INIT;
static expert_field ei_l2tp_avp_length = EI_INIT;
static const enum_val_t l2tpv3_cookies[] = {
{"detect", "Detect", -1},
@ -1380,8 +1387,7 @@ static int dissect_l2tp_cisco_avps(tvbuff_t *tvb, packet_info *pinfo _U_, proto_
break;
default:
proto_tree_add_text(l2tp_avp_tree, tvb, offset,
avp_len-6, "Vendor-Specific AVP data");
proto_tree_add_expert(l2tp_avp_tree, pinfo, &ei_l2tp_vendor_specific_avp_data, tvb, offset, avp_len-6);
break;
}
offset += avp_len;
@ -1464,8 +1470,7 @@ dissect_l2tp_vnd_cablelabs_avps(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre
}
break;
default:
proto_tree_add_text(l2tp_avp_tree, tvb, offset,
avp_len, "Vendor-Specific AVP(not dissected yet)");
proto_tree_add_expert(l2tp_avp_tree, pinfo, &ei_l2tp_vendor_specific_avp_data, tvb, offset, avp_len);
break;
}
offset += avp_len;
@ -1511,8 +1516,7 @@ static void process_control_avps(tvbuff_t *tvb,
avp_type = tvb_get_ntohs(tvb, idx + 4);
if (avp_len < 6) {
proto_tree_add_text(l2tp_avp_tree ? l2tp_avp_tree : l2tp_tree, tvb, idx, 2,
"AVP length must be >= 6, got %u", avp_len);
proto_tree_add_expert_format(l2tp_avp_tree ? l2tp_avp_tree : l2tp_tree, pinfo, &ei_l2tp_avp_length, tvb, idx, 2, "AVP length must be >= 6, got %u", avp_len);
return;
}
@ -1546,9 +1550,9 @@ static void process_control_avps(tvbuff_t *tvb,
proto_tree_add_item(l2tp_avp_tree, hf_l2tp_avp_vendor_id, tvb, idx, 2, ENC_BIG_ENDIAN);
idx += 2;
proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2, "Type: %u", avp_type);
proto_tree_add_uint(l2tp_avp_tree, hf_l2tp_avp_type, tvb, idx, 2, avp_type);
idx += 2;
proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len-6, "Vendor-Specific AVP data");
proto_tree_add_expert(l2tp_avp_tree, pinfo, &ei_l2tp_vendor_specific_avp_data, tvb, idx, avp_len-6);
avp_len-=6;
}
idx += avp_len;
@ -1998,8 +2002,7 @@ static void process_control_avps(tvbuff_t *tvb,
}
default:
if(avp_len>0)
proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"AVP data not dissected yet");
proto_tree_add_expert(l2tp_avp_tree, pinfo, &ei_l2tp_vendor_specific_avp_data, tvb, idx, avp_len);
break;
}
@ -2150,7 +2153,7 @@ process_l2tpv3_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
break;
case L2TPv3_L2_SPECIFIC_LAPD:
if (tree)
proto_tree_add_text(tree, tvb, idx + cookie_len + 4, 3,"LAPD info");
proto_tree_add_item(tree, hf_l2tp_lapd_info, tvb, idx + cookie_len + 4, 3, ENC_NA);
next_tvb = tvb_new_subset_remaining(tvb, idx + cookie_len+4+3);
break;
case L2TPv3_L2_SPECIFIC_NONE:
@ -2255,23 +2258,19 @@ static void
process_l2tpv3_data_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
l2tpv3_conversation_t *l2tp_conv)
{
proto_tree *l2tp_tree = NULL;
proto_item *l2tp_item = NULL;
proto_tree *l2tp_tree;
proto_item *l2tp_item;
int idx = 0;
int sid;
sid = tvb_get_ntohl(tvb, idx);
if (tree) {
l2tp_item = proto_tree_add_item(tree, proto_l2tp, tvb, 0, -1, ENC_NA);
l2tp_tree = proto_item_add_subtree(l2tp_item, ett_l2tp);
proto_item_append_text(l2tp_item, " version 3");
l2tp_item = proto_tree_add_item(tree, proto_l2tp, tvb, 0, -1, ENC_NA);
l2tp_tree = proto_item_add_subtree(l2tp_item, ett_l2tp);
proto_item_append_text(l2tp_item, " version 3");
proto_tree_add_text(l2tp_tree, tvb, 0, 4,
"Packet Type: %s Session Id=%u",
data_msg, sid);
}
proto_tree_add_uint_format(l2tp_tree, hf_l2tp_session_id, tvb, 0, 4, sid, "Packet Type: %s Session Id=%u", data_msg, sid);
/* Call process_l2tpv3_data from Session ID (offset in idx of 0) */
process_l2tpv3_data(tvb, pinfo, tree, l2tp_tree, l2tp_item, &idx, l2tp_conv->tunnel);
@ -2397,7 +2396,7 @@ process_l2tpv3_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
}
if (tree && (LENGTH_BIT(control))&&(length==12)) {
proto_tree_add_text(l2tp_tree, tvb, 0, 0, "Zero Length Bit message");
proto_tree_add_item(l2tp_tree, hf_l2tp_zero_length_bit_message, tvb, 0, 0, ENC_NA);
} else {
avp_type = tvb_get_ntohs(tvb, idx + 4);
if (avp_type == CONTROL_MESSAGE) {
@ -2639,14 +2638,14 @@ dissect_l2tp_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
idx += 2;
if (offset_size != 0) {
if (tree) {
proto_tree_add_text(l2tp_tree, tvb, idx, offset_size, "Offset Padding");
proto_tree_add_item(l2tp_tree, hf_l2tp_offset_padding, tvb, idx, offset_size, ENC_NA);
}
idx += offset_size;
}
}
if (tree && (LENGTH_BIT(control))&&(length==12)) {
proto_tree_add_text(l2tp_tree, tvb, 0, 0, "Zero Length Bit message");
proto_tree_add_item(l2tp_tree, hf_l2tp_zero_length_bit_message, tvb, 0, 0, ENC_NA);
}
if (!CONTROL_BIT(control)) { /* Data Messages so we are done */
@ -3015,6 +3014,10 @@ proto_register_l2tp(void)
{ &hf_l2tp_avp_nonce, { "Nonce", "l2tp.avp.nonce", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_l2tp_avp_tx_connect_speed_v3, { "Tx Connect Speed v3", "l2tp.avp.tx_connect_speed_v3", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_l2tp_avp_rx_connect_speed_v3, { "Rx Connect Speed v3", "l2tp.avp.rx_connect_speed_v3", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_l2tp_lapd_info, { "LAPD info", "l2tp.lapd_info", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_l2tp_session_id, { "Packet Type", "l2tp.session_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_l2tp_zero_length_bit_message, { "Zero Length Bit message", "l2tp.zero_length_bit_message", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_l2tp_offset_padding, { "Offset Padding", "l2tp.offset_padding", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
};
static gint *ett[] = {
@ -3028,6 +3031,9 @@ proto_register_l2tp(void)
static ei_register_info ei[] = {
{ &ei_l2tp_incorrect_digest, { "l2tp.incorrect_digest", PI_CHECKSUM, PI_WARN, "Incorrect Digest", EXPFILL }},
/* Generated from convert_proto_tree_add_text.pl */
{ &ei_l2tp_vendor_specific_avp_data, { "l2tp.vendor_specific_avp_data", PI_UNDECODED, PI_WARN, "Vendor-Specific AVP data", EXPFILL }},
{ &ei_l2tp_avp_length, { "l2tp.avp_length.bad", PI_MALFORMED, PI_ERROR, "Bad AVP length", EXPFILL }},
};
module_t *l2tp_module;

View File

@ -36,6 +36,7 @@
#include "packet-gsm_a_common.h"
#include "lapd_sapi.h"
#include <epan/prefs.h>
#include <epan/expert.h>
#include "packet-rtp.h"
#include "packet-rtcp.h"
@ -133,7 +134,20 @@ static int hf_rsl_cstat_rx_octs = -1;
static int hf_rsl_cstat_lost_pkts = -1;
static int hf_rsl_cstat_ia_jitter = -1;
static int hf_rsl_cstat_avg_tx_dly = -1;
/* Generated from convert_proto_tree_add_text.pl */
static int hf_rsl_channel_description_tag = -1;
static int hf_rsl_mobile_allocation_tag = -1;
static int hf_rsl_no_resources_required = -1;
static int hf_rsl_llsdu_ccch = -1;
static int hf_rsl_llsdu_sacch = -1;
static int hf_rsl_llsdu = -1;
static int hf_rsl_rach_supplementary_information = -1;
static int hf_rsl_full_immediate_assign_info_field = -1;
static int hf_rsl_layer_3_message = -1;
static int hf_rsl_descriptive_group_or_broadcast_call_reference = -1;
static int hf_rsl_group_channel_description = -1;
static int hf_rsl_uic = -1;
static int hf_rsl_codec_list = -1;
/* Initialize the subtree pointers */
static int ett_rsl = -1;
@ -199,6 +213,10 @@ static int ett_ie_local_port = -1;
static int ett_ie_local_ip = -1;
static int ett_ie_rtp_payload = -1;
/* Generated from convert_proto_tree_add_text.pl */
static expert_field ei_rsl_speech_or_data_indicator = EI_INIT;
static expert_field ei_rsl_facility_information_element_3gpp_ts_44071 = EI_INIT;
static expert_field ei_rsl_embedded_message_tfo_configuration = EI_INIT;
static proto_tree *top_tree;
static dissector_handle_t gsm_cbch_handle;
@ -933,14 +951,14 @@ dissect_rsl_ie_ch_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, in
* length should be included.
* XXX Hmm a type 3 IE (TV).
*/
proto_tree_add_text(ie_tree, tvb, offset, 1, "Channel Description Tag");
proto_tree_add_item(ie_tree, hf_rsl_channel_description_tag, tvb, offset, 1, ENC_NA);
de_rr_ch_dsc(tvb, ie_tree, pinfo, offset+1, length, NULL, 0);
offset += 4;
/*
* The 3GPP TS 24.008 "Mobile Allocation" shall for compatibility reasons be
* included but empty, i.e. the length shall be zero.
*/
proto_tree_add_text(ie_tree, tvb, offset, 2, "Mobile Allocation Tag+Length(0)");
proto_tree_add_item(ie_tree, hf_rsl_mobile_allocation_tag, tvb, offset, 2, ENC_NA);
return ie_offset + length;
}
/*
@ -1083,11 +1101,11 @@ dissect_rsl_ie_ch_mode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
* If octet 4 indicates signalling then octet 6 is coded as follows:
* 0000 0000 No resources required
*/
proto_tree_add_text(ie_tree, tvb, offset, 1, "0 No resources required(All other values are reserved)");
proto_tree_add_item(ie_tree, hf_rsl_no_resources_required, tvb, offset, 1, ENC_NA);
break;
default:
/* Should not happen */
proto_tree_add_text(ie_tree, tvb, offset, 1, "Speech or data indicator != 1,2 or 3");
proto_tree_add_expert(ie_tree, pinfo, &ei_rsl_speech_or_data_indicator, tvb, offset, 1);
break;
}
@ -1285,14 +1303,14 @@ dissect_rsl_ie_L3_inf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
if (type == L3_INF_CCCH)
{
/* L3 PDUs carried on CCCH have L2 PSEUDO LENGTH octet or are RR Short PD format */
proto_tree_add_text(ie_tree, tvb, offset, length, "Link Layer Service Data Unit (L3 Message)(CCCH)");
proto_tree_add_item(ie_tree, hf_rsl_llsdu_ccch, tvb, offset, length, ENC_NA);
next_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector(gsm_a_ccch_handle, next_tvb, pinfo, top_tree);
}
else if (type == L3_INF_SACCH)
{
/* L3 PDUs carried on SACCH are normal format or are RR Short PD format */
proto_tree_add_text(ie_tree, tvb, offset, length, "Link Layer Service Data Unit (L3 Message)(SACCH)");
proto_tree_add_item(ie_tree, hf_rsl_llsdu_sacch, tvb, offset, length, ENC_NA);
next_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector(gsm_a_sacch_handle, next_tvb, pinfo, top_tree);
}
@ -1301,7 +1319,7 @@ dissect_rsl_ie_L3_inf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
/* Link Layer Service Data Unit (i.e. a layer 3 message
* as defined in 3GPP TS 24.008 or 3GPP TS 44.018)
*/
proto_tree_add_text(ie_tree, tvb, offset, length, "Link Layer Service Data Unit (L3 Message)");
proto_tree_add_item(ie_tree, hf_rsl_llsdu, tvb, offset, length, ENC_NA);
next_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector(gsm_a_dtap_handle, next_tvb, pinfo, top_tree);
}
@ -1554,7 +1572,7 @@ dissect_rsl_ie_rach_load(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
/* Supplementary Information */
if ( length > 0) {
proto_tree_add_text(ie_tree, tvb, offset, length , "Supplementary Information");
proto_tree_add_item(ie_tree, hf_rsl_rach_supplementary_information, tvb, offset, length, ENC_NA);
}
offset = ie_offset + length;
@ -2067,7 +2085,7 @@ dissect_rsl_ie_full_imm_ass_inf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
* IMMEDIATE ASSIGNMENT EXTENDED or IMMEDIATE ASSIGNMENT REJECT)
* as defined in 3GPP TS 44.018.
*/
proto_tree_add_text(ie_tree, tvb, offset, length, "Full Immediate Assign Info field");
proto_tree_add_item(ie_tree, hf_rsl_full_immediate_assign_info_field, tvb, offset, length, ENC_NA);
next_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector(gsm_a_ccch_handle, next_tvb, pinfo, top_tree);
@ -2223,7 +2241,7 @@ dissect_rsl_ie_full_bcch_inf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
* Octets 3-25 contain the complete L3 message as defined in 3GPP TS 44.018.
*/
proto_tree_add_text(ie_tree, tvb, offset, length, "Layer 3 message");
proto_tree_add_item(ie_tree, hf_rsl_layer_3_message, tvb, offset, length, ENC_NA);
next_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector(gsm_a_ccch_handle, next_tvb, pinfo, top_tree);
@ -2445,7 +2463,7 @@ dissect_rsl_ie_grp_call_ref(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
proto_tree_add_text(ie_tree, tvb, offset, length, "Descriptive group or broadcast call reference");
proto_tree_add_item(ie_tree, hf_rsl_descriptive_group_or_broadcast_call_reference, tvb, offset, length, ENC_NA);
/* The octets 3 to 7 are coded in the same way as the octets 2 to 6
* in the Descriptive group or broadcast call reference
@ -2484,7 +2502,7 @@ dissect_rsl_ie_ch_desc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
proto_tree_add_text(ie_tree, tvb, offset, length, "Group Channel Description");
proto_tree_add_item(ie_tree, hf_rsl_group_channel_description, tvb, offset, length, ENC_NA);
/* Octet j (j = 3, 4, ..., n) is the unchanged octet j-2 of a radio interface Group Channel description
* information element as defined in 3GPP TS 44.018, n-2 is equal to the length of the radio interface
@ -2643,7 +2661,7 @@ dissect_rsl_ie_uic(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int
/* Octet 3 bits 1 to 6 contain the radio interface octet 2 bits 3 to 8 of the
* UIC information element as defined in 3GPP TS 44.018.
*/
proto_tree_add_text(ie_tree, tvb, offset, 1, "UIC");
proto_tree_add_item(ie_tree, hf_rsl_uic, tvb, offset, 1, ENC_NA);
offset++;
return offset;
@ -2777,7 +2795,7 @@ dissect_rsl_ie_sup_codec_types(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
proto_tree_add_text(tree, tvb, offset, length, "Codec List");
proto_tree_add_item(tree, hf_rsl_codec_list, tvb, offset, length, ENC_NA);
/* The Codec List field (octet 4) lists the codec types that are supported
* by the BSS and Transcoder, and are therefore potential candidates for TFO
@ -2965,8 +2983,7 @@ dissect_rsl_ie_llp_apdu(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
* octets defined in 3GPP TS 44.071.
*/
/* TODO: Given traces with LLP data this IE could be further dissected */
proto_tree_add_text(tree, tvb, offset, length,
"Facility Information Element as defined in 3GPP TS 44.071");
proto_tree_add_expert(tree, pinfo, &ei_rsl_facility_information_element_3gpp_ts_44071, tvb, offset, length);
return ie_offset + length;
}
/*
@ -3009,8 +3026,7 @@ dissect_rsl_ie_tfo_transp_cont(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
* 3GPP TS 44.071 excluding the Facility IEI and length of Facility IEI
* octets defined in 3GPP TS 44.071.
*/
proto_tree_add_text(tree, tvb, offset, length,
"Embedded message that contains the TFO configuration");
proto_tree_add_expert(tree, pinfo, &ei_rsl_embedded_message_tfo_configuration, tvb, offset, length);
return ie_offset + length;
}
@ -4259,6 +4275,20 @@ void proto_register_rsl(void)
{ "Average Tx Delay", "gsm_abis_rsl.ipacc.cstat.avg_tx_delay",
FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
},
/* Generated from convert_proto_tree_add_text.pl */
{ &hf_rsl_channel_description_tag, { "Channel Description Tag", "gsm_abis_rsl.channel_description_tag", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_rsl_mobile_allocation_tag, { "Mobile Allocation Tag+Length(0)", "gsm_abis_rsl.mobile_allocation_tag", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_rsl_no_resources_required, { "0 No resources required(All other values are reserved)", "gsm_abis_rsl.no_resources_required", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_rsl_llsdu_ccch, { "Link Layer Service Data Unit (L3 Message)(CCCH)", "gsm_abis_rsl.llsdu.ccch", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_rsl_llsdu_sacch, { "Link Layer Service Data Unit (L3 Message)(SACCH)", "gsm_abis_rsl.llsdu.sacch)", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_rsl_llsdu, { "Link Layer Service Data Unit (L3 Message)", "gsm_abis_rsl.llsdu", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_rsl_rach_supplementary_information, { "Supplementary Information", "gsm_abis_rsl.supplementary_information", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_rsl_full_immediate_assign_info_field, { "Full Immediate Assign Info field", "gsm_abis_rsl.full_immediate_assign_info_field", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_rsl_layer_3_message, { "Layer 3 message", "gsm_abis_rsl.layer_3_message", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_rsl_descriptive_group_or_broadcast_call_reference, { "Descriptive group or broadcast call reference", "gsm_abis_rsl.descriptive_group_or_broadcast_call_reference", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_rsl_group_channel_description, { "Group Channel Description", "gsm_abis_rsl.group_channel_description", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_rsl_uic, { "UIC", "gsm_abis_rsl.uic", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_rsl_codec_list, { "Codec List", "gsm_abis_rsl.codec_list", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
};
static gint *ett[] = {
&ett_rsl,
@ -4324,7 +4354,15 @@ void proto_register_rsl(void)
&ett_ie_local_ip,
&ett_ie_rtp_payload,
};
static ei_register_info ei[] = {
/* Generated from convert_proto_tree_add_text.pl */
{ &ei_rsl_speech_or_data_indicator, { "gsm_abis_rsl.speech_or_data_indicator.bad", PI_PROTOCOL, PI_WARN, "Speech or data indicator != 1,2 or 3", EXPFILL }},
{ &ei_rsl_facility_information_element_3gpp_ts_44071, { "gsm_abis_rsl.facility_information_element_3gpp_ts_44071", PI_PROTOCOL, PI_NOTE, "Facility Information Element as defined in 3GPP TS 44.071", EXPFILL }},
{ &ei_rsl_embedded_message_tfo_configuration, { "gsm_abis_rsl.embedded_message_tfo_configuration", PI_PROTOCOL, PI_NOTE, "Embedded message that contains the TFO configuration", EXPFILL }},
};
module_t *rsl_module;
expert_module_t *expert_rsl;
#define RSL_ATT_TLVDEF(_attr, _type, _fixed_len) \
rsl_att_tlvdef.def[_attr].type = _type; \
@ -4410,6 +4448,8 @@ void proto_register_rsl(void)
proto_register_field_array(proto_rsl, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_rsl = expert_register_protocol(proto_rsl);
expert_register_field_array(expert_rsl, ei, array_length(ei));
new_register_dissector("gsm_abis_rsl", dissect_rsl, proto_rsl);

View File

@ -54,6 +54,7 @@
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
#include <epan/prefs.h>
#include <epan/asn1.h>
#include "packet-bssap.h"
@ -177,12 +178,23 @@ static int hf_uma_urr_UNC_tcp_port = -1;
static int hf_uma_urr_RTP_port = -1;
static int hf_uma_urr_RTCP_port = -1;
static int hf_uma_urr_RXLEV_NCELL = -1;
/* Generated from convert_proto_tree_add_text.pl */
static int hf_uma_access_control_class_n = -1;
static int hf_uma_data = -1;
/* Initialize the subtree pointers */
static int ett_uma = -1;
static int ett_uma_toc = -1;
static int ett_urr_ie = -1;
/* Generated from convert_proto_tree_add_text.pl */
static expert_field ei_uma_fqdn_not_present = EI_INIT;
static expert_field ei_uma_wrong_message_type = EI_INIT;
static expert_field ei_uma_unknown_protocol = EI_INIT;
static expert_field ei_uma_skip_this_message = EI_INIT;
static expert_field ei_uma_cbs_frames = EI_INIT;
static expert_field ei_uma_unknown_format = EI_INIT;
/* The dynamic payload type which will be dissected as uma */
static range_t *global_uma_tcp_port_range;
@ -911,7 +923,7 @@ dissect_uma_IE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
ie_offset++;
proto_tree_add_item(urr_ie_tree, hf_uma_urr_radio_id, tvb, ie_offset, ie_len-1, ENC_NA);
}else{
proto_tree_add_text(urr_ie_tree, tvb, ie_offset, ie_len,"Unknown format");
proto_tree_add_expert(urr_ie_tree, pinfo, &ei_uma_unknown_format, tvb, ie_offset, ie_len);
}
break;
case 4:
@ -969,10 +981,9 @@ dissect_uma_IE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
break;
case 10: /* UNC SGW Fully Qualified Domain/Host Name */
if ( ie_len > 0){
string = (gchar*)tvb_get_string_enc(wmem_packet_scope(), tvb, ie_offset, ie_len, ENC_ASCII);
proto_tree_add_string(urr_ie_tree, hf_uma_urr_FQDN, tvb, ie_offset, ie_len, string);
proto_tree_add_item(urr_ie_tree, hf_uma_urr_FQDN, tvb, ie_offset, ie_len, ENC_ASCII|ENC_NA);
}else{
proto_tree_add_text(urr_ie_tree,tvb,offset,1,"FQDN not present");
proto_tree_add_expert(urr_ie_tree, pinfo, &ei_uma_fqdn_not_present, tvb, offset, 1);
}
break;
case 11: /* Redirection Counter */
@ -1013,7 +1024,7 @@ dissect_uma_IE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* PS HO, PS Handover indicator (octet 6) Bit 6 */
ie_offset++;
proto_tree_add_text(urr_ie_tree,tvb,ie_offset,2,"Access Control Class N");
proto_tree_add_item(urr_ie_tree, hf_uma_access_control_class_n, tvb, ie_offset, 2, ENC_NA);
/* These fields are specified and described in 3GPP TS 44.018 and 3GPP TS 22.011. */
break;
case 15:
@ -1362,7 +1373,7 @@ dissect_uma_IE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* 11.2.72 Broadcast Container */
proto_tree_add_item(urr_ie_tree, hf_uma_urr_num_of_cbs_frms , tvb, ie_offset, 1, ENC_BIG_ENDIAN);
/* The coding of the page of the CBS message is defined in sub-clause 9.4.1 in TS 23.041. */
proto_tree_add_text(urr_ie_tree, tvb, ie_offset + 1, ie_len-1,"CBS Frames - Not decoded");
proto_tree_add_expert(urr_ie_tree, pinfo, &ei_uma_cbs_frames, tvb, ie_offset + 1, ie_len-1);
break;
case 73:
/* 11.2.73 3G Cell Identity */
@ -1404,7 +1415,7 @@ dissect_uma_IE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
/* 11.2.94 CTC Modification Ack List */
case 95:
/* 11.2.95 CTC Modification Ack Description */
proto_tree_add_text(urr_ie_tree,tvb,ie_offset,ie_len,"DATA");
proto_tree_add_item(urr_ie_tree, hf_uma_data, tvb, ie_offset, ie_len, ENC_NA);
break;
case 96: /* MS Radio Identity */
proto_tree_add_item(urr_ie_tree, hf_uma_urr_radio_type_of_id, tvb, ie_offset, 1, ENC_BIG_ENDIAN);
@ -1413,7 +1424,7 @@ dissect_uma_IE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
ie_offset++;
proto_tree_add_item(urr_ie_tree, hf_uma_urr_ms_radio_id, tvb, ie_offset, ie_len-1, ENC_NA);
}else{
proto_tree_add_text(urr_ie_tree, tvb, ie_offset, ie_len,"Unknown format");
proto_tree_add_expert(urr_ie_tree, pinfo, &ei_uma_unknown_format, tvb, ie_offset, ie_len);
}
break;
@ -1438,7 +1449,7 @@ dissect_uma_IE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
string = (gchar*)tvb_get_string_enc(wmem_packet_scope(), tvb, ie_offset, ie_len, ENC_ASCII);
proto_tree_add_string(urr_ie_tree, hf_uma_unc_FQDN, tvb, ie_offset, ie_len, string);
}else{
proto_tree_add_text(urr_ie_tree,tvb,offset,1,"UNC FQDN not present");
proto_tree_add_expert(urr_ie_tree, pinfo, &ei_uma_fqdn_not_present, tvb, offset, 1);
}
break;
case 99:
@ -1523,7 +1534,7 @@ dissect_uma_IE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
proto_tree_add_item(urr_ie_tree, hf_uma_urr_RTP_port, tvb, ie_offset, 2, ENC_BIG_ENDIAN);
/* TODO find out exactly which element contains IP addr */
/* Debug
proto_tree_add_text(urr_ie_tree,tvb,ie_offset,ie_len,"IP %u, Port %u,
proto_tree_add_debug_text(urr_ie_tree,tvb,ie_offset,ie_len,"IP %u, Port %u,
rtp_ipv4_address,RTP_UDP_port);
*/
if(unc_ipv4_address!=0){
@ -1600,7 +1611,7 @@ dissect_uma_IE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
case 126:
/* 11.2.107 CN Domains to Handover */
default:
proto_tree_add_text(urr_ie_tree,tvb,ie_offset,ie_len,"DATA");
proto_tree_add_item(urr_ie_tree, hf_uma_data, tvb, ie_offset, ie_len, ENC_NA);
break;
}
offset = offset + ie_len;
@ -1615,6 +1626,7 @@ dissect_uma(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
int offset = 0;
guint8 octet, pd;
guint16 msg_len;
proto_item* pd_item;
/* Set up structures needed to add the protocol subtree and manage it */
proto_item *ti;
@ -1635,11 +1647,11 @@ dissect_uma(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
pd = octet & 0x0f;
proto_tree_add_item(uma_tree, hf_uma_skip_ind, tvb, offset, 1, ENC_BIG_ENDIAN);
if ((octet & 0xf0) != 0 ){
proto_tree_add_text(uma_tree, tvb,offset,-1,"Skip this message");
proto_tree_add_expert(uma_tree, pinfo, &ei_uma_skip_this_message, tvb, offset, -1);
return tvb_reported_length(tvb);
}
proto_tree_add_item(uma_tree, hf_uma_pd, tvb, offset, 1, ENC_BIG_ENDIAN);
pd_item = proto_tree_add_item(uma_tree, hf_uma_pd, tvb, offset, 1, ENC_BIG_ENDIAN);
switch ( pd ){
case 0: /* URR_C */
case 1: /* URR */
@ -1667,7 +1679,7 @@ dissect_uma(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
}
break;
default:
proto_tree_add_text(uma_tree, tvb,offset,-1,"Unknown protocol %u",pd);
expert_add_info(pinfo, pd_item, &ei_uma_unknown_protocol);
break;
}
@ -1696,6 +1708,7 @@ dissect_uma_urlc_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
int offset = 0;
guint8 octet;
guint16 msg_len;
proto_item* msg_item;
/* Set up structures needed to add the protocol subtree and manage it */
proto_item *ti;
@ -1709,7 +1722,7 @@ dissect_uma_urlc_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
uma_tree = proto_item_add_subtree(ti, ett_uma);
octet = tvb_get_guint8(tvb,offset);
proto_tree_add_item(uma_tree, hf_uma_urlc_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN);
msg_item = proto_tree_add_item(uma_tree, hf_uma_urlc_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN);
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",val_to_str_ext(octet, &uma_urlc_msg_type_vals_ext, "Unknown URLC (%u)"));
col_set_fence(pinfo->cinfo,COL_INFO);
msg_len = tvb_reported_length_remaining(tvb,offset) - 1;
@ -1730,7 +1743,7 @@ dissect_uma_urlc_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
}
return offset;
default:
proto_tree_add_text(uma_tree, tvb,offset,-1,"Wrong message type %u",octet);
expert_add_info(pinfo, msg_item, &ei_uma_wrong_message_type);
return tvb_reported_length(tvb);
}
@ -2265,6 +2278,9 @@ proto_register_uma(void)
FT_UINT8,BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
/* Generated from convert_proto_tree_add_text.pl */
{ &hf_uma_access_control_class_n, { "Access Control Class N", "uma.access_control_class_n", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_uma_data, { "DATA", "uma.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
};
/* Setup protocol subtree array */
@ -2274,6 +2290,18 @@ proto_register_uma(void)
&ett_urr_ie,
};
static ei_register_info ei[] = {
/* Generated from convert_proto_tree_add_text.pl */
{ &ei_uma_unknown_format, { "uma.unknown_format", PI_PROTOCOL, PI_WARN, "Unknown format", EXPFILL }},
{ &ei_uma_fqdn_not_present, { "uma.fqdn_not_present", PI_PROTOCOL, PI_NOTE, "FQDN not present", EXPFILL }},
{ &ei_uma_cbs_frames, { "uma.cbs_frames", PI_UNDECODED, PI_WARN, "CBS Frames - Not decoded", EXPFILL }},
{ &ei_uma_skip_this_message, { "uma.skip_this_message", PI_PROTOCOL, PI_NOTE, "Skip this message", EXPFILL }},
{ &ei_uma_unknown_protocol, { "uma.unknown_protocol", PI_PROTOCOL, PI_WARN, "Unknown protocol", EXPFILL }},
{ &ei_uma_wrong_message_type, { "uma.wrong_message_type", PI_PROTOCOL, PI_WARN, "Wrong message type", EXPFILL }},
};
expert_module_t *expert_uma;
/* Register the protocol name and description */
proto_uma = proto_register_protocol("Unlicensed Mobile Access","UMA", "uma");
/* subdissector code */
@ -2283,6 +2311,8 @@ proto_register_uma(void)
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_uma, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_uma = expert_register_protocol(proto_uma);
expert_register_field_array(expert_uma, ei, array_length(ei));
/* Register a configuration option for port */
uma_module = prefs_register_protocol(proto_uma, proto_reg_handoff_uma);