aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2017-08-14tests: jibuf_test: Add OSMUX supportPau Espin Pedrol1-5/+42
Change-Id: I0f02da0329e6739ff340d31113161bb520b1b760
2017-08-14tests: jibuf: Improve jibuf_test to read pcapsPau Espin Pedrol4-109/+308
Change-Id: I7a13c823fb70e0adbc5fa0726fd66b15dc40014e Signed-off-by: Pau Espin Pedrol <pespin@sysmocom.de>
2017-08-14jibuf: Add osmo_jibuf_empty APIPau Espin Pedrol2-0/+11
This is useful to know if we need to keep iterating over osmo_select_main() to dequeue packets before finishing. Change-Id: I91a23e220c56924b847265c5dc752f286b109c2c
2017-08-14jibuf: Add initial implementation of Jitter BufferPau Espin Pedrol9-2/+883
Change-Id: I9688ba9c4d5b733b9f29d0f15f73750f9271ef55
2017-08-14osmux: Slightly improve output format of osmux_snprintfPau Espin Pedrol2-2/+5
The buffer for osmux_test is increased as the former doesn't seem to be able to cope with the whole output. Change-Id: Ic838dd9d7ad89b4510ccfa58c0390c69a075b616
2017-08-14osmux: Fix buffer overflow in osmux_snprintfPau Espin Pedrol1-1/+1
When running osmux_test on my PC, the process was aborted with a "stack smashing detected" error. Change-Id: I8a7cc422c181c0c5712ac8976a5be5f0ad44a9c0
2017-08-08tests: osmo-pcap: Allow different l2 pktsPau Espin Pedrol9-50/+189
Before this patch, ETH was assumed and other types were not supported. This patch also adds Linux cooked packet support for L2. Change-Id: Ie62fa0a8e45e1e141edb64b116dad185ad9c7a5f
2017-08-08tests: osmo-pcap: Fix per packet timerPau Espin Pedrol2-7/+13
Before this commit, the gap time between 2 packets {n-1, n} was being applied to {n, n+1}. Change-Id: I715865c1edd1fc2ec9b024671d91eb72559cbdea
2017-07-13contrib: Enable -Werror by defaultPau Espin Pedrol1-1/+1
Change-Id: I045536c21d7a0fa2fc23258c727d67bedf176ece
2017-07-13rtp.c: Fix print formatPau Espin Pedrol1-3/+4
Fixes compilation warning Change-Id: I0146a19bf852c9e27d265a098dc9d7a337424e10
2017-07-10jenkins.sh: Proper error message if local environment isn't set upHarald Welte1-0/+7
Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7
2017-07-08configure.ac: Use -Wall in C(PP)FLAGSPau Espin Pedrol1-0/+3
Change-Id: Ia1d7e99541089a92e6bc17798a94ac756047aeba
2017-07-06configure.ac: Add --disable-doxygen flagPau Espin Pedrol1-1/+7
This flag, when set, allows to unconditionally disable doxygen documentation generation, even if doxygen command is found. Change-Id: I16b3502be3e32274f548da6a2a0b0363dd3bfe5d
2017-06-07src: use osmo_timer_setup()Pablo Neira Ayuso3-10/+6
Use new function available in libosmocore to set up timers. Compile tested only. Change-Id: Id3dd32102c7362f3b280d2c058c2decebccb357a
2017-05-14somo_stream_srv_fd_cb(): close socket if NODELAY failsHarald Welte1-8/+14
We didn't check for cases where setsockopt_nodelay() fails. Let's check for that and bail out + close the socket. Change-Id: I0adbc4cec35be7c36bdf01d4d8fefd6097e9be5d Fixes: coverity CID#166970
2017-05-02stream.h: Add missing stdint.h includePau Espin Pedrol1-0/+1
This header uses uint16_t, which is provided by stdint.h. Change-Id: I399e2986c9d8cb5b3dd31673a6b4bf63070a4770
2017-04-29misc: Call the variable ctx like in all other placesHolger Hans Peter Freyther2-11/+11
We couldn't figure out what "crx" as supposed to mean and assume it is a typo. Fix the code and call it ctx, this is fixing the API documentation as well. Change-Id: I27ed1178fdbbcf3fc0e1070dc19b4ecf9a327a04
2017-04-28osmux: Fix delay between RTP packetsPau Espin Pedrol1-2/+3
AMR frame contains 160 samples at 8000Hz -> 20 ms long Change-Id: I36dc69f9caf591dd1b578bc914a2ce426c7f2813
2017-04-27deb: add missing dependency on doxygenMax1-0/+1
Attempt to fix OBS nightly by adding explicit dependency on doxygen, similar to other libosmo* Change-Id: I9cfc94a115c19eedf0923caacd17d1521b4c8fe4
2017-04-27osmux: Use osmo_gettimeofday for testing puroposesPau Espin Pedrol2-6/+26
This way we can use fake time and osmux_test take 700ms instead of >2sec to run. Change-Id: Ic39cab74400aca8262a00c0d06884230b1a15ca3
2017-04-27osmux: Add RTP marker bit supportPau Espin Pedrol3-7/+83
According to RFC4867 (RTP payload format for AMR): "The RTP header marker bit (M) SHALL be set to 1 if the first frameblock carried in the packet contains a speech frame which is the first in a talkspurt. For all other packets the marker bit SHALL be set to zero (M=0)." This information bit provides a way for the receiver to better synchronize the delay with ther sender. This is specially useful if AMR DTX features are supported and enabled on the sender. Change-Id: I0315658159429603f1d80a168718b026015060e9
2017-04-27osmux: Check batch_factor overflow in osmux_batch_enqueuePau Espin Pedrol1-6/+7
This commit should fix a bug present if for instance batch_factor < 8 and osmux_batch_enqueue is called from osmux_replay_lost_packets and enough packets were lost from last received packet. Change-Id: I5d643810949aeca4762f0cad05eed534d35087f7
2017-04-27osmux: use uint8_t everywhere for batch_factorPau Espin Pedrol1-5/+5
Change-Id: I9fcc8e94b2fcd843b10cb3f8f009f2348eb3a4af
2017-04-25Fix debian packagingMax4-1/+23
* add separate -doc packages * fix dh_install override * add conflict with previous version Change-Id: I2781c800d39923c5541bac00f00cb128f4acf008
2017-04-17SCTP: Don't enable sender_dry_event for SCTP, as it breaks Linux SCTPHarald Welte1-2/+11
Enabling sender_dry_event in SCTP_FLAGS breaks reliable delivery of DATA chunks to the scoket user on Linux. Let's avoid enabling that, while still enabling various other interesting events. See https://bugzilla.redhat.com/show_bug.cgi?id=1442784 for all related details. Change-Id: Ib616cd07a6044ca2ee7e05093b22df3369c62b56
2017-04-16stream.c: Fix SCTP_NODELAY settingHarald Welte1-1/+1
We were using the wrong variable when setting the SCTP_NODELAY, resulting in the setsoctkopt() fialing. Change-Id: Ic04cb8bb5ff41f177f7f5b7f7e2a2ecc686dd4c0
2017-04-15netif/ipa.h: Don't redefine 'struct ipaccess_unit' from libosmocoreHarald Welte1-13/+1
'struct ipaccess_unit' is defined in libosmocore/gsm/ipa.h, we shouldn't re-define it here. This entire IPA code duplication accross multiple libraries and programs is a big mess. Change-Id: If378a088c741df540befb928a5557fc62dea954a
2017-04-14osmo_stream_srv_fd_cb(): don't leak socket FDs on errorsNeels Hofmeyr1-6/+23
So far we seem to assume that the accept_cb does all handling of socket fd cleanup. However, there are cases where there is no accept_cb set, the accept_cb returns error, or an earlier sctp_sock_activate_events() or the activation of non-blocking mode fails. For those cases, close the socket and return an error code. Fixes: CID#57915 Change-Id: I3a3ce9194ab7ca5c1921fc79c2a1c9e10a552cf0
2017-04-14ipa.h: Don't redefine what libosmocore already definesHarald Welte1-33/+5
Change-Id: Ibd81efc1dc61b8c2019d55a8fa6e3bb99b5acb20
2017-04-12stream.h: Add missing stdbool.h includeHarald Welte1-0/+2
Functions introduced in 9ec26583cd807e0aeaa3b9de927f3d8a768c3a71 are using the bool type without referencing stdbool.h as include file. Change-Id: I736cb04629d516c10c7d5f42f792ed3d5ae6658f
2017-04-12SCTP: Fix PPID byte widthHarald Welte1-3/+3
In a659590e29412588bca2243b8329e82286244b00 we fixed endianness issues with the Stream ID field, but at the same time mistook the PPID field for 16bits. In reality it is 32bits, and hence our 'htons' is rendering wrong PPID values. Change-Id: I1b60523044835ee630dba9a43d26af4f1ebd1ced
2017-04-11Add osmo_stream_{cli,srv_link}_set_nodelay() functionHarald Welte2-0/+62
Using this function, the user can configure if sockets related to the respective stream client or server should have the NODELAY socket option set in order to avoid Nagle algorithm or related algorithms that may introduce packet delay on the transmitter side. Change-Id: Ibeb9ba227bab18f7f4f16518c0022c4f003cc8e9
2017-04-10stream.c: Fix endianness handling of PPID and STREAM_IDHarald Welte1-6/+6
In their infinite wisdom, the inventors of SCTP designed an API (the sockets API described in RFC6458), where some members are in host byte order (like the stream identifier), while other members are in network byte order (like the PPID). Let's handle this properly (we assumed both are network byte order), and also use 16-bit htons/ntohs fo the PPID, rather than htonl/ntohl. Change-Id: I777174ca2915c6de0063db41a745c71b4a09bbec
2017-04-10stream/datagram: Ensure reliable close/destroyHarald Welte2-4/+16
* when using osmo_*_destroy(), always call *_close() internally to make sure we don't free memory holding references to sockets that are still open * when closing the socket, always make sure to set the fd to -1 in all cases, to avoid attempts to avoid later close() on a new file using the same fd number as the socket closed previously. Change-Id: I29c37da6e8f5be8ab030e68952a8f92add146821
2017-04-10stream/datagram: Consistently use osmo_talloc_replace_string()Harald Welte2-14/+8
during osmo_*_set_addr(), we must make sure to talloc_free() any old address before copying in the new address. Not all functions did this, and those that did implemented it manually. Let's use osmo_talloc_replace_string() which is exactly intended for this case. Change-Id: Ie1b140a160c66e8b62c745174865d5ba525cb2c2
2017-04-10stream+datagram: Allow local bind + connect for client socketsHarald Welte4-7/+48
This uses the new osmo_sock_init2() features introduced in libosmocore Change-Id Idab124bcca47872f55311a82d6818aed590965e6 to bind *and* connect a given socket during creation. Change-Id: I013f4cc10b26d332d52d231f252bb0f03df8c54b
2017-04-08doc: Add Doxygen group for OSMUX related functionsHarald Welte2-0/+21
Change-Id: I87e08bd84236ae5d5c057bca96d122e568a6b52a
2017-04-08Add minimal doxygen documentation for stream + datagram modulesHarald Welte7-4/+2018
We should have doxygen documentation for all libosmo-* APIs. libosmo-netif is currently devoid of any API docs. Let's start with the stream and datagram socket related functions. Change-Id: I589a5e60d9df2b8a65fbaf68f80e3ae0039d8c2a
2017-03-29stream.c: Handle SCTP in osmo_stream_srv_recv()Daniel Willmann1-1/+57
Change-Id: If0875cfa3eba9ef36acc0c4bfd0d168a45c380b9
2017-03-20stream client: Ensure client is notified on reconnectionHarald Welte1-0/+1
without setting the BSC_FD_* flags prior to reconnection, the re-connect would happen silently and the client program would not be notified via the connect_cb(). Change-Id: Iaf8ec8662cf83476eee1b76fa41dc57f063f0ad3
2017-03-17README.md: Make sure all hyperlinks have <>Harald Welte1-6/+6
Change-Id: I5a5659afde32f08b324e602b7b1f96de805ba031
2017-03-17stream: Export osmo_stream_cli_reconnect()Harald Welte2-1/+2
In case the application is using the read-callback and a read returns 0, then the application itself would want to trigger the reconnect. This is different from the osmo_stream_cli_recv() case where the reconnect can be handled internally to the library. Change-Id: I41314bad4a9f44e8a61b9d2ba33d1a76b25bd145
2017-03-17stream: When destroying, make sure to kill reconnect timerHarald Welte1-0/+1
if osmo_stream_cli_destroy() is called while the reconnect timer is running, we would end up in a crash. Change-Id: If6597130f472f1e2b8d9682002250ecd54675bb0
2017-03-17stream: don't crash in _close() when fd is not initializedHarald Welte1-0/+6
We use the magic value '-1' in case the file descriptor is not yet initialized. If somebody calls osmo_stream_*_close() before this changes, we used to crash. Let's check for this and avoid a crash. Also, after close let's change the fd to -1 again to mark the fd invalidity. Change-Id: I3aa04999ab01cb7971ee2dad45dfc31ab4142868
2017-03-17stream_client: Actually use/honor the reconect parameterHarald Welte1-1/+4
The reconnect behavior was likely broken in commit de3f57a8293a5b39435d6f283da23e0172bad8bb If the user requests a re-connect, we should start it. Not only in case the connection drops later, but also if the initial connection itself fails. Change-Id: I817e026404cbd9145cae2ce90bc57a1db1d2e12b
2017-03-16jenkins: add value_string termination checkNeels Hofmeyr1-0/+2
Change-Id: If7f6dce2b8325d4f2f732e1c14d6a1082e122584 Depends: libosmocore change-id I2bc93ab4781487e7685cfb63091a489cd126b1a8
2017-03-16Add README file to libosmo-netif repositoryHarald Welte2-1/+55
Change-Id: Idfc804740e5a086701017d55c86aaf3304c84148
2017-02-07Fix potential NULL dereferenceMax1-1/+2
Change-Id: I5baf369dbf3948565614476980a32be59abaf42a
2017-01-16deb: fix lib versionMax2-2/+2
The library version does not match LIBVERSION from Makefile.am and -dev package dependency - bump it. Change-Id: Ie9bcd71ffcaeaa78aeef74ec329a6966ce1f1ba6 Related: OS#1860
2016-12-22rs232.c: Fix license to GPLv2-or-later. libosmo-netif is GPLv2-or-laterHarald Welte1-3/+3
Change-Id: I7c73d1a0b15cfb2a729687cde6f9a8e62a230fd7