Documentation ¶
Overview ¶
Package sar provides capabilties to segment large messages into a set of concatenated Submit TPDUs for transmit, and to collect the set of Deliver TPDUs corresponding to a received message.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrClosed indicates that the collector has been closed and is no longer // accepting PDUs. ErrClosed = errors.New("closed") // ErrDuplicateSegment indicates a segment has arrived for a reassembly // that already has that segment. // The segments are duplicates in terms of their concatentation information. // They may differ in other fields, particularly UD, but those fields cannot // be used to determine which of the two may better fit the reassembly, so // the first is kept and the second discarded. ErrDuplicateSegment = errors.New("duplcate segment") // ErrReassemblyInconsistency indicates a segment has arrived for a reassembly // that has a seqno greater than the number of segments in the reassembly. ErrReassemblyInconsistency = errors.New("reassembly inconsistency") )
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector struct { sync.Mutex // covers pipes and closing closed // contains filtered or unexported fields }
Collector contains reassembly pipes that buffer concatenated TPDUs until a full set is available to be concatenated.
func NewCollector ¶
NewCollector creates a Collector. The asyncError function is called when a reassembly fails asynchronously. The asyncError function must be safe to be called from multiple goroutines.
type ErrExpired ¶
ErrExpired indicates that a reassembly has timed out. The segments of the aborted reassembly are returned in the error.
func (ErrExpired) Error ¶
func (e ErrExpired) Error() string
type Segmenter ¶
type Segmenter struct {
// contains filtered or unexported fields
}
Segmenter segments a large outgoing message into the set of Submit TPDUs required to contain it.
func (*Segmenter) Segment ¶
Segment returns the set of SMS-Submit TPDUs required to transmit the message using the given alphabet. A template for the SMS-Submit TPDUs is passed in, and provides all the fields in the resulting TPDUs, other than the UD, which is populated using the message. For multi-part messages, the UDH provided in the template is extended with a concatenation IE. The template UDH must not contain a concatenation IE (ID 0) or the resulting TPDUs will be non-conformant.