AUTOSAR SOME/IP container: Lua parsing library

KS implementation details

License: CC0-1.0
Minimal Kaitai Struct required: 0.9

This page hosts a formal specification of AUTOSAR SOME/IP container using Kaitai Struct. This specification can be automatically translated into a variety of programming languages to get a parsing library.

Lua source code to parse AUTOSAR SOME/IP container

some_ip_container.lua

-- This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
--
-- This file is compatible with Lua 5.3

local class = require("class")
require("kaitaistruct")

require("some_ip")
SomeIpContainer = class.class(KaitaiStruct)

function SomeIpContainer:_init(io, parent, root)
  KaitaiStruct._init(self, io)
  self._parent = parent
  self._root = root or self
  self:_read()
end

function SomeIpContainer:_read()
  self.some_ip_packages = {}
  local i = 0
  while not self._io:is_eof() do
    self.some_ip_packages[i + 1] = SomeIp(self._io)
    i = i + 1
  end
end