aboutsummaryrefslogtreecommitdiff
path: root/pkg/messages/types/svcUpdateStringTable.go
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-09-12 20:53:09 +0300
committerArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-09-16 21:39:42 +0300
commit82871ba1bac1d62f69e1933b66659e62d2e5e063 (patch)
treea906310fba89b670bcfda9625a6d776553d482f6 /pkg/messages/types/svcUpdateStringTable.go
parentnet/svc messages finally getting parsed correctly (diff)
downloadsdp.go-82871ba1bac1d62f69e1933b66659e62d2e5e063.tar.gz
sdp.go-82871ba1bac1d62f69e1933b66659e62d2e5e063.tar.bz2
sdp.go-82871ba1bac1d62f69e1933b66659e62d2e5e063.zip
another rewrite, v1.0.0
Diffstat (limited to 'pkg/messages/types/svcUpdateStringTable.go')
-rw-r--r--pkg/messages/types/svcUpdateStringTable.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/pkg/messages/types/svcUpdateStringTable.go b/pkg/messages/types/svcUpdateStringTable.go
new file mode 100644
index 0000000..2840482
--- /dev/null
+++ b/pkg/messages/types/svcUpdateStringTable.go
@@ -0,0 +1,22 @@
1package messages
2
3import "github.com/pektezol/bitreader"
4
5type SvcUpdateStringTable struct {
6 TableId int8
7 NumChangedEntries int16
8 Length int32
9 Data []byte
10}
11
12func ParseSvcUpdateStringTable(reader *bitreader.ReaderType) SvcUpdateStringTable {
13 svcUpdateStringTable := SvcUpdateStringTable{
14 TableId: int8(reader.TryReadBits(5)),
15 }
16 if reader.TryReadBool() {
17 svcUpdateStringTable.NumChangedEntries = int16(reader.TryReadBits(16))
18 }
19 svcUpdateStringTable.Length = int32(reader.TryReadBits(20))
20 svcUpdateStringTable.Data = reader.TryReadBitsToSlice(int(svcUpdateStringTable.Length))
21 return svcUpdateStringTable
22}