ms: Add lua script support utilities

Add a JSON encoder and a small module to sent registration and
other events per unix datagram socket.

json.lua fetched using:
$ wget -O src/osmo_ms_driver/lua/json.lua \
https://raw.githubusercontent.com/rxi/json.lua/master/json.lua

Change-Id: I43ae84a944c7f33e41d5de0880d4aaab3378809b
diff --git a/src/osmo_ms_driver/lua/ms_support.lua b/src/osmo_ms_driver/lua/ms_support.lua
new file mode 100644
index 0000000..817a564
--- /dev/null
+++ b/src/osmo_ms_driver/lua/ms_support.lua
@@ -0,0 +1,31 @@
+json = require("json")
+socket = require("socket")
+socket.unix = require("socket.unix")
+
+local g_c = socket.unix.dgram()
+local g_ms = nil
+
+local mod = {}
+
+-- Register the MS instance with the system
+function mod.register(ms, path)
+	g_ms = ms
+
+	g_c:connect(path)
+
+	local event = {}
+	event['ms'] = g_ms
+	event['type'] = 'register'
+	g_c:send(json.encode(event))
+end
+
+-- Send an event
+function mod.send(data)
+	local event = {}
+	event['ms'] = g_ms
+	event['type'] = 'event'
+	event['data'] = data
+	g_c:send(json.encode(event))
+end
+
+return mod