Documentation
¶
Overview ¶
Package pdu provide codecs for binary PDU data.
Index ¶
- Constants
- type AlertNotification
- func (pdu AlertNotification) FieldList() pdufield.List
- func (pdu AlertNotification) Fields() pdufield.Map
- func (pdu AlertNotification) Header() *Header
- func (pdu AlertNotification) Len() int
- func (pdu AlertNotification) SerializeTo(w io.Writer) error
- func (pdu AlertNotification) TLVFields() pdutlv.Map
- type Bind
- type BindResp
- type Body
- func Decode(r io.Reader) (Body, error)
- func NewBindReceiver() Body
- func NewBindReceiverResp() Body
- func NewBindTransceiver() Body
- func NewBindTransceiverResp() Body
- func NewBindTransmitter() Body
- func NewBindTransmitterResp() Body
- func NewCancelSM() Body
- func NewCancelSMResp() Body
- func NewDataSM() Body
- func NewDataSMResp() Body
- func NewDeliverSM() Body
- func NewDeliverSMResp() Body
- func NewDeliverSMRespSeq(seq uint32) Body
- func NewEnquireLink() Body
- func NewEnquireLinkResp() Body
- func NewEnquireLinkRespSeq(seq uint32) Body
- func NewGenericNACK() Body
- func NewQuerySM() Body
- func NewQuerySMResp() Body
- func NewReplaceSM() Body
- func NewSubmitMulti(fields pdutlv.Fields) Body
- func NewSubmitMultiResp() Body
- func NewSubmitSM(fields pdutlv.Fields) Body
- func NewSubmitSMResp() Body
- func NewUnbind() Body
- func NewUnbindResp() Body
- type CancelSM
- type CancelSMResp
- type DataSM
- type DataSMResp
- type DeliverSM
- type DeliverSMResp
- type EnquireLink
- type EnquireLinkResp
- type GenericNACK
- type Header
- type ID
- type Outbind
- type QuerySM
- type QuerySMResp
- type ReplaceSM
- type ReplaceSMResp
- type Status
- type SubmitMulti
- type SubmitMultiResp
- type SubmitSM
- type SubmitSMResp
- type Unbind
- type UnbindResp
Constants ¶
const HeaderLen = 16
HeaderLen is the PDU header length.
const MaxSize = 69632 // Somewhat above 64KiB
MaxSize is the maximum size allowed for a PDU. Any PDU header that tells it is longer will result in a read error.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertNotification ¶ added in v0.0.5
type AlertNotification struct {
// contains filtered or unexported fields
}
AlertNotification PDU.
func (AlertNotification) Header ¶ added in v0.0.5
func (pdu AlertNotification) Header() *Header
Header implements the PDU interface.
func (AlertNotification) Len ¶ added in v0.0.5
func (pdu AlertNotification) Len() int
Len implements the PDU interface.
func (AlertNotification) SerializeTo ¶ added in v0.0.5
SerializeTo implements the PDU interface.
type Bind ¶
type Bind struct {
// contains filtered or unexported fields
}
Bind PDU.
func (Bind) SerializeTo ¶
SerializeTo implements the PDU interface.
type BindResp ¶
type BindResp struct {
// contains filtered or unexported fields
}
BindResp PDU.
func (BindResp) SerializeTo ¶
SerializeTo implements the PDU interface.
type Body ¶
type Body interface { // Header returns the PDU header, decoded. Header fields // can be updated (e.g. Seq) before re-serializing the PDU. Header() *Header // Len returns the length of the PDU binary data, in bytes. Len() int // FieldList returns a list of mandatory PDU fields for // encoding or decoding the PDU. The order in the list // dictates how PDUs are decoded and serialized. FieldList() pdufield.List // Fields return a decoded map of PDU fields. The returned // map can be modified before re-serializing the PDU. Fields() pdufield.Map // Fields return a decoded map of PDU TLV fields. TLVFields() pdutlv.Map // SerializeTo encodes the PDU to its binary form, including // the header and all fields. SerializeTo(w io.Writer) error }
Body is an abstract Protocol Data Unit (PDU) interface for manipulating PDUs.
func Decode ¶
Decode decodes binary PDU data. It returns a new PDU object, e.g. Bind, with header and all fields decoded. The returned PDU can be modified and re-serialized to its binary form.
func NewBindReceiverResp ¶
func NewBindReceiverResp() Body
NewBindReceiverResp creates and initializes a new BindResp PDU.
func NewBindTransceiverResp ¶
func NewBindTransceiverResp() Body
NewBindTransceiverResp creates and initializes a new BindResp PDU.
func NewBindTransmitterResp ¶
func NewBindTransmitterResp() Body
NewBindTransmitterResp creates and initializes a new BindResp PDU.
func NewCancelSM ¶ added in v0.0.5
func NewCancelSM() Body
NewCancelSM creates and initializes a new CancelSM PDU.
func NewCancelSMResp ¶ added in v0.0.5
func NewCancelSMResp() Body
func NewDataSMResp ¶ added in v0.0.5
func NewDataSMResp() Body
func NewDeliverSM ¶
func NewDeliverSM() Body
NewDeliverSM creates and initializes a new DeliverSM PDU.
func NewDeliverSMResp ¶
func NewDeliverSMResp() Body
NewDeliverSMResp creates and initializes a new DeliverSMResp PDU.
func NewDeliverSMRespSeq ¶
NewDeliverSMRespSeq creates and initializes a new DeliverSMResp PDU for a specific seq.
func NewEnquireLink ¶
func NewEnquireLink() Body
NewEnquireLink creates and initializes a EnquireLink PDU.
func NewEnquireLinkResp ¶
func NewEnquireLinkResp() Body
NewEnquireLinkResp creates and initializes a EnquireLinkResp PDU.
func NewEnquireLinkRespSeq ¶
NewEnquireLinkRespSeq creates and initializes a EnquireLinkResp PDU for a specific seq.
func NewGenericNACK ¶
func NewGenericNACK() Body
NewGenericNACK creates and initializes a GenericNACK PDU.
func NewQuerySMResp ¶
func NewQuerySMResp() Body
NewQuerySMResp creates and initializes a new QuerySMResp PDU.
func NewReplaceSM ¶ added in v0.0.5
func NewReplaceSM() Body
func NewSubmitMulti ¶
NewSubmitMulti creates and initializes a new SubmitMulti PDU.
func NewSubmitMultiResp ¶
func NewSubmitMultiResp() Body
NewSubmitMultiResp creates and initializes a new SubmitMultiResp PDU.
func NewSubmitSM ¶
NewSubmitSM creates and initializes a new SubmitSM PDU.
func NewSubmitSMResp ¶
func NewSubmitSMResp() Body
NewSubmitSMResp creates and initializes a new SubmitSMResp PDU.
func NewUnbindResp ¶
func NewUnbindResp() Body
NewUnbindResp creates and initializes a UnbindResp PDU.
type CancelSM ¶ added in v0.0.5
type CancelSM struct {
// contains filtered or unexported fields
}
CancelSM PDU.
func (CancelSM) Header ¶ added in v0.0.5
func (pdu CancelSM) Header() *Header
Header implements the PDU interface.
func (CancelSM) Len ¶ added in v0.0.5
func (pdu CancelSM) Len() int
Len implements the PDU interface.
func (CancelSM) SerializeTo ¶ added in v0.0.5
SerializeTo implements the PDU interface.
type CancelSMResp ¶ added in v0.0.5
type CancelSMResp struct {
// contains filtered or unexported fields
}
CancelSMResp PDU.
func (CancelSMResp) Header ¶ added in v0.0.5
func (pdu CancelSMResp) Header() *Header
Header implements the PDU interface.
func (CancelSMResp) Len ¶ added in v0.0.5
func (pdu CancelSMResp) Len() int
Len implements the PDU interface.
func (CancelSMResp) SerializeTo ¶ added in v0.0.5
SerializeTo implements the PDU interface.
type DataSM ¶ added in v0.0.5
type DataSM struct {
// contains filtered or unexported fields
}
DataSM PDU.
func (DataSM) Header ¶ added in v0.0.5
func (pdu DataSM) Header() *Header
Header implements the PDU interface.
func (DataSM) SerializeTo ¶ added in v0.0.5
SerializeTo implements the PDU interface.
type DataSMResp ¶ added in v0.0.5
type DataSMResp struct {
// contains filtered or unexported fields
}
DataSMResp PDU.
func (DataSMResp) Header ¶ added in v0.0.5
func (pdu DataSMResp) Header() *Header
Header implements the PDU interface.
func (DataSMResp) Len ¶ added in v0.0.5
func (pdu DataSMResp) Len() int
Len implements the PDU interface.
func (DataSMResp) SerializeTo ¶ added in v0.0.5
SerializeTo implements the PDU interface.
type DeliverSM ¶
type DeliverSM struct {
// contains filtered or unexported fields
}
DeliverSM PDU.
func (DeliverSM) Header ¶
func (pdu DeliverSM) Header() *Header
Header implements the PDU interface.
func (DeliverSM) SerializeTo ¶
SerializeTo implements the PDU interface.
type DeliverSMResp ¶
type DeliverSMResp struct {
// contains filtered or unexported fields
}
DeliverSMResp PDU.
func (DeliverSMResp) Header ¶
func (pdu DeliverSMResp) Header() *Header
Header implements the PDU interface.
func (DeliverSMResp) SerializeTo ¶
SerializeTo implements the PDU interface.
type EnquireLink ¶
type EnquireLink struct {
// contains filtered or unexported fields
}
EnquireLink PDU.
func (EnquireLink) Header ¶
func (pdu EnquireLink) Header() *Header
Header implements the PDU interface.
func (EnquireLink) SerializeTo ¶
SerializeTo implements the PDU interface.
type EnquireLinkResp ¶
type EnquireLinkResp struct {
// contains filtered or unexported fields
}
EnquireLinkResp PDU.
func (EnquireLinkResp) Header ¶
func (pdu EnquireLinkResp) Header() *Header
Header implements the PDU interface.
func (EnquireLinkResp) SerializeTo ¶
SerializeTo implements the PDU interface.
type GenericNACK ¶
type GenericNACK struct {
// contains filtered or unexported fields
}
GenericNACK PDU.
func (GenericNACK) Header ¶
func (pdu GenericNACK) Header() *Header
Header implements the PDU interface.
func (GenericNACK) SerializeTo ¶
SerializeTo implements the PDU interface.
type Header ¶
Header is a PDU header.
func DecodeHeader ¶
DecodeHeader decodes binary PDU header data.
type ID ¶
type ID uint32
ID of the PDU header.
const ( GenericNACKID ID = 0x80000000 BindReceiverID ID = 0x00000001 BindReceiverRespID ID = 0x80000001 BindTransmitterID ID = 0x00000002 BindTransmitterRespID ID = 0x80000002 QuerySMID ID = 0x00000003 QuerySMRespID ID = 0x80000003 SubmitSMID ID = 0x00000004 SubmitSMRespID ID = 0x80000004 DeliverSMID ID = 0x00000005 DeliverSMRespID ID = 0x80000005 UnbindID ID = 0x00000006 UnbindRespID ID = 0x80000006 ReplaceSMID ID = 0x00000007 ReplaceSMRespID ID = 0x80000007 CancelSMID ID = 0x00000008 CancelSMRespID ID = 0x80000008 BindTransceiverID ID = 0x00000009 BindTransceiverRespID ID = 0x80000009 OutbindID ID = 0x0000000B EnquireLinkID ID = 0x00000015 EnquireLinkRespID ID = 0x80000015 SubmitMultiID ID = 0x00000021 SubmitMultiRespID ID = 0x80000021 AlertNotificationID ID = 0x00000102 DataSMID ID = 0x00000103 DataSMRespID ID = 0x80000103 )
PDU Types.
type Outbind ¶ added in v0.0.5
type Outbind struct {
// contains filtered or unexported fields
}
Outbind PDU.
func (Outbind) Header ¶ added in v0.0.5
func (pdu Outbind) Header() *Header
Header implements the PDU interface.
func (Outbind) SerializeTo ¶ added in v0.0.5
SerializeTo implements the PDU interface.
type QuerySM ¶
type QuerySM struct {
// contains filtered or unexported fields
}
QuerySM PDU.
func (QuerySM) SerializeTo ¶
SerializeTo implements the PDU interface.
type QuerySMResp ¶
type QuerySMResp struct {
// contains filtered or unexported fields
}
QuerySMResp PDU.
func (QuerySMResp) Header ¶
func (pdu QuerySMResp) Header() *Header
Header implements the PDU interface.
func (QuerySMResp) SerializeTo ¶
SerializeTo implements the PDU interface.
type ReplaceSM ¶ added in v0.0.5
type ReplaceSM struct {
// contains filtered or unexported fields
}
ReplaceSM PDU.
func (ReplaceSM) Header ¶ added in v0.0.5
func (pdu ReplaceSM) Header() *Header
Header implements the PDU interface.
func (ReplaceSM) Len ¶ added in v0.0.5
func (pdu ReplaceSM) Len() int
Len implements the PDU interface.
func (ReplaceSM) SerializeTo ¶ added in v0.0.5
SerializeTo implements the PDU interface.
type ReplaceSMResp ¶ added in v0.0.5
type ReplaceSMResp struct {
// contains filtered or unexported fields
}
ReplaceSMResp PDU.
func (ReplaceSMResp) Header ¶ added in v0.0.5
func (pdu ReplaceSMResp) Header() *Header
Header implements the PDU interface.
func (ReplaceSMResp) Len ¶ added in v0.0.5
func (pdu ReplaceSMResp) Len() int
Len implements the PDU interface.
func (ReplaceSMResp) SerializeTo ¶ added in v0.0.5
SerializeTo implements the PDU interface.
type Status ¶
type Status uint32
Status is a property of the PDU header.
const ( ESME_ROK Status = 0x00000000 // No Error ESME_RINVMSGLEN Status = 0x00000001 // Message Length is invalid ESME_RINVCMDLEN Status = 0x00000002 // Command Length is invalid ESME_RINVCMDID Status = 0x00000003 // Invalid Command ID ESME_RINVBNDSTS Status = 0x00000004 // Incorrect BIND Status for given command ESME_RALYBND Status = 0x00000005 // ESME Already in Bound State ESME_RINVPRTFLG Status = 0x00000006 // Invalid Priority Flag ESME_RINVREGDLVFLG Status = 0x00000007 // Invalid Registered Delivery Flag ESME_RSYSERR Status = 0x00000008 // System Error ESME_RINVSRCADR Status = 0x0000000A // Invalid Source Address ESME_RINVDSTADR Status = 0x0000000B // Invalid Dest Addr ESME_RINVMSGID Status = 0x0000000C // Message ID is invalid ESME_RBINDFAIL Status = 0x0000000D // Bind Failed ESME_RINVPASWD Status = 0x0000000E // Invalid Password ESME_RINVSYSID Status = 0x0000000F // Invalid System ID ESME_RCANCELFAIL Status = 0x00000011 // Cancel SM Failed ESME_RREPLACEFAIL Status = 0x00000013 // Replace SM Failed ESME_RMSGQFUL Status = 0x00000014 // Message Queue Full ESME_RINVSERTYP Status = 0x00000015 // Invalid Service Type ESME_RINVNUMDESTS Status = 0x00000033 // Invalid number of destinations ESME_RINVDLNAME Status = 0x00000034 // Invalid Distribution List name ESME_RINVDESTFLAG Status = 0x00000040 // Destination flag (submit_multi) ESME_RINVSUBREP Status = 0x00000042 // Invalid ‘submit with replace’ request (i.e. submit_sm with replace_if_present_flag set) ESME_RINVESMSUBMIT Status = 0x00000043 // Invalid esm_SUBMIT field data ESME_RCNTSUBDL Status = 0x00000044 // Cannot Submit to Distribution List ESME_RSUBMITFAIL Status = 0x00000045 // submit_sm or submit_multi failed ESME_RINVSRCTON Status = 0x00000048 // Invalid Source address TON ESME_RINVSRCNPI Status = 0x00000049 // Invalid Source address NPI ESME_RINVDSTTON Status = 0x00000050 // Invalid Destination address TON ESME_RINVDSTNPI Status = 0x00000051 // Invalid Destination address NPI ESME_RINVSYSTYP Status = 0x00000053 // Invalid system_type field ESME_RINVREPFLAG Status = 0x00000054 // Invalid replace_if_present flag ESME_RINVNUMMSGS Status = 0x00000055 // Invalid number of messages ESME_RTHROTTLED Status = 0x00000058 // Throttling error (ESME has exceeded allowed message limits) ESME_RINVSCHED Status = 0x00000061 // Invalid Scheduled Delivery Time ESME_RINVEXPIRY Status = 0x00000062 // Invalid message (Expiry time) ESME_RINVDFTMSGID Status = 0x00000063 // Predefined Message Invalid or Not Found ESME_RX_T_APPN Status = 0x00000064 // ESME Receiver Temporary App Error Code ESME_RX_P_APPN Status = 0x00000065 // ESME Receiver Permanent App Error Code ESME_RX_R_APPN Status = 0x00000066 // ESME Receiver Reject Message Error Code ESME_RQUERYFAIL Status = 0x00000067 // query_sm request failed ESME_RINVOPTPARSTREAM Status = 0x000000C0 // Error in the optional part of the PDU Body. ESME_ROPTPARNOTALLWD Status = 0x000000C1 // Optional Parameter not allowed ESME_RINVPARLEN Status = 0x000000C2 // Invalid Parameter Length. ESME_RMISSINGOPTPARAM Status = 0x000000C3 // Expected Optional Parameter missing ESME_RINVOPTPARAMVAL Status = 0x000000C4 // Invalid Optional Parameter Value ESME_RDELIVERYFAILURE Status = 0x000000FE // Delivery Failure (data_sm_resp) ESME_RUNKNOWNERR Status = 0x000000FF // Unknown Error )
type SubmitMulti ¶
type SubmitMulti struct {
// contains filtered or unexported fields
}
SubmitMulti PDU.
func (SubmitMulti) Header ¶
func (pdu SubmitMulti) Header() *Header
Header implements the PDU interface.
func (SubmitMulti) SerializeTo ¶
SerializeTo implements the PDU interface.
type SubmitMultiResp ¶
type SubmitMultiResp struct {
// contains filtered or unexported fields
}
SubmitMultiResp PDU.
func (SubmitMultiResp) Header ¶
func (pdu SubmitMultiResp) Header() *Header
Header implements the PDU interface.
func (SubmitMultiResp) SerializeTo ¶
SerializeTo implements the PDU interface.
type SubmitSM ¶
type SubmitSM struct {
// contains filtered or unexported fields
}
SubmitSM PDU.
func (SubmitSM) SerializeTo ¶
SerializeTo implements the PDU interface.
type SubmitSMResp ¶
type SubmitSMResp struct {
// contains filtered or unexported fields
}
SubmitSMResp PDU.
func (SubmitSMResp) Header ¶
func (pdu SubmitSMResp) Header() *Header
Header implements the PDU interface.
func (SubmitSMResp) SerializeTo ¶
SerializeTo implements the PDU interface.
type Unbind ¶
type Unbind struct {
// contains filtered or unexported fields
}
Unbind PDU.
func (Unbind) SerializeTo ¶
SerializeTo implements the PDU interface.
type UnbindResp ¶
type UnbindResp struct {
// contains filtered or unexported fields
}
UnbindResp PDU.
func (UnbindResp) Header ¶
func (pdu UnbindResp) Header() *Header
Header implements the PDU interface.
func (UnbindResp) SerializeTo ¶
SerializeTo implements the PDU interface.