nat: Introduce a new connection type for Supplementary Services
If we have a CM Service Request we will look into the message to see if it is a Supplementary Service Activation.
This commit is contained in:
parent
a3967579f8
commit
74dc303134
|
@ -49,6 +49,7 @@ enum {
|
|||
NAT_CON_TYPE_LU,
|
||||
NAT_CON_TYPE_CM_SERV_REQ,
|
||||
NAT_CON_TYPE_PAG_RESP,
|
||||
NAT_CON_TYPE_SSA,
|
||||
NAT_CON_TYPE_LOCAL_REJECT,
|
||||
NAT_CON_TYPE_OTHER,
|
||||
};
|
||||
|
@ -102,6 +103,7 @@ enum bsc_cfg_ctr {
|
|||
BCFG_CTR_CON_TYPE_LU,
|
||||
BCFG_CTR_CON_CMSERV_RQ,
|
||||
BCFG_CTR_CON_PAG_RESP,
|
||||
BCFG_CTR_CON_SSA,
|
||||
BCFG_CTR_CON_OTHER,
|
||||
};
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ static const struct rate_ctr_desc bsc_cfg_ctr_description[] = {
|
|||
[BCFG_CTR_CON_TYPE_LU] = { "conn.lu", "Conn Location Update "},
|
||||
[BCFG_CTR_CON_CMSERV_RQ] = { "conn.rq", "Conn CM Service Req "},
|
||||
[BCFG_CTR_CON_PAG_RESP] = { "conn.pag", "Conn Paging Response "},
|
||||
[BCFG_CTR_CON_SSA] = { "conn.ssa", "Conn USSD "},
|
||||
[BCFG_CTR_CON_OTHER] = { "conn.other", "Conn Other "},
|
||||
};
|
||||
|
||||
|
@ -391,7 +392,7 @@ static int _cr_check_loc_upd(struct bsc_connection *bsc,
|
|||
|
||||
static int _cr_check_cm_serv_req(struct bsc_connection *bsc,
|
||||
uint8_t *data, unsigned int length,
|
||||
char **imsi)
|
||||
int *con_type, char **imsi)
|
||||
{
|
||||
static const uint32_t classmark_offset =
|
||||
offsetof(struct gsm48_service_request, classmark);
|
||||
|
@ -410,6 +411,8 @@ static int _cr_check_cm_serv_req(struct bsc_connection *bsc,
|
|||
}
|
||||
|
||||
req = (struct gsm48_service_request *) data;
|
||||
if (req->cm_service_type == 0x8)
|
||||
*con_type = NAT_CON_TYPE_SSA;
|
||||
rc = gsm48_extract_mi((uint8_t *) &req->classmark,
|
||||
length - classmark_offset, mi_string, &mi_type);
|
||||
if (rc < 0) {
|
||||
|
@ -537,7 +540,9 @@ int bsc_nat_filter_sccp_cr(struct bsc_connection *bsc, struct msgb *msg,
|
|||
} else if (hdr48->proto_discr == GSM48_PDISC_MM &&
|
||||
msg_type == GSM48_MT_MM_CM_SERV_REQ) {
|
||||
*con_type = NAT_CON_TYPE_CM_SERV_REQ;
|
||||
return _cr_check_cm_serv_req(bsc, &hdr48->data[0], hdr48_len - sizeof(*hdr48), imsi);
|
||||
return _cr_check_cm_serv_req(bsc, &hdr48->data[0],
|
||||
hdr48_len - sizeof(*hdr48),
|
||||
con_type, imsi);
|
||||
} else if (hdr48->proto_discr == GSM48_PDISC_RR &&
|
||||
msg_type == GSM48_MT_RR_PAG_RESP) {
|
||||
*con_type = NAT_CON_TYPE_PAG_RESP;
|
||||
|
@ -614,6 +619,7 @@ static const char *con_types [] = {
|
|||
[NAT_CON_TYPE_LU] = "Location Update",
|
||||
[NAT_CON_TYPE_CM_SERV_REQ] = "CM Serv Req",
|
||||
[NAT_CON_TYPE_PAG_RESP] = "Paging Response",
|
||||
[NAT_CON_TYPE_SSA] = "Supplementar Service Activation",
|
||||
[NAT_CON_TYPE_LOCAL_REJECT] = "Local Reject",
|
||||
[NAT_CON_TYPE_OTHER] = "Other",
|
||||
};
|
||||
|
@ -693,6 +699,7 @@ static const int con_to_ctr[] = {
|
|||
[NAT_CON_TYPE_LU] = BCFG_CTR_CON_TYPE_LU,
|
||||
[NAT_CON_TYPE_CM_SERV_REQ] = BCFG_CTR_CON_CMSERV_RQ,
|
||||
[NAT_CON_TYPE_PAG_RESP] = BCFG_CTR_CON_PAG_RESP,
|
||||
[NAT_CON_TYPE_SSA] = BCFG_CTR_CON_SSA,
|
||||
[NAT_CON_TYPE_LOCAL_REJECT] = -1,
|
||||
[NAT_CON_TYPE_OTHER] = BCFG_CTR_CON_OTHER,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue