gsm48: Split LU Reject sending and generation into two.
This commit is contained in:
parent
2c0f16699e
commit
230a4d886d
|
@ -61,5 +61,6 @@ int gsm48_rx_rr_modif_ack(struct msgb *msg);
|
|||
int gsm48_parse_meas_rep(struct gsm_meas_rep *rep, struct msgb *msg);
|
||||
|
||||
struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value);
|
||||
struct msgb *gsm48_create_loc_upd_rej(uint8_t cause);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -309,23 +309,23 @@ void gsm0408_clear_request(struct gsm_subscriber_connection* conn, uint32_t caus
|
|||
int gsm0408_loc_upd_rej(struct gsm_subscriber_connection *conn, u_int8_t cause)
|
||||
{
|
||||
struct gsm_bts *bts = conn->bts;
|
||||
struct msgb *msg = gsm48_msgb_alloc();
|
||||
struct gsm48_hdr *gh;
|
||||
struct msgb *msg;
|
||||
|
||||
counter_inc(bts->network->stats.loc_upd_resp.reject);
|
||||
|
||||
msg = gsm48_create_loc_upd_rej(cause);
|
||||
if (!msg) {
|
||||
LOGP(DMM, LOGL_ERROR, "Failed to create msg for LOCATION UPDATING REJECT.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
msg->lchan = conn->lchan;
|
||||
|
||||
gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
|
||||
gh->proto_discr = GSM48_PDISC_MM;
|
||||
gh->msg_type = GSM48_MT_MM_LOC_UPD_REJECT;
|
||||
gh->data[0] = cause;
|
||||
|
||||
LOGP(DMM, LOGL_INFO, "Subscriber %s: LOCATION UPDATING REJECT "
|
||||
"LAC=%u BTS=%u\n", conn->subscr ?
|
||||
subscr_name(conn->subscr) : "unknown",
|
||||
bts->location_area_code, bts->nr);
|
||||
|
||||
counter_inc(bts->network->stats.loc_upd_resp.reject);
|
||||
|
||||
return gsm48_conn_sendmsg(msg, conn, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -581,3 +581,19 @@ struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value)
|
|||
|
||||
return msg;
|
||||
}
|
||||
|
||||
struct msgb *gsm48_create_loc_upd_rej(uint8_t cause)
|
||||
{
|
||||
struct gsm48_hdr *gh;
|
||||
struct msgb *msg;
|
||||
|
||||
msg = gsm48_msgb_alloc();
|
||||
if (!msg)
|
||||
return NULL;
|
||||
|
||||
gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
|
||||
gh->proto_discr = GSM48_PDISC_MM;
|
||||
gh->msg_type = GSM48_MT_MM_LOC_UPD_REJECT;
|
||||
gh->data[0] = cause;
|
||||
return msg;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue