summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/include/osmocom/bb
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2017-11-08 14:59:06 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2017-12-03 12:58:53 +0000
commit4080e622b7661c0f2305c3d4d84021a456a76ceb (patch)
treee4217e1c22b42af4fbc90c00e56b49272122deae /src/host/layer23/include/osmocom/bb
parent32dec4236e5bf3753bd84715d5e099272ea5d481 (diff)
mobile: Add initial support for scripting support
Right now the script will be executed once it is loaded. Make sure to write it into the config file last. Expose various log commands for logging. Jump through some hoops and get the filename and line number from lua. Change-Id: I456f6b6b5e1a14ed6c8cb0dcc5140093d3c61ef6
Diffstat (limited to 'src/host/layer23/include/osmocom/bb')
-rw-r--r--src/host/layer23/include/osmocom/bb/common/osmocom_data.h3
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/app_mobile.h4
2 files changed, 7 insertions, 0 deletions
diff --git a/src/host/layer23/include/osmocom/bb/common/osmocom_data.h b/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
index 7a935f97..8f5cdc33 100644
--- a/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
+++ b/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
@@ -85,6 +85,9 @@ struct osmocom_ms {
struct gsm48_cclayer cclayer;
struct osmomncc_entity mncc_entity;
struct llist_head trans_list;
+
+ void *lua_state;
+ char *lua_script;
};
enum osmobb_sig_subsys {
diff --git a/src/host/layer23/include/osmocom/bb/mobile/app_mobile.h b/src/host/layer23/include/osmocom/bb/mobile/app_mobile.h
index 7abfda1f..c2ab3c88 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/app_mobile.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/app_mobile.h
@@ -6,6 +6,7 @@
extern char *config_dir;
struct osmocom_ms;
+struct vty;
int l23_app_init(int (*mncc_recv)(struct osmocom_ms *ms, int, void *),
const char *config_file, const char *vty_ip, uint16_t vty_port);
@@ -20,6 +21,9 @@ int mobile_stop(struct osmocom_ms *ms, int force);
void mobile_set_started(struct osmocom_ms *ms, bool state);
void mobile_set_shutdown(struct osmocom_ms *ms, int state);
+int script_lua_load(struct vty *vty, struct osmocom_ms *ms, const char *filename);
+int script_lua_close(struct osmocom_ms *ms);
+
/* Internal code. Don't call directly */
int mobile_exit(struct osmocom_ms *ms, int force);