summaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-05-14 09:50:27 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-05-15 15:30:52 +0200
commit1159005ae02f8c9e42624769ec1b2a8d84c9dee5 (patch)
tree6a229dad6dc61d84de77cd98a4a8d8ed65578eb9 /openbsc/src/osmo-bsc
parent268b2e65446fef5c3ddb3bb4423ddf376929e731 (diff)
ctrl: Introduce a macro for read-only attributes and use it
Certain attributes are read-only. Add a macro to make it more easy to define those.
Diffstat (limited to 'openbsc/src/osmo-bsc')
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_ctrl.c38
1 files changed, 3 insertions, 35 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
index e32218d..d3593de 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
@@ -58,7 +58,7 @@ void osmo_bsc_send_trap(struct ctrl_cmd *cmd, struct bsc_msc_connection *msc_con
talloc_free(trap);
}
-CTRL_CMD_DEFINE(msc_connection_status, "msc_connection_status");
+CTRL_CMD_DEFINE_RO(msc_connection_status, "msc_connection_status");
static int msc_connection_status = 0;
static int get_msc_connection_status(struct ctrl_cmd *cmd, void *data)
@@ -70,17 +70,6 @@ static int get_msc_connection_status(struct ctrl_cmd *cmd, void *data)
return CTRL_CMD_REPLY;
}
-static int set_msc_connection_status(struct ctrl_cmd *cmd, void *data)
-{
- return CTRL_CMD_ERROR;
-}
-
-static int verify_msc_connection_status(struct ctrl_cmd *cmd, const char *value, void *data)
-{
- cmd->reply = "Read-only property";
- return 1;
-}
-
static int msc_connection_status_trap_cb(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data)
{
struct ctrl_cmd *cmd;
@@ -114,7 +103,7 @@ static int msc_connection_status_trap_cb(unsigned int subsys, unsigned int signa
return 0;
}
-CTRL_CMD_DEFINE(bts_connection_status, "bts_connection_status");
+CTRL_CMD_DEFINE_RO(bts_connection_status, "bts_connection_status");
static int bts_connection_status = 0;
static int get_bts_connection_status(struct ctrl_cmd *cmd, void *data)
@@ -126,17 +115,6 @@ static int get_bts_connection_status(struct ctrl_cmd *cmd, void *data)
return CTRL_CMD_REPLY;
}
-static int set_bts_connection_status(struct ctrl_cmd *cmd, void *data)
-{
- return CTRL_CMD_ERROR;
-}
-
-static int verify_bts_connection_status(struct ctrl_cmd *cmd, const char *value, void *data)
-{
- cmd->reply = "Read-only property";
- return 1;
-}
-
static int bts_connection_status_trap_cb(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data)
{
struct ctrl_cmd *cmd;
@@ -496,7 +474,7 @@ err:
return 1;
}
-CTRL_CMD_DEFINE(bts_rf_state, "rf_state");
+CTRL_CMD_DEFINE_RO(bts_rf_state, "rf_state");
static int get_bts_rf_state(struct ctrl_cmd *cmd, void *data)
{
const char *oper, *admin, *policy;
@@ -520,16 +498,6 @@ static int get_bts_rf_state(struct ctrl_cmd *cmd, void *data)
return CTRL_CMD_REPLY;
}
-static int set_bts_rf_state(struct ctrl_cmd *cmd, void *data)
-{
- cmd->reply = "set is unimplemented";
- return CTRL_CMD_ERROR;
-}
-
-static int verify_bts_rf_state(struct ctrl_cmd *cmd, const char *value, void *data)
-{
- return 0;
-}
CTRL_CMD_DEFINE(net_rf_lock, "rf_locked");
static int get_net_rf_lock(struct ctrl_cmd *cmd, void *data)