aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2020-11-04 17:32:11 +0100
committerlaforge <laforge@osmocom.org>2020-11-11 20:11:50 +0000
commit638cddd8f18e3f362a1bbb18ccc986c174a015a6 (patch)
tree1756c09fca2de67377b3c20d642fb64ef459393b
parent58937ce3336c6ac3a720202f285bef4775751cbf (diff)
osmo-gbproxy: Implement nsvc-state ctrl command
-rw-r--r--src/gbproxy/gb_proxy_ctrl.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/gbproxy/gb_proxy_ctrl.c b/src/gbproxy/gb_proxy_ctrl.c
index 3ebc7d17..95773830 100644
--- a/src/gbproxy/gb_proxy_ctrl.c
+++ b/src/gbproxy/gb_proxy_ctrl.c
@@ -33,12 +33,20 @@
extern vector ctrl_node_vec;
+struct nsvc_cb_data {
+ struct ctrl_cmd *cmd;
+ uint16_t nsei;
+ bool is_sgsn;
+};
+
static int ctrl_nsvc_state_cb(struct gprs_ns2_vc *nsvc, void *ctx) {
-/* FIXME: Can't get NSVC state in ns2
- struct ctrl_cmd *cmd = (struct ctrl_cmd *)ctx;
+ struct nsvc_cb_data *data = (struct nsvc_cb_data *)ctx;
+ struct ctrl_cmd *cmd = (struct ctrl_cmd *)data->cmd;
+
+ cmd->reply = talloc_asprintf_append(cmd->reply, "%u,%s,%s,%s\n",
+ data->nsei, gprs_ns2_ll_str(nsvc), gprs_ns2_nsvc_state_name(nsvc),
+ data->is_sgsn ? "SGSN" : "BSS" );
- cmd->reply = gprs_ns2_vc_state_append(cmd->reply, nsvc);
-*/
return 0;
}
@@ -66,8 +74,8 @@ static int get_nsvc_state(struct ctrl_cmd *cmd, void *data)
if (nse)
gprs_ns2_nse_foreach_nsvc(nse, &ctrl_nsvc_state_cb, cmd);
}
- cmd->reply = "Getting NSVC state not yet implemented for NS2";
- return CTRL_CMD_ERROR;
+
+ return CTRL_CMD_REPLY;
}
CTRL_CMD_DEFINE_RO(nsvc_state, "nsvc-state");