mscsplit: directly access gsm_network backpointer from gsm_subscriber_connection
The previous commit added a network backpointer to gsm_subscriber_connection. Use it wherever it makes sense, to skip the step through the bts structure. In some places, remove local variables that become unused. Change-Id: I34537025986713291e14c8212a81539b497befd4
This commit is contained in:
parent
5e0b0a658f
commit
a9f2bb5ab8
|
@ -146,7 +146,7 @@ static void assignment_t10_timeout(void *_conn)
|
||||||
conn->secondary_lchan = NULL;
|
conn->secondary_lchan = NULL;
|
||||||
|
|
||||||
/* inform them about the failure */
|
/* inform them about the failure */
|
||||||
api = conn->bts->network->bsc_api;
|
api = conn->network->bsc_api;
|
||||||
api->assign_fail(conn, GSM0808_CAUSE_NO_RADIO_RESOURCE_AVAILABLE, NULL);
|
api->assign_fail(conn, GSM0808_CAUSE_NO_RADIO_RESOURCE_AVAILABLE, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ static void handle_mr_config(struct gsm_subscriber_connection *conn,
|
||||||
struct gsm_lchan *lchan, int full_rate)
|
struct gsm_lchan *lchan, int full_rate)
|
||||||
{
|
{
|
||||||
struct bsc_api *api;
|
struct bsc_api *api;
|
||||||
api = conn->bts->network->bsc_api;
|
api = conn->network->bsc_api;
|
||||||
struct amr_multirate_conf *mr;
|
struct amr_multirate_conf *mr;
|
||||||
struct gsm48_multi_rate_conf *mr_conf;
|
struct gsm48_multi_rate_conf *mr_conf;
|
||||||
|
|
||||||
|
@ -387,7 +387,7 @@ static int chan_compat_with_mode(struct gsm_lchan *lchan, int chan_mode, int ful
|
||||||
int gsm0808_assign_req(struct gsm_subscriber_connection *conn, int chan_mode, int full_rate)
|
int gsm0808_assign_req(struct gsm_subscriber_connection *conn, int chan_mode, int full_rate)
|
||||||
{
|
{
|
||||||
struct bsc_api *api;
|
struct bsc_api *api;
|
||||||
api = conn->bts->network->bsc_api;
|
api = conn->network->bsc_api;
|
||||||
|
|
||||||
if (!chan_compat_with_mode(conn->lchan, chan_mode, full_rate)) {
|
if (!chan_compat_with_mode(conn->lchan, chan_mode, full_rate)) {
|
||||||
if (handle_new_assignment(conn, chan_mode, full_rate) != 0)
|
if (handle_new_assignment(conn, chan_mode, full_rate) != 0)
|
||||||
|
@ -424,7 +424,7 @@ static void handle_ass_compl(struct gsm_subscriber_connection *conn,
|
||||||
struct msgb *msg)
|
struct msgb *msg)
|
||||||
{
|
{
|
||||||
struct gsm48_hdr *gh;
|
struct gsm48_hdr *gh;
|
||||||
struct bsc_api *api = conn->bts->network->bsc_api;
|
struct bsc_api *api = conn->network->bsc_api;
|
||||||
|
|
||||||
if (conn->secondary_lchan != msg->lchan) {
|
if (conn->secondary_lchan != msg->lchan) {
|
||||||
LOGP(DMSC, LOGL_ERROR, "Assignment Compl should occur on second lchan.\n");
|
LOGP(DMSC, LOGL_ERROR, "Assignment Compl should occur on second lchan.\n");
|
||||||
|
@ -461,7 +461,7 @@ static void handle_ass_compl(struct gsm_subscriber_connection *conn,
|
||||||
static void handle_ass_fail(struct gsm_subscriber_connection *conn,
|
static void handle_ass_fail(struct gsm_subscriber_connection *conn,
|
||||||
struct msgb *msg)
|
struct msgb *msg)
|
||||||
{
|
{
|
||||||
struct bsc_api *api = conn->bts->network->bsc_api;
|
struct bsc_api *api = conn->network->bsc_api;
|
||||||
uint8_t *rr_failure;
|
uint8_t *rr_failure;
|
||||||
struct gsm48_hdr *gh;
|
struct gsm48_hdr *gh;
|
||||||
|
|
||||||
|
@ -751,7 +751,7 @@ static void send_sapi_reject(struct gsm_subscriber_connection *conn, int link_id
|
||||||
if (!conn)
|
if (!conn)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
api = conn->bts->network->bsc_api;
|
api = conn->network->bsc_api;
|
||||||
if (!api || !api->sapi_n_reject)
|
if (!api || !api->sapi_n_reject)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ void allocate_security_operation(struct gsm_subscriber_connection *conn)
|
||||||
int gsm48_secure_channel(struct gsm_subscriber_connection *conn, int key_seq,
|
int gsm48_secure_channel(struct gsm_subscriber_connection *conn, int key_seq,
|
||||||
gsm_cbfn *cb, void *cb_data)
|
gsm_cbfn *cb, void *cb_data)
|
||||||
{
|
{
|
||||||
struct gsm_network *net = conn->bts->network;
|
struct gsm_network *net = conn->network;
|
||||||
struct gsm_subscriber *subscr = conn->subscr;
|
struct gsm_subscriber *subscr = conn->subscr;
|
||||||
struct gsm_security_operation *op;
|
struct gsm_security_operation *op;
|
||||||
struct gsm_auth_tuple atuple;
|
struct gsm_auth_tuple atuple;
|
||||||
|
@ -321,7 +321,7 @@ static void allocate_loc_updating_req(struct gsm_subscriber_connection *conn)
|
||||||
static int finish_lu(struct gsm_subscriber_connection *conn)
|
static int finish_lu(struct gsm_subscriber_connection *conn)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
int avoid_tmsi = conn->bts->network->avoid_tmsi;
|
int avoid_tmsi = conn->network->avoid_tmsi;
|
||||||
|
|
||||||
/* We're all good */
|
/* We're all good */
|
||||||
if (avoid_tmsi) {
|
if (avoid_tmsi) {
|
||||||
|
@ -332,7 +332,7 @@ static int finish_lu(struct gsm_subscriber_connection *conn)
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = gsm0408_loc_upd_acc(conn);
|
rc = gsm0408_loc_upd_acc(conn);
|
||||||
if (conn->bts->network->send_mm_info) {
|
if (conn->network->send_mm_info) {
|
||||||
/* send MM INFO with network name */
|
/* send MM INFO with network name */
|
||||||
rc = gsm48_tx_mm_info(conn);
|
rc = gsm48_tx_mm_info(conn);
|
||||||
}
|
}
|
||||||
|
@ -429,7 +429,7 @@ void gsm0408_clear_request(struct gsm_subscriber_connection *conn, uint32_t caus
|
||||||
* we have a subscriber connection.
|
* we have a subscriber connection.
|
||||||
*/
|
*/
|
||||||
restart:
|
restart:
|
||||||
llist_for_each_entry_safe(trans, temp, &conn->bts->network->trans_list, entry) {
|
llist_for_each_entry_safe(trans, temp, &conn->network->trans_list, entry) {
|
||||||
if (trans->conn == conn) {
|
if (trans->conn == conn) {
|
||||||
trans_free(trans);
|
trans_free(trans);
|
||||||
goto restart;
|
goto restart;
|
||||||
|
@ -457,7 +457,7 @@ int gsm0408_loc_upd_rej(struct gsm_subscriber_connection *conn, uint8_t cause)
|
||||||
struct gsm_bts *bts = conn->bts;
|
struct gsm_bts *bts = conn->bts;
|
||||||
struct msgb *msg;
|
struct msgb *msg;
|
||||||
|
|
||||||
rate_ctr_inc(&bts->network->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_RESP_REJECT]);
|
rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_RESP_REJECT]);
|
||||||
|
|
||||||
msg = gsm48_create_loc_upd_rej(cause);
|
msg = gsm48_create_loc_upd_rej(cause);
|
||||||
if (!msg) {
|
if (!msg) {
|
||||||
|
@ -477,7 +477,6 @@ int gsm0408_loc_upd_rej(struct gsm_subscriber_connection *conn, uint8_t cause)
|
||||||
/* Chapter 9.2.13 : Send LOCATION UPDATE ACCEPT */
|
/* Chapter 9.2.13 : Send LOCATION UPDATE ACCEPT */
|
||||||
static int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn)
|
static int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn)
|
||||||
{
|
{
|
||||||
struct gsm_bts *bts = conn->bts;
|
|
||||||
struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 LOC UPD ACC");
|
struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 LOC UPD ACC");
|
||||||
struct gsm48_hdr *gh;
|
struct gsm48_hdr *gh;
|
||||||
struct gsm48_loc_area_id *lai;
|
struct gsm48_loc_area_id *lai;
|
||||||
|
@ -490,8 +489,9 @@ static int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn)
|
||||||
gh->msg_type = GSM48_MT_MM_LOC_UPD_ACCEPT;
|
gh->msg_type = GSM48_MT_MM_LOC_UPD_ACCEPT;
|
||||||
|
|
||||||
lai = (struct gsm48_loc_area_id *) msgb_put(msg, sizeof(*lai));
|
lai = (struct gsm48_loc_area_id *) msgb_put(msg, sizeof(*lai));
|
||||||
gsm48_generate_lai(lai, bts->network->country_code,
|
gsm48_generate_lai(lai, conn->network->country_code,
|
||||||
bts->network->network_code, bts->location_area_code);
|
conn->network->network_code,
|
||||||
|
conn->bts->location_area_code);
|
||||||
|
|
||||||
if (conn->subscr->tmsi == GSM_RESERVED_TMSI) {
|
if (conn->subscr->tmsi == GSM_RESERVED_TMSI) {
|
||||||
uint8_t mi[10];
|
uint8_t mi[10];
|
||||||
|
@ -506,7 +506,7 @@ static int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn)
|
||||||
|
|
||||||
DEBUGP(DMM, "-> LOCATION UPDATE ACCEPT\n");
|
DEBUGP(DMM, "-> LOCATION UPDATE ACCEPT\n");
|
||||||
|
|
||||||
rate_ctr_inc(&bts->network->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_RESP_ACCEPT]);
|
rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_RESP_ACCEPT]);
|
||||||
|
|
||||||
return gsm48_conn_sendmsg(msg, conn, NULL);
|
return gsm48_conn_sendmsg(msg, conn, NULL);
|
||||||
}
|
}
|
||||||
|
@ -543,9 +543,7 @@ static struct gsm_subscriber *subscr_create(const struct gsm_network *net,
|
||||||
static int mm_rx_id_resp(struct gsm_subscriber_connection *conn, struct msgb *msg)
|
static int mm_rx_id_resp(struct gsm_subscriber_connection *conn, struct msgb *msg)
|
||||||
{
|
{
|
||||||
struct gsm48_hdr *gh = msgb_l3(msg);
|
struct gsm48_hdr *gh = msgb_l3(msg);
|
||||||
struct gsm_lchan *lchan = msg->lchan;
|
struct gsm_network *net = conn->network;
|
||||||
struct gsm_bts *bts = lchan->ts->trx->bts;
|
|
||||||
struct gsm_network *net = bts->network;
|
|
||||||
uint8_t mi_type = gh->data[1] & GSM_MI_TYPE_MASK;
|
uint8_t mi_type = gh->data[1] & GSM_MI_TYPE_MASK;
|
||||||
char mi_string[GSM48_MI_SIZE];
|
char mi_string[GSM48_MI_SIZE];
|
||||||
|
|
||||||
|
@ -565,7 +563,7 @@ static int mm_rx_id_resp(struct gsm_subscriber_connection *conn, struct msgb *ms
|
||||||
conn->subscr = subscr_create(net, mi_string);
|
conn->subscr = subscr_create(net, mi_string);
|
||||||
}
|
}
|
||||||
if (!conn->subscr && conn->loc_operation) {
|
if (!conn->subscr && conn->loc_operation) {
|
||||||
gsm0408_loc_upd_rej(conn, bts->network->reject_cause);
|
gsm0408_loc_upd_rej(conn, net->reject_cause);
|
||||||
release_loc_updating_req(conn, 1);
|
release_loc_updating_req(conn, 1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -592,11 +590,9 @@ static int mm_rx_id_resp(struct gsm_subscriber_connection *conn, struct msgb *ms
|
||||||
static void loc_upd_rej_cb(void *data)
|
static void loc_upd_rej_cb(void *data)
|
||||||
{
|
{
|
||||||
struct gsm_subscriber_connection *conn = data;
|
struct gsm_subscriber_connection *conn = data;
|
||||||
struct gsm_lchan *lchan = conn->lchan;
|
|
||||||
struct gsm_bts *bts = lchan->ts->trx->bts;
|
|
||||||
|
|
||||||
LOGP(DMM, LOGL_DEBUG, "Location Updating Request procedure timedout.\n");
|
LOGP(DMM, LOGL_DEBUG, "Location Updating Request procedure timedout.\n");
|
||||||
gsm0408_loc_upd_rej(conn, bts->network->reject_cause);
|
gsm0408_loc_upd_rej(conn, conn->network->reject_cause);
|
||||||
release_loc_updating_req(conn, 1);
|
release_loc_updating_req(conn, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -620,7 +616,6 @@ static int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb
|
||||||
struct gsm48_hdr *gh = msgb_l3(msg);
|
struct gsm48_hdr *gh = msgb_l3(msg);
|
||||||
struct gsm48_loc_upd_req *lu;
|
struct gsm48_loc_upd_req *lu;
|
||||||
struct gsm_subscriber *subscr = NULL;
|
struct gsm_subscriber *subscr = NULL;
|
||||||
struct gsm_bts *bts = conn->bts;
|
|
||||||
uint8_t mi_type;
|
uint8_t mi_type;
|
||||||
char mi_string[GSM48_MI_SIZE];
|
char mi_string[GSM48_MI_SIZE];
|
||||||
|
|
||||||
|
@ -637,13 +632,13 @@ static int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb
|
||||||
|
|
||||||
switch (lu->type) {
|
switch (lu->type) {
|
||||||
case GSM48_LUPD_NORMAL:
|
case GSM48_LUPD_NORMAL:
|
||||||
rate_ctr_inc(&bts->network->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_NORMAL]);
|
rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_NORMAL]);
|
||||||
break;
|
break;
|
||||||
case GSM48_LUPD_IMSI_ATT:
|
case GSM48_LUPD_IMSI_ATT:
|
||||||
rate_ctr_inc(&bts->network->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_ATTACH]);
|
rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_ATTACH]);
|
||||||
break;
|
break;
|
||||||
case GSM48_LUPD_PERIODIC:
|
case GSM48_LUPD_PERIODIC:
|
||||||
rate_ctr_inc(&bts->network->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_PERIODIC]);
|
rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_PERIODIC]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -670,12 +665,11 @@ static int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb
|
||||||
conn->loc_operation->waiting_for_imei = 1;
|
conn->loc_operation->waiting_for_imei = 1;
|
||||||
|
|
||||||
/* look up subscriber based on IMSI, create if not found */
|
/* look up subscriber based on IMSI, create if not found */
|
||||||
subscr = subscr_get_by_imsi(bts->network->subscr_group, mi_string);
|
subscr = subscr_get_by_imsi(conn->network->subscr_group, mi_string);
|
||||||
if (!subscr)
|
if (!subscr)
|
||||||
subscr = subscr_create(bts->network, mi_string);
|
subscr = subscr_create(conn->network, mi_string);
|
||||||
|
|
||||||
if (!subscr) {
|
if (!subscr) {
|
||||||
gsm0408_loc_upd_rej(conn, bts->network->reject_cause);
|
gsm0408_loc_upd_rej(conn, conn->network->reject_cause);
|
||||||
release_loc_updating_req(conn, 0);
|
release_loc_updating_req(conn, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -683,7 +677,7 @@ static int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb
|
||||||
case GSM_MI_TYPE_TMSI:
|
case GSM_MI_TYPE_TMSI:
|
||||||
DEBUGPC(DMM, "\n");
|
DEBUGPC(DMM, "\n");
|
||||||
/* look up the subscriber based on TMSI, request IMSI if it fails */
|
/* look up the subscriber based on TMSI, request IMSI if it fails */
|
||||||
subscr = subscr_get_by_tmsi(bts->network->subscr_group,
|
subscr = subscr_get_by_tmsi(conn->network->subscr_group,
|
||||||
tmsi_from_string(mi_string));
|
tmsi_from_string(mi_string));
|
||||||
if (!subscr) {
|
if (!subscr) {
|
||||||
/* send IDENTITY REQUEST message to get IMSI */
|
/* send IDENTITY REQUEST message to get IMSI */
|
||||||
|
@ -738,7 +732,7 @@ int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn)
|
||||||
{
|
{
|
||||||
struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 MM INF");
|
struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 MM INF");
|
||||||
struct gsm48_hdr *gh;
|
struct gsm48_hdr *gh;
|
||||||
struct gsm_network *net = conn->bts->network;
|
struct gsm_network *net = conn->network;
|
||||||
struct gsm_bts *bts = conn->bts;
|
struct gsm_bts *bts = conn->bts;
|
||||||
uint8_t *ptr8;
|
uint8_t *ptr8;
|
||||||
int name_len, name_pad;
|
int name_len, name_pad;
|
||||||
|
@ -973,7 +967,7 @@ static int gsm48_rx_mm_serv_req(struct gsm_subscriber_connection *conn, struct m
|
||||||
uint8_t mi_type;
|
uint8_t mi_type;
|
||||||
char mi_string[GSM48_MI_SIZE];
|
char mi_string[GSM48_MI_SIZE];
|
||||||
|
|
||||||
struct gsm_bts *bts = conn->bts;
|
struct gsm_network *network = conn->network;
|
||||||
struct gsm_subscriber *subscr;
|
struct gsm_subscriber *subscr;
|
||||||
struct gsm48_hdr *gh = msgb_l3(msg);
|
struct gsm48_hdr *gh = msgb_l3(msg);
|
||||||
struct gsm48_service_request *req =
|
struct gsm48_service_request *req =
|
||||||
|
@ -1004,13 +998,13 @@ static int gsm48_rx_mm_serv_req(struct gsm_subscriber_connection *conn, struct m
|
||||||
DEBUGPC(DMM, "serv_type=0x%02x MI(%s)=%s\n",
|
DEBUGPC(DMM, "serv_type=0x%02x MI(%s)=%s\n",
|
||||||
req->cm_service_type, gsm48_mi_type_name(mi_type),
|
req->cm_service_type, gsm48_mi_type_name(mi_type),
|
||||||
mi_string);
|
mi_string);
|
||||||
subscr = subscr_get_by_imsi(bts->network->subscr_group,
|
subscr = subscr_get_by_imsi(network->subscr_group,
|
||||||
mi_string);
|
mi_string);
|
||||||
} else if (mi_type == GSM_MI_TYPE_TMSI) {
|
} else if (mi_type == GSM_MI_TYPE_TMSI) {
|
||||||
DEBUGPC(DMM, "serv_type=0x%02x MI(%s)=%s\n",
|
DEBUGPC(DMM, "serv_type=0x%02x MI(%s)=%s\n",
|
||||||
req->cm_service_type, gsm48_mi_type_name(mi_type),
|
req->cm_service_type, gsm48_mi_type_name(mi_type),
|
||||||
mi_string);
|
mi_string);
|
||||||
subscr = subscr_get_by_tmsi(bts->network->subscr_group,
|
subscr = subscr_get_by_tmsi(network->subscr_group,
|
||||||
tmsi_from_string(mi_string));
|
tmsi_from_string(mi_string));
|
||||||
} else {
|
} else {
|
||||||
DEBUGPC(DMM, "mi_type is not expected: %d\n", mi_type);
|
DEBUGPC(DMM, "mi_type is not expected: %d\n", mi_type);
|
||||||
|
@ -1020,7 +1014,7 @@ static int gsm48_rx_mm_serv_req(struct gsm_subscriber_connection *conn, struct m
|
||||||
|
|
||||||
osmo_signal_dispatch(SS_SUBSCR, S_SUBSCR_IDENTITY, (classmark2 + classmark2_len));
|
osmo_signal_dispatch(SS_SUBSCR, S_SUBSCR_IDENTITY, (classmark2 + classmark2_len));
|
||||||
|
|
||||||
if (is_siemens_bts(bts))
|
if (is_siemens_bts(conn->bts))
|
||||||
send_siemens_mrpci(msg->lchan, classmark2-1);
|
send_siemens_mrpci(msg->lchan, classmark2-1);
|
||||||
|
|
||||||
|
|
||||||
|
@ -1051,7 +1045,7 @@ static int gsm48_rx_mm_serv_req(struct gsm_subscriber_connection *conn, struct m
|
||||||
|
|
||||||
static int gsm48_rx_mm_imsi_detach_ind(struct gsm_subscriber_connection *conn, struct msgb *msg)
|
static int gsm48_rx_mm_imsi_detach_ind(struct gsm_subscriber_connection *conn, struct msgb *msg)
|
||||||
{
|
{
|
||||||
struct gsm_bts *bts = conn->bts;
|
struct gsm_network *network = conn->network;
|
||||||
struct gsm48_hdr *gh = msgb_l3(msg);
|
struct gsm48_hdr *gh = msgb_l3(msg);
|
||||||
struct gsm48_imsi_detach_ind *idi =
|
struct gsm48_imsi_detach_ind *idi =
|
||||||
(struct gsm48_imsi_detach_ind *) gh->data;
|
(struct gsm48_imsi_detach_ind *) gh->data;
|
||||||
|
@ -1063,17 +1057,17 @@ static int gsm48_rx_mm_imsi_detach_ind(struct gsm_subscriber_connection *conn, s
|
||||||
DEBUGP(DMM, "IMSI DETACH INDICATION: MI(%s)=%s",
|
DEBUGP(DMM, "IMSI DETACH INDICATION: MI(%s)=%s",
|
||||||
gsm48_mi_type_name(mi_type), mi_string);
|
gsm48_mi_type_name(mi_type), mi_string);
|
||||||
|
|
||||||
rate_ctr_inc(&bts->network->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_DETACH]);
|
rate_ctr_inc(&network->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_DETACH]);
|
||||||
|
|
||||||
switch (mi_type) {
|
switch (mi_type) {
|
||||||
case GSM_MI_TYPE_TMSI:
|
case GSM_MI_TYPE_TMSI:
|
||||||
DEBUGPC(DMM, "\n");
|
DEBUGPC(DMM, "\n");
|
||||||
subscr = subscr_get_by_tmsi(bts->network->subscr_group,
|
subscr = subscr_get_by_tmsi(network->subscr_group,
|
||||||
tmsi_from_string(mi_string));
|
tmsi_from_string(mi_string));
|
||||||
break;
|
break;
|
||||||
case GSM_MI_TYPE_IMSI:
|
case GSM_MI_TYPE_IMSI:
|
||||||
DEBUGPC(DMM, "\n");
|
DEBUGPC(DMM, "\n");
|
||||||
subscr = subscr_get_by_imsi(bts->network->subscr_group,
|
subscr = subscr_get_by_imsi(network->subscr_group,
|
||||||
mi_string);
|
mi_string);
|
||||||
break;
|
break;
|
||||||
case GSM_MI_TYPE_IMEI:
|
case GSM_MI_TYPE_IMEI:
|
||||||
|
@ -1087,7 +1081,7 @@ static int gsm48_rx_mm_imsi_detach_ind(struct gsm_subscriber_connection *conn, s
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subscr) {
|
if (subscr) {
|
||||||
subscr_update(subscr, bts,
|
subscr_update(subscr, conn->bts,
|
||||||
GSM_SUBSCRIBER_UPDATE_DETACHED);
|
GSM_SUBSCRIBER_UPDATE_DETACHED);
|
||||||
DEBUGP(DMM, "Subscriber: %s\n", subscr_name(subscr));
|
DEBUGP(DMM, "Subscriber: %s\n", subscr_name(subscr));
|
||||||
|
|
||||||
|
@ -1119,7 +1113,7 @@ static int gsm48_rx_mm_auth_resp(struct gsm_subscriber_connection *conn, struct
|
||||||
{
|
{
|
||||||
struct gsm48_hdr *gh = msgb_l3(msg);
|
struct gsm48_hdr *gh = msgb_l3(msg);
|
||||||
struct gsm48_auth_resp *ar = (struct gsm48_auth_resp*) gh->data;
|
struct gsm48_auth_resp *ar = (struct gsm48_auth_resp*) gh->data;
|
||||||
struct gsm_network *net = conn->bts->network;
|
struct gsm_network *net = conn->network;
|
||||||
|
|
||||||
DEBUGP(DMM, "MM AUTHENTICATION RESPONSE (sres = %s): ",
|
DEBUGP(DMM, "MM AUTHENTICATION RESPONSE (sres = %s): ",
|
||||||
osmo_hexdump(ar->sres, 4));
|
osmo_hexdump(ar->sres, 4));
|
||||||
|
@ -1200,7 +1194,6 @@ static int gsm0408_rcv_mm(struct gsm_subscriber_connection *conn, struct msgb *m
|
||||||
/* Receive a PAGING RESPONSE message from the MS */
|
/* Receive a PAGING RESPONSE message from the MS */
|
||||||
static int gsm48_rx_rr_pag_resp(struct gsm_subscriber_connection *conn, struct msgb *msg)
|
static int gsm48_rx_rr_pag_resp(struct gsm_subscriber_connection *conn, struct msgb *msg)
|
||||||
{
|
{
|
||||||
struct gsm_bts *bts = conn->bts;
|
|
||||||
struct gsm48_hdr *gh = msgb_l3(msg);
|
struct gsm48_hdr *gh = msgb_l3(msg);
|
||||||
struct gsm48_pag_resp *resp;
|
struct gsm48_pag_resp *resp;
|
||||||
uint8_t *classmark2_lv = gh->data + 1;
|
uint8_t *classmark2_lv = gh->data + 1;
|
||||||
|
@ -1217,11 +1210,11 @@ static int gsm48_rx_rr_pag_resp(struct gsm_subscriber_connection *conn, struct m
|
||||||
|
|
||||||
switch (mi_type) {
|
switch (mi_type) {
|
||||||
case GSM_MI_TYPE_TMSI:
|
case GSM_MI_TYPE_TMSI:
|
||||||
subscr = subscr_get_by_tmsi(bts->network->subscr_group,
|
subscr = subscr_get_by_tmsi(conn->network->subscr_group,
|
||||||
tmsi_from_string(mi_string));
|
tmsi_from_string(mi_string));
|
||||||
break;
|
break;
|
||||||
case GSM_MI_TYPE_IMSI:
|
case GSM_MI_TYPE_IMSI:
|
||||||
subscr = subscr_get_by_imsi(bts->network->subscr_group,
|
subscr = subscr_get_by_imsi(conn->network->subscr_group,
|
||||||
mi_string);
|
mi_string);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3595,7 +3588,7 @@ static int gsm0408_rcv_cc(struct gsm_subscriber_connection *conn, struct msgb *m
|
||||||
DEBUGP(DCC, "Unknown transaction ID %x, "
|
DEBUGP(DCC, "Unknown transaction ID %x, "
|
||||||
"creating new trans.\n", transaction_id);
|
"creating new trans.\n", transaction_id);
|
||||||
/* Create transaction */
|
/* Create transaction */
|
||||||
trans = trans_alloc(conn->bts->network, conn->subscr,
|
trans = trans_alloc(conn->network, conn->subscr,
|
||||||
GSM48_PDISC_CC,
|
GSM48_PDISC_CC,
|
||||||
transaction_id, new_callref++);
|
transaction_id, new_callref++);
|
||||||
if (!trans) {
|
if (!trans) {
|
||||||
|
|
|
@ -309,20 +309,20 @@ try_local:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* determine gsms->receiver based on dialled number */
|
/* determine gsms->receiver based on dialled number */
|
||||||
gsms->receiver = subscr_get_by_extension(conn->bts->network->subscr_group,
|
gsms->receiver = subscr_get_by_extension(conn->network->subscr_group,
|
||||||
gsms->dst.addr);
|
gsms->dst.addr);
|
||||||
if (!gsms->receiver) {
|
if (!gsms->receiver) {
|
||||||
#ifdef BUILD_SMPP
|
#ifdef BUILD_SMPP
|
||||||
/* Avoid a second look-up */
|
/* Avoid a second look-up */
|
||||||
if (smpp_first) {
|
if (smpp_first) {
|
||||||
rate_ctr_inc(&conn->bts->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]);
|
rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]);
|
||||||
return 1; /* cause 1: unknown subscriber */
|
return 1; /* cause 1: unknown subscriber */
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = smpp_try_deliver(gsms, conn);
|
rc = smpp_try_deliver(gsms, conn);
|
||||||
if (rc == 1) {
|
if (rc == 1) {
|
||||||
rc = 1; /* cause 1: unknown subscriber */
|
rc = 1; /* cause 1: unknown subscriber */
|
||||||
rate_ctr_inc(&conn->bts->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]);
|
rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]);
|
||||||
} else if (rc < 0) {
|
} else if (rc < 0) {
|
||||||
LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.",
|
LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.",
|
||||||
subscr_name(conn->subscr), rc);
|
subscr_name(conn->subscr), rc);
|
||||||
|
@ -333,7 +333,7 @@ try_local:
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
rc = 1; /* cause 1: unknown subscriber */
|
rc = 1; /* cause 1: unknown subscriber */
|
||||||
rate_ctr_inc(&conn->bts->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]);
|
rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]);
|
||||||
#endif
|
#endif
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -374,7 +374,7 @@ static int gsm340_rx_tpdu(struct gsm_subscriber_connection *conn, struct msgb *m
|
||||||
uint8_t address_lv[12]; /* according to 03.40 / 9.1.2.5 */
|
uint8_t address_lv[12]; /* according to 03.40 / 9.1.2.5 */
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
rate_ctr_inc(&conn->bts->network->msc_ctrs->ctr[MSC_CTR_SMS_SUBMITTED]);
|
rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_SUBMITTED]);
|
||||||
|
|
||||||
gsms = sms_alloc();
|
gsms = sms_alloc();
|
||||||
if (!gsms)
|
if (!gsms)
|
||||||
|
@ -616,7 +616,7 @@ static int gsm411_rx_rp_ack(struct msgb *msg, struct gsm_trans *trans,
|
||||||
static int gsm411_rx_rp_error(struct msgb *msg, struct gsm_trans *trans,
|
static int gsm411_rx_rp_error(struct msgb *msg, struct gsm_trans *trans,
|
||||||
struct gsm411_rp_hdr *rph)
|
struct gsm411_rp_hdr *rph)
|
||||||
{
|
{
|
||||||
struct gsm_network *net = trans->conn->bts->network;
|
struct gsm_network *net = trans->conn->network;
|
||||||
struct gsm_sms *sms = trans->sms.sms;
|
struct gsm_sms *sms = trans->sms.sms;
|
||||||
uint8_t cause_len = rph->data[0];
|
uint8_t cause_len = rph->data[0];
|
||||||
uint8_t cause = rph->data[1];
|
uint8_t cause = rph->data[1];
|
||||||
|
@ -816,7 +816,7 @@ int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn,
|
||||||
|
|
||||||
if (!trans) {
|
if (!trans) {
|
||||||
DEBUGP(DLSMS, " -> (new transaction)\n");
|
DEBUGP(DLSMS, " -> (new transaction)\n");
|
||||||
trans = trans_alloc(conn->bts->network, conn->subscr,
|
trans = trans_alloc(conn->network, conn->subscr,
|
||||||
GSM48_PDISC_SMS,
|
GSM48_PDISC_SMS,
|
||||||
transaction_id, new_callref++);
|
transaction_id, new_callref++);
|
||||||
if (!trans) {
|
if (!trans) {
|
||||||
|
@ -878,7 +878,7 @@ int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *sms)
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
transaction_id =
|
transaction_id =
|
||||||
trans_assign_trans_id(conn->bts->network, conn->subscr,
|
trans_assign_trans_id(conn->network, conn->subscr,
|
||||||
GSM48_PDISC_SMS, 0);
|
GSM48_PDISC_SMS, 0);
|
||||||
if (transaction_id == -1) {
|
if (transaction_id == -1) {
|
||||||
LOGP(DLSMS, LOGL_ERROR, "No available transaction ids\n");
|
LOGP(DLSMS, LOGL_ERROR, "No available transaction ids\n");
|
||||||
|
@ -891,7 +891,7 @@ int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *sms)
|
||||||
DEBUGP(DLSMS, "%s()\n", __func__);
|
DEBUGP(DLSMS, "%s()\n", __func__);
|
||||||
|
|
||||||
/* FIXME: allocate transaction with message reference */
|
/* FIXME: allocate transaction with message reference */
|
||||||
trans = trans_alloc(conn->bts->network, conn->subscr,
|
trans = trans_alloc(conn->network, conn->subscr,
|
||||||
GSM48_PDISC_SMS,
|
GSM48_PDISC_SMS,
|
||||||
transaction_id, new_callref++);
|
transaction_id, new_callref++);
|
||||||
if (!trans) {
|
if (!trans) {
|
||||||
|
@ -943,7 +943,7 @@ int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *sms)
|
||||||
|
|
||||||
DEBUGP(DLSMS, "TX: SMS DELIVER\n");
|
DEBUGP(DLSMS, "TX: SMS DELIVER\n");
|
||||||
|
|
||||||
rate_ctr_inc(&conn->bts->network->msc_ctrs->ctr[MSC_CTR_SMS_DELIVERED]);
|
rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_DELIVERED]);
|
||||||
db_sms_inc_deliver_attempts(trans->sms.sms);
|
db_sms_inc_deliver_attempts(trans->sms.sms);
|
||||||
|
|
||||||
return gsm411_rp_sendmsg(&trans->sms.smr_inst, msg,
|
return gsm411_rp_sendmsg(&trans->sms.smr_inst, msg,
|
||||||
|
@ -1037,7 +1037,7 @@ void gsm411_sapi_n_reject(struct gsm_subscriber_connection *conn)
|
||||||
struct gsm_network *net;
|
struct gsm_network *net;
|
||||||
struct gsm_trans *trans, *tmp;
|
struct gsm_trans *trans, *tmp;
|
||||||
|
|
||||||
net = conn->bts->network;
|
net = conn->network;
|
||||||
|
|
||||||
llist_for_each_entry_safe(trans, tmp, &net->trans_list, entry) {
|
llist_for_each_entry_safe(trans, tmp, &net->trans_list, entry) {
|
||||||
struct gsm_sms *sms;
|
struct gsm_sms *sms;
|
||||||
|
|
|
@ -40,7 +40,7 @@ static const uint8_t ass_pref_pos_req[] = { 0x40, 0x03, 0x79, 0x50 };
|
||||||
|
|
||||||
static int send_rrlp_req(struct gsm_subscriber_connection *conn)
|
static int send_rrlp_req(struct gsm_subscriber_connection *conn)
|
||||||
{
|
{
|
||||||
struct gsm_network *net = conn->bts->network;
|
struct gsm_network *net = conn->network;
|
||||||
const uint8_t *req;
|
const uint8_t *req;
|
||||||
|
|
||||||
switch (net->rrlp.mode) {
|
switch (net->rrlp.mode) {
|
||||||
|
|
|
@ -37,7 +37,7 @@ struct gsm_trans *trans_find_by_id(struct gsm_subscriber_connection *conn,
|
||||||
uint8_t proto, uint8_t trans_id)
|
uint8_t proto, uint8_t trans_id)
|
||||||
{
|
{
|
||||||
struct gsm_trans *trans;
|
struct gsm_trans *trans;
|
||||||
struct gsm_network *net = conn->bts->network;
|
struct gsm_network *net = conn->network;
|
||||||
struct gsm_subscriber *subscr = conn->subscr;
|
struct gsm_subscriber *subscr = conn->subscr;
|
||||||
|
|
||||||
llist_for_each_entry(trans, &net->trans_list, entry) {
|
llist_for_each_entry(trans, &net->trans_list, entry) {
|
||||||
|
@ -155,7 +155,7 @@ int trans_has_conn(const struct gsm_subscriber_connection *conn)
|
||||||
{
|
{
|
||||||
struct gsm_trans *trans;
|
struct gsm_trans *trans;
|
||||||
|
|
||||||
llist_for_each_entry(trans, &conn->bts->network->trans_list, entry)
|
llist_for_each_entry(trans, &conn->network->trans_list, entry)
|
||||||
if (trans->conn == conn)
|
if (trans->conn == conn)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue