summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-05-02 16:44:43 +0200
committerHarald Welte <laforge@gnumonks.org>2017-05-04 13:35:13 +0000
commit50eb66996d4d68d32f6b1ee8c9adfc8046808266 (patch)
tree8247985a1979ff72f2aacebfb43bb2c1f41aa22b
parent086067f0a13846590130379bfeffeb2962cd4708 (diff)
ctrl: remove boilerplate code
Define subscriber-list-active-v1 ctrl command as RO and remove unnecessary functions. Change-Id: I88fe905c22cf7563415d470b88cb43fca0d52a7f
-rw-r--r--openbsc/src/gprs/sgsn_ctrl.c13
-rw-r--r--openbsc/src/libmsc/ctrl_commands.c13
2 files changed, 2 insertions, 24 deletions
diff --git a/openbsc/src/gprs/sgsn_ctrl.c b/openbsc/src/gprs/sgsn_ctrl.c
index ccf507672..31ac74f1f 100644
--- a/openbsc/src/gprs/sgsn_ctrl.c
+++ b/openbsc/src/gprs/sgsn_ctrl.c
@@ -30,17 +30,6 @@
extern vector ctrl_node_vec;
-static int verify_subscriber_list(struct ctrl_cmd *cmd, const char *v, void *d)
-{
- return 1;
-}
-
-static int set_subscriber_list(struct ctrl_cmd *cmd, void *d)
-{
- cmd->reply = "Get only attribute";
- return CTRL_CMD_ERROR;
-}
-
static int get_subscriber_list(struct ctrl_cmd *cmd, void *d)
{
struct sgsn_mm_ctx *mm;
@@ -64,7 +53,7 @@ static int get_subscriber_list(struct ctrl_cmd *cmd, void *d)
return CTRL_CMD_REPLY;
}
-CTRL_CMD_DEFINE(subscriber_list, "subscriber-list-active-v1");
+CTRL_CMD_DEFINE_RO(subscriber_list, "subscriber-list-active-v1");
int sgsn_ctrl_cmds_install(void)
{
diff --git a/openbsc/src/libmsc/ctrl_commands.c b/openbsc/src/libmsc/ctrl_commands.c
index a56d122d2..c99dde44c 100644
--- a/openbsc/src/libmsc/ctrl_commands.c
+++ b/openbsc/src/libmsc/ctrl_commands.c
@@ -184,17 +184,6 @@ static int set_subscriber_delete(struct ctrl_cmd *cmd, void *data)
}
CTRL_CMD_DEFINE_WO_NOVRF(subscriber_delete, "subscriber-delete-v1");
-static int verify_subscriber_list(struct ctrl_cmd *cmd, const char *value, void *d)
-{
- return 1;
-}
-
-static int set_subscriber_list(struct ctrl_cmd *cmd, void *d)
-{
- cmd->reply = "Get only attribute";
- return CTRL_CMD_ERROR;
-}
-
static void list_cb(struct gsm_subscriber *subscr, void *d)
{
char **data = (char **) d;
@@ -210,7 +199,7 @@ static int get_subscriber_list(struct ctrl_cmd *cmd, void *d)
printf("%s\n", cmd->reply);
return CTRL_CMD_REPLY;
}
-CTRL_CMD_DEFINE(subscriber_list, "subscriber-list-active-v1");
+CTRL_CMD_DEFINE_RO(subscriber_list, "subscriber-list-active-v1");
int msc_ctrl_cmds_install(void)
{