mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-02 21:13:44 +00:00
libctrl: Add a function to create the cmd
This commit is contained in:
@@ -78,6 +78,7 @@ int ctrl_cmd_send(struct osmo_wqueue *queue, struct ctrl_cmd *cmd);
|
||||
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);
|
||||
|
||||
#define CTRL_CMD_DEFINE_RANGE(cmdname, cmdstr, dtype, element, min, max) \
|
||||
static int get_##cmdname(struct ctrl_cmd *cmd, void *data) \
|
||||
|
||||
@@ -239,6 +239,18 @@ int ctrl_cmd_install(enum ctrl_node_type node, struct ctrl_cmd_element *cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct ctrl_cmd *ctrl_cmd_create(void *ctx, enum ctrl_type type)
|
||||
{
|
||||
struct ctrl_cmd *cmd;
|
||||
|
||||
cmd = talloc_zero(ctx, struct ctrl_cmd);
|
||||
if (!cmd)
|
||||
return NULL;
|
||||
|
||||
cmd->type = type;
|
||||
return cmd;
|
||||
}
|
||||
|
||||
struct ctrl_cmd *ctrl_cmd_cpy(void *ctx, struct ctrl_cmd *cmd)
|
||||
{
|
||||
struct ctrl_cmd *cmd2;
|
||||
|
||||
Reference in New Issue
Block a user