summaryrefslogtreecommitdiffstats
path: root/build_spec.sh
blob: dfebbd2ae418d5ae1070c287b7e498b5e38c0268 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

if [[ "$OSTYPE" == "darwin"* ]]; then
  SED=gsed
else
  SED=sed
fi

kaitai-struct-compiler -t graphviz solec.ksy
dot -Tsvg solec.dot > solec.svg
rm solec.dot

~/bin/kaitai-struct-compiler-ws/bin/kaitai-struct-compiler -t wireshark --read-pos solec.ksy

${SED} -i -e '5s/.*/package.path = "kaitai_struct_lua_runtime\/?.lua" .. package.path/' solec.lua
${SED} -i -e 's/, self.type_payload//' solec.lua

cat <<EOT >> solec.lua
local tcp_port = DissectorTable.get("tcp.port")
tcp_port:add(9999, proto)
EOT