aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2020-01-02Bump version: 0.6.0.16-6413a-dirty → 0.7.00.7.0Pau Espin Pedrol5-5/+28
Change-Id: Iabfa9a706c6456bf554ba59badbc3cbfc9210423
2019-11-20osmux_test: don't use color loggingNeels Hofmeyr3-214/+216
Change-Id: I7b0c8d311123f4fa0aeedf3938c8628a4442daf7
2019-10-22libosmo-netif.pc.in: Append -lsctp to Libs.privatePau Espin Pedrol1-0/+1
It will be used by the linker when linking statically against libosmo-netif. Change-Id: If25064d43363bace563e992828350f6d28543854
2019-10-21stream: Fix fd param passed to close() in error conditonPau Espin Pedrol1-2/+2
Fixes: CID#205089, CID#205087 Change-Id: I65714f214b9962862cda01605c7c2c578c78d3c7
2019-10-18tests: osmux_test: Hardcode h_output values set by random()Pau Espin Pedrol1-0/+3
osmux implementation randomizes those values. It seems build in OBS sometimes provide different values than the ones expected in the test result. Let's hardcode them to make sure we always have the same values regarless of the random() implementation. Values chosen are the one matching the current expected test output so it doesn't need any change. Change-Id: Icc553c83ddff41900ae3d5990a655c29c9073e01
2019-10-15stream: osmo_stream_cli: Support setting multiple addrPau Espin Pedrol2-12/+85
This API will be later used to set multiple addresses for SCTP sockets. Depends: libosmocore.git Ic8681d9e093216c99c6bca4be81c31ef83688ed1 Related: OS#3608 Change-Id: I09f0d989f2309abdeb304fe570355abed2cd107b
2019-10-15stream: osmo_stream_srv_link: Support setting multiple addrPau Espin Pedrol3-4/+39
This API will be later used to set multiple addresses for SCTP sockets. Depends: libosmocore.git Ic8681d9e093216c99c6bca4be81c31ef83688ed1 Related: OS#3608 Change-Id: I0fe62f518e195db4e34f3b0ad1762bb57ba9d92a
2019-10-10stream.c: remove duplicated line setting variablePau Espin Pedrol1-1/+0
Change-Id: I03b05179f5656ab81e5e14cd146f82a471f7b071
2019-10-04tests: osmux_test: Provide More accurate logging expectanciesPau Espin Pedrol3-13/+1096
Change-Id: I85722ebcb5486426dfe76cdca1b8a0692bb5b111
2019-10-04osmux: squash LOGP message to one linePau Espin Pedrol1-2/+1
It seems different compiler versions (jenkins and my workstation) are generating different line number for that message, and it makes osmux_test fail when improving logging on next commit. Change-Id: Ie2bb0ecf4cc165b9a1080e2558b33ba37014278c
2019-10-04tests: osmux_test: Use fake time also for monotonic clockPau Espin Pedrol1-4/+29
Currently osmux related code uses both gettimeofday on some parts and clock_gettime(CLOCK_MONOTONIC) on others (for different purposes). Let's fake both clocks and not only the one used by gettimeofday API. Change-Id: I4e1a0eb4f8c4ea1bc0f963afa18b116d3af9978c
2019-10-04osmux: osmux_snprintf(): Remove dangling whitespace at the end of dummy framesPau Espin Pedrol1-1/+3
Change-Id: I1ef73807c3300cbcc332f32e6bb905d9b30557be
2019-10-04osmux: osmux_snprintf(): Append comma between osmux frames in msgPau Espin Pedrol1-1/+4
Change-Id: I7acaba9429466db6cb5700b206d6b42da5e4627a
2019-09-19stream_test: Log fake timePau Espin Pedrol3-66/+82
It allows easy verification that timing is correct and makes it easier to debug time related race conditions. Change-Id: I86eb1d7a8096011fd273f067255eb8d6484be65c
2019-09-19stream_test: Use fake timePau Espin Pedrol1-1/+8
By using fake own-controlled time we get two benefits: * Test doesn't take 9 seconds to run anymore * More fine-grade control of different events happening (and associated race conditions). Change-Id: I16b2884b289bfe40dfb8d743dce01bb4c208d117
2019-09-04stream: Fix scheduling of queued messages during connecting statePau Espin Pedrol1-1/+6
If messages are sent using osmo_stream_cli_send() while the stream is still (re)connecting, they won't have a chance to be sent until the stream is connected, and hence they are queued until CONNECTING->CONNECTED is done. However, at that time (osmo_stream_cli_fd_cb), the WRITE flag was dropped unconditionally, which meant already queued packets didn't have the opportunity to be sent by the same callback until first message is enqueued and WRITE flag is set (again by osmo_stream_cli_send()). Let's make them be sent as soon as possible once the connection is available. Related: OS#4188 Change-Id: I289495f9aad6389c5f2623fb072d676235b7d24c
2019-09-04stream: Introduce API osmo_stream_cli_is_connectedPau Espin Pedrol2-0/+9
Can be used by users to fetch current status of the stream. Change-Id: I5402430e5f39eef22dfa18f33807ab6b1e771f1b
2019-08-07Bump version: 0.5.0.2-6563-dirty → 0.6.00.6.0Pau Espin Pedrol5-9/+17
Change-Id: I3af3b7aaff5c6dc3ac94e942191e27af4bf5392a
2019-07-10contrib/jenkins.sh: run "make maintainer-clean"Oliver Smith1-0/+1
Related: OS#3047 Change-Id: I37908c12dae9d268b8bde186e2743a2d7fd13536
2019-05-17osmux: Extend osmux_out_handle and add new API to set rtp payload_typePau Espin Pedrol7-11/+22
Previously payload_type was always hardcoded to 98 for generated rtp packets from incoming osmux frame. Change-Id: I5cbeb494a8932953d9fd2dc24dacf8cd97fd84e4
2019-05-10Bump version: 0.4.0.1-738f → 0.5.00.5.0Harald Welte2-1/+38
Change-Id: Iea2da939e259d0a9e7c5dad14d7a961434c276ef
2019-03-20amr: use sizeof(struct amr_hdr) when working with amr header lengthPhilipp Maier1-3/+3
The header of an AMR header payload is 2 bytes long. At the moment we use just a constant of 2 when we refer to the header length, but we have a struct amr_hdr defined. Lets use sizeof(struct amr_hdr) to make it more clear that we are refering to the header length. Change-Id: Ic7ca04b99a97d7d3b91717b0c3e6c55ef3001a3e
2019-03-19Deprecate osmo_stream_cli_open2()Max3-7/+120
This supposed to be variant of osmo_stream_cli_open() with explicit control over reconnection logic but it's plain broken: doxygen docs contradict the code, actual reconnection logic is affected by timeout parameter directly which is set in different function. It seems like we haven't been affected by this so far because we always use it in auto-reconnection mode which is triggered by default due to positive reconnection timeout value (5 sec) automatically used in the absense of explicitly set timeout. Looking at commit history, this function already been source of confusion in the past. Instead of trying to fix this mess, let's just deprecate it entirely and properly document use of osmo_stream_cli_set_reconnect_timeout() to control reconnection logic. The only known user is libosmo-sccp which won't use it as of 0a93a683f3cb8e5977eb4a666ab207db6e7d7af9 commit. Change-Id: Id988ed0274b363db049f59cbf6a193727c8c3c8a
2019-03-14tests: AM_LDFLAGS = -noinstall for all testsOliver Smith1-2/+1
Fix a symbol lookup error when building a new test on systems where a previous libosmonetif.so is installed. Symptoms described here in detail: https://osmocom.org/issues/3812#note-10 -no-install causes libtool to generate output files that link against libraries in the build tree, instead of linking against the future installation paths and generating a wrapper script. The wrapper script should override the library paths, but at least on Debian, it does not work as it should. Test binaries won't be installed anyway, so we can safely use -no-install and work around the problem. See also: https://autotools.io/libtool/wrappers.html https://www.gnu.org/software/libtool/manual/html_node/Link-mode.html Related: OS#3812 Change-Id: I94ccff42dfba71aaf59bb30ca312db0bac58c27d
2019-03-14gitignore: add amr_testOliver Smith1-0/+1
Change-Id: I1ea7aad144a505412969c6c301349f8d47964422
2019-03-12amr: be sure result of osmo_amr_bwe_to_oa() fits into int bufPhilipp Maier1-1/+1
osmo_amr_bwe_to_oa() uses an internal buffer with static size to store intermediate results. The buffer is large enough for any real world situation, but the check that tests if the result would fit into the internal buffer is incorrect. It checks if there is enough room for the existing payload, but does not include the expected growth of the payload. Eventually the buffer could be overrun by one byte if one would put a 256 byte long AMR payload. Fixes: CID#195926 Change-Id: I4d7ac570a0b48368a82183673c46bca5f235f228
2019-03-12amr: cosmetic: correct sourcecode formattingPhilipp Maier1-1/+1
Change-Id: Ie4ad6b1a2382da4dc21e66a45c2a96224cab5752
2019-03-07AMR: add functions to convert between bw-efficient and octet-alignedpmaier/amrmanglePhilipp Maier6-2/+612
RFC 3267 describes two different AMR frame formats. Octet Aligned and Bandwidth efficient mode. In Bandwith efficient mode the padding bits, which are used to align CMR, TOC and payload on octet boundaries are saved and the fielda are packed directly one after another. - Add functions to convert from one mode to the other and vice versa. - Add function to detect in which mode an AMR frame is encoded. Change-Id: I5b5a0fa644d8dbb1f04f9d7e35312683c7b3d196 Related: SYS#4470
2019-03-01AMR: add define constants for AMR payload lengthPhilipp Maier2-9/+21
AMR uses different payload sizes, those sizes are well defined in RFC 3267. Lets add define constants and replace the magic values with the define constants. Also correct the value for AMR_FT_SID in amr_ft_to_bytes from 6 to 5 (39bits / 8 = 4.875 bytes ==> 5 byte, see also RFC 3267, chapter 3.6) Change-Id: I65b5da920d58015b875d6dcf17aacdc04b58955e
2019-02-28debian: Add BuildDepends on libpcap0.8-devHarald Welte1-0/+1
The debian packaging wants to execute "make check" which in turn wants to build the jitterbuffer tests, which in turn require pcap.h to be present, which is provided by libpcap0.8-dev. Closes: OS#3818 Change-Id: Iab471de9fb276a436332241337539eab544f965a
2019-02-27AMR: add spec reference for AMR frame typesPhilipp Maier1-0/+3
Change-Id: I39a602ae96570c9609680ff67e0946a696091cbe
2019-02-20Stream client: add disconnect callbackMax4-1/+31
It's similar to connect_cb() but called once client has been disconnected. Change-Id: I905adb2d6191216551a3bcdcd1aec1f96f01612a
2019-02-07Add stream client/server testMax6-1/+418
Previously stream client and server code were only used in examples which means regressions could be easily introduced unnoticed until they trigger bugs in external code which relies on osmo_stream_*() Fix this by adding basic client-server interaction tests with and without reconnection. Change-Id: I336f79970982ed8e1d73b73d54fa4c27ba8bce8e
2019-02-07Stream client: report reconnection event as INFOMax1-2/+2
This helps to avoid unnecessary debug output in reconnection logic tests in follow-up patches. Change-Id: Ic96430a9e9294e72de23b0bbacdbf3e99a453f1d
2019-02-06Ignore test binariesMax1-0/+3
Change-Id: Ice6f5aec2f22a97033a555a292a5648090fc5970
2019-02-06Stream examples: fix typos in error messageMax1-2/+2
Likely a copy-paste error from corresponding client example code. Change-Id: I47cc8c7340eb188d85a49d4f41c295bed0e1bee4
2019-02-05Stream client: fix disconnection logicMax1-2/+8
Previously closing the client did not alter its state, so we might end-up with a client without any file descriptors, but being in state STREAM_CLI_STATE_CONNECTED. Fix this inconsistency by setting appropriate state. Related issue is that reconnect function, which is always (at least in the library and examples) called when some problem with the connection is detected, closed the connection only after checking whether reconnection is enabled. This might result in another inconsistency fixed in this patch by moving the check below connection cleanup. While at it, also move connection close logging to appropriate place: it's confusing to see logs about connection being closed while in reality it wasn't even established. Change-Id: If41ed60bd625488c283d1e8a2b078e640f04c78e
2019-02-05Add socket name functions to stream client/serverMax4-2/+35
Add functions to get the description of a server link or client connection which examine data on corresponding socket. Those functions use static buffers and intended for single use in log/printf statements as illustarted by corresponding example changes. Change-Id: If9a8e211da85956781479862a63c4fc6e53ed6be
2019-02-05Stream client: update loggingMax1-16/+25
Introduce logging macro wrapper to properly log current client state and function to aid in debugging. Change-Id: Ie22a80dcec95998cce0b25053fdf74f23eab6e53
2019-02-05Stream examples: print accepted client addressMax1-0/+6
Display socket information for accepted client. Change-Id: I5aa6757be79754cf7ffa4a276dae1cfb80fe904e
2019-02-04Stream client: fix doxygen typoMax1-4/+4
Change-Id: Ic45d3e0520db4060c5c24e5ef5a766a52f060a34
2019-01-31Cosmetic: use #pragma once as include guardMax1-4/+1
Change-Id: I2c1a13252730294597a7a9fb5726aae928f41bfd
2019-01-31Add missing includeMax1-0/+2
stream.h uses msgb from libosmocore without corresponding #include It's odd that we haven't hit this issue earlier. Change-Id: Ib8b4f4965af0fefa7dac3f2a56a5a4b76a03fd57
2019-01-29Stream examples: fix server's endless loopMax1-3/+6
Stream server example had an error which resulted in infinite loop on client disconnect. Fix this by properly handling client closing connection to allow it to reconnect multiple times. Change-Id: Icfc2cf7f971b9e3a4abc34cc18d8a44c811c5617
2019-01-29Stream examples: log sent/received bytesMax2-10/+23
Make client and server examples more verbose by logging actual bytes sent/received. Change-Id: I6979b2f92c96c2366f18bf31e4bc495a6709133a
2019-01-29Stream examples: filter internal loggingMax2-0/+2
Set category filter to make sure internal library logging won't interfere with example's own logging. It's also nice example illustrating log_set_category_filter() usage. Change-Id: I17d7878d302f011d8ff0d86708d677f5b559299e
2019-01-20Bump version: 0.3.0.6-a555 → 0.4.00.4.0Harald Welte3-4/+23
Change-Id: I99a3244f922382468251df675287520ca40d9d0d
2018-12-10logging: fix typo in stream.cNeels Hofmeyr1-1/+1
Change-Id: I5dcae1f19e18f04709ce7585943af1d582ebc7ed
2018-11-09detect freed connections in osmo_stream_srv_read()Stefan Sperling1-7/+10
While we are processing a read event, the connection's callback might free the connection. Check for this and don't attempt to process further events on an already freed connection. Change-Id: I0a9c7d8e3263c73440f7084dbb1792a4ca5038f0 Related: OS#3685 Depends: g#11704 (for libosmo-sccp)
2018-08-13jibuf: fix indentation in line inside conditional clausePau Espin Pedrol1-1/+1
Change-Id: I3cb356a4a13d53e7f88a5e4595899bb2eb510d20