rua_to_scu(): drop dead code for connection-less

From rua_to_scu(), drop dead code for connection-less messages. In fact,
rua_to_scu() is only used for connection-oriented messages. Clarify
that.

Change-Id: Id03c412cde066a6b2bbc26cb6b87053aa2408cba
This commit is contained in:
Neels Hofmeyr 2023-02-23 01:34:10 +01:00
parent 1e277db2cc
commit 62d50a1fe8
1 changed files with 11 additions and 23 deletions

View File

@ -175,8 +175,9 @@ int rua_tx_disc(struct hnb_context *hnb, int is_ps, uint32_t context_id,
} }
/* dispatch a RUA connection-oriented message received from a HNB to a context mapping's RUA FSM, so that it is
/* forward a RUA message to the SCCP User API to SCCP */ * forwarded to the CN via SCCP connection-oriented messages.
* Connectionless messages are handled in hnbgw_ranap_rx() instead, not here. */
static int rua_to_scu(struct hnb_context *hnb, static int rua_to_scu(struct hnb_context *hnb,
RUA_CN_DomainIndicator_t cN_DomainIndicator, RUA_CN_DomainIndicator_t cN_DomainIndicator,
enum osmo_scu_prim_type type, enum osmo_scu_prim_type type,
@ -217,18 +218,14 @@ static int rua_to_scu(struct hnb_context *hnb,
prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim)); prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim));
osmo_prim_init(&prim->oph, SCCP_SAP_USER, type, PRIM_OP_REQUEST, msg); osmo_prim_init(&prim->oph, SCCP_SAP_USER, type, PRIM_OP_REQUEST, msg);
switch (type) { /* Only connection-oriented messages are handled by this function */
case OSMO_SCU_PRIM_N_UNITDATA: OSMO_ASSERT(type != OSMO_SCU_PRIM_N_UNITDATA);
LOGHNB(hnb, DRUA, LOGL_DEBUG, "rua_to_scu() %s to %s, rua_ctx_id %u (unitdata, no scu_conn_id)\n",
cn_domain_indicator_to_str(cN_DomainIndicator), osmo_sccp_addr_dump(remote_addr), context_id); map = context_map_alloc_by_hnb(hnb, context_id, is_ps, cn);
break; OSMO_ASSERT(map);
default: LOGHNB(hnb, DRUA, LOGL_DEBUG, "rua_to_scu() %s to %s, rua_ctx_id %u scu_conn_id %u\n",
map = context_map_alloc_by_hnb(hnb, context_id, is_ps, cn); cn_domain_indicator_to_str(cN_DomainIndicator), osmo_sccp_addr_dump(remote_addr),
OSMO_ASSERT(map); map->rua_ctx_id, map->scu_conn_id);
LOGHNB(hnb, DRUA, LOGL_DEBUG, "rua_to_scu() %s to %s, rua_ctx_id %u scu_conn_id %u\n",
cn_domain_indicator_to_str(cN_DomainIndicator), osmo_sccp_addr_dump(remote_addr),
map->rua_ctx_id, map->scu_conn_id);
}
/* add primitive header */ /* add primitive header */
switch (type) { switch (type) {
@ -253,15 +250,6 @@ static int rua_to_scu(struct hnb_context *hnb,
/* Mark SCCP conn as gracefully disconnected */ /* Mark SCCP conn as gracefully disconnected */
map->scu_conn_active = false; map->scu_conn_active = false;
break; break;
case OSMO_SCU_PRIM_N_UNITDATA:
prim->u.unitdata.called_addr = *remote_addr;
prim->u.unitdata.calling_addr = cn->gw->sccp.local_addr;
/* Two separate logs because of osmo_sccp_addr_dump(). */
LOGHNB(hnb, DRUA, LOGL_DEBUG, "RUA to SCCP N_UNITDATA: called_addr:%s\n",
osmo_sccp_addr_dump(&prim->u.unitdata.called_addr));
LOGHNB(hnb, DRUA, LOGL_DEBUG, "RUA to SCCP N_UNITDATA: calling_addr:%s\n",
osmo_sccp_addr_dump(&prim->u.unitdata.calling_addr));
break;
default: default:
return -EINVAL; return -EINVAL;
} }