diff options
author | Daniel Willmann <daniel@totalueberwachung.de> | 2011-08-05 11:48:18 +0200 |
---|---|---|
committer | Daniel Willmann <daniel@totalueberwachung.de> | 2011-08-22 19:24:34 +0200 |
commit | 91914cbec20aa0c27e54578c142cec4c6d82a20b (patch) | |
tree | fbc7c0dc1121771ecdbc8912309638361ff57255 | |
parent | 4af112527ae40bef603271c7d0365dbd09638fe9 (diff) |
libctrl: Mark the cmd set/get/verify functions static
-rw-r--r-- | openbsc/include/openbsc/control_cmd.h | 16 | ||||
-rw-r--r-- | openbsc/src/libctrl/control_if.c | 12 | ||||
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_main.c | 20 | ||||
-rw-r--r-- | openbsc/src/osmo-bsc_nat/bsc_nat.c | 6 |
4 files changed, 27 insertions, 27 deletions
diff --git a/openbsc/include/openbsc/control_cmd.h b/openbsc/include/openbsc/control_cmd.h index b75514b34..e9683be08 100644 --- a/openbsc/include/openbsc/control_cmd.h +++ b/openbsc/include/openbsc/control_cmd.h @@ -90,7 +90,7 @@ struct ctrl_cmd *ctrl_cmd_cpy(void *ctx, struct ctrl_cmd *cmd); struct ctrl_cmd *ctrl_cmd_trap(struct ctrl_cmd *cmd); #define CTRL_CMD_DEFINE_RANGE(cmdname, cmdstr, dtype, element, min, max) \ -int get_##cmdname(struct ctrl_cmd *cmd, void *data) \ +static int get_##cmdname(struct ctrl_cmd *cmd, void *data) \ { \ dtype *node = data; \ cmd->reply = talloc_asprintf(cmd, "%i", node->element); \ @@ -100,14 +100,14 @@ int get_##cmdname(struct ctrl_cmd *cmd, void *data) \ } \ return CTRL_CMD_REPLY; \ } \ -int set_##cmdname(struct ctrl_cmd *cmd, void *data) \ +static int set_##cmdname(struct ctrl_cmd *cmd, void *data) \ { \ dtype *node = data; \ int tmp = atoi(cmd->value); \ node->element = tmp; \ return get_##cmdname(cmd, data); \ } \ -int verify_##cmdname(struct ctrl_cmd *cmd, const char *value, void *data) \ +static int verify_##cmdname(struct ctrl_cmd *cmd, const char *value, void *data) \ { \ int tmp = atoi(value); \ if ((tmp >= min)&&(tmp <= max)) { \ @@ -124,7 +124,7 @@ struct ctrl_cmd_element cmd_##cmdname = { \ } #define CTRL_CMD_DEFINE_STRING(cmdname, cmdstr, dtype, element) \ -int get_##cmdname(struct ctrl_cmd *cmd, dtype *data) \ +static int get_##cmdname(struct ctrl_cmd *cmd, dtype *data) \ { \ cmd->reply = talloc_asprintf(cmd, "%s", data->element); \ if (!cmd->reply) { \ @@ -133,7 +133,7 @@ int get_##cmdname(struct ctrl_cmd *cmd, dtype *data) \ } \ return CTRL_CMD_REPLY; \ } \ -int set_##cmdname(struct ctrl_cmd *cmd, dtype *data) \ +static int set_##cmdname(struct ctrl_cmd *cmd, dtype *data) \ { \ bsc_replace_string(cmd->node, &data->element, cmd->value); \ return get_##cmdname(cmd, data); \ @@ -147,9 +147,9 @@ struct ctrl_cmd_element cmd_##cmdname = { \ } #define CTRL_CMD_DEFINE(cmdname, cmdstr) \ -int get_##cmdname(struct ctrl_cmd *cmd, void *data); \ -int set_##cmdname(struct ctrl_cmd *cmd, void *data); \ -int verify_##cmdname(struct ctrl_cmd *cmd, const char *value, void *data); \ +static int get_##cmdname(struct ctrl_cmd *cmd, void *data); \ +static int set_##cmdname(struct ctrl_cmd *cmd, void *data); \ +static int verify_##cmdname(struct ctrl_cmd *cmd, const char *value, void *data); \ struct ctrl_cmd_element cmd_##cmdname = { \ .name = cmdstr, \ .param = NULL, \ diff --git a/openbsc/src/libctrl/control_if.c b/openbsc/src/libctrl/control_if.c index c2fc1d0be..0115b3a26 100644 --- a/openbsc/src/libctrl/control_if.c +++ b/openbsc/src/libctrl/control_if.c @@ -464,7 +464,7 @@ oom: /* rate_ctr */ CTRL_CMD_DEFINE(rate_ctr, "rate_ctr *"); -int get_rate_ctr(struct ctrl_cmd *cmd, void *data) +static int get_rate_ctr(struct ctrl_cmd *cmd, void *data) { int intv; unsigned int idx; @@ -557,21 +557,21 @@ err: return CTRL_CMD_ERROR; } -int set_rate_ctr(struct ctrl_cmd *cmd, void *data) +static int set_rate_ctr(struct ctrl_cmd *cmd, void *data) { cmd->reply = "Can't set rate counter."; return CTRL_CMD_ERROR; } -int verify_rate_ctr(struct ctrl_cmd *cmd, const char *value, void *data) +static int verify_rate_ctr(struct ctrl_cmd *cmd, const char *value, void *data) { return 0; } /* counter */ CTRL_CMD_DEFINE(counter, "counter *"); -int get_counter(struct ctrl_cmd *cmd, void *data) +static int get_counter(struct ctrl_cmd *cmd, void *data) { char *ctr_name, *tmp, *dup, *saveptr; struct osmo_counter *counter; @@ -614,7 +614,7 @@ err: return CTRL_CMD_ERROR; } -int set_counter(struct ctrl_cmd *cmd, void *data) +static int set_counter(struct ctrl_cmd *cmd, void *data) { cmd->reply = "Can't set counter."; @@ -622,7 +622,7 @@ int set_counter(struct ctrl_cmd *cmd, void *data) return CTRL_CMD_ERROR; } -int verify_counter(struct ctrl_cmd *cmd, const char *value, void *data) +static int verify_counter(struct ctrl_cmd *cmd, const char *value, void *data) { return 0; } diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c index 7088ca3c4..e51c74371 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_main.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c @@ -215,7 +215,7 @@ static int location_equal(struct location *a, struct location *b) static LLIST_HEAD(locations); -void cleanup_locations() +static void cleanup_locations() { struct location *myloc, *tmp; int invalpos = 0, i = 0; @@ -245,7 +245,7 @@ void cleanup_locations() } CTRL_CMD_DEFINE(net_loc, "location"); -int get_net_loc(struct ctrl_cmd *cmd, void *data) +static int get_net_loc(struct ctrl_cmd *cmd, void *data) { struct location *myloc; @@ -266,7 +266,7 @@ int get_net_loc(struct ctrl_cmd *cmd, void *data) return CTRL_CMD_REPLY; } -int set_net_loc(struct ctrl_cmd *cmd, void *data) +static int set_net_loc(struct ctrl_cmd *cmd, void *data) { char *saveptr, *lat, *lon, *height, *tstamp, *valid, *tmp; struct location *myloc, *lastloc; @@ -317,7 +317,7 @@ oom: return CTRL_CMD_ERROR; } -int verify_net_loc(struct ctrl_cmd *cmd, const char *value, void *data) +static int verify_net_loc(struct ctrl_cmd *cmd, const char *value, void *data) { char *saveptr, *latstr, *lonstr, *heightstr, *tstampstr, *validstr, *tmp; time_t tstamp; @@ -357,7 +357,7 @@ err: } CTRL_CMD_DEFINE(trx_rf_lock, "rf_locked"); -int get_trx_rf_lock(struct ctrl_cmd *cmd, void *data) +static int get_trx_rf_lock(struct ctrl_cmd *cmd, void *data) { struct gsm_bts_trx *trx = cmd->node; if (!trx) { @@ -369,7 +369,7 @@ int get_trx_rf_lock(struct ctrl_cmd *cmd, void *data) return CTRL_CMD_REPLY; } -int set_trx_rf_lock(struct ctrl_cmd *cmd, void *data) +static int set_trx_rf_lock(struct ctrl_cmd *cmd, void *data) { int locked = atoi(cmd->value); struct gsm_bts_trx *trx = cmd->node; @@ -383,7 +383,7 @@ int set_trx_rf_lock(struct ctrl_cmd *cmd, void *data) return get_trx_rf_lock(cmd, data); } -int verify_trx_rf_lock(struct ctrl_cmd *cmd, const char *value, void *data) +static int verify_trx_rf_lock(struct ctrl_cmd *cmd, const char *value, void *data) { int locked = atoi(cmd->value); @@ -394,13 +394,13 @@ int verify_trx_rf_lock(struct ctrl_cmd *cmd, const char *value, void *data) } CTRL_CMD_DEFINE(net_rf_lock, "rf_locked"); -int get_net_rf_lock(struct ctrl_cmd *cmd, void *data) +static int get_net_rf_lock(struct ctrl_cmd *cmd, void *data) { cmd->reply = "get only works for the individual trx properties."; return CTRL_CMD_ERROR; } -int set_net_rf_lock(struct ctrl_cmd *cmd, void *data) +static int set_net_rf_lock(struct ctrl_cmd *cmd, void *data) { int locked = atoi(cmd->value); struct gsm_network *net = cmd->node; @@ -426,7 +426,7 @@ int set_net_rf_lock(struct ctrl_cmd *cmd, void *data) return CTRL_CMD_REPLY; } -int verify_net_rf_lock(struct ctrl_cmd *cmd, const char *value, void *data) +static int verify_net_rf_lock(struct ctrl_cmd *cmd, const char *value, void *data) { int locked = atoi(cmd->value); diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index 73143f8ab..60d421724 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -1688,17 +1688,17 @@ done: } CTRL_CMD_DEFINE(fwd_cmd, "bsc *"); -int get_fwd_cmd(struct ctrl_cmd *cmd, void *data) +static int get_fwd_cmd(struct ctrl_cmd *cmd, void *data) { return forward_to_bsc(cmd); } -int set_fwd_cmd(struct ctrl_cmd *cmd, void *data) +static int set_fwd_cmd(struct ctrl_cmd *cmd, void *data) { return forward_to_bsc(cmd); } -int verify_fwd_cmd(struct ctrl_cmd *cmd, const char *value, void *data) +static int verify_fwd_cmd(struct ctrl_cmd *cmd, const char *value, void *data) { return 0; } |