From b59f450314140968e57f5a6bbbf7e6128fff3d6e Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Thu, 25 Aug 2011 16:37:45 +0200 Subject: libctrl, osmo-bsc: Get rid of net prefix net is now implicit in the root node --- openbsc/include/openbsc/control_cmd.h | 1 - openbsc/src/libctrl/control_if.c | 13 +++---------- openbsc/src/osmo-bsc/osmo_bsc_ctrl.c | 4 ++-- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/openbsc/include/openbsc/control_cmd.h b/openbsc/include/openbsc/control_cmd.h index 3ee2174e1..c4a3af17e 100644 --- a/openbsc/include/openbsc/control_cmd.h +++ b/openbsc/include/openbsc/control_cmd.h @@ -12,7 +12,6 @@ enum ctrl_node_type { CTRL_NODE_ROOT, /* Root elements */ - CTRL_NODE_NET, /* Network specific (net.) */ CTRL_NODE_BTS, /* BTS specific (net.btsN.) */ CTRL_NODE_TRX, /* TRX specific (net.btsN.trxM.) */ CTRL_NODE_TS, /* TS specific (net.btsN.trxM.tsI.) */ diff --git a/openbsc/src/libctrl/control_if.c b/openbsc/src/libctrl/control_if.c index 40ca21221..630b7e77b 100644 --- a/openbsc/src/libctrl/control_if.c +++ b/openbsc/src/libctrl/control_if.c @@ -137,9 +137,8 @@ int ctrl_cmd_handle(struct ctrl_cmd *cmd, void *data) char *token, *request; long num; int i, j, ret, node; - struct gsm_network *gsmnet = data; - struct gsm_network *net = NULL; + struct gsm_network *net = data; struct gsm_bts *bts = NULL; struct gsm_bts_trx *trx = NULL; struct gsm_bts_trx_ts *ts = NULL; @@ -147,8 +146,8 @@ int ctrl_cmd_handle(struct ctrl_cmd *cmd, void *data) ret = CTRL_CMD_ERROR; cmd->reply = "Someone forgot to fill in the reply."; - cmd->node = NULL; node = CTRL_NODE_ROOT; + cmd->node = net; request = talloc_strdup(tall_bsc_ctx, cmd->variable); if (!request) @@ -171,13 +170,7 @@ int ctrl_cmd_handle(struct ctrl_cmd *cmd, void *data) /* TODO: We need to make sure that the following chars are digits * and/or use strtol to check if number conversion was successful * Right now something like net.bts_stats will not work */ - if (!strcmp(token, "net")) { - net = gsmnet; - if (!net) - goto err_missing; - cmd->node = net; - node = CTRL_NODE_NET; - } else if (!strcmp(token, "bts")) { + if (!strcmp(token, "bts")) { if (!net) goto err_missing; i++; diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c index 45b8e3323..d6ff9269c 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c @@ -67,7 +67,7 @@ static void generate_location_state_trap(struct gsm_bts *bts, struct bsc_msc_con } cmd->id = "0"; - cmd->variable = talloc_asprintf(cmd, "net.bts.%i.location-state", bts->nr); + cmd->variable = talloc_asprintf(cmd, "bts.%i.location-state", bts->nr); /* Prepare the location reply */ cmd->node = bts; @@ -318,7 +318,7 @@ int bsc_ctrl_cmds_install() rc = ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_loc); if (rc) goto end; - rc = ctrl_cmd_install(CTRL_NODE_NET, &cmd_net_rf_lock); + rc = ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_rf_lock); if (rc) goto end; end: -- cgit v1.2.3