forked from osmocom/wireshark
Minor cleanup:
col_clear() not required; unneeded initializers; whitespace. svn path=/trunk/; revision=43992
This commit is contained in:
parent
7d900f7450
commit
2516627cd5
|
@ -98,18 +98,18 @@ static void
|
|||
dissect_dvb_eit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||
{
|
||||
|
||||
guint offset = 0, length = 0, descriptor_end = 0;
|
||||
guint16 evt_id = 0, descriptor_len = 0;
|
||||
guint offset = 0, length = 0;
|
||||
guint descriptor_len, descriptor_end;
|
||||
guint16 evt_id;
|
||||
|
||||
proto_item *ti = NULL;
|
||||
proto_tree *dvb_eit_tree = NULL;
|
||||
proto_item *ei = NULL;
|
||||
proto_tree *dvb_eit_event_tree = NULL;
|
||||
proto_item *duration_item = NULL;
|
||||
proto_item *ti;
|
||||
proto_tree *dvb_eit_tree;
|
||||
proto_item *ei;
|
||||
proto_tree *dvb_eit_event_tree;
|
||||
proto_item *duration_item;
|
||||
|
||||
nstime_t start_time;
|
||||
nstime_t start_time;
|
||||
|
||||
col_clear(pinfo->cinfo, COL_INFO);
|
||||
col_set_str(pinfo->cinfo, COL_INFO, "Event Information Table (EIT)");
|
||||
|
||||
if (!tree)
|
||||
|
@ -121,34 +121,35 @@ dissect_dvb_eit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
offset += packet_mpeg_sect_header(tvb, offset, dvb_eit_tree, &length, NULL);
|
||||
length -= 4;
|
||||
|
||||
proto_tree_add_item(dvb_eit_tree, hf_dvb_eit_service_id, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_eit_tree, hf_dvb_eit_service_id, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
proto_tree_add_item(dvb_eit_tree, hf_dvb_eit_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_eit_tree, hf_dvb_eit_version_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_eit_tree, hf_dvb_eit_current_next_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset++;
|
||||
proto_tree_add_item(dvb_eit_tree, hf_dvb_eit_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_eit_tree, hf_dvb_eit_version_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_eit_tree, hf_dvb_eit_current_next_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
proto_tree_add_item(dvb_eit_tree, hf_dvb_eit_section_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset++;
|
||||
proto_tree_add_item(dvb_eit_tree, hf_dvb_eit_section_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
proto_tree_add_item(dvb_eit_tree, hf_dvb_eit_last_section_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset++;
|
||||
proto_tree_add_item(dvb_eit_tree, hf_dvb_eit_last_section_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
proto_tree_add_item(dvb_eit_tree, hf_dvb_eit_transport_stream_id, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_eit_tree, hf_dvb_eit_transport_stream_id, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
proto_tree_add_item(dvb_eit_tree, hf_dvb_eit_original_network_id, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_eit_tree, hf_dvb_eit_original_network_id, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
proto_tree_add_item(dvb_eit_tree, hf_dvb_eit_segment_last_section_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset++;
|
||||
offset += 1;
|
||||
|
||||
proto_tree_add_item(dvb_eit_tree, hf_dvb_eit_last_table_id, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset++;
|
||||
offset += 1;
|
||||
|
||||
if (offset >= length) {
|
||||
packet_mpeg_sect_crc(tvb, pinfo, dvb_eit_tree, 0, offset);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -166,7 +167,9 @@ dissect_dvb_eit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
if (packet_mpeg_sect_mjd_to_utc_time(tvb, offset, &start_time) < 0) {
|
||||
proto_tree_add_text(tree, tvb, offset, 5, "Unparseable time");
|
||||
} else {
|
||||
proto_tree_add_time_format(dvb_eit_event_tree, hf_dvb_eit_start_time, tvb, offset, 5, &start_time, "Start Time: %s UTC", abs_time_to_str(&start_time, ABSOLUTE_TIME_UTC, FALSE));
|
||||
proto_tree_add_time_format(dvb_eit_event_tree, hf_dvb_eit_start_time, tvb, offset,
|
||||
5, &start_time,
|
||||
"Start Time: %s UTC", abs_time_to_str(&start_time, ABSOLUTE_TIME_UTC, FALSE));
|
||||
}
|
||||
} else {
|
||||
proto_tree_add_text(tree, tvb, offset, 5, "Start Time: Undefined (0xFFFFFFFFFF)");
|
||||
|
@ -180,8 +183,8 @@ dissect_dvb_eit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
MPEG_SECT_BCD44_TO_DEC(tvb_get_guint8(tvb, offset + 2)));
|
||||
offset += 3;
|
||||
|
||||
proto_tree_add_item(dvb_eit_event_tree, hf_dvb_eit_running_status, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_eit_event_tree, hf_dvb_eit_free_ca_mode, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_eit_event_tree, hf_dvb_eit_running_status, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_eit_event_tree, hf_dvb_eit_free_ca_mode, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_eit_event_tree, hf_dvb_eit_descriptors_loop_length, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
descriptor_len = tvb_get_ntohs(tvb, offset) & DVB_EIT_DESCRIPTORS_LOOP_LENGTH_MASK;
|
||||
offset += 2;
|
||||
|
|
|
@ -81,16 +81,16 @@ static void
|
|||
dissect_dvb_nit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||
{
|
||||
|
||||
guint offset = 0, descriptor_end = 0, ts_end = 0;
|
||||
guint offset = 0;
|
||||
guint ts_desc_len, descriptor_end, ts_end;
|
||||
|
||||
guint16 tsid = 0, ts_desc_len = 0;
|
||||
guint16 tsid;
|
||||
|
||||
proto_item *ti = NULL;
|
||||
proto_tree *dvb_nit_tree = NULL;
|
||||
proto_item *tsi = NULL;
|
||||
proto_tree *dvb_nit_ts_tree = NULL;
|
||||
proto_item *ti;
|
||||
proto_tree *dvb_nit_tree;
|
||||
proto_item *tsi;
|
||||
proto_tree *dvb_nit_ts_tree;
|
||||
|
||||
col_clear(pinfo->cinfo, COL_INFO);
|
||||
col_set_str(pinfo->cinfo, COL_INFO, "Network Information Table (NIT)");
|
||||
|
||||
if (!tree)
|
||||
|
@ -101,21 +101,21 @@ dissect_dvb_nit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
offset += packet_mpeg_sect_header(tvb, offset, dvb_nit_tree, NULL, NULL);
|
||||
|
||||
proto_tree_add_item(dvb_nit_tree, hf_dvb_nit_network_id, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_nit_tree, hf_dvb_nit_network_id, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
proto_tree_add_item(dvb_nit_tree, hf_dvb_nit_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_nit_tree, hf_dvb_nit_version_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_nit_tree, hf_dvb_nit_current_next_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset++;
|
||||
proto_tree_add_item(dvb_nit_tree, hf_dvb_nit_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_nit_tree, hf_dvb_nit_version_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_nit_tree, hf_dvb_nit_current_next_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
proto_tree_add_item(dvb_nit_tree, hf_dvb_nit_section_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset++;
|
||||
proto_tree_add_item(dvb_nit_tree, hf_dvb_nit_section_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
proto_tree_add_item(dvb_nit_tree, hf_dvb_nit_last_section_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset++;
|
||||
proto_tree_add_item(dvb_nit_tree, hf_dvb_nit_last_section_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
proto_tree_add_item(dvb_nit_tree, hf_dvb_nit_reserved2, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_nit_tree, hf_dvb_nit_reserved2, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_nit_tree, hf_dvb_nit_network_descriptors_length, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
descriptor_end = offset + (tvb_get_ntohs(tvb, offset) & DVB_NIT_NETWORK_DESCRIPTORS_LENGTH_MASK);
|
||||
offset += 2;
|
||||
|
@ -123,7 +123,7 @@ dissect_dvb_nit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
while (offset < descriptor_end)
|
||||
offset += proto_mpeg_descriptor_dissect(tvb, offset, dvb_nit_tree);
|
||||
|
||||
proto_tree_add_item(dvb_nit_tree, hf_dvb_nit_reserved3, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_nit_tree, hf_dvb_nit_reserved3, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_nit_tree, hf_dvb_nit_transport_stream_loop_length, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
ts_end = offset + (tvb_get_ntohs(tvb, offset) & DVB_NIT_TRANSPORT_STREAM_LOOP_LENGTH_MASK);
|
||||
offset += 2;
|
||||
|
@ -141,7 +141,7 @@ dissect_dvb_nit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
proto_tree_add_item(dvb_nit_ts_tree, hf_dvb_nit_original_network_id, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
proto_tree_add_item(dvb_nit_ts_tree, hf_dvb_nit_reserved4, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_nit_ts_tree, hf_dvb_nit_reserved4, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_nit_ts_tree, hf_dvb_nit_transport_descriptors_length, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
descriptor_end = offset + (tvb_get_ntohs(tvb, offset) & DVB_NIT_TRANSPORT_DESCRIPTORS_LENGTH_MASK);
|
||||
offset += 2;
|
||||
|
|
|
@ -101,17 +101,17 @@ static void
|
|||
dissect_dvb_sdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||
{
|
||||
|
||||
guint offset = 0, length = 0, descriptor_end = 0;
|
||||
guint16 svc_id = 0, descriptor_len = 0;
|
||||
guint offset = 0, length = 0;
|
||||
guint descriptor_len, descriptor_end;
|
||||
guint16 svc_id;
|
||||
|
||||
proto_item *ti = NULL;
|
||||
proto_tree *dvb_sdt_tree = NULL;
|
||||
proto_item *si = NULL;
|
||||
proto_tree *dvb_sdt_service_tree = NULL;
|
||||
proto_item *ti;
|
||||
proto_tree *dvb_sdt_tree;
|
||||
proto_item *si;
|
||||
proto_tree *dvb_sdt_service_tree;
|
||||
|
||||
/* The TVB should start right after the section_length in the Section packet */
|
||||
|
||||
col_clear(pinfo->cinfo, COL_INFO);
|
||||
col_set_str(pinfo->cinfo, COL_INFO, "Service Description Table (SDT)");
|
||||
|
||||
if (!tree)
|
||||
|
@ -123,25 +123,25 @@ dissect_dvb_sdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
offset += packet_mpeg_sect_header(tvb, offset, dvb_sdt_tree, &length, NULL);
|
||||
length -= 4;
|
||||
|
||||
proto_tree_add_item(dvb_sdt_tree, hf_dvb_sdt_transport_stream_id, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_sdt_tree, hf_dvb_sdt_transport_stream_id, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
proto_tree_add_item(dvb_sdt_tree, hf_dvb_sdt_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_sdt_tree, hf_dvb_sdt_version_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_sdt_tree, hf_dvb_sdt_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_sdt_tree, hf_dvb_sdt_version_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_sdt_tree, hf_dvb_sdt_current_next_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset++;
|
||||
offset += 1;
|
||||
|
||||
proto_tree_add_item(dvb_sdt_tree, hf_dvb_sdt_section_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset++;
|
||||
proto_tree_add_item(dvb_sdt_tree, hf_dvb_sdt_section_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
proto_tree_add_item(dvb_sdt_tree, hf_dvb_sdt_last_section_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset++;
|
||||
proto_tree_add_item(dvb_sdt_tree, hf_dvb_sdt_last_section_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
proto_tree_add_item(dvb_sdt_tree, hf_dvb_sdt_original_network_id, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_sdt_tree, hf_dvb_sdt_original_network_id, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
proto_tree_add_item(dvb_sdt_tree, hf_dvb_sdt_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset++;
|
||||
proto_tree_add_item(dvb_sdt_tree, hf_dvb_sdt_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
|
||||
if (offset >= length)
|
||||
|
@ -154,17 +154,17 @@ dissect_dvb_sdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
si = proto_tree_add_text(dvb_sdt_tree, tvb, offset, 5, "Service 0x%04hx", svc_id);
|
||||
dvb_sdt_service_tree = proto_item_add_subtree(si, ett_dvb_sdt_service);
|
||||
|
||||
proto_tree_add_item(dvb_sdt_service_tree, hf_dvb_sdt_service_id, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_sdt_service_tree, hf_dvb_sdt_service_id, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
proto_tree_add_item(dvb_sdt_service_tree, hf_dvb_sdt_reserved3, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_sdt_service_tree, hf_dvb_sdt_eit_schedule_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_sdt_service_tree, hf_dvb_sdt_reserved3, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_sdt_service_tree, hf_dvb_sdt_eit_schedule_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_sdt_service_tree, hf_dvb_sdt_eit_present_following_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset++;
|
||||
offset += 1;
|
||||
|
||||
proto_tree_add_item(dvb_sdt_service_tree, hf_dvb_sdt_running_status, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_sdt_service_tree, hf_dvb_sdt_free_ca_mode, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_sdt_service_tree, hf_dvb_sdt_descriptors_loop_length, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_sdt_service_tree, hf_dvb_sdt_running_status, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_sdt_service_tree, hf_dvb_sdt_free_ca_mode, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(dvb_sdt_service_tree, hf_dvb_sdt_descriptors_loop_length, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
descriptor_len = tvb_get_ntohs(tvb, offset) & DVB_SDT_DESCRIPTORS_LOOP_LENGTH_MASK;
|
||||
offset += 2;
|
||||
|
||||
|
|
|
@ -45,12 +45,11 @@ dissect_dvb_tdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
guint offset = 0;
|
||||
|
||||
proto_item *ti = NULL;
|
||||
proto_tree *dvb_tdt_tree = NULL;
|
||||
proto_item *ti;
|
||||
proto_tree *dvb_tdt_tree;
|
||||
|
||||
nstime_t utc_time;
|
||||
nstime_t utc_time;
|
||||
|
||||
col_clear(pinfo->cinfo, COL_INFO);
|
||||
col_set_str(pinfo->cinfo, COL_INFO, "Time and Date Table (TDT)");
|
||||
|
||||
if (!tree)
|
||||
|
|
|
@ -50,14 +50,14 @@ static void
|
|||
dissect_dvb_tot(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||
{
|
||||
|
||||
guint offset = 0, descriptor_len = 0, descriptor_end = 0;
|
||||
guint offset = 0;
|
||||
guint descriptor_len, descriptor_end;
|
||||
|
||||
proto_item *ti = NULL;
|
||||
proto_tree *dvb_tot_tree = NULL;
|
||||
proto_item *ti;
|
||||
proto_tree *dvb_tot_tree;
|
||||
|
||||
nstime_t utc_time;
|
||||
nstime_t utc_time;
|
||||
|
||||
col_clear(pinfo->cinfo, COL_INFO);
|
||||
col_set_str(pinfo->cinfo, COL_INFO, "Time Offset Table (TOT)");
|
||||
|
||||
if (!tree)
|
||||
|
|
Loading…
Reference in New Issue