diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2024-06-15 13:58:30 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-15 13:58:30 +0300 |
| commit | 77e4b066cb8d506b4bc944ab4eb2d6e4679e2202 (patch) | |
| tree | 1d549eca619ed36cb881e487cb054c4643ac8376 /pkg/messages/types/svcPacketEntities.go | |
| parent | change project name to sdp.go (diff) | |
| download | sdp.go-77e4b066cb8d506b4bc944ab4eb2d6e4679e2202.tar.gz sdp.go-77e4b066cb8d506b4bc944ab4eb2d6e4679e2202.tar.bz2 sdp.go-77e4b066cb8d506b4bc944ab4eb2d6e4679e2202.zip | |
enable multithreading with goroutines (#20)
Diffstat (limited to 'pkg/messages/types/svcPacketEntities.go')
| -rw-r--r-- | pkg/messages/types/svcPacketEntities.go | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/pkg/messages/types/svcPacketEntities.go b/pkg/messages/types/svcPacketEntities.go index 188f827..abef83d 100644 --- a/pkg/messages/types/svcPacketEntities.go +++ b/pkg/messages/types/svcPacketEntities.go | |||
| @@ -2,21 +2,21 @@ package messages | |||
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | "github.com/pektezol/bitreader" | 4 | "github.com/pektezol/bitreader" |
| 5 | "github.com/pektezol/sdp.go/pkg/writer" | 5 | "github.com/pektezol/sdp.go/pkg/types" |
| 6 | ) | 6 | ) |
| 7 | 7 | ||
| 8 | type SvcPacketEntities struct { | 8 | type SvcPacketEntities struct { |
| 9 | MaxEntries uint16 | 9 | MaxEntries uint16 `json:"max_entries"` |
| 10 | IsDelta bool | 10 | IsDelta bool `json:"is_delta"` |
| 11 | DeltaFrom int32 | 11 | DeltaFrom int32 `json:"delta_from"` |
| 12 | BaseLine bool | 12 | BaseLine bool `json:"base_line"` |
| 13 | UpdatedEntries uint16 | 13 | UpdatedEntries uint16 `json:"updated_entries"` |
| 14 | Length uint32 | 14 | Length uint32 `json:"length"` |
| 15 | UpdatedBaseline bool | 15 | UpdatedBaseline bool `json:"updated_baseline"` |
| 16 | Data []byte | 16 | Data []byte `json:"data"` |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | func ParseSvcPacketEntities(reader *bitreader.Reader) SvcPacketEntities { | 19 | func ParseSvcPacketEntities(reader *bitreader.Reader, demo *types.Demo) SvcPacketEntities { |
| 20 | svcPacketEntities := SvcPacketEntities{ | 20 | svcPacketEntities := SvcPacketEntities{ |
| 21 | MaxEntries: uint16(reader.TryReadBits(11)), | 21 | MaxEntries: uint16(reader.TryReadBits(11)), |
| 22 | IsDelta: reader.TryReadBool(), | 22 | IsDelta: reader.TryReadBool(), |
| @@ -31,12 +31,12 @@ func ParseSvcPacketEntities(reader *bitreader.Reader) SvcPacketEntities { | |||
| 31 | svcPacketEntities.Length = uint32(reader.TryReadBits(20)) | 31 | svcPacketEntities.Length = uint32(reader.TryReadBits(20)) |
| 32 | svcPacketEntities.UpdatedBaseline = reader.TryReadBool() | 32 | svcPacketEntities.UpdatedBaseline = reader.TryReadBool() |
| 33 | svcPacketEntities.Data = reader.TryReadBitsToSlice(uint64(svcPacketEntities.Length)) | 33 | svcPacketEntities.Data = reader.TryReadBitsToSlice(uint64(svcPacketEntities.Length)) |
| 34 | writer.TempAppendLine("\t\tMax Entries: %d", svcPacketEntities.MaxEntries) | 34 | demo.Writer.TempAppendLine("\t\tMax Entries: %d", svcPacketEntities.MaxEntries) |
| 35 | writer.TempAppendLine("\t\tIs Delta: %t", svcPacketEntities.IsDelta) | 35 | demo.Writer.TempAppendLine("\t\tIs Delta: %t", svcPacketEntities.IsDelta) |
| 36 | writer.TempAppendLine("\t\tDelta From: %d", svcPacketEntities.DeltaFrom) | 36 | demo.Writer.TempAppendLine("\t\tDelta From: %d", svcPacketEntities.DeltaFrom) |
| 37 | writer.TempAppendLine("\t\tBaseline: %t", svcPacketEntities.BaseLine) | 37 | demo.Writer.TempAppendLine("\t\tBaseline: %t", svcPacketEntities.BaseLine) |
| 38 | writer.TempAppendLine("\t\tUpdated Baseline: %t", svcPacketEntities.UpdatedBaseline) | 38 | demo.Writer.TempAppendLine("\t\tUpdated Baseline: %t", svcPacketEntities.UpdatedBaseline) |
| 39 | writer.TempAppendLine("\t\t%d Updated Entries:", svcPacketEntities.UpdatedEntries) | 39 | demo.Writer.TempAppendLine("\t\t%d Updated Entries:", svcPacketEntities.UpdatedEntries) |
| 40 | writer.TempAppendLine("\t\tData: %v", svcPacketEntities.Data) | 40 | demo.Writer.TempAppendLine("\t\tData: %v", svcPacketEntities.Data) |
| 41 | return svcPacketEntities | 41 | return svcPacketEntities |
| 42 | } | 42 | } |