highlight only the actual bytes of EIT, SDT, TDT, TOT and BAT

minor whitespace cleanup
skip initialization and 'if (tree)' where it's not required

svn path=/trunk/; revision=44761
This commit is contained in:
Martin Kaiser 2012-09-03 21:18:50 +00:00
parent 2558013747
commit 677d843489
5 changed files with 16 additions and 24 deletions

View File

@ -104,17 +104,14 @@ dissect_dvb_bat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint offset = 0, length = 0, descriptor_end = 0, ts_loop_end = 0;
guint16 ts_id = 0, descriptor_len = 0, ts_loop_len = 0;
proto_item *ti = NULL;
proto_tree *dvb_bat_tree = NULL;
proto_item *tsi = NULL;
proto_tree *transport_stream_tree = NULL;
proto_item *ti;
proto_tree *dvb_bat_tree;
proto_item *tsi;
proto_tree *transport_stream_tree;
col_clear(pinfo->cinfo, COL_INFO);
col_set_str(pinfo->cinfo, COL_INFO, "Bouquet Association Table (BAT)");
if (!tree)
return;
ti = proto_tree_add_item(tree, proto_dvb_bat, tvb, offset, -1, ENC_NA);
dvb_bat_tree = proto_item_add_subtree(ti, ett_dvb_bat);
@ -172,7 +169,8 @@ dissect_dvb_bat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += proto_mpeg_descriptor_dissect(tvb, offset, transport_stream_tree);
}
packet_mpeg_sect_crc(tvb, pinfo, dvb_bat_tree, 0, offset);
offset += packet_mpeg_sect_crc(tvb, pinfo, dvb_bat_tree, 0, offset);
proto_item_set_len(ti, offset);
}

View File

@ -112,9 +112,6 @@ dissect_dvb_eit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_INFO, "Event Information Table (EIT)");
if (!tree)
return;
ti = proto_tree_add_item(tree, proto_dvb_eit, tvb, offset, -1, ENC_NA);
dvb_eit_tree = proto_item_add_subtree(ti, ett_dvb_eit);
@ -195,7 +192,8 @@ dissect_dvb_eit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
packet_mpeg_sect_crc(tvb, pinfo, dvb_eit_tree, 0, offset);
offset += packet_mpeg_sect_crc(tvb, pinfo, dvb_eit_tree, 0, offset);
proto_item_set_len(ti, offset);
}

View File

@ -102,7 +102,7 @@ dissect_dvb_sdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint offset = 0, length = 0;
guint descriptor_len, descriptor_end;
guint descriptor_len, descriptor_end;
guint16 svc_id;
proto_item *ti;
@ -114,9 +114,6 @@ dissect_dvb_sdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_INFO, "Service Description Table (SDT)");
if (!tree)
return;
ti = proto_tree_add_item(tree, proto_dvb_sdt, tvb, offset, -1, ENC_NA);
dvb_sdt_tree = proto_item_add_subtree(ti, ett_dvb_sdt);
@ -174,7 +171,8 @@ dissect_dvb_sdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
packet_mpeg_sect_crc(tvb, pinfo, dvb_sdt_tree, 0, offset);
offset += packet_mpeg_sect_crc(tvb, pinfo, dvb_sdt_tree, 0, offset);
proto_item_set_len(ti, offset);
}

View File

@ -52,9 +52,6 @@ dissect_dvb_tdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_INFO, "Time and Date Table (TDT)");
if (!tree)
return;
ti = proto_tree_add_item(tree, proto_dvb_tdt, tvb, offset, -1, ENC_NA);
dvb_tdt_tree = proto_item_add_subtree(ti, ett_dvb_tdt);
@ -66,6 +63,9 @@ dissect_dvb_tdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_time_format(dvb_tdt_tree, hf_dvb_tdt_utc_time, tvb, offset, 5, &utc_time,
"UTC Time : %s UTC", abs_time_to_str(&utc_time, ABSOLUTE_TIME_UTC, FALSE));
}
offset += 5;
proto_item_set_len(ti, offset);
}

View File

@ -60,9 +60,6 @@ dissect_dvb_tot(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_INFO, "Time Offset Table (TOT)");
if (!tree)
return;
ti = proto_tree_add_item(tree, proto_dvb_tot, tvb, offset, -1, ENC_NA);
dvb_tot_tree = proto_item_add_subtree(ti, ett_dvb_tot);
@ -86,7 +83,8 @@ dissect_dvb_tot(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
while (offset < descriptor_end)
offset += proto_mpeg_descriptor_dissect(tvb, offset, dvb_tot_tree);
packet_mpeg_sect_crc(tvb, pinfo, dvb_tot_tree, 0, offset);
offset += packet_mpeg_sect_crc(tvb, pinfo, dvb_tot_tree, 0, offset);
proto_item_set_len(ti, offset);
}