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
lapd-over-datagram-network.c:38:12: warning: ‘sapi’ defined but not used [-Wunused-variable]
static int sapi = 63, tei = 0;
^~~~
Change-Id: If367deb0e0d7d5e031db2bd905179263d18703f0
Use the new macros to deal with little/big endian. Im a bit
worried to make this change due the little test coverage in
this module but in case of a typo the elements would not be
defined.
CC osmux-test-input.o
osmux-test-input.c:85:2: warning: initialization from incompatible pointer type [enabled by default]
osmux-test-input.c:85:2: warning: (near initialization for ‘h_input.deliver’) [enabled by default]
Remove these functions:
- osmux_xfrm_input_get_ccid
- osmux_xfrm_input_register_ccid
The ccid will be managed by the BSC and it will be stored in the
mgcp_endpoint structure.
Also adjust all tests and examples using the API.
You can use these utilities to test osmux:
1) in one console, run ./osmux-test-input
This listens in port UDP 20000 and convert RTP traffic to osmux
Then, it sends osmux traffic via port UDP 20001
2) in another console, run ./osmux-test-output
This listens in port UDP 20001 and convert osmux to RTP traffic
Then, it sends RTP traffic to UDP port 20002
3) in another console run, nc -u nc -u -l -p 20002
This is the sink, just to avoid ICMP destination unreachable messages
Now you can run replay UDP traffic from one pcap trace that contains
RTP traffic with this tool:
http://1984.lsi.us.es/git/pcap-inject/
Example of command line invocation:
./traffic-inject /home/pablo/rtp-nanobts-2-phones-amr.pcap udp 20000
You can run wireshark in the loopback to make sure osmux is getting back
the traces looking like the original.
The tests also generate output files in AMR that you can validate via
mplayer: /tmp/output.amr and /tmp/input.amr respectively. This is to
make sure there are no reordering or problems of any sort.
This patch removes osmo_ipa_recv_msg, it performs two syscall invocations
and it's stream generic. Now we use the specific receival function
we want to use (no matter if stream or datagram based) and then we
call osmo_ipa_process_msg to check that the IPA message correct.
This adds the possibility to specify the variant of the channel.
This was discussed during the osmocom workshop. Harald wanted a way
to say if the channel is using TCP, UDP, DADHDI and so on.
This patch splits osmo_rtp_parse in two functions:
osmo_rtp_get_hdr
osmo_rtp_get_payload
So we can validate corrent RTP header to access its fields. Then,
obtain the payload.
This patch adds the initial RTP support for libosmo-netif, it's based
on Harald's RTP support available in openBSC.
I have also added a couple of example to show how our new channel
infrastructure interacts with the RTP layer.
Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
This patch adds the generic channel infrastructure that allows to
create channel of different types. Each channel has their own
configuration functions.
struct osmo_chan *chan;
chan = osmo_chan_create(tall_example, CHAN_ABIS_IPA_SERVER);
...
/* specific configuration functions per supported channel. */
osmo_chan_abis_ipa_server_set_cb_signalmsg(chan, signal_msg_cb);
osmo_chan_abis_ipa_unit_add(chan, 1801, 0);
/* open channel. */
osmo_chan_open(chan);
The input path requires a callback to be registered. The output path
is handled through:
int osmo_chan_enqueue(struct osmo_chan *c, struct msgb *msg);
The msg->dst must be set (it can be taken from the original message
to route one reply).
This patch also adds A-bis IPA server support. It has been tested with
e1inp_ipa_bsc_test available in libosmo-abis.
This patch adds IPA helper function that can be use on top of stream
sockets.
The current API is just a copy and paste from libosmo-abis, it will
change in follow up patches to improve it.
We provide osmo_dgram_conn_recv(...) which allows you to take control
on the message allocation and receival process. Instead of hiding this
details inside the datagram infrastructure.
Providing more control to clients of this code means more flexibility.
Now they can be used to generate a number of messages from the
user and to measure the RTT of LAPD over datagram messages.
Still, they need to be expanded to take the origin and remote
IPs as argument from the command line, later.
This patch changes the prototype of osmo_dgram_conn_set_read_cb.
Now it takes one callback to a generic struct osmo_dgram_conn
instead of osmo_dgram_server_conn. This is useful in case that
you want to reply to one message using the datagram socket (without
this change is not possible).