aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gtphub_vty.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2015-11-27 00:05:56 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2015-12-03 11:40:18 +0100
commitf977320736fe15ffc3a0e6110bec7823a57c65ee (patch)
tree9b89e3e5b034574be13a5568282723081145e918 /openbsc/src/gprs/gtphub_vty.c
parentba9e9f63bce9a868b8b3e15adca616ac4dec9414 (diff)
gtphub: cosmetic: for_each_side,_plane macros.
Simplify looping over sides and planes. I'm tired of typing the same for loops all the time. Sponsored-by: On-Waves ehi
Diffstat (limited to 'openbsc/src/gprs/gtphub_vty.c')
-rw-r--r--openbsc/src/gprs/gtphub_vty.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/openbsc/src/gprs/gtphub_vty.c b/openbsc/src/gprs/gtphub_vty.c
index f99f81803..5e5c1ddf7 100644
--- a/openbsc/src/gprs/gtphub_vty.c
+++ b/openbsc/src/gprs/gtphub_vty.c
@@ -122,7 +122,7 @@ DEFUN(cfg_gtphub_bind_to_sgsns_short, cfg_gtphub_bind_to_sgsns_short_cmd,
)
{
int i;
- for (i = 0; i < GTPH_PLANE_N; i++)
+ for_each_plane(i)
g_cfg->to_sgsns[i].bind.addr_str = talloc_strdup(tall_vty_ctx, argv[0]);
g_cfg->to_sgsns[GTPH_PLANE_CTRL].bind.port = GTPH_DEFAULT_CONTROL_PORT;
g_cfg->to_sgsns[GTPH_PLANE_USER].bind.port = GTPH_DEFAULT_USER_PORT;
@@ -137,7 +137,7 @@ DEFUN(cfg_gtphub_bind_to_ggsns_short, cfg_gtphub_bind_to_ggsns_short_cmd,
)
{
int i;
- for (i = 0; i < GTPH_PLANE_N; i++)
+ for_each_plane(i)
g_cfg->to_ggsns[i].bind.addr_str = talloc_strdup(tall_vty_ctx, argv[0]);
g_cfg->to_ggsns[GTPH_PLANE_CTRL].bind.port = GTPH_DEFAULT_CONTROL_PORT;
g_cfg->to_ggsns[GTPH_PLANE_USER].bind.port = GTPH_DEFAULT_USER_PORT;
@@ -254,7 +254,7 @@ DEFUN(cfg_grx_ggsn, cfg_grx_ggsn_cmd,
static void show_bind_stats_all(struct vty *vty)
{
int plane_idx;
- for (plane_idx = 0; plane_idx < GTPH_PLANE_N; plane_idx++) {
+ for_each_plane(plane_idx) {
vty_out(vty, "- %s Plane:%s",
gtphub_plane_idx_names[plane_idx], VTY_NEWLINE);