mirror of
https://github.com/pion/webrtc.git
synced 2025-11-01 03:04:06 +08:00
* Make sure errors in SCTP make it all the way back * Move structs into files with proper names in SCTP * Add String() for AssociationState enum * Add callbacks to Association to that we can handle DATA in the DataChannel package and send outbound SCTP
23 lines
908 B
Go
23 lines
908 B
Go
package sctp
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
func TestAssociationInit(t *testing.T) {
|
|
pkt := &Packet{}
|
|
rawPkt := []byte{0x13, 0x88, 0x13, 0x88, 0x00, 0x00, 0x00, 0x00, 0x81, 0x46, 0x9d, 0xfc, 0x01, 0x00, 0x00, 0x56, 0x55,
|
|
0xb9, 0x64, 0xa5, 0x00, 0x02, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0xe8, 0x6d, 0x10, 0x30, 0xc0, 0x00, 0x00, 0x04, 0x80,
|
|
0x08, 0x00, 0x09, 0xc0, 0x0f, 0xc1, 0x80, 0x82, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x24, 0x9f, 0xeb, 0xbb, 0x5c, 0x50,
|
|
0xc9, 0xbf, 0x75, 0x9c, 0xb1, 0x2c, 0x57, 0x4f, 0xa4, 0x5a, 0x51, 0xba, 0x60, 0x17, 0x78, 0x27, 0x94, 0x5c, 0x31, 0xe6,
|
|
0x5d, 0x5b, 0x09, 0x47, 0xe2, 0x22, 0x06, 0x80, 0x04, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x80, 0x03, 0x00, 0x06, 0x80, 0xc1, 0x00, 0x00}
|
|
if err := pkt.Unmarshal(rawPkt); err != nil {
|
|
t.Error(errors.Wrap(err, "Unmarshal failed, has chunk"))
|
|
}
|
|
|
|
assoc := &Association{}
|
|
assoc.PushPacket(pkt)
|
|
}
|