DVB-S2: Store whether low roll-off values are used in conversation data

It's possible to have a capture that has multiple DVB-S2[X] streams
on different UDP or RTP ports that use different roll-off values.
Store the information about whether we've transitioned into the
lower roll-off range in conversation data instead of in a global.
This commit is contained in:
John Thacker 2022-05-10 23:16:27 -04:00 committed by A Wireshark GitLab Utility
parent 3e7ea95108
commit 74082386de
1 changed files with 33 additions and 10 deletions

View File

@ -312,8 +312,6 @@ static const fragment_items dvb_s2_gse_frag_items = {
"DVB-S2 GSE fragments"
};
static unsigned char _use_low_rolloff_value = 0;
/* Offset in SYNC MARKER */
#define DVB_S2_OFFS_SYNCBYTE 0
@ -1040,6 +1038,31 @@ virtual_stream_init(void)
virtual_stream_count = 1;
}
/* Data that is associated with a receiver at the BBFrame level, stored
* at the conversation level. The Transmission Roll-off factor applies
* for all ISI in a Multiple Input Stream Configuration (see ETSI EN
* 302 307-2, clause 5.1.6 "Base-Band Header insertion".) Upon first
* detection of '11' for the RO value, receiver will switch to low
* roll-off range for the entire conversation.
*/
typedef struct {
guint32 use_low_ro;
} dvbs2_bb_conv_data;
static dvbs2_bb_conv_data *
get_dvbs2_bb_conv_data(conversation_t *conv)
{
dvbs2_bb_conv_data *bb_data;
bb_data = (dvbs2_bb_conv_data *)conversation_get_proto_data(conv, proto_dvb_s2_bb);
if (!bb_data) {
bb_data = wmem_new0(wmem_file_scope(), dvbs2_bb_conv_data);
conversation_add_proto_data(conv, proto_dvb_s2_bb, bb_data);
}
return bb_data;
}
/* Data that is associated with one BBFrame, used by GSE or TS packets
* contained within it. Lifetime of the packet.
*/
@ -1472,6 +1495,7 @@ static int dissect_dvb_s2_bb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
stream_t *ts_stream;
stream_pdu_fragment_t *ts_frag;
fragment_head *fd_head;
dvbs2_bb_conv_data *conv_data;
dvbs2_bb_data *pdata;
gboolean npd, composite_init = FALSE;
@ -1503,6 +1527,8 @@ static int dissect_dvb_s2_bb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
NULL
};
conv = find_or_create_conversation(pinfo);
col_append_str(pinfo->cinfo, COL_PROTOCOL, "BB ");
col_append_str(pinfo->cinfo, COL_INFO, "Baseband ");
@ -1519,13 +1545,12 @@ static int dissect_dvb_s2_bb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
issyi = (matype1 & DVB_S2_BB_ISSYI_MASK) >> DVB_S2_BB_ISSYI_POS;
npd = (matype1 & DVB_S2_BB_NPD_MASK) >> DVB_S2_BB_NPD_POS;
if ((pinfo->fd->num == 1) && (_use_low_rolloff_value != 0)) {
_use_low_rolloff_value = 0;
conv_data = get_dvbs2_bb_conv_data(conv);
if (((matype1 & DVB_S2_BB_RO_MASK) == 3) && !conv_data->use_low_ro) {
conv_data->use_low_ro = pinfo->num;
}
if (((matype1 & DVB_S2_BB_RO_MASK) == 3) && !_use_low_rolloff_value) {
_use_low_rolloff_value = 1;
}
if (_use_low_rolloff_value) {
if (conv_data->use_low_ro && pinfo->num >= conv_data->use_low_ro) {
proto_tree_add_bitmask_with_flags(dvb_s2_bb_tree, tvb, DVB_S2_BB_OFFS_MATYPE1, hf_dvb_s2_bb_matype1,
ett_dvb_s2_bb_matype1, bb_header_bitfields_low_ro, ENC_BIG_ENDIAN, BMT_NO_FLAGS);
} else {
@ -1596,8 +1621,6 @@ static int dissect_dvb_s2_bb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
* create a virtual ISI.
*/
conv = find_conversation_pinfo(pinfo, 0);
/* UDP and RTP both always create conversations. If we later have
* support for DVB Base Band Frames as the link-layer of a capture file,
* we'll need to handle it differently. In that case just use the