AgeCommit message (Collapse)AuthorFilesLines
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: → 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
2018-08-06debian/rules: Don't overwrite .tarball-versionHarald Welte1-5/+1
The .tarball-version file should contain the *source version* uniquely identifying the git commit, and not the Debian package name. With https://gerrit.osmocom.org/#/c/osmo-ci/+/10343/ there is a correct .tarball-version file in the .tar.xz of the nightly source packages. Change-Id: I8915ebbf7d3a64a9474e1aeb49b1d192a388ef53 Related: OS#3449
2018-08-01link libosmo-netif against libosmogsmHarald Welte1-2/+2
The recently-introduced dependency to libosmogsm symbols needed some explicit addition of linker flags to avoid user applications to fail linking with /usr/bin/ld: /usr/local/lib/libosmonetif.so: undefined reference to `ipa_ccm_id_resp_parse' Change-Id: I07a28f8970b90f82736e2de783bafc9d2c5ea0e5
2018-08-01Migrate from osmo_ipa_idtag_parse() to ipa_ccm_id_resp_parse()Harald Welte4-37/+7
In libosmocore Change-ID I1834d90fbcdbfcb05f5b8cfe39bfe9543737ef8f we have introduced ipa_ccm_id_resp_parse() as a bugfixed replacement of ipa_ccm_idtag_parse(). The main difference is that the returned "value" parts now have a correct reported "length", whereas before this commit they all reported a one-byte too-long "length" for each IE. Let's use this opportunity to remove the copy+pasted osmo_ipa_idtag_parse() function from the libosmo-netif codebase. Change-Id: I4626d247626543e032593bf226b6c233f6678562
2018-07-27fix strncpy bug in rs232.cNeels Hofmeyr1-2/+1
Change-Id: I2f3b7888acb4f25da22ffef4391e1d0831485483
2018-07-27Bump version: → Espin Pedrol5-8/+22
Change-Id: Ic9bbe8427c44ef2a9ee02537f17821048f177cdd
2018-07-05stream.c: Use non-blocking connect in osmo_stream_cliHarald Welte1-1/+1
When establishing a client-side stream connection via libosmo-netif, we must using non-blocking connect if we want to avoid blocking/stalling the entire process. The libosmocore socket API provides the OSMO_SOCK_F_NONBLOCK flag for this. Make use of it! Change-Id: I9bfcb39b5801a36ef32ca0d1f3eb8236687d7ed6 Related: OS#3383
2018-06-29remove "channel" layerHarald Welte18-1141/+1
The "channel" layer on top of IPA client + server was introduced in 2011 but never used in any osmocom program/project so far. Contrary to the several other IPA multiplex related implementations in libosmo*, it did not deal properly with segmented IPA messages, i.e. where a single TCP segment (and hence recv/read call) does not contain a full IPA message. So rather than fixing it up and having yet another IPA related API in our libraries, let's remove it. Change-Id: I97c378750acb1637ee032fa88a968edf68d8979f
2018-05-15osmux: change log lvl of batch full to debugPau Espin Pedrol1-2/+2
This message is expected as all code filling batches call osmux_batch_enqueue() and checks for error to know if it must tell the user of the lib to call osmux_xfrm_input_deliver. Change-Id: I3d8227f2281f6ca92fd2502d3e328765dc7ecfe9
2018-05-15jibuf: Fix out-of-order seq queue around syncpointsPau Espin Pedrol3-7/+36
Fixes: OS#3262 Change-Id: Ib8c61dbe6261cf73d6efcd7873e23b7656117556
2018-05-15tests: jibuf_test: Add scenario to show out-of-order bugPau Espin Pedrol2-0/+83
Related: OS#3262 Change-Id: I1e78cc44f8a04dcb983352b513f8de2574b2394b
2018-05-15tests: jibuf_test: Set some functions as staticPau Espin Pedrol1-2/+2
Change-Id: I3af6db3fd74d55c5e659132fc542f22478a55eb7
2018-05-03Bump version: → Espin Pedrol3-4/+58
Change-Id: Ic8a9e44b2f930fed024040777eab58699fdcaadc
2018-04-28osmux: Fix use of uninitialized memory in osmux_out_handleHarald Welte1-0/+1
In Change-Id: I2efed6d726a1b8e77e686c7a5fe1940d3f4901a7 we're adding a new member to 'struct osmux_out_handle' which is not initialized. Rather than initializing this single new member, let's do a memset() over the entire osmux_out_handle at the beginnign of osmux_xfrm_output_init(). Change-Id: I751e9414c6de2413a9f977e5ae5655ebfd114f45 Closes: OS#3219
2018-04-19osmux: Move examples and tests to use new output APIsPau Espin Pedrol4-24/+17
Change-Id: Ie69c427308eb7d81aedab7fbb71f1bdaf43f0275
2018-04-19osmux: Set Marker bit on osmux frame loss detectedPau Espin Pedrol4-12/+34
Until this patch, we didn't notify in any way to the RTP reader when an Osmux frame was lost. Instead, we updated the seq&timestamp as if there was no lost, and as a result the RTP reader would only see a steady increase of delay every time an osmux frame was lost. As the batch_factor for the lost packet is unknown, we cannot assume any number of amr payloads lost, and thus we cannot simply increment seq and timestamp for a specific amount. Instead, the only viable solution seems to set the M marker bit in the first rtp packet generated after a non-consecutive osmux frame is received. The implementation may act differently with the first generated RTP packet based on the first osmux seq number used for the stream. In case 0 it's used as first osmux seq number, M will be set depending on request from original RTP packet having the M bit set. If it's not 0, the first RTP packer will unconditionally have the M bit. That's not an issue because it's anyway expect for receiver to sync on the first packet. Related: OS#3185 Change-Id: I2efed6d726a1b8e77e686c7a5fe1940d3f4901a7
2018-04-19tests: Add osmux2 testsuitePau Espin Pedrol4-1/+497
This test is aimed at testing several specific scenarios related to how osmux manages in/out of osmux/rtp packets over time. Change-Id: I3bf59276424ea87c4e66a6ff46de1e3e9a06a904
2018-04-19osmux: Add new API osmux_xfrm_output_sched to fix rtp generation issuesPau Espin Pedrol2-3/+141
With old implementation, in conditions with jitter we could end up scheduling RTP generated packets from two consecutive osmux frames in an interleaved way (from seq field point of view). This new implementation should make it easier for any RTP reader/playback to have better results in those conditions. Old APIs osmux_xfm_output and osmux_tx_sched are marked as deprecated in favour of the new one, which has a better control of generated RTP packets. However, they are still usable despite the implementation changes done to support the new API. Related: OS#3180 Change-Id: I4e05ff141eb4041128ae77812bbcfe84ed4c02de
2018-04-17examples: use osmo_init_logging2Pau Espin Pedrol16-31/+33
Change-Id: I7f1f4503f254931edeebfbadf3953efa7b20f85f
2018-04-17Build jibuf_tool based on libpcap availabilityPau Espin Pedrol2-4/+13
Change-Id: I27cdb1b5175a5b02638e6d743b686bdf4b1be144
2018-04-17tests: use osmo_init_logging2Pau Espin Pedrol2-2/+6
Change-Id: Icc84bbd53e1589e26e445e3460024e77162bd76f
2018-04-13jibuf: Estimate src clock skewPau Espin Pedrol6-13/+1005
Change-Id: Ifae633d53107417a8e2f9b0f200d2711db72d199
2018-04-13tests: jibuf_tool: Add seq.pltPau Espin Pedrol1-0/+50
Change-Id: I37bb3ab372b7ad7c3c1d09c8134827c932bf8bf8
2018-04-13jibuf: re-sync clock out of sync timestampsPau Espin Pedrol4-7/+152
Change-Id: I33556b33d7549654442d9bdd7f31128792506652
2018-04-13jibuf: Take RTP marker into accountPau Espin Pedrol4-5/+89
Change-Id: Ie142acfb45650e0af775f58226fd191beaf8178e
2018-04-13tests: jibuf_tool: Add parameters to control size of bufferPau Espin Pedrol1-4/+14
Change-Id: I8a7fa39985f8d197e24c32cab80299aba2d03087
2018-04-13tests: jibuf_tool: Add OSMUX supportPau Espin Pedrol1-3/+40
Change-Id: I0f02da0329e6739ff340d31113161bb520b1b760
2018-04-13tests: jibuf_tool: Improve jibuf_test to read pcapsPau Espin Pedrol3-105/+308
Change-Id: I7a13c823fb70e0adbc5fa0726fd66b15dc40014e Signed-off-by: Pau Espin Pedrol <pespin@sysmocom.de>