diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-09-17 18:24:18 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-09-20 11:10:20 +0300 |
| commit | 6aa511f2ae3d5c84e7db02627ffd4d7f6796ce75 (patch) | |
| tree | e925740a5c04b1c5c44e725dab04f9b1833cf9e3 /pkg/messages/types/svcPacketEntities.go | |
| parent | parse netSignOnState flags (diff) | |
| download | sdp.go-6aa511f2ae3d5c84e7db02627ffd4d7f6796ce75.tar.gz sdp.go-6aa511f2ae3d5c84e7db02627ffd4d7f6796ce75.tar.bz2 sdp.go-6aa511f2ae3d5c84e7db02627ffd4d7f6796ce75.zip | |
decide what message types are left
Diffstat (limited to 'pkg/messages/types/svcPacketEntities.go')
| -rw-r--r-- | pkg/messages/types/svcPacketEntities.go | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/pkg/messages/types/svcPacketEntities.go b/pkg/messages/types/svcPacketEntities.go index 54e4a2a..2d86bf2 100644 --- a/pkg/messages/types/svcPacketEntities.go +++ b/pkg/messages/types/svcPacketEntities.go | |||
| @@ -5,33 +5,30 @@ import ( | |||
| 5 | ) | 5 | ) |
| 6 | 6 | ||
| 7 | type SvcPacketEntities struct { | 7 | type SvcPacketEntities struct { |
| 8 | MaxEntries int16 | 8 | MaxEntries uint16 |
| 9 | IsDelta bool | 9 | IsDelta bool |
| 10 | DeltaFrom int32 | 10 | DeltaFrom int32 |
| 11 | BaseLine bool | 11 | BaseLine bool |
| 12 | UpdatedEntries int16 | 12 | UpdatedEntries uint16 |
| 13 | Length int32 | 13 | Length uint32 |
| 14 | UpdatedBaseline bool | 14 | UpdatedBaseline bool |
| 15 | Data []byte | 15 | Data []byte |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | func ParseSvcPacketEntities(reader *bitreader.Reader) SvcPacketEntities { | 18 | func ParseSvcPacketEntities(reader *bitreader.Reader) SvcPacketEntities { |
| 19 | svcPacketEntities := SvcPacketEntities{ | 19 | svcPacketEntities := SvcPacketEntities{ |
| 20 | MaxEntries: int16(reader.TryReadBits(11)), | 20 | MaxEntries: uint16(reader.TryReadBits(11)), |
| 21 | IsDelta: reader.TryReadBool(), | 21 | IsDelta: reader.TryReadBool(), |
| 22 | } | 22 | } |
| 23 | if svcPacketEntities.IsDelta { | 23 | if svcPacketEntities.IsDelta { |
| 24 | svcPacketEntities.DeltaFrom = int32(reader.TryReadBits(32)) | 24 | svcPacketEntities.DeltaFrom = reader.TryReadSInt32() |
| 25 | } else { | 25 | } else { |
| 26 | svcPacketEntities.DeltaFrom = -1 | 26 | svcPacketEntities.DeltaFrom = -1 |
| 27 | } | 27 | } |
| 28 | svcPacketEntities.BaseLine = reader.TryReadBool() | 28 | svcPacketEntities.BaseLine = reader.TryReadBool() |
| 29 | svcPacketEntities.UpdatedEntries = int16(reader.TryReadBits(11)) | 29 | svcPacketEntities.UpdatedEntries = uint16(reader.TryReadBits(11)) |
| 30 | svcPacketEntities.Length = int32(reader.TryReadBits(20)) | 30 | svcPacketEntities.Length = uint32(reader.TryReadBits(20)) |
| 31 | svcPacketEntities.UpdatedBaseline = reader.TryReadBool() | 31 | svcPacketEntities.UpdatedBaseline = reader.TryReadBool() |
| 32 | svcPacketEntities.Data = reader.TryReadBitsToSlice(uint64(svcPacketEntities.Length)) //, dataReader = reader.ForkAndSkip(int(svcPacketEntities.Length)) | 32 | svcPacketEntities.Data = reader.TryReadBitsToSlice(uint64(svcPacketEntities.Length)) |
| 33 | // for count := 0; count < int(svcPacketEntities.UpdatedEntries); count++ { | ||
| 34 | // dataReader.TryReadBool() | ||
| 35 | // } | ||
| 36 | return svcPacketEntities | 33 | return svcPacketEntities |
| 37 | } | 34 | } |