mtp: Stop hardcoding the supported SSN inside the mtp_layer3.c
Stop hardcoding the supported ssn's inside the mtp_layer3.c and make it possible to allow to configure this in the future.
This commit is contained in:
parent
b27c9626e8
commit
1b5d846b46
|
@ -66,6 +66,9 @@ struct mtp_link_set {
|
|||
struct mtp_link *slc[16];
|
||||
int sltm_once;
|
||||
|
||||
/* ssn map */
|
||||
int supported_ssn[256];
|
||||
|
||||
int pcap_fd;
|
||||
|
||||
/* special handling */
|
||||
|
|
|
@ -103,6 +103,12 @@ struct mtp_link_set *link_init(struct bsc_data *bsc)
|
|||
set->spare = bsc->ni_spare;
|
||||
set->pcap_fd = bsc->pcap_fd;
|
||||
|
||||
set->supported_ssn[1] = 1;
|
||||
set->supported_ssn[7] = 1;
|
||||
set->supported_ssn[8] = 1;
|
||||
set->supported_ssn[146] = 1;
|
||||
set->supported_ssn[254] = 1;
|
||||
|
||||
if (!bsc->src_port) {
|
||||
LOGP(DINP, LOGL_ERROR, "You need to set a UDP address.\n");
|
||||
return NULL;
|
||||
|
|
|
@ -264,6 +264,11 @@ int main(int argc, char **argv)
|
|||
m2ua_set->ni = 3;
|
||||
m2ua_set->pcap_fd = bsc->pcap_fd;
|
||||
m2ua_set->name = talloc_strdup(m2ua_set, "M2UA");
|
||||
m2ua_set->supported_ssn[1] = 1;
|
||||
m2ua_set->supported_ssn[7] = 1;
|
||||
m2ua_set->supported_ssn[8] = 1;
|
||||
m2ua_set->supported_ssn[146] = 1;
|
||||
m2ua_set->supported_ssn[254] = 1;
|
||||
|
||||
/* setup things */
|
||||
set->pass_all_isup = bsc->isup_pass;
|
||||
|
|
|
@ -402,8 +402,7 @@ static int mtp_link_sccp_data(struct mtp_link_set *link, struct mtp_level_3_hdr
|
|||
LOGP(DINP, LOGL_ERROR, "Unknown APOC: %u/%u\n",
|
||||
ntohs(prt->apoc), prt->apoc);
|
||||
type = SCCP_SSP;
|
||||
} else if (prt->assn != 1 && prt->assn != 254 &&
|
||||
prt->assn != 7 && prt->assn != 8 && prt->assn != 146) {
|
||||
} else if (!link->supported_ssn[prt->assn]) {
|
||||
LOGP(DINP, LOGL_ERROR, "Unknown affected SSN assn: %u\n",
|
||||
prt->assn);
|
||||
type = SCCP_SSP;
|
||||
|
|
Reference in New Issue