osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27466 )
Change subject: bsc_nat_fsm: log prim_name once, not in each case ......................................................................
bsc_nat_fsm: log prim_name once, not in each case
Move the log message outside of the switch case to make it a bit shorter. Use LOGP instead of LOG_SCCP, because the latter is about to get removed in a follow-up patch.
Related: SYS#5560 Change-Id: I1f181ff38f86d83969da4e9d3da72dd9d69d298a --- M src/osmo-bsc-nat/bsc_nat_fsm.c 1 file changed, 2 insertions(+), 9 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc-nat refs/changes/66/27466/1
diff --git a/src/osmo-bsc-nat/bsc_nat_fsm.c b/src/osmo-bsc-nat/bsc_nat_fsm.c index 3e10749..f0f28f8 100644 --- a/src/osmo-bsc-nat/bsc_nat_fsm.c +++ b/src/osmo-bsc-nat/bsc_nat_fsm.c @@ -122,11 +122,11 @@ struct osmo_sccp_addr peer_addr_out; int rc = -1;
+ LOGP(DMAIN, LOGL_DEBUG, "Rx %s from %s\n", osmo_scu_prim_name(oph), src == g_bsc_nat->cn ? "CN" : "RAN"); + switch (OSMO_PRIM_HDR(oph)) { case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION): /* indication of new inbound connection request */ - LOG_SCCP(src, NULL, LOGL_DEBUG, "%s(%s)\n", __func__, osmo_scu_prim_name(oph)); - if (sccp_sap_get_peer_addr_in(src, &peer_addr_in, &prim->u.connect.called_addr, &prim->u.connect.calling_addr) < 0) goto error; @@ -146,8 +146,6 @@
case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_CONFIRM): /* indication of connection confirm */ - LOG_SCCP(src, NULL, LOGL_DEBUG, "%s(%s)\n", __func__, osmo_scu_prim_name(oph)); - if (sccp_sap_get_peer_addr_in(src, &peer_addr_in, &prim->u.connect.called_addr, &prim->u.connect.calling_addr) < 0) goto error; @@ -167,8 +165,6 @@
case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION): /* connection-oriented data received */ - LOG_SCCP(src, NULL, LOGL_DEBUG, "%s(%s)\n", __func__, osmo_scu_prim_name(oph)); - if (sccp_sap_get_peer_addr_out(src, NULL, &peer_addr_out) < 0) goto error;
@@ -183,8 +179,6 @@
case OSMO_PRIM(OSMO_SCU_PRIM_N_DISCONNECT, PRIM_OP_INDICATION): /* indication of disconnect */ - LOG_SCCP(src, NULL, LOGL_DEBUG, "%s(%s)\n", __func__, osmo_scu_prim_name(oph)); - if (sccp_sap_get_peer_addr_out(src, NULL, &peer_addr_out) < 0) goto error;
@@ -200,7 +194,6 @@ case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): /* connection-less data received */ peer_addr_in = &prim->u.unitdata.calling_addr; - LOG_SCCP(src, peer_addr_in, LOGL_DEBUG, "%s(%s)\n", __func__, osmo_scu_prim_name(oph));
if (sccp_sap_get_peer_addr_out(src, peer_addr_in, &peer_addr_out) < 0) goto error;