Documentation ¶
Overview ¶
Package ucp provides UCP primitives.
References:
http://documents.swisscom.com/product/1000174-Internet/Documents/Landingpage-Mobile-Mehrwertdienste/UCP_R4.7.pdf https://wiki.wireshark.org/UCP https://www.wireshark.org/docs/dfref/u/ucp.html
Index ¶
Constants ¶
const ( STX = 2 ETX = 3 ALERT_OP = "31" SUBMIT_SHORT_MESSAGE_OP = "51" DELIVER_SHORT_MESSAGE_OP = "52" DELIVER_NOTIFICATION_OP = "53" SESSION_MANAGEMENT_OP = "60" )
Variables ¶
var ( // Suffix is a unique identifier for the current running server Suffix = uuid.NewV1().String() // CountersKey is a redis key for atomic counters CountersKey = "counters_" + Suffix // SmField is a redis field for submit_sm SmField = "submit_sm_" + Suffix // DrField is a redis field for deliver_sm DrField = "deliver_sm_" + Suffix // TpsKey is a redis key for tps TpsKey = "tps_" + Suffix // ActiveConnection is a redis key for sorted set of active connections ActiveConnection = "active_conn_" + Suffix // ReqPacket is a redis key for incoming tcp packet ReqPacket = "req_packet_" + Suffix // ResPacket is a redis key for outgoing tcp packet ResPacket = "res_packet_" + Suffix // MsgList is a redis key for message list MsgList = "msg_list_" + Suffix // Cost is a redis key for the total message cost Cost = "cost_" + Suffix // RefNum is a redis key for a long message with a reference number RefNum string // IpSrcDstMsg is a redis key for storing messages sent by an IP addr IpSrcDstMsg string = "ip_src_dst_msg_" + Suffix KeepAliveTimeout = 0 )
var DeliverSMCh = make(chan DeliverSM, 10)
Functions ¶
func GetKeepAliveTimeout ¶
func GetKeepAliveTimeout() int
func SetKeepAliveTimeout ¶
func SetKeepAliveTimeout(n int)
Types ¶
type DeliverNotification ¶
type DeliverNotification struct { AdC []byte OAdC []byte AC []byte NRq []byte NAdC []byte NT []byte NPID []byte LRq []byte LRAd []byte LPID []byte DD []byte DDT []byte VP []byte RPID []byte SCTS []byte Dst []byte Rsn []byte DSCTS []byte MT []byte NB []byte Msg []byte MMS []byte PR []byte DCs []byte MCLs []byte RPI []byte CPg []byte RPLy []byte OTOA []byte HPLMN []byte Xser []byte RES4 []byte RES5 []byte // contains filtered or unexported fields }
DeliverNotification is a Deliver Notification Operation(53).
func NewDeliverNotification ¶
func NewDeliverNotification(pdu *PDU, AdC, OAdC, SCTS string) *DeliverNotification
NewDeliverNotification creates a new Deliver Notification PDU.
func (*DeliverNotification) Result ¶
func (d *DeliverNotification) Result() []byte
Result returns a Deliver Notification Result.
type DeliverSM ¶
type DeliverSM struct { AdC []byte OAdC []byte AC []byte NRq []byte NAdC []byte NT []byte NPID []byte LRq []byte LRAd []byte LPID []byte DD []byte DDT []byte VP []byte RPID []byte SCTS []byte Dst []byte Rsn []byte DSCTS []byte MT []byte NB []byte Msg []byte MMS []byte PR []byte DCs []byte MCLs []byte RPI []byte CPg []byte RPLy []byte OTOA []byte HPLMN []byte Xser []byte RES4 []byte RES5 []byte }
type ExtraService ¶
type ExtraService string
ExtraService field allows the specification of one or more additional services, all in the format TTLLDD, where TT field specifies the type of service, LL indicates the length of data and DD indicates zero or more data elements
const ( // User Data Header UDH ExtraService = "01" //BillingIdentifier enables the client to send additional billing information to the server BillingIdentifier ExtraService = "0C" )
type PDU ¶
type PDU struct { sync.Mutex // Transaction Reference Number TransRefNum []byte // PDU length Len []byte // Operation type or Result type Type []byte // Operation Identifier Operation []byte // Operation data Data []byte // PDU checksum Checksum []byte // contains filtered or unexported fields }
PDU is a UCP protocol data unit.
type Session ¶
type Session struct { OAdC []byte OTON []byte ONPI []byte STYP []byte PWD []byte NPWD []byte VERS []byte LAdC []byte LTON []byte LNPI []byte OPID []byte RES1 []byte // contains filtered or unexported fields }
Session is a Session Management Operation(60).
func NewSession ¶
NewSession creates a new Session Management Operation PDU.
func (*Session) GetPassword ¶
type Submit ¶
type Submit struct { AdC []byte OAdC []byte AC []byte NRq []byte NAdC []byte NT []byte NPID []byte LRq []byte LRAd []byte LPID []byte DD []byte DDT []byte VP []byte RPID []byte SCTS []byte Dst []byte Rsn []byte DSCTS []byte MT []byte NB []byte Msg []byte MMS []byte PR []byte DCs []byte MCLs []byte RPI []byte CPg []byte RPLy []byte OTOA []byte HPLMN []byte Xser []byte RES4 []byte RES5 []byte // contains filtered or unexported fields }
Submit is a Submit Short Message Operation(51).
func (*Submit) GetMessage ¶
GetMessage returns the decoded message
func (*Submit) GetRecipient ¶
GetRecipient returns the recipient of the messsage
func (*Submit) IsNotifRequested ¶
IsNotifRequested returns true if a delivery notification is requested
func (*Submit) ParseXser ¶
func (s *Submit) ParseXser() map[ExtraService]string
ParseXser returns a map of Extra Services