diff options
| author | bt <bt@rctt.net> | 2026-03-29 08:51:30 +0200 |
|---|---|---|
| committer | bt <bt@rctt.net> | 2026-03-29 08:51:30 +0200 |
| commit | 69703f3a808edd9b1e12f5e0c226abae2e79fa21 (patch) | |
| tree | c44cfa8ccb73c82f20337928fdd05c5128b9f710 /solec.lua | |
| parent | 52d6632a0b51e48334ada3ec4d489d15c2d59c8a (diff) | |
| download | solec-69703f3a808edd9b1e12f5e0c226abae2e79fa21.tar.gz solec-69703f3a808edd9b1e12f5e0c226abae2e79fa21.zip | |
[docs] Update README.md and protocol diagram
Diffstat (limited to 'solec.lua')
| -rw-r--r-- | solec.lua | 34 |
1 files changed, 4 insertions, 30 deletions
@@ -23,10 +23,6 @@ local Solec_Test_num3 = ProtoField.new('num3', 'Solec.Test.num3', ftypes.UINT32) table.insert(proto.fields, Solec_Test_num3) local Solec_Test_num4 = ProtoField.new('num4', 'Solec.Test.num4', ftypes.UINT32) table.insert(proto.fields, Solec_Test_num4) -local Solec_Binary_len_payload = ProtoField.new('len_payload', 'Solec.Binary.len_payload', ftypes.UINT32) -table.insert(proto.fields, Solec_Binary_len_payload) -local Solec_Binary_payload = ProtoField.new('payload', 'Solec.Binary.payload', ftypes.BYTES) -table.insert(proto.fields, Solec_Binary_payload) local Solec_String_len_payload = ProtoField.new('len_payload', 'Solec.String.len_payload', ftypes.UINT32) table.insert(proto.fields, Solec_String_len_payload) local str_decode = require("string_decode") @@ -152,15 +148,15 @@ function Solec.Test:_read() self.num2 = self._io:read_u2be() self._tree:add(Solec_Test_num2, self._io._io.tvb(_offset, self._io:pos() - _offset), self.num2) local _offset = self._io:pos() - local _tree = self._tree:add(self._io._io.tvb(_offset, 0), 'bin1') - self.bin1 = Solec.Binary(self._io, _tree, self, self._root) + local _tree = self._tree:add(self._io._io.tvb(_offset, 0), 'str2') + self.str2 = Solec.String(self._io, _tree, self, self._root) _tree:set_len(self._io:pos() - _offset) local _offset = self._io:pos() self.num3 = self._io:read_u4be() self._tree:add(Solec_Test_num3, self._io._io.tvb(_offset, self._io:pos() - _offset), self.num3) local _offset = self._io:pos() - local _tree = self._tree:add(self._io._io.tvb(_offset, 0), 'str2') - self.str2 = Solec.String(self._io, _tree, self, self._root) + local _tree = self._tree:add(self._io._io.tvb(_offset, 0), 'str3') + self.str3 = Solec.String(self._io, _tree, self, self._root) _tree:set_len(self._io:pos() - _offset) local _offset = self._io:pos() self.num4 = self._io:read_u8be() @@ -184,28 +180,6 @@ function Solec.Success:_read() end --- --- Binary data of unspecifed type. -Solec.Binary = class.class(KaitaiStruct) - -function Solec.Binary:_init(io, tree, parent, root) - KaitaiStruct._init(self, io) - self._parent = parent - self._root = root or self - self._tree = tree - self:_read() -end - -function Solec.Binary:_read() - local _offset = self._io:pos() - self.len_payload = self._io:read_u2be() - self._tree:add(Solec_Binary_len_payload, self._io._io.tvb(_offset, self._io:pos() - _offset), self.len_payload) - local _offset = self._io:pos() - self.payload = self._io:read_bytes(self.len_payload) - self._tree:add(Solec_Binary_payload, self._io._io.tvb(_offset, self._io:pos() - _offset), self.payload) -end - - Solec.Auth = class.class(KaitaiStruct) function Solec.Auth:_init(io, tree, parent, root) |
