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
diff --git a/openbsc/src/gprs/gtphub_vty.c b/openbsc/src/gprs/gtphub_vty.c
index f99f818..5e5c1dd 100644
--- a/openbsc/src/gprs/gtphub_vty.c
+++ b/openbsc/src/gprs/gtphub_vty.c
@@ -122,7 +122,7 @@
)
{
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 @@
)
{
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 @@
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);