summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openbsc/include/openbsc/control_cmd.h1
-rw-r--r--openbsc/src/libctrl/control_if.c13
2 files changed, 14 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/control_cmd.h b/openbsc/include/openbsc/control_cmd.h
index a3f74b48..f4785690 100644
--- a/openbsc/include/openbsc/control_cmd.h
+++ b/openbsc/include/openbsc/control_cmd.h
@@ -79,6 +79,7 @@ struct ctrl_cmd *ctrl_cmd_parse(void *ctx, struct msgb *msg);
struct msgb *ctrl_cmd_make(struct ctrl_cmd *cmd);
struct ctrl_cmd *ctrl_cmd_cpy(void *ctx, struct ctrl_cmd *cmd);
struct ctrl_cmd *ctrl_cmd_create(void *ctx, enum ctrl_type);
+struct ctrl_cmd *ctrl_cmd_trap(struct ctrl_cmd *cmd);
#define CTRL_CMD_DEFINE_RANGE(cmdname, cmdstr, dtype, element, min, max) \
static int get_##cmdname(struct ctrl_cmd *cmd, void *data) \
diff --git a/openbsc/src/libctrl/control_if.c b/openbsc/src/libctrl/control_if.c
index e871a519..f68cb809 100644
--- a/openbsc/src/libctrl/control_if.c
+++ b/openbsc/src/libctrl/control_if.c
@@ -87,6 +87,19 @@ int ctrl_cmd_send(struct osmo_wqueue *queue, struct ctrl_cmd *cmd)
return ret;
}
+struct ctrl_cmd *ctrl_cmd_trap(struct ctrl_cmd *cmd)
+{
+ struct ctrl_cmd *trap;
+
+ trap = ctrl_cmd_cpy(tall_bsc_ctx, cmd);
+ if (!trap)
+ return NULL;
+
+ trap->ccon = cmd->ccon;
+ trap->type = CTRL_TYPE_TRAP;
+ return trap;
+}
+
int ctrl_cmd_handle(struct ctrl_cmd *cmd, void *data)
{
char *token, *request;