Versions in this module Expand all Collapse all v1 v1.0.1 Aug 11, 2026 v1.0.0 Aug 2, 2026 Changes in this version + var ErrConnectionNotFound = errors.New("sccp: connection not found") + var ErrFlowControlBlocked = errors.New("sccp: flow control blocked") + var ErrInvalidConnectionState = errors.New("sccp: invalid connection state") + var ErrInvalidCredit = errors.New("sccp: invalid credit") + var ErrInvalidStackMessage = errors.New("sccp: invalid stack message") + var ErrLocalReferenceExhausted = errors.New("sccp: local reference exhausted") + var ErrReferenceMismatch = errors.New("sccp: connection reference mismatch") + var ErrSequenceMismatch = errors.New("sccp: sequence mismatch") + func DecodeSequenceNumber(encoded uint8) uint8 + func DisableLogging() + func EnableLogging(l *log.Logger) + func EncodeSequenceNumber(n uint8) uint8 + func SetLogger(l *log.Logger) + type AK struct + Credit *params.Credit + DestinationLocalReference *params.LocalReference + ReceiveSequenceNumber *params.ReceiveSequenceNumber + Type MsgType + func NewAK(dst uint32, rcv, credit uint8) *AK + func ParseAK(b []byte) (*AK, error) + func (a *AK) MarshalBinary() ([]byte, error) + func (a *AK) MarshalLen() int + func (a *AK) MarshalTo(b []byte) error + func (a *AK) MessageType() MsgType + func (a *AK) MessageTypeName() string + func (a *AK) String() string + func (a *AK) UnmarshalBinary(b []byte) error + type CC struct + CalledPartyAddress *params.PartyAddress + Credit *params.Credit + Data *params.Data + DestinationLocalReference *params.LocalReference + EndOfOptionalParameters *params.EndOfOptionalParameters + Importance *params.Importance + ProtocolClass *params.ProtocolClass + SourceLocalReference *params.LocalReference + Type MsgType + func NewCC(dst, src uint32, pcls int, retOnErr bool, opts ...params.Parameter) *CC + func ParseCC(b []byte) (*CC, error) + func (c *CC) MarshalBinary() ([]byte, error) + func (c *CC) MarshalLen() int + func (c *CC) MarshalTo(b []byte) error + func (c *CC) MessageType() MsgType + func (c *CC) MessageTypeName() string + func (c *CC) String() string + func (c *CC) UnmarshalBinary(b []byte) error + type CR struct + CalledPartyAddress *params.PartyAddress + CallingPartyAddress *params.PartyAddress + Credit *params.Credit + Data *params.Data + EndOfOptionalParameters *params.EndOfOptionalParameters + HopCounter *params.HopCounter + Importance *params.Importance + ProtocolClass *params.ProtocolClass + SourceLocalReference *params.LocalReference + Type MsgType + func NewCR(src uint32, pcls int, retOnErr bool, cdpa *params.PartyAddress, ...) *CR + func ParseCR(b []byte) (*CR, error) + func (c *CR) MarshalBinary() ([]byte, error) + func (c *CR) MarshalLen() int + func (c *CR) MarshalTo(b []byte) error + func (c *CR) MessageType() MsgType + func (c *CR) MessageTypeName() string + func (c *CR) String() string + func (c *CR) UnmarshalBinary(b []byte) error + type CREF struct + CalledPartyAddress *params.PartyAddress + Data *params.Data + DestinationLocalReference *params.LocalReference + EndOfOptionalParameters *params.EndOfOptionalParameters + Importance *params.Importance + RefusalCause *params.RefusalCause + Type MsgType + func NewCREF(dst uint32, cause params.RefusalCauseValue, opts ...params.Parameter) *CREF + func ParseCREF(b []byte) (*CREF, error) + func (c *CREF) MarshalBinary() ([]byte, error) + func (c *CREF) MarshalLen() int + func (c *CREF) MarshalTo(b []byte) error + func (c *CREF) MessageType() MsgType + func (c *CREF) MessageTypeName() string + func (c *CREF) String() string + func (c *CREF) UnmarshalBinary(b []byte) error + type ConnectionSection struct + Credit uint8 + LocalReference uint32 + ProtocolClass int + ReceiveSequenceNumber uint8 + ReceiveWindowLowerEdge uint8 + RemoteReference uint32 + SendCredit uint8 + SendSequenceNumber uint8 + SendWindowLowerEdge uint8 + State ConnectionState + func NewEstablishedConnectionSection(localReference, remoteReference uint32, protocolClass int, credit uint8) *ConnectionSection + func NewPendingConnectionSection(localReference uint32, protocolClass int, credit uint8) *ConnectionSection + func (s *ConnectionSection) HandleAcknowledgement(acknowledgement *AK) error + func (s *ConnectionSection) HandleConnectionConfirm(confirm *CC) error + func (s *ConnectionSection) HandleConnectionRefused(refusal *CREF) error + func (s *ConnectionSection) HandleDataForm1(data *DT1) (DataIndication, error) + func (s *ConnectionSection) HandleDataForm2(data *DT2) (DataIndication, error) + func (s *ConnectionSection) HandleReleaseComplete(complete *RLC) error + func (s *ConnectionSection) HandleReleased(released *RLSD) (*RLC, error) + func (s *ConnectionSection) Release(cause params.ReleaseCauseValue, opts ...params.Parameter) (*RLSD, error) + func (s *ConnectionSection) SendData(data []byte, moreData bool) (Message, error) + type ConnectionState uint8 + const ConnectionStateEstablished + const ConnectionStateFrozen + const ConnectionStateIdle + const ConnectionStatePending + const ConnectionStateReleasePending + func (s ConnectionState) String() string + type DT1 struct + Data *params.Data + DestinationLocalReference *params.LocalReference + SegmentingReassembling *params.SegmentingReassembling + Type MsgType + func NewDT1(dst uint32, moreData bool, data []byte) *DT1 + func ParseDT1(b []byte) (*DT1, error) + func (d *DT1) MarshalBinary() ([]byte, error) + func (d *DT1) MarshalLen() int + func (d *DT1) MarshalTo(b []byte) error + func (d *DT1) MessageType() MsgType + func (d *DT1) MessageTypeName() string + func (d *DT1) String() string + func (d *DT1) UnmarshalBinary(b []byte) error + type DT2 struct + Data *params.Data + DestinationLocalReference *params.LocalReference + SequencingSegmenting *params.SequencingSegmenting + Type MsgType + func NewDT2(dst uint32, snd, rcv uint8, moreData bool, data []byte) *DT2 + func ParseDT2(b []byte) (*DT2, error) + func (d *DT2) MarshalBinary() ([]byte, error) + func (d *DT2) MarshalLen() int + func (d *DT2) MarshalTo(b []byte) error + func (d *DT2) MessageType() MsgType + func (d *DT2) MessageTypeName() string + func (d *DT2) String() string + func (d *DT2) UnmarshalBinary(b []byte) error + type DataIndication struct + Acknowledgement *AK + Data []byte + LocalReference uint32 + Message Message + MoreData bool + ProtocolClass int + RemoteReference uint32 + type EA struct + DestinationLocalReference *params.LocalReference + Type MsgType + func NewEA(dst uint32) *EA + func ParseEA(b []byte) (*EA, error) + func (e *EA) MarshalBinary() ([]byte, error) + func (e *EA) MarshalLen() int + func (e *EA) MarshalTo(b []byte) error + func (e *EA) MessageType() MsgType + func (e *EA) MessageTypeName() string + func (e *EA) String() string + func (e *EA) UnmarshalBinary(b []byte) error + type ED struct + Data *params.Data + DestinationLocalReference *params.LocalReference + Type MsgType + func NewED(dst uint32, data []byte) *ED + func ParseED(b []byte) (*ED, error) + func (e *ED) MarshalBinary() ([]byte, error) + func (e *ED) MarshalLen() int + func (e *ED) MarshalTo(b []byte) error + func (e *ED) MessageType() MsgType + func (e *ED) MessageTypeName() string + func (e *ED) String() string + func (e *ED) UnmarshalBinary(b []byte) error + type ERR struct + DestinationLocalReference *params.LocalReference + ErrorCause *params.ErrorCause + OptionalParameters []params.Parameter + Type MsgType + func NewERR(dst uint32, cause params.ErrorCauseValue, opts ...params.Parameter) *ERR + func ParseERR(b []byte) (*ERR, error) + func (e *ERR) MarshalBinary() ([]byte, error) + func (e *ERR) MarshalLen() int + func (e *ERR) MarshalTo(b []byte) error + func (e *ERR) MessageType() MsgType + func (e *ERR) MessageTypeName() string + func (e *ERR) String() string + func (e *ERR) UnmarshalBinary(b []byte) error + type IT struct + Credit *params.Credit + DestinationLocalReference *params.LocalReference + ProtocolClass *params.ProtocolClass + SequencingSegmenting *params.SequencingSegmenting + SourceLocalReference *params.LocalReference + Type MsgType + func NewIT(dst, src uint32, pcls int, retOnErr bool, snd, rcv uint8, moreData bool, ...) *IT + func ParseIT(b []byte) (*IT, error) + func (i *IT) MarshalBinary() ([]byte, error) + func (i *IT) MarshalLen() int + func (i *IT) MarshalTo(b []byte) error + func (i *IT) MessageType() MsgType + func (i *IT) MessageTypeName() string + func (i *IT) String() string + func (i *IT) UnmarshalBinary(b []byte) error + type LUDT struct + CalledPartyAddress *params.PartyAddress + CallingPartyAddress *params.PartyAddress + EndOfOptionalParameters *params.EndOfOptionalParameters + HopCounter *params.HopCounter + Importance *params.Importance + LongData *params.LongData + ProtocolClass *params.ProtocolClass + Segmentation *params.Segmentation + Type MsgType + func NewLUDT(pcls int, retOnErr bool, hc uint8, cdpa, cgpa *params.PartyAddress, ...) *LUDT + func ParseLUDT(b []byte) (*LUDT, error) + func (l *LUDT) CdGT() string + func (l *LUDT) CgGT() string + func (l *LUDT) MarshalBinary() ([]byte, error) + func (l *LUDT) MarshalLen() int + func (l *LUDT) MarshalTo(b []byte) error + func (l *LUDT) MessageType() MsgType + func (l *LUDT) MessageTypeName() string + func (l *LUDT) String() string + func (l *LUDT) UnmarshalBinary(b []byte) error + type LUDTS struct + CalledPartyAddress *params.PartyAddress + CallingPartyAddress *params.PartyAddress + EndOfOptionalParameters *params.EndOfOptionalParameters + HopCounter *params.HopCounter + Importance *params.Importance + LongData *params.LongData + ReturnCause *params.ReturnCause + Segmentation *params.Segmentation + Type MsgType + func NewLUDTS(rc params.ReturnCauseValue, hc uint8, cdpa, cgpa *params.PartyAddress, ...) *LUDTS + func ParseLUDTS(b []byte) (*LUDTS, error) + func (l *LUDTS) CdGT() string + func (l *LUDTS) CgGT() string + func (l *LUDTS) MarshalBinary() ([]byte, error) + func (l *LUDTS) MarshalLen() int + func (l *LUDTS) MarshalTo(b []byte) error + func (l *LUDTS) MessageType() MsgType + func (l *LUDTS) MessageTypeName() string + func (l *LUDTS) String() string + func (l *LUDTS) UnmarshalBinary(b []byte) error + type Message interface + MarshalLen func() int + MarshalTo func([]byte) error + MessageType func() MsgType + MessageTypeName func() string + func ParseMessage(b []byte) (Message, error) + type MsgType uint8 + const MsgTypeAK + const MsgTypeCC + const MsgTypeCR + const MsgTypeCREF + const MsgTypeDT1 + const MsgTypeDT2 + const MsgTypeEA + const MsgTypeED + const MsgTypeERR + const MsgTypeIT + const MsgTypeLUDT + const MsgTypeLUDTS + const MsgTypeRLC + const MsgTypeRLSD + const MsgTypeRSC + const MsgTypeRSR + const MsgTypeUDT + const MsgTypeUDTS + const MsgTypeXUDT + const MsgTypeXUDTS + func (i MsgType) String() string + type NoticeIndication struct + CalledPartyAddress *params.PartyAddress + CallingPartyAddress *params.PartyAddress + Data []byte + Message Message + ReturnCause params.ReturnCauseValue + type RLC struct + DestinationLocalReference *params.LocalReference + SourceLocalReference *params.LocalReference + Type MsgType + func NewRLC(dst, src uint32) *RLC + func ParseRLC(b []byte) (*RLC, error) + func (r *RLC) MarshalBinary() ([]byte, error) + func (r *RLC) MarshalLen() int + func (r *RLC) MarshalTo(b []byte) error + func (r *RLC) MessageType() MsgType + func (r *RLC) MessageTypeName() string + func (r *RLC) String() string + func (r *RLC) UnmarshalBinary(b []byte) error + type RLSD struct + Data *params.Data + DestinationLocalReference *params.LocalReference + EndOfOptionalParameters *params.EndOfOptionalParameters + Importance *params.Importance + ReleaseCause *params.ReleaseCause + SourceLocalReference *params.LocalReference + Type MsgType + func NewRLSD(dst, src uint32, cause params.ReleaseCauseValue, opts ...params.Parameter) *RLSD + func ParseRLSD(b []byte) (*RLSD, error) + func (r *RLSD) MarshalBinary() ([]byte, error) + func (r *RLSD) MarshalLen() int + func (r *RLSD) MarshalTo(b []byte) error + func (r *RLSD) MessageType() MsgType + func (r *RLSD) MessageTypeName() string + func (r *RLSD) String() string + func (r *RLSD) UnmarshalBinary(b []byte) error + type RSC struct + DestinationLocalReference *params.LocalReference + SourceLocalReference *params.LocalReference + Type MsgType + func NewRSC(dst, src uint32) *RSC + func ParseRSC(b []byte) (*RSC, error) + func (r *RSC) MarshalBinary() ([]byte, error) + func (r *RSC) MarshalLen() int + func (r *RSC) MarshalTo(b []byte) error + func (r *RSC) MessageType() MsgType + func (r *RSC) MessageTypeName() string + func (r *RSC) String() string + func (r *RSC) UnmarshalBinary(b []byte) error + type RSR struct + DestinationLocalReference *params.LocalReference + OptionalParameters []params.Parameter + ResetCause *params.ResetCause + SourceLocalReference *params.LocalReference + Type MsgType + func NewRSR(dst, src uint32, cause params.ResetCauseValue, opts ...params.Parameter) *RSR + func ParseRSR(b []byte) (*RSR, error) + func (r *RSR) MarshalBinary() ([]byte, error) + func (r *RSR) MarshalLen() int + func (r *RSR) MarshalTo(b []byte) error + func (r *RSR) MessageType() MsgType + func (r *RSR) MessageTypeName() string + func (r *RSR) String() string + func (r *RSR) UnmarshalBinary(b []byte) error + type SCMG struct + AffectedPC uint16 + AffectedSSN uint8 + SCCPCongestionLevel uint8 + SubsystemMultiplicityIndicator uint8 + Type SCMGType + func NewSCMG(typ SCMGType, assn uint8, apc uint16, smi uint8, scl uint8) *SCMG + func ParseSCMG(b []byte) (*SCMG, error) + func (s *SCMG) MarshalBinary() ([]byte, error) + func (s *SCMG) MarshalLen() int + func (s *SCMG) MarshalTo(b []byte) error + func (s *SCMG) MessageType() SCMGType + func (s *SCMG) MessageTypeName() string + func (s *SCMG) String() string + func (s *SCMG) UnmarshalBinary(b []byte) error + type SCMGType uint8 + const SCMGTypeSOG + const SCMGTypeSOR + const SCMGTypeSSA + const SCMGTypeSSC + const SCMGTypeSSP + const SCMGTypeSST + func (i SCMGType) String() string + type Stack struct + func NewStack(config StackConfig) *Stack + func (s *Stack) Connection(localReference uint32) (ConnectionSection, bool) + func (s *Stack) HandleMessage(message Message) (StackResult, error) + func (s *Stack) NewConnectionRequest(protocolClass int, returnOnError bool, credit uint8, ...) (*CR, uint32, error) + func (s *Stack) RegisterSubsystem(ssn uint8) + func (s *Stack) ReleaseConnection(localReference uint32, cause params.ReleaseCauseValue, ...) (*RLSD, error) + func (s *Stack) SubsystemAvailable(ssn uint8) bool + func (s *Stack) UnregisterSubsystem(ssn uint8) + type StackConfig struct + InitialLocalReference uint32 + LocalPointCode uint16 + type StackResult struct + DataIndications []DataIndication + Deliveries []UnitdataIndication + Notices []NoticeIndication + Outbound []Message + type UDT struct + CalledPartyAddress *params.PartyAddress + CallingPartyAddress *params.PartyAddress + Data *params.Data + ProtocolClass *params.ProtocolClass + Type MsgType + func NewUDT(pcls int, retOnErr bool, cdpa, cgpa *params.PartyAddress, data []byte) *UDT + func ParseUDT(b []byte) (*UDT, error) + func (u *UDT) CdGT() string + func (u *UDT) CgGT() string + func (u *UDT) MarshalBinary() ([]byte, error) + func (u *UDT) MarshalLen() int + func (u *UDT) MarshalTo(b []byte) error + func (u *UDT) MessageType() MsgType + func (u *UDT) MessageTypeName() string + func (u *UDT) String() string + func (u *UDT) UnmarshalBinary(b []byte) error + type UDTS struct + CalledPartyAddress *params.PartyAddress + CallingPartyAddress *params.PartyAddress + Data *params.Data + ReturnCause *params.ReturnCause + Type MsgType + func NewUDTS(rc params.ReturnCauseValue, cdpa, cgpa *params.PartyAddress, data []byte) *UDTS + func ParseUDTS(b []byte) (*UDTS, error) + func (u *UDTS) CdGT() string + func (u *UDTS) CgGT() string + func (u *UDTS) MarshalBinary() ([]byte, error) + func (u *UDTS) MarshalLen() int + func (u *UDTS) MarshalTo(b []byte) error + func (u *UDTS) MessageType() MsgType + func (u *UDTS) MessageTypeName() string + func (u *UDTS) String() string + func (u *UDTS) UnmarshalBinary(b []byte) error + type UnitdataIndication struct + CalledPartyAddress *params.PartyAddress + CallingPartyAddress *params.PartyAddress + Data []byte + Message Message + ProtocolClass int + ReturnOnError bool + type UnsupportedTypeError uint8 + func (e UnsupportedTypeError) Error() string + type XUDT struct + CalledPartyAddress *params.PartyAddress + CallingPartyAddress *params.PartyAddress + Data *params.Data + EndOfOptionalParameters *params.EndOfOptionalParameters + HopCounter *params.HopCounter + Importance *params.Importance + ProtocolClass *params.ProtocolClass + Segmentation *params.Segmentation + Type MsgType + func NewXUDT(pcls int, retOnErr bool, hc uint8, cdpa, cgpa *params.PartyAddress, ...) *XUDT + func ParseXUDT(b []byte) (*XUDT, error) + func (x *XUDT) CdGT() string + func (x *XUDT) CgGT() string + func (x *XUDT) MarshalBinary() ([]byte, error) + func (x *XUDT) MarshalLen() int + func (x *XUDT) MarshalTo(b []byte) error + func (x *XUDT) MessageType() MsgType + func (x *XUDT) MessageTypeName() string + func (x *XUDT) String() string + func (x *XUDT) UnmarshalBinary(b []byte) error + type XUDTS struct + CalledPartyAddress *params.PartyAddress + CallingPartyAddress *params.PartyAddress + Data *params.Data + EndOfOptionalParameters *params.EndOfOptionalParameters + HopCounter *params.HopCounter + Importance *params.Importance + ReturnCause *params.ReturnCause + Segmentation *params.Segmentation + Type MsgType + func NewXUDTS(rc params.ReturnCauseValue, hc uint8, cdpa, cgpa *params.PartyAddress, ...) *XUDTS + func ParseXUDTS(b []byte) (*XUDTS, error) + func (x *XUDTS) CdGT() string + func (x *XUDTS) CgGT() string + func (x *XUDTS) MarshalBinary() ([]byte, error) + func (x *XUDTS) MarshalLen() int + func (x *XUDTS) MarshalTo(b []byte) error + func (x *XUDTS) MessageType() MsgType + func (x *XUDTS) MessageTypeName() string + func (x *XUDTS) String() string + func (x *XUDTS) UnmarshalBinary(b []byte) error