summaryrefslogtreecommitdiffstats
path: root/build_spec.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build_spec.sh')
-rwxr-xr-xbuild_spec.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/build_spec.sh b/build_spec.sh
new file mode 100755
index 0000000..ae78b81
--- /dev/null
+++ b/build_spec.sh
@@ -0,0 +1,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.payload_type//' solec.lua
+
+cat <<EOT >> solec.lua
+local tcp_port = DissectorTable.get("tcp.port")
+tcp_port:add(9999, proto)
+EOT
+