summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2017-06-25fix warning: sccp_scoc.c: missing headerneels/aoipNeels Hofmeyr1-0/+1
Change-Id: I0577346379bd41b25a75331f53d7914ee0696931
2017-06-25osmo_sccp_user_sap_down(): store called/calling addr in new connNeels Hofmeyr1-0/+8
Change-Id: I7a52053c2377e47d558e41db59d0fb736a11ffe8
2017-06-25sccp_scoc fsm: abort with error log on null connNeels Hofmeyr1-0/+6
Change-Id: I091e5b6e64b24ce94b6495f3006f44c17d513ee7
2017-06-25Revert "SCOC: When sending a CORE/CR, SUA SRC_ADDR == CallingPartyAddress"Neels Hofmeyr1-1/+1
According to pmaier, this commit breaks AoIP in openbsc.git. Until this question is resolved, I will revert this on my branch to be able to build binaries for the osmo-gsm-tester. This reverts commit 5527df78adc08b76df07c4b682263b5bdd6181d4.
2017-06-25sccp_user.c: add missing error loggingNeels Hofmeyr1-4/+12
Change-Id: I98e400e297f8fa83037a8e74a936e4ecc137099c
2017-06-25gen_mtp_transfer_req_xua(): add addr to error log for missing DPCNeels Hofmeyr1-1/+3
Change-Id: Icfd45bcbecc440b94893db2aca537a162f210abd
2017-06-25add/tweak various logging to help figure out complex routingNeels Hofmeyr5-19/+85
Add function osmo_ss7_point_code_print2() to be able to print two point codes in the same log message. Change signatures of two static functions to aid logging: add invalid ref arg to sccp_scoc_rx_inval_src_ref(), pass conn instead of inst to sccp_scoc_rx_inval_opc(). Change-Id: Ia3243606d6cad7721f7da7f6caba2caa90ae2bbd
2017-06-23cosmetic: drop second ';;'Neels Hofmeyr1-1/+1
Change-Id: I861b87e485d94f17e4b4a800c8da865f98633c92
2017-06-23fix sanitize make check: xua_test: initialize gt_out.Neels Hofmeyr2-1/+5
The sanitize build fails because gt_out is not initialized to zero, but is later mem-compared to a zero-initialized struct. Zero-initialize gt_out. Also print in the test output both byte dumps. It helped to figure out the test failure and might as well stay. Change-Id: Ice8ee9c2a6bde4924f3ae6d95aa9268ebef9f070
2017-06-22ss7: Fix compilation error (warning)Philipp Maier1-1/+1
In osmo_ss7_route_create() as is only initalized if lset can not be initalized. If lset can be initalized, as will not be used so everything is fine. However, the compiler complains that as may not be initalized. Initalizing as to NULL solves the problem. Change-Id: Ibcb3ebf9aaa7717cb553242517abce1499bc9c2a
2017-06-22Revert "configure.ac: Use -Werror in C(PP)FLAGS"Neels Hofmeyr1-2/+2
As discussed in chat, -Werror should not be enabled by default. Instead it should be added in our jenkins build scripts. This reverts commit fc252ca38427bf77e55fd272a954dfe24f03a719. Change-Id: I92955c2f74f9a5c40e80028459100cf5e79a537b
2017-06-22sccp: Fix a classic typo of mineHolger Hans Peter Freyther1-7/+7
Change-Id: Ie1194406d9d9c62a513fac35ffa458957809a0e3
2017-06-22configure.ac: Use -Werror in C(PP)FLAGSPau Espin Pedrol1-2/+2
Change-Id: Ia753a3080ef54ac248dacce5cd692fdd38f7649a
2017-06-22configure.ac: Use -Wall in C(PP)FLAGSPau Espin Pedrol1-1/+3
Change-Id: I1e49427b8267bbdb05d0121971a56359dbecd690
2017-06-22xua_test.c: remove useless keyword in struct declarationPau Espin Pedrol1-1/+1
Fixes following warning: warning: useless storage class specifier in empty declaratio Change-Id: I5cea7b6ec2cc755ad8cec69b771f6e3b297e607d
2017-06-22stp_main.c: Add missing headerPau Espin Pedrol1-0/+1
stp_main uses osmo_fsm_vty_add_cmds which is defined in /osmocom/vty/misc.h Fixes 'implicit declaration of function' compilation warning. Change-Id: I3cc9543fcb908eeb172d36fa472a19b01bf52c46
2017-06-22xua_internal.h: Add missing functions required by xua_testPau Espin Pedrol1-0/+5
Change-Id: Ic97de20c567bf67c513a45060e1e96e4b67b2311
2017-06-22sccp_test_vty: Fix compilation warning: Unused variablePau Espin Pedrol1-1/+1
Instead of removing the variable, leave it there with unused attribute set because it is an example and gives extra information to potential readers of the function (it provides you with the actual type of void* _scu). Change-Id: Id5fddf261a7a75ee1d6e9aff0734065ebf8551ab
2017-06-22sccp_scrc: Fix warning: uneeded constant evaulationPau Espin Pedrol1-1/+1
translate function is always present in the same file, thus we can remove this check. Fixes following warning: warning: the address of ‘translate’ will always evaluate as ‘true’ [-Waddress] if (translate && As requested by Harald, leave a comment there stating that there are some checks missing and yet to be implemented. The translate function check was used for this purpose. Change-Id: I48a711f3a43496e2c0c637f34f56784f765938c4
2017-06-21sccp: add addressbook functionality for sccp addressesPhilipp Maier4-0/+587
SCCP addresses are defined through a number of compoinents, not just an IP-Address, there is also point code, ssn and more. To simplify and unify the handling of such objects, this patch introduces an addressbook functionality. The user can set up multiple addresses per ss7 instance and give them names. Later that name can be used to reference the address at a later point in the config. This means that the usage of sccp-addresses from the programmers point of view boils down to a VTY function that reads the string name of a previously defined address. The programmer can then use the API to get a pointer to the SCCP address struct and use it normally. For this feature, two additional VTY nodes are necessary, this commit depends libosmocore change: Change-Id I42aa29c0cccc97f284b85801c5329b015b189640 Change-Id: I068ed7f7d113dab88424a9d47bab7fc703bb7942
2017-06-18cosmetic: Fix typo in sccp_types.hPhilipp Maier1-1/+1
change SCCP_RETURN_CAUSE_SEGMENTATION_FAOLURE to SCCP_RETURN_CAUSE_SEGMENTATION_FAILURE Change-Id: I34f767234f677307bb04891b40f03109901c0f1b
2017-06-18cosmetic: fix typo in osmo_ss7_vty.c VTY docPhilipp Maier1-1/+1
Change-Id: I931ccf6f765d4fe916ea94bde704314561e4537c
2017-05-14stp: Add test scripts for executing m3ua-testtool and sua-testtoolHarald Welte4-0/+123
You will need to have * GNU/Linux with support for [network] namespaces * the 'unshare' command line tool * m3ua-testtool and sua-testtool repositories from git.osmocom.org/nplab installed adjacent to libosmo-sccp * their requirements, i.e. ** guile ** guile-sctp from https://github.com/nplab/guile-sctp When those are installed, you can do things like (cd contrib/test && ./run-in-ns.sh test-m3ua.sh) (cd contrib/test && ./run-in-ns.sh test-sua.sh) to execute the test suite. Change-Id: Ic36eafbb9868b2ec9ae2173f8d1b651b976ccf88
2017-05-04SUA-to-SCCP: Fix use of Called/Calling vs. Src/Dest AddressHarald Welte1-4/+24
SUA uses different semantics (source / destination) address, while SCCP uses Calling/CalledParty. This leads to some confusion. At least in the CR/CORE and CREF/COREF case, the CallingParty equals the SRC_ADDR. Change-Id: I1c641aac7b53c6de7c4e369aaf3004523bd85936
2017-05-04SCOC: When sending a CORE/CR, SUA SRC_ADDR == CallingPartyAddressHarald Welte1-1/+1
SUA uses different semantics (source / destination) address, while SCCP uses Calling/CalledParty. This leads to some confusion. At least in the CR/CORE case, the CallingParty equals the SRC_ADDR. Change-Id: I5a3c27b112148dd539f092cce7618b4f62fde73c
2017-04-27osmo_sccp_addr_parse() Fix point code integer precision handlingHarald Welte1-1/+2
"(cur[1] << 8) & 0x3f" is always 0 regardless of the values of its operands. Change-Id: Ie47e632f4bca490baf4282dc5d55ee55ca7f1ae8 Fixes: coverity CID#166932
2017-04-27osmo_ss7_user_unregister(): Don't dereference NULL userHarald Welte1-1/+2
The 'user' argument to osmo_ss7_user_unregister() can be NULL, so let's make sure we don't dereference it. Change-Id: Ia34b181dcbcb179b2639e2f405364cc952069842 Fixes: coverity CID#166933
2017-04-27sccp_scoc: don't pass variable as argument if we know it's NULLHarald Welte1-1/+1
xua will always be NULL in one particular switch case of scoc_fsm_conn_pend_out(), so let's use NULL directly rather than obscure it though a variable that might be understood as this being non-NULL in some cases. Change-Id: Id6dc56442441489aefc706bcebc49197ca3dae1e Fixes: coverity CID#166934
2017-04-27m3ua_decode_notify(): Ensure status_ie is valid before using itHarald Welte1-0/+4
Change-Id: I3cdd0fbdffcbeeb68dbc979385de045220ea0b0c Fixes: coverity CID#166939
2017-04-27sclc_rx_cldr(): Don't try to dereference user data_ie without checkHarald Welte1-0/+5
While the SUA / SCCP2SUA code is ensuring that mandatory information elements such as the user data IE in a CLD$ message, we might still have current or future callers of sclc_rx_cldr() that don't comply with that. So let's make sure data_ie is valid before dereferencing it. Change-Id: I7c1010b0ac82ee0b7bd5e2c7413899695eae0070 Fixes: coverity CID#166940
2017-04-27m3ua_to_xfer_ind(): don't use data_ie without checking it existsHarald Welte1-1/+1
Change-Id: I5f7551e49c1b4ea417bee3516da1b2ece5ee0699 Fixes: coverity CID#166941
2017-04-27sclc_rx_cldt(): Don't try to dereference user data_ie without checkHarald Welte1-0/+5
While the SUA / SCCP2SUA code is ensuring that mandatory information elements such as the user data IE in a CLDT message, we might still have current or future callers of sclc_rx_cldt() that don't comply with that. So let's make sure data_ie is valid before dereferencing it. Change-Id: Ia102f6c4cd5c6c3f823cb219635c42b9a87765f8 Fixes: coverity CID#166942
2017-04-27ss7_test: Fix '=' that should have been '=='Harald Welte1-1/+1
Change-Id: I1be4529c73992cb342a62aa19ba79be25e982620 Fixes: coverity CID#166944
2017-04-27scu_gen_encode_and_send(): Fix NULL pointer derefHarald Welte1-1/+1
We were using the 'xua' pointer before checkin if it actually is valid Change-Id: I5cd3250afc0b787b78683cd8ab6b2512e0d5c69e Fixes: coverity CID#166945
2017-04-27deliver_to_mtp_user(): Fix null pointer dereferenceHarald Welte1-1/+1
We had used + derefernced the 'prim' pointer before checking its validity. Change-Id: I0ca5026091e91926924b297f9342bda5f9fd38c9 Fixes: coverity CID#166946
2017-04-27osmo_sccp_user_sap_down(): Avoid uninitialized pointer derefHarald Welte1-0/+5
When receiving an unknown primitive, we end up de-referencing an unassigned/uninitialized pointer for 'conn'. Let's properly catch that case and print an error message. Change-Id: Id1f5f293ea9bce8601d45164be670a7062d91802 Fixes: coverity CID#166947
2017-04-27sccp_user: Add missing 'break' statementHarald Welte1-0/+1
The missing break statement leads to an unintended fall-through which in turn prints a wrong ERROR message. Change-Id: I6618fa247b889d4162118278cd05dee85cf21899 Fixes: coverity CID#166948
2017-04-27sccp2sua: Avoid array overruns in sccp_is_{mandatory,optional}()Harald Welte1-2/+2
Change-Id: Ied76c21e20332514c2ad364eea5fc17e24a3f4c6 Fixes: coverity CID#166943, CID#166980
2017-04-27xua_rkm: Fix handling of RK Registration with multiple Routing KeysHarald Welte1-6/+7
RKM permits multiple routing key IEs to be inside a single Routing Key Registration message. We were trying to handle this, but the counter we used as array index into the 'newly_assigned_as' array was actually always kept at zero. Change-Id: I08a962d2f242cefb67fb2dc93818c1ed532e8990 Fixes: coverity CID#166991
2017-04-27ss7_test: Avoid possible NULL pointer dereference in test caseHarald Welte1-0/+1
Change-Id: If2a7b2c988d06e8bbd2a63f3a5ceeb403bfb34ed Fixes: coverity CID#166992
2017-04-27xua_default_lm_fsm: Missing printf() argumentHarald Welte1-1/+1
Change-Id: I03c30a0d1e03ff56df80bdd1e8a7846142b6f79c Fixes: coverity CID#166993
2017-04-27Address some negative integer handling issuesHarald Welte1-7/+14
If for some reason we cannot resolve the file descriptor for a given FSM, we shouldn't attempt to send data through it. Fixes: coverity CID#167155, CID#167154, CID#167153, CID#167152, CID#167151, CID#167151 Change-Id: I8b1a676b653bcdad21cb7927d549f499950a2b73
2017-04-27stp: Install VTY commands for FSM introspectionHarald Welte1-0/+1
Change-Id: I4ee881715e874eaed3cca6ac42db21260123306a
2017-04-25Fix debian buildsMax3-2/+4
Add missing libosmogsm dependency. Change-Id: I6e5cf393ffe81c582966ca0e9479e6deeffa9280 Fixes: OS#2182
2017-04-18IPA: Override/Set point codesHarald Welte3-2/+64
As an IPA SCCPlite message arrives without any MTP routing label, we simply construct one artificially for all inbound IPA/SCCPlite packets: * we set the SPC to the point-code of the routing key of the AS (as this is the PC we route to this IPA/SCCPlite client anyway) * we set the DPC to a point-code from a new vty config command "point-code override dpc" Change-Id: Id556398e1ded3e613cfde7ea8b71aff7a414ff90
2017-04-18osmo_ss7: Allocate message buffers with headroomHarald Welte1-3/+2
The use of m3ua_msgb_alloc() from generic code is a bit ugly, but I really don't want to introduce yet another msgb_alloc wrapper. Change-Id: Ic6dc9a1e7bbed2e1f73395bd18b727fa7892e25b
2017-04-18osmo_ss7: make sure to re-set all state on client disconnectHarald Welte1-5/+3
When we disconnect a client, make sure that we always go through xua_cli_close_and_reconnect(), which will make sure to notify the ASP FSM using XUA_ASP_E_SCTP_COMM_DOWN_IND. Change-Id: I6859b8549c8cbbe2e8279da0ede562387a066d04
2017-04-18Add IPA/SCCPlite support as SIGTRAN alternativeHarald Welte12-17/+681
This tries as good as possible to fit the IPA/SCCPlite stacking into the existing SIGTRAN/SS7 code architecture/model. To the user, the IPA protocol looks like yet another protocol on the same level as the choice between SUA and M3AU. On the inside, things are obviously quite different. We need to handle TCP with IPA framing instead of SCTP for both server and client. We also implement an alternative "ASP FSM" for IPA, which takes care of the CCM handshake (ID_REQ/ID_RESP/ID_ACK/ID_ACK2) for both client and server mode. In server mode, we use the 'unit name' as identifier to look up the AS, similar to how we use a routing context to look up the AS in the xUA case. We also have to bypass activating the default layer manager in the simple client to make sure we don't run into even more complexity. What's missing right now is some way to manually override/set the point codes. As IPA/SCCPlite is missing any routing label, we currently simply generate one with SPC=0/DPC=0, which will obviously not work in most configurations. Change-Id: I9098574cddeba10fcf8f1b6c196a7069a6805c56
2017-04-17SUA: Our SUA implementation needs an SCCP instance in ss7_instanceHarald Welte1-0/+9
So when we create a xua_server for SUA, we must make sure to create that associated SCCP instance, if it doesn't already exist. End-user programs probably normally call this during their initialization anyway, but in something like OsmoSTP, we need to auto-create it. Change-Id: Ib575763dbd00f5bd7bfbf48f227a8f5ef9528e2a
2017-04-17SUA: Make sure to reject unknown CO message typesHarald Welte1-0/+20
Found using sua-sgp-mtr-i-04 from Michael Tuexen's sua-testtool. Change-Id: Iec5c8deb6cc48a1269fd85243c1350bafd1dd815