Commit Graph

358 Commits

Author SHA1 Message Date
Pau Espin 9452adcc33 tests: Add osmux2 testsuite
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-19 18:24:25 +02:00
Pau Espin dbf8e53192 osmux: Add new API osmux_xfrm_output_sched to fix rtp generation issues
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-19 18:24:25 +02:00
Pau Espin 6fb0f4de86 examples: use osmo_init_logging2
Change-Id: I7f1f4503f254931edeebfbadf3953efa7b20f85f
2018-04-17 13:55:09 +02:00
Pau Espin a29ea763ea Build jibuf_tool based on libpcap availability
Change-Id: I27cdb1b5175a5b02638e6d743b686bdf4b1be144
2018-04-17 11:56:37 +02:00
Pau Espin d5b68e2c70 tests: use osmo_init_logging2
Change-Id: Icc84bbd53e1589e26e445e3460024e77162bd76f
2018-04-17 11:41:13 +02:00
Pau Espin e9e6200d84 jibuf: Estimate src clock skew
Change-Id: Ifae633d53107417a8e2f9b0f200d2711db72d199
2018-04-13 16:13:17 +02:00
Pau Espin 14947b931b tests: jibuf_tool: Add seq.plt
Change-Id: I37bb3ab372b7ad7c3c1d09c8134827c932bf8bf8
2018-04-13 16:13:17 +02:00
Pau Espin 13c01178c5 jibuf: re-sync clock out of sync timestamps
Change-Id: I33556b33d7549654442d9bdd7f31128792506652
2018-04-13 16:13:17 +02:00
Pau Espin 1ad87f26a1 jibuf: Take RTP marker into account
Change-Id: Ie142acfb45650e0af775f58226fd191beaf8178e
2018-04-13 16:13:08 +02:00
Pau Espin c70d260348 tests: jibuf_tool: Add parameters to control size of buffer
Change-Id: I8a7fa39985f8d197e24c32cab80299aba2d03087
2018-04-13 16:12:26 +02:00
Pau Espin 0fa4eec275 tests: jibuf_tool: Add OSMUX support
Change-Id: I0f02da0329e6739ff340d31113161bb520b1b760
2018-04-13 16:12:26 +02:00
Pau Espin e32095033b tests: jibuf_tool: Improve jibuf_test to read pcaps
Change-Id: I7a13c823fb70e0adbc5fa0726fd66b15dc40014e
Signed-off-by: Pau Espin Pedrol <pespin@sysmocom.de>
2018-04-13 16:12:24 +02:00
Pau Espin 7787c8cce3 tests: jibuf_tool: Initial commit
Change-Id: I92307c8b1483dd488339771462290aae0ae5689a
2018-04-13 16:11:33 +02:00
Pau Espin ce820763c1 jibuf: Add initial implementation of Jitter Buffer
Change-Id: I9688ba9c4d5b733b9f29d0f15f73750f9271ef55
2018-04-13 15:51:43 +02:00
Alexey 5c962c2f3e Update README.md
Fixed "interface" double references

Change-Id: Icb41dc65dec56d6b8d8f23dfc9bbc2e85cf6dc3b
2018-04-13 09:34:50 +02:00
Pau Espin 23148b069f osmux: osmux_xfrm_output_pull: Improve checks and log of malformed packets
Change-Id: I143805bb5ee9f5e3ada46114e380a03ede80df9f
Related: SYS#4182
2018-04-12 19:33:53 +00:00
Pau Espin 9f521e10db tests: osmo-pcap-test: Fix pcap includes not found in old versions
pcap/dlt.h only exists on newer versions of libpcap. On older versions,
same defines are available in pcap/bpf.h, which in newer versions
include pcap/dlt.h, so we are always fine include pcap/bpf.h.
As a side note, there's a lots of comments in pcap/dlt.h stating that
those symbols used to reside in pcap/bpf.h but were moved there at some
point.

Change-Id: I824671a415eb3f35f480c934b9780ff13510011a
2018-04-12 16:35:12 +02:00
Pau Espin c71c9516dd stream.c: osmo_stream_cli_open2: Remove wrong assumption in reconnect decision
Documentation of osmo_sock_init2 doesn't provide information of any
specific value of errno set/expected after running the function. It is
incorrect to expect a specific value of errno and looking at the
implementation it is actually not a good idea to check it.

If reconnect flag is set, let's reconnect always instead of looking at
errno to decide.

Change-Id: I25b33f4cdc496ae31ff240d445b9b2805091845c
2018-04-05 18:07:41 +02:00
Neels Hofmeyr 9d726d0e56 jenkins.sh: use --enable-werror configure flag, not CFLAGS
Change-Id: I739f4562a96b7b6031075d47d94f46af7a37b4b4
2018-03-12 23:59:32 +00:00
Neels Hofmeyr 9f4a9232e7 configure: add --enable-werror
Provide a sane means of adding the -Werror compiler flag.

Currently, some of our jenkins.sh add -Werror by passing 'CFLAGS="-Werror"',
but that actually *overwrites* all the other CFLAGS we might want to have set.

Maintain these exceptions from -Werror:
a) deprecation (allow upstream to mark deprecation without breaking builds);
b) "#warning" pragmas (allow to remind ourselves of errors without breaking
   builds)

As a last configure step before generating the output files, print the complete
CFLAGS and CPPFLAGS by means of AC_MSG_RESULT.

Change-Id: I68e4781ec5dfaf1dac46510a092a87e35691f082
2018-03-12 23:59:31 +00:00
Pau Espin ce439fc945 osmux: Use correct log category DLMUX
Change-Id: I77f4593941207689f714d15304dcce40b21d4bd8
2018-03-07 13:13:28 +01:00
Pau Espin 525256a15a test: osmo-pcap-test: Fix clock drift while replaying pcap file
In the previous implementation, the processing time was not being taken
into account, which was implicitly added for each new packet to be sent,
which caused a steady incremental drift in the clock clearly visible
when analysing a RTP stream.

As it uses timespecsub, it depends on libosmocore Change-Id
I45fc993b9bb0a343763238bf463c8640f47b00f1.

Change-Id: I11cb9a63e16e829ccd4af1096b9f473c802d822f
2018-02-26 18:20:20 +01:00
Stefan Sperling f27fdf89dc add support for flushing and destroying a server-side stream
Introduce osmo_stream_srv_set_flush_and_destroy() which marks a
stream to be 'flushed and destroyed'. No new messages will be
received on this stream, and no new messages can be queued.
Once the Tx queue has been drained, the connection is destroyed.

The API user is given a chance to perform cleanup operations
in the closed_cb() callback for the connection.

The same mechanism will be added for client-side connections
in a follow-up patch.

Change-Id: I8ed78fe39c463e9018756700d13ee5ebe003b57f
Related: OS#2789
Suggested-by: Harald Welte
2018-02-22 19:48:36 +01:00
Harald Welte 2cbaf4139a debian/control: Fix Vcs-Browser
Change-Id: I19049ccf6bfc100dbbeb81b80b9ff7f422ad232f
2018-02-09 12:10:33 +01:00
Max 3f93caea6e Enable sanitize for CI tests
Change-Id: I3a888a415698db5a11d74422f7ccb2d94126f56e
2017-12-21 17:03:46 +01:00
Pau Espin 3173ca7ac7 contrib: jenkins.sh: Disable building doxygen for deps
Change-Id: I456b539ebdb86a6a27af0bec1d44d68b407ad912
2017-12-14 15:53:20 +01:00
Neels Hofmeyr c72be77aa3 osmo_stream_{cli,srv}_destroy: fix mem leak: empty msgb queue
On destroying a client or server stream, deallocate any msgbs that are still
pending in the queue.

In libosmo-sccp, the ss7_test.c in test_as(), messages are queued and were,
before this, left floating after the stream was destroyed, causing a sanitizer
memory leak. This patch fixes the leak.

Depends: Ia291832ca445d4071f0ed9a01730d945ff691cf7 (libosmocore)
Change-Id: Iaad35f03e3bdfabf3ba82b16e563c0a5d1f03639
2017-11-20 16:23:59 +00:00
Neels Hofmeyr b6e8d39417 gitignore: vim swp files
Change-Id: I0013625df95c5600479953e6f83b848efadb525a
2017-11-20 14:23:52 +01:00
Neels Hofmeyr 2547e87b94 add --enable-sanitize config option
Change-Id: Ie00859d981044d59b8114332884e3d7f6fc48ef7
2017-11-18 10:23:09 +00:00
Pau Espin 6d4acefb69 stream: Avoid re-creating and leaking socket when unneeded
In previous implementation, if no reconfiguring is needed, a new socket
would be created without closing the old one, leaking the previous
socket. Instead, if we don't need reconfiguring, we return 0 as no
operation is required.

Change-Id: I6c1a7fff63e44840fb5e2bc7ace5e9a61e304987
2017-11-17 15:17:07 +01:00
Harald Welte bea215a565 Add SPDX-License-Identifier + Copyright statements
Change-Id: I43bb1c4a889421907a1a08eb29c96f2330ab00ec
2017-11-13 01:21:03 +09:00
Harald Welte fb31c0953c src/rs232.c: Fix accidential reference to GPLv3+ instead of GPLv2+
Change-Id: I5fa2696c5090994c417ca882c5225cbd7c1be2c7
2017-11-13 01:11:46 +09:00
Harald Welte 443f40a6bf debian/copyright: There are no AGPL licensed files left
Change-Id: I7d1bf1cdefea955b28e756419e7d90beb2535bd0
2017-11-13 01:10:45 +09:00
Harald Welte cc7f236a4a debian/control: Fix upstream-name
Change-Id: Ic5f42a387525f7718097f4259bae6628b903a4ca
2017-11-13 01:09:52 +09:00
Neels Hofmeyr 1274b37430 jenkins: use osmo-clean-workspace.sh before and after build
See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale.

Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93
Change-Id: I6bdbd22b5f05ab75de2c6c777667bf1a63eb0b86
2017-10-28 15:08:45 +00:00
Harald Welte 5edefaf0e6 Bump version: 0.1.0 → 0.1.1
Change-Id: I731fce9fd10a586c10261b23ed0f0bbcb6f3eada
2017-10-28 12:41:34 +02:00
Harald Welte 358350468f Debian: The -dev package doesn't depend on any shared libraries
This fixes:
dpkg-gencontrol: warning: Depends field of package libosmo-netif-dev: unknown substitution variable ${shlibs:Depends}

Change-Id: Ic57cbc8a1876e6e5449e7dd4a73f269444dd67da
2017-10-28 10:20:59 +00:00
Harald Welte bdfe9682fe Don't link library against libosmogsm, we don't use any symbols of it
This fixes a related dpkg-shlibdeps warning

Change-Id: I0325e7a6dea5195f1634230930570bf4dfe3810c
2017-10-28 10:18:44 +00:00
Harald Welte c2c8b5c557 Tag/Release Version 0.1.0
Short changelog:
* Add Doxygen documentation
* SCTP support in stream.c
* new udp-test-client and udp-test-server programs
* better / more verbose error handling in examples
* new osmo_dgram_tx_set_local_{addr,port}() functions
* use IPA definitions from libosmogsm, rather than repeating them
* encode RTP header M field of RFC3550/4867 in OSMUX header
* new osmo_stream_srv_link_set_nodelay()
* new osmo_stream_srv_link_set_proto()
* new osmo_stream_cli_set_nodelay()
* new osmo_stream_cli_set_proto()
* new osmo_stream_cli_set_local_addr()
* new osmo_stream_cli_set_local_port()
* new osmo_stream_cli_reconnect()
* new osmo_stream_cli_open2() with reconnect argument
* more vrebose osmux_snprintf()
* remove mistaken reference to AGPL in rs232.c
* fix memory leak in osmo_stream_srv_link_set_addr()
* add osmo-pcap-test for SLL and Ethernet
* extend osmux-test

Change-Id: Ibf75fcd6643351ce3946faa155ae1db8c33a5e35
2017-10-27 20:21:20 +02:00
Harald Welte c01033fcac depend on new upstream libosmocore version 0.10.0
Change-Id: Id22c69f96e9b6058e4c32ffa5a77d224453711ce
2017-10-27 20:21:20 +02:00
Harald Welte 61b5b65deb some more Doxygen header text for datagram, osmux and stream module
Change-Id: Ied83e6b117a420d734a88e3aff925a874c3dd520
2017-10-27 19:57:37 +02:00
Pau Espin d8f2b38eb9 osmux_snprintf: Add doxygen doc
Change-Id: Idb3fcf25be9558bfc2f822352c07ebc2cb7d5caa
2017-10-24 12:37:44 +02:00
Pau Espin 77d08a67b5 osmux_snprintf: Support different types of Osmux frames
Previous implementation handled all types as if they were Osmux AMR
frames. For Dummy frames, we account the padding but we don't care about
the padding content. For Signalling ones, as they are not in the
specification yet, it is better avoid using unespecified fields and
return an error because it's still not known how extra data will be
handled in the input msgb.

Change-Id: I48565472b47c2a0e5db50881fbb005537af8c70d
2017-10-24 12:36:00 +02:00
Pau Espin 05bb1c2b2e osmux_snprintf: Split logic parsing osmux header and AMR payload
The current code still expects to parse only AMR osmux frames, but that
will be fixed in following patches.

Change-Id: Ic2f4d1d3cc88af912bb43c8ecd90eacc6ff7190f
2017-10-23 17:16:01 +02:00
Max 1bfbf98f06 cosmetic: print textual error from recv()
Change-Id: Ic9557c6519b44b5985daf7d2d14ec063790441fb
2017-10-13 18:24:37 +02:00
Max a2b50809c7 cosmetic: relax UDP length check
Previously recv() returning 0 for UDP socket was considered as error
although it's legitimate return value for empty UDP packets. Relax the
error check to avoid confusing error messages.

The function behavior is the same:
* msg is not altered while receiving 0-length UDP packet
* return value is 0

The only result of the relaxed error check is the absense of error log
message for 0-length UDP packet.

Change-Id: I32e5fcbf5ed92cc923660ac59e6a37fd3f0703a7
Fixes: OS#2219
2017-10-13 18:19:32 +02:00
Max 8440357d4c examples: add simple UDP client/server
In addition to showing basic UDP send/receive example, it helps to test
corner-case when dealing with 0-length UDP packets.

Change-Id: I08c0adf1cf9b6a6f1f7090b237d0497c2ec13cdf
Related: OS#2219
2017-10-13 18:13:14 +02:00
Alexander Couzens fae8559ff5 debian/rules: show testsuite.log when tests are failing
Change-Id: I3af7b50e3d3e0ba3eddace0e6d4e58c6cb98b9aa
2017-10-11 07:08:08 +02:00
Harald Welte c98bf1b880 rs232.c: Don't #include <osmocom/abis/e1_input.h>
There's no need for the rs232 code to include a files from
libosmoabis. The only users of libosmoabis left now are the LAPD
examples:
	examples/lapd-over-datagram-network.c
	examples/lapd-over-datagram-user.c

Change-Id: Ie1bc0dd811362cec546486edc41d632740ed19cd
2017-10-05 08:41:52 +08:00
Pablo Neira Ayuso 5994198208 src: _snprintf() helper functions nul-terminate buffers, if possible
This patch inconditionally initializes the buffer we get to
nul-terminate it, whenever possible. It's a very simple solution to
catch three overly corner cases:

1) snprintf() returns -1, very much unlikely in practise.

2) msg->len == 0: In such case, I would expect this function is never
   called with an empty message, but let's be safe in this case too.

3) If your buffer is empty, it doesn't nul-terminate the buffer.

Change-Id: I97e517f2d98e83894ea707c63489559302ff6bd2
2017-09-12 13:28:41 +02:00