Exemple #1
0
func DecodeLossDigestOption(opt *dccp.Option) *LossDigestOption {
	if opt.Type != OptionLossDigest || len(opt.Data) != 5 {
		return nil
	}
	return &LossDigestOption{
		RateInv:      dccp.DecodeUint32(opt.Data[0:4]),
		NewLossCount: dccp.DecodeUint8(opt.Data[4:5]),
	}
}
Exemple #2
0
func DecodeLossEventRateOption(opt *dccp.Option) *LossEventRateOption {
	if opt.Type != OptionLossEventRate || len(opt.Data) != 4 {
		return nil
	}
	return &LossEventRateOption{RateInv: dccp.DecodeUint32(opt.Data[0:4])}
}
Exemple #3
0
func DecodeRoundtripReportOption(opt *dccp.Option) *RoundtripReportOption {
	if opt.Type != OptionRoundtripReport || len(opt.Data) != 4 {
		return nil
	}
	return &RoundtripReportOption{Roundtrip: dccp.DecodeUint32(opt.Data[0:4])}
}
Exemple #4
0
func DecodeReceiveRateOption(opt *dccp.Option) *ReceiveRateOption {
	if opt.Type != OptionReceiveRate || len(opt.Data) != 4 {
		return nil
	}
	return &ReceiveRateOption{Rate: dccp.DecodeUint32(opt.Data[0:4])}
}