aboutsummaryrefslogtreecommitdiffstats
path: root/src/xua_msg.c
AgeCommit message (Collapse)AuthorFilesLines
2024-02-16fix xua_msg_dump(): convert message length to the host's byte orderVadim Yanitskiy1-1/+1
This fixes bogus messages like this one: Received MGMT_ERR 'Invalid Routing Context': HDR=(MGMT:ERROR,V=1,LEN=268435456), PART(T=Error Code,L=4,D=00000019) ^^^^^^^^^^^^^ Change-Id: I516e486fb7b51a25e33965ed5a0f12ab4488d240
2023-09-21sccp: Introduce initial support for SCCP LUDT + LUDTS messagesHarald Welte1-0/+8
* LUDT/LUDTS is now properly received and passed along to the app. * LUDT/LUDTS is now used if the data to transmit spans more than 255 bytes. Related: SYS#6566 Change-Id: Ic91abfc921f5e4f36045bfa325333112cddd9fa6
2023-09-20xua_msg: Implement xua_msg_dump() using OSMO_STRBUFPau Espin Pedrol1-21/+7
This fixes a buffer overflow when a big message (eg containing long unitada, LUDT) is passed. Change-Id: I3f91586a96df2d683865715dabb4d6bc042fb33f
2021-02-08xua: introduce xua_msg_get_u32p() helperHarald Welte1-0/+10
Change-Id: Id7780074b82bc668ae148456750b1a01799decd1
2021-02-08xua_msg: Add xua_msg*_get_str() to obtain string IEHarald Welte1-0/+23
We copy the contents to a static thread-local buffer to ensure zero termination of the string received by a remote entity. Change-Id: I8cbb7aeaf0cb64db0ce01c21e5fca9ab3cd932b6
2021-02-07xua_msg: const-ify input arguments to xua_*_get_u32()Harald Welte1-2/+2
Change-Id: I517943bd11d73195de9418fb1c5d4151dab77873
2021-02-06xua_msg_add_data() Mark input argument as 'const'Harald Welte1-1/+1
We only read from it. Change-Id: I12c17273b9d64a084f59d91fc06ae1512d70855b
2020-09-14xua_msg: Get Rid of confusing double network byte order swapPau Espin Pedrol1-1/+1
The ipv4 addr in addr->ip.v4 is already in network byte order, as it's usual in struct in_addr (see sua_addr_parse_part()). So the code in there was simply calling ntohl() because msgb_t16l16vp_put_u32() is calling htonl() on the given parameter before storing it. Let's simply use msgb_t16l16vp_put() directly and avoid a double byte swap which only adds confusion. Change-Id: I70a94ee1b459d56116f0c6a6c7c3b778a939b7ea
2020-09-14sua: Support SUA_IEI_IPv6Pau Espin Pedrol1-1/+1
Change-Id: I5bd69e8400fd2d9251b5d4edd9bf3514e1194b5a
2019-11-12xua: Avoid multiline log in xua_msg_dump()Pau Espin Pedrol1-4/+4
In general we want to avoid multiline log messages since they make parsing more difficult. Also output in VTY over telnet looks strange (indentation incremented at each new line). Change-Id: Id9084d0e0f976bb374186db93d6ff8062b99e238
2018-07-12add osmo_xua_msg_tall_ctx_init()Neels Hofmeyr1-1/+7
So far the tall_xua ctx used to allocate from in xua_msg_alloc() was never initialized, actually hiding memory leaks from the talloc report. Add this API to allow branching the xua_msg ctx off a sane root ctx. Explicitly initialize tall_xua to NULL, so that, if xua_msg_ctx_init() isn't called, tall_xua is still guaranteed to not be a random pointer. osmo-bsc will use this function to hook the tall_xua ctx to osmo-bsc's own root ctx. Change-Id: I618878680a096a7f7fc2d83098590f2e4cb08870
2017-11-13Add SPDX-License-Identifier + missing copyright statementsHarald Welte1-0/+2
Change-Id: I113232bbeaa7a835871df7f9b883ba573d8a2534
2017-04-10xua_msg: Add xua_from_nested() helper function for nested IEsHarald Welte1-20/+49
... and add a test case to ensure it continues to work. Change-Id: Iee434886598b528d23ddce0490dcc782e0f5d6ae
2017-04-10xua: Remove library-internal DXUA log subsystemHarald Welte1-14/+2
We don't really need those thre log messages, and we can thus do away with the library-internal log-subsystem of DXUA. The rest of libosmo-sigtran uses the new globa DL... subsystems anyway Change-Id: Iea0d3db34a3674a9c6422b174a879bfdaa25786f
2017-04-10xua_msg: Add support for msg_event_mapsHarald Welte1-0/+21
msg_event_maps facilitate the mapping from a xUA message (class + type) to an integer event. This is useful when passing xUA messages to a osmo_fsm. Change-Id: Iee1c7fc2bf64219ebb71a0dbe6fd210749332413
2017-04-10License headers: Should always have been GPLv2-or-laterHarald Welte1-4/+4
libosmo-sigtran is GPLv2-or-later, there were some files that accidentially had an AGPLv3 license header, which was a copy+paste mistake at that time. Change-Id: I67dfd0ae6157afafd3873a3baaa4c6107c04ddfd
2017-04-10xua_msg: Add support for encoding IPv4 addr in osmo_sccp_addrHarald Welte1-1/+1
Change-Id: I956f069ce4cea78cb0db0470265ca8365093c0e5
2017-04-10xua_msg: Add support for encoding Global Title in osmo_sccp_addrHarald Welte1-3/+62
Change-Id: I4668fd0fba2e1be1ec37e75eeee85ed476320d14
2017-04-10xua_msg: Add concept of xua_msg_class and xua_msg_dialectHarald Welte1-0/+106
A xua_msg_class repreents one xUA message class (like M3UA XFER or SUA CL). A dialect is then something like SUA or M3UA, each consisting of as many as 256 message classes. Each class contains value_strings of the individual messages, as well as constraint information on mandatory IEs for each message. Change-Id: Ib538aca295b7b50132bc814b2d7b56cbe5d65bfc
2017-04-10xua_msg: Add xua_msg_free_tag() and xua_msg_copy_part()Harald Welte1-1/+27
... also, mark input to xua_msg_find_tag as 'const' pointer. Change-Id: I083634db9c3606bcff87700f253054a38a20816d
2017-02-13Add xua_msg_part_get_u32() to get U32 value from xua_msg_partHarald Welte1-4/+10
Sometimes one already has the xua_msg_part and thus can avoid the lookup that's done by xua_msg_get_u32(). Change-Id: Ie11c35f9528313d0b35786a361d853addd17364f
2017-02-13Move xua_msg_add_sccp_addr() to xua_msg.h and export itHarald Welte1-0/+33
Change-Id: I07fa00dd71d8ecdf1542734598fab8ecad5a7b53
2017-02-13xua_msg: Make DXUA available to other XUA codeHarald Welte1-1/+1
Change-Id: Ie5b6492ead2c523de3969134291b2c3f434f92a2
2017-02-13migrate some generic XUA helpers from sua.c to xua_msg.cHarald Welte1-0/+54
Change-Id: I59e55d21a05b5d770c120da4c17220d5f21d44bd
2015-12-22Import SUA (SCCP User Adaptation) and SCCP User SAPHarald Welte1-1/+1
... this code originates from the osmo-iuh repository, but is now part of a new shared libosmo-sigtran.so library generated in this repository.
2015-03-23xua: Generalize the m2ua_msg and call it xua_msgHolger Hans Peter Freyther1-0/+184
Generalize, this requires various API modifications but that is the most sane path forward.