Commit Graph

599 Commits

Author SHA1 Message Date
Pablo Neira Ayuso 8ba490fd96 osmux: add osmux_tx_sched to reconstruct the timing of RTP messages
This function schedules the transmission of a RTP message that was
obtained from one osmux batch. It takes the time (in microseconds)
after which the message should be transmitted.
2012-07-19 11:38:50 +02:00
Pablo Neira Ayuso d3c21b3cad osmux: use osmo_amr_bytes instead of hardcoded 15 bytes for CMR 2
I was using AMR CMR 2 (15 bytes) as the initial tests were done
with the codec variant.

This patch fixes this by using the new generic osmo_amr_bytes
extracted from 3GPP TS 26.101.
2012-07-13 21:17:51 +02:00
Pablo Neira Ayuso 42915068af src: add function to obtain bytes depending on AMR frame code 2012-07-13 21:12:32 +02:00
Pablo Neira Ayuso 51d408acee tests: osmo-pcap: test osmux functions 2012-07-12 13:03:56 +02:00
Pablo Neira Ayuso 00b6026f64 add osmux support 2012-07-12 13:03:07 +02:00
Pablo Neira Ayuso e53d2ed172 osmo-pcap-test: add -g compilation for debugging (valgrind) and use -losmonetif 2012-07-12 13:01:33 +02:00
Pablo Neira Ayuso efaae10304 rtp: add new parameter to osmo_rtp_get_payload to obtain payload length 2012-07-12 13:01:28 +02:00
Pablo Neira Ayuso c6dceb8cf7 amr: add osmo_amr_get_payload 2012-07-12 13:01:25 +02:00
Pablo Neira Ayuso 93b16cb871 rtp: add RTP_PT_RTCP (72-76 for RTCP)
As specified by RFC 3551, these are reserved to distinguish
RCTP from RTP.
2012-07-09 16:58:46 +02:00
Pablo Neira Ayuso 67b988a077 rtp: add missing RTP_PT_AMR for AMR-WB (type 98) and RTP_PT_GSM_HALF (96) 2012-07-09 16:58:12 +02:00
Pablo Neira Ayuso a359315c8b include: add AMR definitions in amr.h header
As defined by RFC3267 in Octed-Aligned mode.
2012-07-07 17:43:14 +02:00
Pablo Neira Ayuso e142ddfd77 rtp: split osmo_rtp_parse in two functions
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.
2012-07-07 17:40:17 +02:00
Pablo Neira Ayuso d2de668547 tests: osmo-pcap: fix bad UDP header calculation
Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2012-07-04 10:21:50 +02:00
Pablo Neira Ayuso f52b3c8b11 rtp: remove unused rtp_handle parameter from osmo_rtp_parse
And also adjust example files to use the new function.

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2012-07-03 20:03:01 +02:00
Pablo Neira Ayuso f04b5f66f3 rtp: move RTP header definitions to include rtp.h
Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2012-07-03 18:44:32 +02:00
Pablo Neira Ayuso 435f7a7dfe add .gitignore
Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2012-06-28 18:57:53 +02:00
Pablo Neira Ayuso 75755dd7d9 test: add osmo-pcap-test infrastructure
This patch adds the osmo-pcap-test infrastructure that allows you
to take packets stored in one pcap file, convert them to msgb and
pass it to some function.

The infrastructure also provides timing reconstruction based on
the pcap file information.

This is useful for easy protocol development, automated testing and
fuzzying of the existing code to validate the code.

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2012-06-28 16:42:22 +02:00
Pablo Neira Ayuso 729a0917ac add rs232 support
This include an example to open /dev/ttyACM0 to receive data from
u-blox GPS and one to configure it in TIMEPULSE2 mode.
2012-04-04 19:08:27 +02:00
Pablo Neira Ayuso 163707ba12 build: use libosmo-netif.pc instead libosmonetif.pc
Otherwise, openbsc fails to find this new library by libosmo-netif.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2012-02-23 19:51:01 +01:00
Pablo Neira Ayuso bc4208095d build: fix wrong name for linking options
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2012-02-23 19:50:56 +01:00
Pablo Neira Ayuso 4cd6689587 examples: Display more details on RTP payload in rtp-udp-test-*
Minor change, more verbose output to make sure the functions in
the library are doing OK.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2012-02-23 19:50:54 +01:00
Pablo Neira Ayuso 59b4f79946 datagram: minor cleanup
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2012-02-23 19:50:47 +01:00
Pablo Neira Ayuso 72cd95b352 add RTP support
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>
2012-02-23 13:44:26 +01:00
Pablo Neira Ayuso 2b5d3ce7c6 src: add generic channel infrastructure and A-bis IPA server support
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.
2011-11-08 11:17:44 +01:00
Pablo Neira Ayuso ffe3cb3ef9 ipa: don't release message in osmo_ipa_msg_recv
The client of this code must control message freeing it self.
2011-11-08 11:17:44 +01:00
Pablo Neira Ayuso e57c7e1e3f stream: don't destroy server connection on error
This patch includes a minor fix. We don't destroy connection on
errors, it should be the caller which must control this.
2011-11-08 11:17:38 +01:00
Pablo Neira Ayuso d3ba14648c stream: allow to set reconnect timeout
This patch allows to set reconnect timeout. If zero, it will try
immediately. If negative, it will skip retrying.
2011-11-08 11:13:22 +01:00
Pablo Neira Ayuso e1a7ede826 examples: disable Nagle in ipa-stream-*.c
To emulate how openBSC behaves.
2011-10-17 23:02:39 +02:00
Pablo Neira Ayuso 20c660caec ipa: initial addition of helper functions and examples
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.
2011-10-17 22:12:42 +02:00
Pablo Neira Ayuso 1434e40951 stream: add osmo_stream_*_conn_get_ofd(...) functions
To obtain the file description.
2011-10-17 22:12:37 +02:00
Pablo Neira Ayuso 96dbb24b50 stream: reconfiguration is only required if address and port change
No need to force reconfiguration if any of the callback or data
pointers are changed.
2011-10-17 12:52:39 +02:00
Pablo Neira Ayuso 98ec00d8d2 stream: add osmo_stream_*_conn_recv
Like c43bb08906 but for stream
sockets.
2011-10-17 12:51:18 +02:00
Pablo Neira Ayuso c43bb08906 datagram: add osmo_dgram_conn_recv
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.
2011-10-17 12:34:40 +02:00
Pablo Neira Ayuso 60eb983964 stream: use debug loglevel instead of notice for spamming debug message 2011-10-17 12:10:30 +02:00
Pablo Neira Ayuso 4b83212dfb datagram: reconfiguration is only required if address and port change
We allow to change the callback and data pointers in runtime safely
without the need to reconfig.
2011-10-17 12:09:29 +02:00
Pablo Neira Ayuso 6c3c279489 examples: update LAPD over datagram tests
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.
2011-10-14 21:03:52 +02:00
Pablo Neira Ayuso 370794a4a7 datagram: use LOGL_DEBUG in osmo_dgram_server_conn_read
This removes spamming message that is currently displayed with
LOGL_NOTICE loglevel.
2011-10-14 20:53:39 +02:00
Pablo Neira Ayuso 6e0415a9cc datagram: change prototype of osmo_dgram_conn_set_read_cb
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).
2011-10-14 20:51:19 +02:00
Pablo Neira Ayuso 2bd6adfd86 stream: add *_get_data() function to obtain private data
Add new functions:

osmo_stream_server_link_get_data
osmo_stream_server_conn_get_data
osmo_stream_client_conn_get_data

To obtain private data from osmo_stream_* handlers.

This patch also introduces missing osmo_stream_server_conn_set_data.
2011-10-09 21:35:51 +02:00
Pablo Neira Ayuso dae8f28374 datagram: support calling dgram_*_open() multiple times for reconfigurations
This patch allows you to call dgram_*_open(..) as many times as
you want to trigger reconfigurations.
2011-10-09 20:44:28 +02:00
Pablo Neira Ayuso cc7a948d3e stream: support calling stream_*_open() multiple times for reconfigurations
This patch allows you to call stream_*_open(..) as many times as
you want to trigger reconfigurations.
2011-10-09 20:44:09 +02:00
Pablo Neira Ayuso f47752fbff datagram: add osmo_ prefix to all functions
Modify examples as well to use the new API.
2011-10-09 18:27:28 +02:00
Pablo Neira Ayuso ad2eca4768 stream: add osmo_ prefix to all functions
Modify examples as well to use the new API.
2011-10-09 18:00:53 +02:00
Pablo Neira Ayuso 06a1557578 add COPYING file (GPLv2 license) 2011-10-05 13:43:25 +02:00
Pablo Neira Ayuso 602df1ec4c examples: add stream server/client example
This patch adds a couple of examples that allow chatting between
the client and the server. For simplicity, the example only support
one client.
2011-10-05 13:43:21 +02:00
Pablo Neira Ayuso 7c20d4ef1e stream: remove internal stream_msg_recv()
Remove stream_msg_recv(...), now we use recv(...) directly. This fixes
since we were calling msgb_put(...) twice.
2011-10-05 13:43:18 +02:00
Pablo Neira Ayuso 57d86b7d28 stream: remove includes from stream.h header
The should be uses in the client program. They are not required by
the generic stream socket infrastructure.
2011-10-05 13:43:15 +02:00
Pablo Neira Ayuso ddb9bf65f4 add generic datagram socket infrastructure and examples
This patch adds new datagram socket infrastructure and it reworks
the previous examples (now it's LAPD over datagram).
2011-10-05 13:43:10 +02:00
Pablo Neira Ayuso 8bf16493f6 initial commit 2011-10-04 02:36:46 +02:00