ctrl: remove boilerplate code

Define subscriber-list-active-v1 ctrl command as RO and remove
unnecessary functions.

Change-Id: I88fe905c22cf7563415d470b88cb43fca0d52a7f
changes/88/3188/1
Maxim Suraev 6 years ago committed by Harald Welte
parent 086067f0a1
commit 50eb66996d
  1. 13
      openbsc/src/gprs/sgsn_ctrl.c
  2. 13
      openbsc/src/libmsc/ctrl_commands.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)
{

@ -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)
{

Loading…
Cancel
Save