aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gtphub_main.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2015-11-29 23:49:48 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2015-12-03 11:43:25 +0100
commita9905a51f96acdddf761d0b3e4c21ac0711b57ae (patch)
treefb640b648ca69d180596ade30659c5fbfe841158 /openbsc/src/gprs/gtphub_main.c
parent7174b169e0346d2a44ec50b309bd1e332503c825 (diff)
gtphub: refactor: use side_idx everywhere.
This is a mostly cosmetic change. Instead of separate buffer handling functions, reduce some code duplication by using a side_idx just like the plane_idx, with arrays. Sponsored-by: On-Waves ehi
Diffstat (limited to 'openbsc/src/gprs/gtphub_main.c')
-rw-r--r--openbsc/src/gprs/gtphub_main.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/openbsc/src/gprs/gtphub_main.c b/openbsc/src/gprs/gtphub_main.c
index 6dd316ace..a330b9d39 100644
--- a/openbsc/src/gprs/gtphub_main.c
+++ b/openbsc/src/gprs/gtphub_main.c
@@ -83,22 +83,15 @@ static const struct log_info gtphub_log_info = {
void log_cfg(struct gtphub_cfg *cfg)
{
struct gtphub_cfg_addr *a;
- a = &cfg->to_sgsns[GTPH_PLANE_CTRL].bind;
- LOGP(DGTPHUB, LOGL_NOTICE,
- "to-SGSNs bind, Control: %s port %d\n",
- a->addr_str, a->port);
- a = &cfg->to_sgsns[GTPH_PLANE_USER].bind;
- LOGP(DGTPHUB, LOGL_NOTICE,
- "to-SGSNs bind, User: %s port %d\n",
- a->addr_str, a->port);
- a = &cfg->to_ggsns[GTPH_PLANE_CTRL].bind;
- LOGP(DGTPHUB, LOGL_NOTICE,
- "to-GGSNs bind, Control: %s port %d\n",
- a->addr_str, a->port);
- a = &cfg->to_ggsns[GTPH_PLANE_USER].bind;
- LOGP(DGTPHUB, LOGL_NOTICE,
- "to-GGSNs bind, User: %s port %d\n",
- a->addr_str, a->port);
+ int side_idx, plane_idx;
+ for_each_side_and_plane(side_idx, plane_idx) {
+ a = &cfg->to_gsns[side_idx][plane_idx].bind;
+ LOGP(DGTPHUB, LOGL_NOTICE,
+ "to-%ss bind, %s: %s port %d\n",
+ gtphub_side_idx_names[side_idx],
+ gtphub_plane_idx_names[plane_idx],
+ a->addr_str, a->port);
+ }
}
static void signal_handler(int signal)