Exemple #1
0
func (opt *RoundtripReportOption) Encode() (*dccp.Option, error) {
	d := make([]byte, 4)
	dccp.EncodeUint32(opt.Roundtrip, d)
	return &dccp.Option{
		Type:      OptionRoundtripReport,
		Data:      d,
		Mandatory: false,
	}, nil
}
Exemple #2
0
func (opt *LossEventRateOption) Encode() (*dccp.Option, error) {
	d := make([]byte, 4)
	dccp.EncodeUint32(opt.RateInv, d)
	return &dccp.Option{
		Type:      OptionLossEventRate,
		Data:      d,
		Mandatory: false,
	}, nil
}
Exemple #3
0
func (opt *LossDigestOption) Encode() (*dccp.Option, error) {
	d := make([]byte, 5)
	dccp.EncodeUint32(opt.RateInv, d)
	dccp.EncodeUint8(opt.NewLossCount, d[4:])
	return &dccp.Option{
		Type:      OptionLossDigest,
		Data:      d,
		Mandatory: false,
	}, nil
}