Commit Graph

290 Commits

Author SHA1 Message Date
Pau Espin 2286c1b873 ipa_proto.erl: Implement TCP/IPA reassembly
Related: OS#6377
Change-Id: I322e6ab9368ad66be66a9e8d113575f51f9c91c3
2024-02-28 18:38:20 +01:00
Alexander Couzens 414a618804 ipa: fix empty IPA CCM ID Tags
decode_ies() would crash because lists:lasts([]) tries to access an
empty lists.

Change-Id: I6f44561f83c84bac7e5c98747f969f5436617f90
2024-02-28 14:24:25 +01:00
Alexander Couzens c26105e165 ipa_proto: start_listen: use correct ok/error pattern
The ok path only returned the port without an "ok".
Also path back the ListenSock.

Change-Id: I9b317c13089fae2406f401a1f420623de9a2dffa
2024-02-28 14:24:22 +01:00
Pau Espin bb49f95b7f cosmetic: ipa_proto.erl: Fix trailing whitespace
Change-Id: I8b742ae041670452745d5f0022e49b1bed0f1cf5
2024-02-27 21:16:58 +01:00
Oliver Smith 3c6cdc5a53 treewide: remove FSF address
Remove the paragraph about writing to the Free Software Foundation's
mailing address. The FSF has changed addresses in the past, and may do
so again. In 2021 this is not useful, let's rather have a bit less
boilerplate at the start of source files.

Change-Id: Ic8c69d24141abd183e3b1257f4e9edfd9c1afabe
2021-12-14 12:24:20 +01:00
Matt Johnson 7a8b1bad22 ebin/app: Add missing ipa_proto_ccm module
Commit 0c40c626ca introduced a new
ipa_proto_ccm module, which was not added to the app module
list. Commit 515aa33434 then used a
function from this module. In interactive mode the module would be
loaded automatically so its omission was not detected in testing. In
embedded mode (used by default in relx releases) modules are loaded
statically on startup and must be explicitly listed.

Change-Id: I5b7338341a9e179b41b8f2f092efe9aaf83451bb
2020-09-18 16:21:46 -07:00
Matt Johnson 4621456837 ipa_proto: Allow configuring ack initiation behavior
When the osmo-msc version 1.6.1 connects to the osmo-hlr, it sends an
id response and an immediate ack. This commit allows initiating the
handshake with an ack rather than an id request (as is done by ipa
*clients*, like a bts towards a bsc, or the msc towards the hlr) if
needed to mimic behavior of particular components.

Change-Id: I6ab3c9efb51e806f582ce8f473a13ee73ca1567e
2020-09-18 16:21:46 -07:00
Matt Johnson 44a4dd6494 ipa_proto: Implement ccm response with variable options
This commit allows configuration of the ccm protocol options used when
setting up an ipa connection with an external entity. The options
record is kept alongside the socket in the socket-owning process loop,
and used to fill the values in the ccm identity response. If
additional CCM state were needed in the future this commit could be
extended to keep generic state, with the options only representing one
piece of the overall state.

Change-Id: I3f67095f33f1ff826ad04dad72990bf79617149a
2020-09-11 14:05:51 -07:00
Harald Welte 515aa33434 ipa_proto: Hook ipa_proto_ccm into the handling of CCM messages
Change-Id: Ib1be00f73146519c8cc78bb08dd26a110771cd55
2020-09-08 01:34:03 -07:00
Harald Welte 0c40c626ca Add IPA CCM protocol encoder/decoder
This uses the new 'codec' infrastructure of our Erlang IPA
implementation to decode/encode the IPA CCM messages.

Change-Id: I9575145acbb6e3aff57f8bd97d327cbcd81b3665
2020-08-25 09:07:21 +02:00
Harald Welte 3b95a7cfc9 ipa_proto: Add notion of 'codecs'
A codec for a given Stream Identifier can be registered with encode
and decode functions.  This codec transcodes from the binary payload
of messages within that stream identifier and some abstract
representation.  Any received messages will be passed through decode,
while any to-be-transmitted messages will be passed through encode.

Change-Id: I8eaf888402545a1a871df9ae3dfbce690729dd03
2020-08-25 09:07:20 +02:00
Harald Welte d0f391ef60 ipa_proto: Add support for Osmocom Extended Stream IDs
IPAC_PROTO_OSMO reserves one StreamID and creates a new hierarchy
of 256 different Osmocom specifice stream Identifiers.  It adds one
extra byte for this (the first byte in the payload).

Change-Id: I765e0d96523feec401d6fb04693189281c580d04
2020-08-25 09:05:58 +02:00
Oliver Smith df195a4865 contrib/jenkins.sh: new file
Related: OS#4345
Change-Id: Ib20eb2e6d18a5b91ba3f042a70acb132256e9d26
2020-01-17 09:06:20 +01:00
Harald Welte c9f3178023 make it compile with modern Erlang (22.0)
... also do away with our local outdated copy of exprecs and use
upstream
2019-08-11 15:36:14 +02:00
Harald Welte be87545011 port to rebar3 2019-08-11 15:36:14 +02:00
Harald Welte 48c07f08b1 make use of local IP address of #sigtran_peer actually work 2013-09-08 22:22:29 +02:00
Harald Welte e126068ec8 sctp_core: respect local IP of sigtran peer
when the user specifies an IP in the local #sigtran_peer, we have
to bind the socket explicitly to that IP and not let the kernel choose.
2013-09-08 22:00:41 +02:00
Harald Welte e9c97f8b6a ss7_links: make sure IP addresses are canonical before sctp_handler 2013-09-08 21:52:34 +02:00
Harald Welte d44e3ea6de permit configuration of links, linksets and routes in app config
Links, Linksets and routes can now be configured in the applicaiton
configuration file.
2013-09-08 21:33:10 +02:00
Harald Welte bd88eb1b41 osmo_util: introduce convenience wrappers around application:get_env() 2013-09-08 21:32:32 +02:00
Harald Welte fe6ef13a9a fix MTP3 eunit test case DPC/OPC switch
Following-up to 0402b8f1ac where OPC/DPC
parsing was fixed, we also need to fix our broken teset case...
2013-09-05 23:16:11 +02:00
Harald Welte 287a3fd644 M2UA: Send connect request after ASP_ACTIVATE_ACK
we only snd it once and don't care about the response, this is really
only a minimal implementation to test other parts of the system.
2013-08-27 12:14:23 +02:00
Harald Welte 0402b8f1ac MTP3: OPC and DPC elements were switched 2013-08-27 12:12:02 +02:00
Harald Welte 7ccc15e025 M2UA: Send interface identifier and 'mode override' in ASP_ACTIVE_REQ 2013-08-27 10:27:52 +02:00
Harald Welte cf74df58fe sctp_m2ua: work as SG and ASP; encode #mtp3_msg{} before handing it to M2UA 2013-08-26 17:29:28 +02:00
Harald Welte 48e452874c xua_codec: convert integer to binary and truncate binary to length 2013-08-26 17:26:42 +02:00
Harald Welte a5dfd5b449 m3ua_core: handle 'sctp_paddr_change' event
This happens e.g. if the route to the peer STP is lost, and we shouldn't
crash just because that happens, but rather try to reconnect...
2013-08-24 14:06:49 +02:00
Harald Welte 9b9ec4abb7 xua_asp_fsm: don't start any timers in 'sg' role 2013-07-27 16:00:08 +08:00
Harald Welte 0b928664ff ss7_link_m2ua: handle_info() is used instead of handle_cast()
handle_cast() is an inherited legacy from old m3ua_core
2013-07-27 16:00:08 +08:00
Harald Welte ad6e5a9123 xua_asp_fsm: match {next_state, X, Y} return value from callback module 2013-07-27 16:00:08 +08:00
Harald Welte f76565a007 sctp_m2ua: don't suppress any ASP_UP events from becoming visible to user 2013-07-27 16:00:08 +08:00
Harald Welte 799b2fca79 remove dead commented out code 2013-07-27 16:00:08 +08:00
Harald Welte 4540ecdad7 sctp_m2ua: ignore ASP-UP.ind in case of passive/listen mode 2013-07-27 16:00:08 +08:00
Harald Welte a540950cfb xua_asp_fsm: fix typo 2013-07-27 16:00:08 +08:00
Harald Welte 0d8af6bc86 xua_asp_fsm: add support for SG mode in addition to existing ASP mode 2013-07-27 16:00:07 +08:00
Harald Welte 7266d7e032 sctp_core: handle shutdown_comp sctp event. 2013-07-27 16:00:07 +08:00
Harald Welte c3cc853c6e add ss7_links:role2sctp_role()
helps to translate from asp -> active and sg -> passive
2013-07-27 16:00:07 +08:00
Harald Welte e861700c3e osmo_ss7.hrl: add type annotations 2013-07-27 16:00:07 +08:00
Harald Welte 317cee0464 add 'role' to #sigtran_link{} indicating sg or asp role 2013-07-27 16:00:07 +08:00
Harald Welte fdf2653264 sctp_sua: use 'undefined' for AS Pid 2013-07-27 16:00:07 +08:00
Harald Welte dd03995ea2 sctp_core: register process name and listen to SCTP socket in passive mode 2013-07-27 16:00:07 +08:00
Harald Welte 43ceb09099 xua_asp_fsm: Only send ASPAS event from ASP to AS if AS pid != undefined 2013-07-27 16:00:07 +08:00
Harald Welte 69b5f279a1 sctp_sua: Change number of arguments to xua_asp_fsm:init()
In commit eb61885c35 the number of
arguments to xua_asp_fsm:init() was expanded by one for the pid of the
AS FSM.  This change alters sctp_sua to adhere to this new list of
arguments, enen though it passes 'fixme' in as the pid, as we currently
don't yet fully use the xua_as_fsm module yet.
2013-07-27 16:00:07 +08:00
Harald Welte 5c9f3b5862 hook up the existing m2ua code into the ss7_link infrastructure
After this commit, it is possible to add #sigtran_link{type=m2ua}
using the osmo_ss7_sup:add_mtp_link() API.

The actual M2UA code appears to be incomplete at this point
2013-07-27 16:00:07 +08:00
Harald Welte 049ee73509 isup_codec: add gen_party_number() helper 2013-06-24 08:00:24 +02:00
Harald Welte a0d2d96566 m3ua_core: handle shutdown_comp SCTP evnt 2013-06-24 08:00:22 +02:00
Tobias Engel d49aa21366 handle non-tuple return value of TupleCB 2013-06-13 11:19:30 +02:00
Harald Welte ef770471dc Fix error in MTP3MG parsing code
The MTP3MG payload is not the MTP3 payload, but only what is remaining
after the MTP3MG header has been parsed.
2013-04-26 21:20:19 +05:30
Harald Welte eef6ce4397 add xua_asp_test module to repository (was in my local tree only) 2012-05-30 12:06:21 +02:00
Harald Welte e58b38f7a8 make module compile again (m2ua->xua changes) 2012-05-30 12:05:18 +02:00