diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2019-11-08 04:08:36 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2019-11-11 05:31:59 +0100 |
commit | 7ca9bc517acff0cc4c63c2f937753ced644f0877 (patch) | |
tree | ecebca5365f9ffe647e29aa08c0a68111c554e43 | |
parent | 37ec56d39cacf115516020a5222bcd2b422ef6b0 (diff) |
dgsm fu
Change-Id: Id66461ef017c2cf4848c08505ff2e8c0d0a3259a
-rw-r--r-- | src/dgsm.c | 3 | ||||
-rw-r--r-- | src/gsup_server.h | 12 | ||||
-rw-r--r-- | src/remote_hlr.c | 19 | ||||
-rw-r--r-- | src/remote_hlr.h | 6 |
4 files changed, 25 insertions, 15 deletions
@@ -411,8 +411,7 @@ bool dgsm_check_forward_gsup_msg(struct osmo_gsup_conn *conn, const struct osmo_ proxy = g_hlr->gsup_proxy.ps; break; default: - LOG_DGSM(gsup->imsi, LOGL_ERROR, "Unknown cn_domain: %d\n", gsup->cn_domain); - osmo_gsup_conn_send_err_reply(conn, gsup, GMM_CAUSE_INV_MAND_INFO); + LOG_GSUPCONN_MSG(conn, gsup, LOGL_ERROR, "D-GSM: Unknown cn_domain: %d\n", gsup->cn_domain); return -GMM_CAUSE_INV_MAND_INFO; } diff --git a/src/gsup_server.h b/src/gsup_server.h index 6dae9bc..b2f94a7 100644 --- a/src/gsup_server.h +++ b/src/gsup_server.h @@ -10,6 +10,18 @@ #define OSMO_GSUP_MAX_CALLED_PARTY_BCD_LEN 43 /* TS 24.008 10.5.4.7 */ #endif +#define LOG_GSUPCONN(conn, level, fmt, args...) \ + LOGP(DLGSUP, level, "GSUP from %s: " fmt, \ + conn && conn->server && conn->server->link ? \ + osmo_sock_get_name2_c(OTC_SELECT, conn->server->link->ofd.fd) \ + : "?", \ + ##args) + +#define LOG_GSUPCONN_MSG(conn, gsup_msg, level, fmt, args...) \ + LOG_GSUPCONN(conn, level, "IMSI-%s %s: " fmt, (gsup_msg)->imsi, \ + osmo_gsup_message_type_name((gsup_msg)->message_type), \ + ##args) + struct osmo_gsup_conn; /* Expects message in msg->l2h */ diff --git a/src/remote_hlr.c b/src/remote_hlr.c index 37ca913..cdf10a7 100644 --- a/src/remote_hlr.c +++ b/src/remote_hlr.c @@ -12,13 +12,6 @@ static LLIST_HEAD(remote_hlrs); -#define LOG_GSUPC(gsupc, level, fmt, args...) \ - LOGP(DDGSM, level, "HLR Proxy: GSUP from %s:%u: " fmt, (gsupc)->link->addr, (gsupc)->link->port, ##args) - -#define LOG_GSUP_MSG(gsupc, gsup_msg, level, fmt, args...) \ - LOG_GSUPC(gsupc, level, "%s: " fmt, osmo_gsup_message_type_name((gsup_msg)->message_type), ##args) - - void remote_hlr_err_reply(struct osmo_gsup_client *gsupc, const struct osmo_gsup_message *gsup_orig, enum gsm48_gmm_cause cause) { @@ -69,7 +62,7 @@ static int remote_hlr_rx(struct osmo_gsup_client *gsupc, struct msgb *msg) } if (!gsup.imsi[0]) { - LOG_GSUP_MSG(gsupc, &gsup, LOGL_ERROR, "Failed to decode GSUP message: missing IMSI\n"); + LOG_GSUPC_MSG(gsupc, &gsup, LOGL_ERROR, "Failed to decode GSUP message: missing IMSI\n"); remote_hlr_err_reply(gsupc, &gsup, GMM_CAUSE_INV_MAND_INFO); return -GMM_CAUSE_INV_MAND_INFO; } @@ -82,20 +75,20 @@ static int remote_hlr_rx(struct osmo_gsup_client *gsupc, struct msgb *msg) proxy = g_hlr->gsup_proxy.ps; break; default: - LOG_GSUP_MSG(gsupc, &gsup, LOGL_ERROR, "Unknown cn_domain: %d\n", gsup.cn_domain); + LOG_GSUPC_MSG(gsupc, &gsup, LOGL_ERROR, "Unknown cn_domain: %d\n", gsup.cn_domain); remote_hlr_err_reply(gsupc, &gsup, GMM_CAUSE_INV_MAND_INFO); return -GMM_CAUSE_INV_MAND_INFO; } if (!proxy) { - LOG_GSUP_MSG(gsupc, &gsup, LOGL_ERROR, "Cannot route, there is no GSUP proxy set up\n"); + LOG_GSUPC_MSG(gsupc, &gsup, LOGL_ERROR, "Cannot route, there is no GSUP proxy set up\n"); remote_hlr_err_reply(gsupc, &gsup, GMM_CAUSE_NET_FAIL); return -GMM_CAUSE_NET_FAIL; } proxy_subscr = proxy_subscr_get_by_imsi(proxy, gsup.imsi); if (!proxy_subscr) { - LOG_GSUP_MSG(gsupc, &gsup, LOGL_ERROR, "Cannot route, no GSUP proxy record for this IMSI\n"); + LOG_GSUPC_MSG(gsupc, &gsup, LOGL_ERROR, "Cannot route, no GSUP proxy record for this IMSI\n"); remote_hlr_err_reply(gsupc, &gsup, GMM_CAUSE_IMSI_UNKNOWN); return -GMM_CAUSE_IMSI_UNKNOWN; } @@ -103,7 +96,7 @@ static int remote_hlr_rx(struct osmo_gsup_client *gsupc, struct msgb *msg) /* Route to MSC that we're proxying for */ vlr_conn = gsup_route_find_gt(g_hlr->gs, &proxy_subscr->vlr_name); if (!vlr_conn) { - LOG_GSUP_MSG(gsupc, &gsup, LOGL_ERROR, "Destination VLR unreachable: %s\n", + LOG_GSUPC_MSG(gsupc, &gsup, LOGL_ERROR, "Destination VLR unreachable: %s\n", global_title_name(&proxy_subscr->vlr_name)); remote_hlr_err_reply(gsupc, &gsup, GMM_CAUSE_MSC_TEMP_NOTREACH); return -GMM_CAUSE_MSC_TEMP_NOTREACH; @@ -114,7 +107,7 @@ static int remote_hlr_rx(struct osmo_gsup_client *gsupc, struct msgb *msg) * We also need to strip the IPA header and have headroom. Just re-encode. */ gsup_copy = osmo_gsup_msgb_alloc("GSUP proxy to VLR"); if (osmo_gsup_encode(gsup_copy, &gsup)) { - LOG_GSUP_MSG(gsupc, &gsup, LOGL_ERROR, "Failed to re-encode GSUP message, cannot forward\n"); + LOG_GSUPC_MSG(gsupc, &gsup, LOGL_ERROR, "Failed to re-encode GSUP message, cannot forward\n"); remote_hlr_err_reply(gsupc, &gsup, GMM_CAUSE_MSC_TEMP_NOTREACH); return -GMM_CAUSE_MSC_TEMP_NOTREACH; } diff --git a/src/remote_hlr.h b/src/remote_hlr.h index 5f2c84d..d6e5e19 100644 --- a/src/remote_hlr.h +++ b/src/remote_hlr.h @@ -8,6 +8,12 @@ struct osmo_gsup_client; struct osmo_gsup_message; struct msgb; +#define LOG_GSUPC(gsupc, level, fmt, args...) \ + LOGP(DDGSM, level, "HLR Proxy: GSUP from %s:%u: " fmt, (gsupc)->link->addr, (gsupc)->link->port, ##args) + +#define LOG_GSUPC_MSG(gsupc, gsup_msg, level, fmt, args...) \ + LOG_GSUPC(gsupc, level, "%s: " fmt, osmo_gsup_message_type_name((gsup_msg)->message_type), ##args) + /* GSUP client link for proxying to a remote HLR. */ struct remote_hlr { struct llist_head entry; |