Documentation
¶
Overview ¶
Package sccp provides encoding/decoding feature of Signalling Connection Control Part used in SS7/SIGTRAN protocol stack.
This is still an experimental project, and currently in its very early stage of development. Any part of implementations (including exported APIs) may be changed before released as v1.0.0.
Index ¶
- type CC
- type CR
- type DT1
- type Header
- type Message
- type MsgType
- type RLC
- type RLSD
- type SCMG
- type SCMGType
- type UDT
- 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) SetLength()
- func (u *UDT) String() string
- func (u *UDT) UnmarshalBinary(b []byte) error
- type UnsupportedTypeError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CC ¶
type CC struct { Type MsgType DestinationLocalReference uint32 SourceLocalReference uint32 params.ProtocolClass Opts []*params.Optional Data *params.Optional CalledPartyAddress *params.PartyAddress }
func (*CC) MarshalBinary ¶
MarshalBinary returns the byte sequence generated from a CC instance.
func (*CC) MarshalLen ¶
func (*CC) MarshalTo ¶
MarshalTo puts the byte sequence in the byte array given as b. SCCP is dependent on the Pointers when serializing, which means that it might fail when invalid Pointers are set.
func (*CC) MessageType ¶
MessageType returns the Message Type in int.
func (*CC) MessageTypeName ¶
func (*CC) UnmarshalBinary ¶
type CR ¶
type CR struct { Type MsgType SourceLocalReference uint32 params.ProtocolClass CalledPartyAddress *params.PartyAddress Opts []*params.Optional // all others // just pointers, not used for Marshal-ing, I kust really need these two // similar objects are expected to be found in Opts Data *params.Optional CallingPartyAddress *params.PartyAddress }
func (*CR) MarshalBinary ¶
MarshalBinary returns the byte sequence generated from a CR instance.
func (*CR) MarshalLen ¶
func (*CR) MessageType ¶
MessageType returns the Message Type in int.
func (*CR) MessageTypeName ¶
func (*CR) UnmarshalBinary ¶
type DT1 ¶
func (*DT1) MarshalBinary ¶
func (*DT1) MarshalLen ¶
func (*DT1) MessageType ¶
MessageType returns the Message Type in int.
func (*DT1) MessageTypeName ¶
func (*DT1) UnmarshalBinary ¶
type Header ¶
Header is a SCCP common header.
func ParseHeader ¶
ParseHeader decodes given byte sequence as a SCCP common header.
func (*Header) MarshalBinary ¶
MarshalBinary returns the byte sequence generated from a Header instance.
func (*Header) UnmarshalBinary ¶
UnmarshalBinary sets the values retrieved from byte sequence in a SCCP common header.
type Message ¶
type Message interface { encoding.BinaryMarshaler encoding.BinaryUnmarshaler MarshalTo([]byte) error MarshalLen() int MessageType() MsgType MessageTypeName() string fmt.Stringer }
Message is an interface that defines SCCP messages.
func ParseMessage ¶
ParseMessage decodes the byte sequence into Message by Message Type. Currently this only supports UDT type of message only.
type MsgType ¶
type MsgType uint8
MsgType is type of SCCP message.
const ( MsgTypeCR MsgType MsgTypeCC MsgTypeCREF MsgTypeRLSD MsgTypeRLC MsgTypeDT1 MsgTypeDT2 MsgTypeAK MsgTypeUDT MsgTypeUDTS MsgTypeED MsgTypeEA MsgTypeRSR MsgTypeRSC MsgTypeERR MsgTypeIT MsgTypeXUDT MsgTypeXUDTS MsgTypeLUDT MsgTypeLUDTS )
Message Type definitions.
type RLC ¶
func (*RLC) MarshalBinary ¶
func (*RLC) MarshalLen ¶
func (*RLC) MessageType ¶
MessageType returns the Message Type in int.
func (*RLC) MessageTypeName ¶
func (*RLC) UnmarshalBinary ¶
type RLSD ¶
type RLSD struct { Type MsgType DestinationLocalReference uint32 SourceLocalReference uint32 Cause byte Opts []*params.Optional }
func (*RLSD) MarshalBinary ¶
func (*RLSD) MarshalLen ¶
func (*RLSD) MessageType ¶
MessageType returns the Message Type in int.
func (*RLSD) MessageTypeName ¶
func (*RLSD) UnmarshalBinary ¶
type SCMG ¶
type SCMG struct { Type SCMGType AffectedSSN uint8 AffectedPC uint16 SubsystemMultiplicityIndicator uint8 SCCPCongestionLevel uint8 }
SCMG represents a SCCP Management message (SCMG). Chapter 5.3/Q.713
func NewSCMG ¶
func NewSCMG(typ SCMGType, affectedSSN uint8, affectedPC uint16, subsystemMultiplicityIndicator uint8, sccpCongestionLevel uint8) *SCMG
NewSCMG creates a new SCMG.
func (*SCMG) MarshalBinary ¶
MarshalBinary returns the byte sequence generated from a SCMG instance.
func (*SCMG) MessageType ¶
MessageType returns the Message Type in int.
func (*SCMG) MessageTypeName ¶
MessageTypeName returns the Message Type in string.
func (*SCMG) UnmarshalBinary ¶
UnmarshalBinary sets the values retrieved from byte sequence in a SCMG.
type SCMGType ¶
type SCMGType uint8
SCMGType is type of SCMG message.
const ( SCMGTypeSSA SCMGType SCMGTypeSSP SCMGTypeSST SCMGTypeSOR SCMGTypeSOG SCMGTypeSSC )
Table 23/Q.713
type UDT ¶
type UDT struct { Type MsgType params.ProtocolClass Ptr1, Ptr2, Ptr3 uint8 CalledPartyAddress *params.PartyAddress CallingPartyAddress *params.PartyAddress DataLength uint8 Data []byte }
UDT represents a SCCP Message Unit Data(UDT).
func (*UDT) MarshalBinary ¶
MarshalBinary returns the byte sequence generated from a UDT instance.
func (*UDT) MarshalTo ¶
MarshalTo puts the byte sequence in the byte array given as b. SCCP is dependent on the Pointers when serializing, which means that it might fail when invalid Pointers are set.
func (*UDT) MessageType ¶
MessageType returns the Message Type in int.
func (*UDT) MessageTypeName ¶
MessageTypeName returns the Message Type in string.
func (*UDT) UnmarshalBinary ¶
UnmarshalBinary sets the values retrieved from byte sequence in a SCCP UDT.
type UnsupportedTypeError ¶
type UnsupportedTypeError byte
UnsupportedTypeError indicates the value in Version field is invalid.
func (UnsupportedTypeError) Error ¶
func (e UnsupportedTypeError) Error() string
Error returns the type of receiver and some additional message.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
examples
|
|
client
Command client sends given payload on top of SCCP UDT message.
|
Command client sends given payload on top of SCCP UDT message. |
Package utils provides some utilities which might be useful specifically for GTP(or other telco protocols).
|
Package utils provides some utilities which might be useful specifically for GTP(or other telco protocols). |