From 1b5d846b461a5e197646b6db35b49ceb0d867481 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 17 Feb 2011 01:48:42 +0100 Subject: 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. --- src/links.c | 6 ++++++ src/main_stp.c | 5 +++++ src/mtp_layer3.c | 3 +-- 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/links.c b/src/links.c index 2db67bd..ccc8bfb 100644 --- a/src/links.c +++ b/src/links.c @@ -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; diff --git a/src/main_stp.c b/src/main_stp.c index 0a502b4..a4694b9 100644 --- a/src/main_stp.c +++ b/src/main_stp.c @@ -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; diff --git a/src/mtp_layer3.c b/src/mtp_layer3.c index aeb1866..83c8d63 100644 --- a/src/mtp_layer3.c +++ b/src/mtp_layer3.c @@ -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; -- cgit v1.2.3