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 ¶
- func DisableLogging()
- func EnableLogging(l *log.Logger)
- func SetLogger(l *log.Logger)
- type Message
- type MsgType
- 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) String() string
- func (u *UDT) UnmarshalBinary(b []byte) error
- type UnsupportedTypeError
- type XUDT
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableLogging ¶ added in v0.0.4
func DisableLogging()
DisableLogging disables the logging from the package. Logging is enabled by default.
func EnableLogging ¶ added in v0.0.4
EnableLogging enables the logging from the package. If l is nil, it uses default logger provided by the package. Logging is enabled by default.
See also: SetLogger.
func SetLogger ¶ added in v0.0.4
SetLogger replaces the standard logger with arbitrary *log.Logger.
This package prints just informational logs from goroutines working background that might help developers test the program but can be ignored safely. More important ones that needs any action by caller would be returned as errors.
Types ¶
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.
type MsgType ¶
type MsgType uint8
MsgType is type of SCCP message.
const ( MsgTypeCR MsgType // CR MsgTypeCC // CC MsgTypeCREF // CREF MsgTypeRLSD // RLSD MsgTypeRLC // RLC MsgTypeDT1 // DT1 MsgTypeDT2 // DT2 MsgTypeAK // AK MsgTypeUDT // UDT MsgTypeUDTS // UDTS MsgTypeED // ED MsgTypeEA // EA MsgTypeRSR // RSR MsgTypeRSC // RSC MsgTypeERR // ERR MsgTypeIT // IT MsgTypeXUDT // XUDT MsgTypeXUDTS // XUDTS MsgTypeLUDT // LUDT MsgTypeLUDTS // LUDTS )
Message Type definitions.
type SCMG ¶ added in v0.0.3
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 (*SCMG) MarshalBinary ¶ added in v0.0.3
MarshalBinary returns the byte sequence generated from a SCMG instance.
func (*SCMG) MarshalLen ¶ added in v0.0.3
MarshalLen returns the serial length.
func (*SCMG) MarshalTo ¶ added in v0.0.3
MarshalTo puts the byte sequence in the byte array given as b.
func (*SCMG) MessageType ¶ added in v0.0.3
MessageType returns the Message Type in int.
func (*SCMG) MessageTypeName ¶ added in v0.0.3
MessageTypeName returns the Message Type in string.
func (*SCMG) UnmarshalBinary ¶ added in v0.0.3
UnmarshalBinary sets the values retrieved from byte sequence in a SCMG.
type SCMGType ¶ added in v0.0.3
type SCMGType uint8
SCMGType is type of SCMG message.
const ( SCMGTypeSSA SCMGType // SSA SCMGTypeSSP // SSP SCMGTypeSST // SST SCMGTypeSOR // SOR SCMGTypeSOG // SOG SCMGTypeSSC // SSC )
Table 23/Q.713
type UDT ¶
type UDT struct { Type MsgType ProtocolClass *params.ProtocolClass CalledPartyAddress *params.PartyAddress CallingPartyAddress *params.PartyAddress Data *params.Data // contains filtered or unexported fields }
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 uint8
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 ¶ added in v0.0.4
type XUDT struct { Type MsgType ProtocolClass *params.ProtocolClass HopCounter *params.HopCounter CalledPartyAddress *params.PartyAddress CallingPartyAddress *params.PartyAddress Data *params.Data Segmentation *params.Segmentation Importance *params.Importance EndOfOptionalParameters *params.EndOfOptionalParameters // contains filtered or unexported fields }
XUDT represents a SCCP Message Extended unitdata (XUDT).
func NewXUDT ¶ added in v0.0.4
func NewXUDT(pcls int, retOnErr bool, hc uint8, cdpa, cgpa *params.PartyAddress, data []byte, opts ...params.Parameter) *XUDT
NewXUDT creates a new XUDT.
func (*XUDT) CdGT ¶ added in v0.0.4
CdGT returns the GT in CalledPartyAddress in human readable string.
func (*XUDT) CgGT ¶ added in v0.0.4
CgGT returns the GT in CalledPartyAddress in human readable string.
func (*XUDT) MarshalBinary ¶ added in v0.0.4
MarshalBinary returns the byte sequence generated from a XUDT instance.
func (*XUDT) MarshalLen ¶ added in v0.0.4
MarshalLen returns the serial length.
func (*XUDT) MarshalTo ¶ added in v0.0.4
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 (*XUDT) MessageType ¶ added in v0.0.4
MessageType returns the Message Type in int.
func (*XUDT) MessageTypeName ¶ added in v0.0.4
MessageTypeName returns the Message Type in string.
func (*XUDT) UnmarshalBinary ¶ added in v0.0.4
UnmarshalBinary sets the values retrieved from byte sequence in a SCCP XUDT.
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. |
server
Command receiver receives SCCP messages from the client and prints them out.
|
Command receiver receives SCCP messages from the client and prints them out. |
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). |