Documentation ¶
Overview ¶
Package pdu provide codecs for binary PDU data.
Index ¶
- Constants
- 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 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 NewSubmitMulti(fields pdutlv.Fields) Body
- func NewSubmitMultiResp() Body
- func NewSubmitSM(fields pdutlv.Fields) Body
- func NewSubmitSMResp() Body
- func NewUnbind() Body
- func NewUnbindResp() Body
- type DeliverSM
- type DeliverSMResp
- type EnquireLink
- type EnquireLinkResp
- type GenericNACK
- type Header
- type ID
- type QuerySM
- type QuerySMResp
- 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 = 4096
MaxSize is the maximum size allowed for a PDU.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 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 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 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 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 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.