AgeCommit message (Collapse)AuthorFilesLines
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.
2015-12-25stream.c: ensure to zero-initialize sctp_sndrcvinfoHarald Welte1-0/+2
caught by valgrind: ==3150== Syscall param sendmsg(msg.msg_control) points to uninitialised byte(s) ==3150== at 0x60DC0D0: __sendmsg_nocancel (syscall-template.S:81) ==3150== by 0x5DF3413: sctp_send (in /usr/lib/x86_64-linux-gnu/libsctp.so.1.0.16) ==3150== by 0x65AA066: osmo_stream_srv_write (stream.c:540)
2015-12-22fix/complete stream client re-connect logicHarald Welte2-4/+17
So far, when the first connection attempt failed in osmo_stream_cli_open(), we returned a terminal errro without any re-connection attempts. While this may be useful in some cases, our general idea of the stream client logic is to handle the reconnection attempts insid the library. We introduce a new osmo_stream_cli_open2() function while keping the old behavior for backwards compatibility.
2015-12-22stream.c: Fix another 'link' variable / symbol mismatchHarald Welte1-1/+1
2015-12-22osmo_stream_cli_destroy: call talloc_free on right objectHarald Welte1-1/+1
'link' turns out to be a really bad variable name, as the symbol resolves to the global link(2)...
2015-12-21SCTP support for osmo_stream_{cli,srv} codeHarald Welte4-7/+98
Wih this change, osmo_stream_ client and server API can be used not only for TCP but also for SCTP. The latter is needed in SIGTRAN ad Iuh applications, for example.
2015-11-07teip is a pointer, not an intAlexander Huemer1-2/+2
2015-11-03misc: Release 0.0.6 without libosmovty dependency0.0.6Holger Hans Peter Freyther1-0/+6
2015-11-03libosmovty: Drop dependency as no VTY code is written hereHolger Hans Peter Freyther2-3/+2
Do not link to libosmovty as we don't need it.
2015-08-23Prepare a new release0.0.5Holger Hans Peter Freyther1-2/+2
2015-08-19osmux: rename batch->dummy field to batch->ndummyPablo Neira Ayuso1-5/+5
This is basically a counter that tells us how many circuits need the padding, so better rename this to ndummy. Suggested by Holger.