-
Notifications
You must be signed in to change notification settings - Fork 38
/
pdu_generic_nack.go
66 lines (51 loc) · 1.24 KB
/
pdu_generic_nack.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package smpp34
var (
reqGNFields = []string{}
)
type GenericNack struct {
*Header
mandatoryFields map[string]Field
tlvFields map[uint16]*TLVField
}
func NewGenericNack(hdr *Header) (*GenericNack, error) {
s := &GenericNack{Header: hdr}
return s, nil
}
func (s *GenericNack) GetField(f string) Field {
return nil
}
func (s *GenericNack) Fields() map[string]Field {
return s.mandatoryFields
}
func (s *GenericNack) MandatoryFieldsList() []string {
return reqGNFields
}
func (s *GenericNack) Ok() bool {
return true
}
func (s *GenericNack) GetHeader() *Header {
return s.Header
}
func (s *GenericNack) SetField(f string, v interface{}) error {
return FieldValueErr
}
func (s *GenericNack) SetSeqNum(i uint32) {
s.Header.Sequence = i
}
func (s *GenericNack) SetTLVField(t, l int, v []byte) error {
return TLVFieldPduErr
}
func (s *GenericNack) TLVFields() map[uint16]*TLVField {
return s.tlvFields
}
func (s *GenericNack) writeFields() []byte {
return []byte{}
}
func (s *GenericNack) Writer() []byte {
b := s.writeFields()
h := packUi32(uint32(len(b) + 16))
h = append(h, packUi32(uint32(GENERIC_NACK))...)
h = append(h, packUi32(uint32(s.Header.Status))...)
h = append(h, packUi32(s.Header.Sequence)...)
return append(h, b...)
}