improve logging, remove obsolete FIXMEs, return of non-void functions

This commit is contained in:
Harald Welte 2015-12-24 10:12:09 +01:00
parent bc4560cf18
commit 37166a27ca
2 changed files with 25 additions and 12 deletions

View File

@ -71,9 +71,10 @@ context_map_alloc_by_hnb(struct hnb_context *hnb, uint32_t rua_ctx_id,
}
}
/* FIXME: allocated CN side ID! */
if (alloc_cn_conn_id(cn_if_new, &new_scu_conn_id) < 0)
if (alloc_cn_conn_id(cn_if_new, &new_scu_conn_id) < 0) {
LOGP(DMAIN, LOGL_ERROR, "Unable to allocate CN connection ID\n");
return NULL;
}
/* alloate a new map entry */
map = talloc_zero(hnb, struct hnbgw_context_map);
@ -96,8 +97,6 @@ context_map_by_cn(struct hnbgw_cnlink *cn, uint32_t scu_conn_id)
{
struct hnbgw_context_map *map;
/* FIXME: allocated HNB side ID! */
llist_for_each_entry(map, &cn->map_list, cn_list) {
if (map->state != MAP_S_ACTIVE)
continue;
@ -107,7 +106,9 @@ context_map_by_cn(struct hnbgw_cnlink *cn, uint32_t scu_conn_id)
}
/* we don't allocate new mappings in the CN->HNB
* direction, as the RUA=SCCP=SUA connections are always
* established from HNB towards CN. */
* established from HNB towards CN. */
LOGP(DMAIN, LOGL_NOTICE, "Unable to resolve map for CN "
"connection ID %u\n", scu_conn_id);
return NULL;
}
@ -128,6 +129,7 @@ static void context_map_tmr_cb(void *data)
struct hnb_gw *gw = data;
struct hnbgw_cnlink *cn;
DEBUGP(DMAIN, "Running context mapper garbage collection\n");
/* iterate over list of core network (links) */
llist_for_each_entry(cn, &gw->cn_list, list) {
struct hnbgw_context_map *map;

View File

@ -290,7 +290,7 @@ static int rua_rx_init_connect(struct msgb *msg, ANY_t *in)
break;
}
DEBUGP(DRUA, "Connect.req(ctx=0x%x, %s)\n", context_id,
DEBUGP(DRUA, "RUA Connect.req(ctx=0x%x, %s)\n", context_id,
ies.establishment_Cause == RUA_Establishment_Cause_emergency_call
? "emergency" : "normal");
@ -320,7 +320,7 @@ static int rua_rx_init_disconnect(struct msgb *msg, ANY_t *in)
context_id = asn1bitstr_to_u32(&ies.context_ID);
scu_cause = rua_to_scu_cause(&ies.cause);
DEBUGP(DRUA, "Disconnect.req(ctx=0x%x,cause=%s)\n", context_id,
DEBUGP(DRUA, "RUA Disconnect.req(ctx=0x%x,cause=%s)\n", context_id,
rua_cause_str(&ies.cause));
/* route to CS (MSC) or PS (SGSN) domain */
@ -359,7 +359,7 @@ static int rua_rx_init_dt(struct msgb *msg, ANY_t *in)
context_id = asn1bitstr_to_u32(&ies.context_ID);
DEBUGP(DRUA, "Data.req(ctx=0x%x)\n", context_id);
DEBUGP(DRUA, "RUA Data.req(ctx=0x%x)\n", context_id);
/* route to CS (MSC) or PS (SGSN) domain */
switch (ies.cN_DomainIndicator) {
@ -390,7 +390,7 @@ static int rua_rx_init_udt(struct msgb *msg, ANY_t *in)
if (rc < 0)
return rc;
DEBUGP(DRUA, "UData.req()\n");
DEBUGP(DRUA, "RUA UData.req()\n");
/* according tot the spec, we can primarily receive Overload,
* Reset, Reset ACK, Error Indication, reset Resource, Reset
@ -414,7 +414,7 @@ static int rua_rx_init_err_ind(struct msgb *msg, ANY_t *in)
if (rc < 0)
return rc;
DEBUGP(DRUA, "UData.ErrorInd()\n");
DEBUGP(DRUA, "RUA UData.ErrorInd()\n");
return rc;
}
@ -442,18 +442,26 @@ static int rua_rx_initiating_msg(struct msgb *msg, RUA_InitiatingMessage_t *imsg
case RUA_ProcedureCode_id_privateMessage:
break;
default:
return -1;
LOGP(DRUA, LOGL_NOTICE, "Unknown RUA Procedure %u\n",
imsg->procedureCode);
rc = -1;
}
return rc;
}
static int rua_rx_successful_outcome_msg(struct msgb *msg, RUA_SuccessfulOutcome_t *in)
{
/* FIXME */
LOGP(DRUA, LOGL_NOTICE, "Unexpected RUA Sucessful Outcome\n");
return -1;
}
static int rua_rx_unsuccessful_outcome_msg(struct msgb *msg, RUA_UnsuccessfulOutcome_t *in)
{
/* FIXME */
LOGP(DRUA, LOGL_NOTICE, "Unexpected RUA Unsucessful Outcome\n");
return -1;
}
@ -474,8 +482,11 @@ static int _hnbgw_rua_rx(struct msgb *msg, RUA_RUA_PDU_t *pdu)
rc = rua_rx_unsuccessful_outcome_msg(msg, &pdu->choice.unsuccessfulOutcome);
break;
default:
return -1;
LOGP(DRUA, LOGL_NOTICE, "Unknown RUA presence %u\n", pdu->present);
rc = -1;
}
return rc;
}
int hnbgw_rua_rx(struct hnb_context *hnb, struct msgb *msg)