summaryrefslogtreecommitdiffstats
path: root/solec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'solec.lua')
-rw-r--r--solec.lua34
1 files changed, 4 insertions, 30 deletions
diff --git a/solec.lua b/solec.lua
index 85efaad..6dece06 100644
--- a/solec.lua
+++ b/solec.lua
@@ -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)