diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/osmocom/ctrl/control_cmd.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/osmocom/ctrl/control_cmd.h b/include/osmocom/ctrl/control_cmd.h index 8f2eaa25..a63557d7 100644 --- a/include/osmocom/ctrl/control_cmd.h +++ b/include/osmocom/ctrl/control_cmd.h @@ -187,4 +187,28 @@ static int verify_##cmdname(struct ctrl_cmd *cmd, const char *value, void *data) } \ CTRL_CMD_DEFINE_STRUCT(cmdname, cmdstr, verify_##cmdname) +#define CTRL_CMD_DEFINE_WO(cmdname, cmdstr) \ +static int set_##cmdname(struct ctrl_cmd *cmd, void *data); \ +static int get_##cmdname(struct ctrl_cmd *cmd, void *data) \ +{ \ + cmd->reply = "Write Only attribute"; \ + return CTRL_CMD_ERROR; \ +} \ +static int verify_##cmdname(struct ctrl_cmd *cmd, const char *val, void *data); \ +CTRL_CMD_DEFINE_STRUCT(cmdname, cmdstr, verify_##cmdname) + + +#define CTRL_CMD_DEFINE_WO_NOVRF(cmdname, cmdstr) \ +static int set_##cmdname(struct ctrl_cmd *cmd, void *data); \ +static int get_##cmdname(struct ctrl_cmd *cmd, void *data) \ +{ \ + cmd->reply = "Write Only attribute"; \ + return CTRL_CMD_ERROR; \ +} \ +static int verify_##cmdname(struct ctrl_cmd *cmd, const char *val, void *data) \ +{ \ + return 0; \ +} \ +CTRL_CMD_DEFINE_STRUCT(cmdname, cmdstr, verify_##cmdname) + struct gsm_network; |