aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
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
2016-12-22Add gerrit settingsMax1-0/+3
Make it simple to setup and use this repo with 'git review' command. Change-Id: I4fc8b17a0cbea16c7bdd7e50d106ef4aa35780e0
2016-12-21Integrate Debian packaging changesMax3-6/+93
debian/control: * restructure to make it easier to incorporate further changes * update package descriptions * update project URL debian/rules: * use proper hardening syntax * restructure to make it easier to incorporate further changes * add cleanup override debian/copyright: add file matching Debian format Change-Id: I9174b34a79c0562ef43f757ea76d67301088f109 Related: OS#1694
2016-12-01examples/stream-server.c: use read() rc instead of strlen()Neels Hofmeyr1-2/+4
Fixes: CID#57922 Change-Id: Ibaafdd49d9446a12fe7d0e2f5b2039da3ffc7ea9
2016-12-01ipa-stream-{client,server}: Add missing #include <sys/socket.h>Harald Welte2-0/+2
This lead to compiler warnings on FreeBSD, as setsockopt() is undefined. Change-Id: Ie0ee3e48adfd0cd252703ec020cef28cf76ca223
2016-12-01osmo_stream_cli_open2(): Fix bogus EINPROGRESS handlingHarald Welte1-10/+3
osmo_sock_init() never returns -1 + errno EINPROGRESS. It will return a positive fd in case the connect operation is in progress. Therefore, the related code in osmo_stream_cli_open2() was impossible to execute. Change-Id: Id3483d1d1d4d2eabba94729ea29e5c93b33abff0 Fixes: Coverity CID 57861
2016-12-01rs232: Don't pass negative number to strerror()Harald Welte1-1/+1
Change-Id: Ia777221cd0472cd1e7aa79e5146b07048a545dd8 Fixes: Coverity CID 57860
2016-12-01stream-client: check read() return value before using it as length input to ↵Harald Welte1-1/+2
memcpy Change-Id: Id962821c71b3a1c4c01c1131eb809b8ec8eaa062 Fixes: Coverity CID 57859
2016-12-01stream-client: Check for osmo_fd_register() return valueHarald Welte1-1/+6
Change-Id: I1b5fa97d14e69ff502b6deba0fd898a01e53420f Fixes: Coverity CID 57633
2016-12-01rs232-write: Check return value of osmo_fd_register()Harald Welte1-1/+6
Change-Id: If40e85600ca1dfbda5975d7aa92cccdb11f9c34d Fixes: Coverity CID 57632
2016-11-26sctp_sock_activate_events(): Print error message on errorHarald Welte1-0/+3
When the setsockopt() in sctp_sock_activate_events() indicates an error, let's print an error message in the log about this. Change-Id: I5920154e23debe6d01eaa156005db0842f1a18cc Fixes: Coverity CID 57634
2016-11-11examples/lapd-over-datagram-network: Fix compiler warningHarald Welte1-1/+1
lapd-over-datagram-network.c:38:12: warning: ‘sapi’ defined but not used [-Wunused-variable] static int sapi = 63, tei = 0; ^~~~ Change-Id: If367deb0e0d7d5e031db2bd905179263d18703f0
2016-11-02Set SO_NOSIGPIPE on SCTP connections, for patforms which support it (macOS, ↵Arran Cudbard-Bell1-1/+17
FreeBSD etc...) Change-Id: If4f2a99b2baf143551a7122f40ed1f9088c5936c Signed-off-by: Arran Cudbard-Bell <a.cudbardb@freeradius.org>
2016-10-07jenkins.sh: use osmo-build-dep.sh, log test failuresNeels Hofmeyr1-18/+24
Like in libosmo-abis' jenkins.sh Change-Id: I022fbaaa1d211f68b38f18cfaf338ece51198c34
2016-10-01configure: check for pkg-config presenceNeels Hofmeyr2-0/+14
Change-Id: Ifaea95befa3d1d8f6f047e22efcd62cb0bd8b287
2016-10-01build: be robust against install-sh files above the root dirNeels Hofmeyr1-0/+3
Explicitly set AC_CONFIG_AUX_DIR. To reproduce the error avoided by this patch: rm install-sh # in case it was already generated. touch ../install-sh # yes, outside this source tree autoreconf -fi This will produce an error like ... configure.ac:16: error: required file '../ltmain.sh' not found configure.ac:5: installing '../missing' src/Makefile.am: installing '../depcomp' autoreconf: automake failed with exit status: 1 See also automake (vim `which automake`) and look for 'sub locate_aux_dir'. Change-Id: Idcce286e83b802b9cd96cee6230aedd51a660b12
2016-07-07gitignore: tests/osmux/.dirstampNeels Hofmeyr1-0/+1
Change-Id: Ia0380da1f4980035938ec39cd2b5674f0400fbb3
2016-07-07osmux-test: remove real-time constraint by defaultNeels Hofmeyr1-0/+10
Introduce a local #define to disable the real-time constraint from osmux-test. It would make sense to remove this completely, but in case anyone may be interested in the timing on a specific platform, I've just #defined it away. The real-time constraint to pass or fail the test is a bad idea in terms of our build server. Whenever the server is loaded, the tests will fail for no reason, like here: https://gerrit.osmocom.org/474 The real time to calculate is highly dependent also on the hardware platform. The arbitrarity of the time constraint is sort of proven by dd24cdd95f3fb8c8f which simply doubles the time to pass the test. Change-Id: Ic1da4bd22411652334f73195b2e37853e0738906
2016-05-26debian: Make upgrading from debian SID easierHolger Hans Peter Freyther1-0/+6
Make sure the version number of this sourcepackage is higher than the one found in Debian SID. Change-Id: I6486f91bc11e0828b4ccd0e22f8e2135af0d271a Reviewed-on: https://gerrit.osmocom.org/111 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-26osmux: Add function to delete all msgs pending for a circuitDaniel Willmann1-0/+11
Use this function in osmux_batch_del_circuit() since msgs are stored in a list per circuit. After the circuit is free()d the msgs are lost. Before this patch any messages enqueued inside a batch when the circiut is deleted were leaking. Change-Id: Ib0311652183332d0475bf7347023d518d38487ef Ticket: OS#1733 Reviewed-on: https://gerrit.osmocom.org/120 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-25osmux: Pass circuit to _batch_del_circuit() and use it from _xfrm_input_fini()Daniel Willmann1-12/+10
Change-Id: If224980123d4a369133499ab7b577d02511f4055 Ticket: OS#1733 Reviewed-on: https://gerrit.osmocom.org/119 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-14misc: Drop oRTP dependency as there is nothing using itHolger Hans Peter Freyther2-2/+1
This seems to be a copy of paste of libsomo-abis. Let us just drop it here and be done with it. Change-Id: Ia5cb2b572fb5597605284d1c3f657d548aa790f2 Reviewed-on: https://gerrit.osmocom.org/64 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-04-13jenkins: Add the build script from jenkins hereHolger Hans Peter Freyther1-0/+26
This can be used to replicate a build issue more easily.
2016-03-05debian: Update dependencies due SCTP supportHolger Hans Peter Freyther1-1/+1
We need to have the sctp-dev headers to be installed to be able to build this package.
2016-02-29osmux_test.c: tweak error reportNeels Hofmeyr1-1/+3
2016-02-19stream: Use macros to access data and lengthDaniel Willmann1-1/+1
2016-01-23Do not use strlen on binary inpitHolger Hans Peter Freyther1-1/+1
Coverity points out that buf might not be NULL terminated. For the memcpy ret was already used, so use ret for msgb_put as well. Fixes: CID#57922
2015-12-26libsctp: Only define LIBSCTP_LIBS in case there is a libHolger Hans Peter Freyther1-1/+3
2015-12-26libsctp: Fix build and don't link everything to libsctpHolger Hans Peter Freyther1-7/+9
On some systems sctp_* is part of the standard libc, so do not use AC_CHECK_LIB but AC_SEARCH_LIBS to find the symbol we need. Both macros modify LIBS which means all applications will link again libsctp and this is not what we want. Undo the side-effect of LIBS and export LIBSCTP_LIBS which is already used in the Makefile.am.