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 CREF
- type DT1
- type DT2
- type Header
- type LUDT
- func (u *LUDT) CdGT() string
- func (u *LUDT) CgGT() string
- func (u *LUDT) MarshalBinary() ([]byte, error)
- func (u *LUDT) MarshalLen() int
- func (u *LUDT) MarshalTo(b []byte) error
- func (u *LUDT) MessageType() MsgType
- func (u *LUDT) MessageTypeName() string
- func (u *LUDT) String() string
- func (u *LUDT) UnmarshalBinary(b []byte) error
- 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
- type XUDT
- func (u *XUDT) CdGT() string
- func (u *XUDT) CgGT() string
- func (u *XUDT) MarshalBinary() ([]byte, error)
- func (u *XUDT) MarshalLen() int
- func (u *XUDT) MarshalTo(b []byte) error
- func (u *XUDT) MessageType() MsgType
- func (u *XUDT) MessageTypeName() string
- func (u *XUDT) String() string
- func (u *XUDT) UnmarshalBinary(b []byte) error
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 CREF ¶
type CREF struct {
Type MsgType
DestinationLocalReference uint32
Cause byte
Opts []*params.Optional
Data *params.Optional
CalledPartyAddress *params.PartyAddress
}
func (*CREF) MarshalBinary ¶
MarshalBinary returns the byte sequence generated from a CREF instance.
func (*CREF) MarshalLen ¶
func (*CREF) 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 (*CREF) MessageType ¶
MessageType returns the Message Type in int.
func (*CREF) MessageTypeName ¶
func (*CREF) 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 DT2 ¶
type DT2 struct {
Type MsgType
DestinationLocalReference uint32
Sequencing uint16 // just dummy for me. All I need is MsgType infact
Data []byte
}
func (*DT2) MarshalBinary ¶
func (*DT2) MarshalLen ¶
func (*DT2) MessageType ¶
MessageType returns the Message Type in int.
func (*DT2) MessageTypeName ¶
func (*DT2) 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 LUDT ¶
type LUDT struct {
Type MsgType
params.ProtocolClass
HopCntr uint8
CalledPartyAddress *params.PartyAddress
CallingPartyAddress *params.PartyAddress
DataLength uint16
Data []byte
// contains filtered or unexported fields
}
func (*LUDT) MarshalBinary ¶
MarshalBinary returns the byte sequence generated from a LUDT instance.
func (*LUDT) MessageType ¶
MessageType returns the Message Type in int.
func (*LUDT) MessageTypeName ¶
MessageTypeName returns the Message Type in string.
func (*LUDT) UnmarshalBinary ¶
UnmarshalBinary sets the values retrieved from byte sequence in a SCCP LUDT.
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.
type XUDT ¶
type XUDT struct {
Type MsgType
params.ProtocolClass
HopCntr uint8
CalledPartyAddress *params.PartyAddress
CallingPartyAddress *params.PartyAddress
DataLength uint8 // have to inherit it from the original git :-(
Data []byte
// contains filtered or unexported fields
}
func (*XUDT) MarshalBinary ¶
MarshalBinary returns the byte sequence generated from a XUDT instance.
func (*XUDT) MessageType ¶
MessageType returns the Message Type in int.
func (*XUDT) MessageTypeName ¶
MessageTypeName returns the Message Type in string.
func (*XUDT) UnmarshalBinary ¶
UnmarshalBinary sets the values retrieved from byte sequence in a SCCP XUDT.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
client
command
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). |