cosmetics: link_id=42, s/Iu-CS/IuCS, debug logs.

Until I get the proper link id from the SUA SAP, make sure we recognise it
as hardcoded by setting it to 42.
This commit is contained in:
Neels Hofmeyr
2016-01-28 15:04:56 +01:00
parent 39daffd7a5
commit b6769b99de
2 changed files with 16 additions and 4 deletions

View File

@@ -263,7 +263,7 @@ static int rcvmsg_iu_cs(struct msgb *msg, struct gprs_ra_id *ra_id, /* FIXME gpr
DEBUGP(DIUCS, "got Iu-CS message\n");
DEBUGP(DIUCS, "Iu-CS message is %s\n",
osmo_hexdump(msg->data, msg->len));
uint8_t link_id = 1; /* TODO proper link_id */
uint8_t link_id = 42; /* TODO proper link_id */
return gsm0408_rcvmsg_iucs(bsc_gsmnet, msg, link_id);
}

View File

@@ -1,3 +1,8 @@
#include <inttypes.h>
#include <osmocom/core/logging.h>
#include <openbsc/debug.h>
#include <openbsc/gsm_data.h>
#include <openbsc/iu.h>
@@ -12,6 +17,9 @@ struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_network *ne
{
struct gsm_subscriber_connection *conn;
DEBUGP(DIUCS, "Allocating IuCS subscriber conn: link_id %" PRIx8 ", conn_id %" PRIx32 "\n",
link_id, conn_id);
conn = talloc_zero(network, struct gsm_subscriber_connection);
if (!conn)
return NULL;
@@ -24,7 +32,7 @@ struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_network *ne
return conn;
}
/* Return an existing Iu-CS subscriber connection record for the given link and
/* Return an existing IuCS subscriber connection record for the given link and
* connection IDs, or return NULL if not found. */
static struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_network *network,
uint8_t link_id,
@@ -38,12 +46,16 @@ static struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_networ
continue;
if (conn->iu.conn_id != conn_id)
continue;
DEBUGP(DIUCS, "Found IuCS subscriber for link_id %" PRIx8 ", conn_id %" PRIx32 "\n",
link_id, conn_id);
return conn;
}
DEBUGP(DIUCS, "No IuCS subscriber found for link_id %" PRIx8 ", conn_id %" PRIx32 "\n",
link_id, conn_id);
return NULL;
}
/* Receive MM/CC/... message from Iu-CS (SCCP user SAP).
/* Receive MM/CC/... message from IuCS (SCCP user SAP).
* msg->dst must reference a struct ue_conn_ctx. link_id identifies the SCTP
* peer that sent the msg.
*
@@ -64,7 +76,7 @@ int gsm0408_rcvmsg_iucs(struct gsm_network *network, struct msgb *msg, uint8_t l
/* if we already have a connection, handle DTAP.
gsm0408_dispatch() is aka msc_dtap() */
/* Make sure we don't receive RR over Iu-CS; otherwise all
/* Make sure we don't receive RR over IuCS; otherwise all
* messages handled by gsm0408_dispatch() are of interest (CC,
* MM, SMS, NS_SS, maybe even MM_GPRS and SM_GPRS). */
struct gsm48_hdr *gh = msgb_l3(msg);