Add legit test for pdu encoding

This commit is contained in:
2024-07-24 20:58:12 +02:00
parent d25058fdec
commit 38976d6bc8
3 changed files with 49 additions and 26 deletions

View File

@@ -12,6 +12,7 @@ type (
Decode(*bytes.Buffer) error
// Size in bytes
Size() int
UpdateSize()
}
PDU_HEADER struct {
@@ -80,3 +81,6 @@ func (p *PDU_HEADER) Decode(buf *bytes.Buffer) error {
func (p *PDU_HEADER) Size() int {
return 16
}
func (p *PDU_HEADER) UpdateSize() {
p.command_length = uint32(p.Size())
}