Commit Graph

114 Commits

Author SHA1 Message Date
Pablo Neira Ayuso c92810eccd osmux: remove arrays from osmux_out_handle
there will be one osmux_out_handle per endpoint.
2013-02-12 17:24:13 +01:00
Pablo Neira Ayuso 7ff7a5cd6d osmux: allow to pass data to osmux_deliver 2013-02-11 22:49:27 +01:00
Pablo Neira Ayuso 0f1f41411f osmux: fix missing data set in osmux_tx_sched 2012-10-21 04:12:29 +02:00
Pablo Neira Ayuso 4aa540ae27 dgram: add osmo_dgram_get_data 2012-10-21 03:08:37 +02:00
Pablo Neira Ayuso 5654c43f80 osmux: remove generic functions to register and get ccid
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.
2012-10-20 20:17:28 +02:00
Pablo Neira Ayuso 631c6fe0ad ipa: fix compilation warning
Shows up with gcc-4.7

ipa.c: In function 'osmo_ipa_rcvmsg_base':
ipa.c:210:6: warning: variable 'ret' set but not used [-Wunused-but-set-variabl
2012-10-15 23:09:36 +02:00
Pablo Neira Ayuso 7f9ebe2e56 osmux: fix DELTA_RTP_MSG
It should be 16000 and add DELTA_RTP_TIMESTAMP which is 160.
2012-10-15 23:09:36 +02:00
Pablo Neira Ayuso 8c9caa8607 osmux: rewrite batching function
Rework batching routine to reduce its complexity, updates:

* Now it uses a list of lists to store the messages that will be
  batched.

batch list
    |
    `-> node SSRC=a ---> ... ---> node SSRC=b
            |                         |
        msg seq=x1               msg seq=y1
            |                         |
        msg seq=x2               msg seq=y2
            |                         |
        msg seq=x3               msg seq=y3
            |                         |
        msg seq=x4               msg seq y4

This keeps easier the creation of the final batch that is sent from that
data structure.

* We also detect duplicate messages in the batch, ie. messages with the
  same sequence are skipped.

Still pending to resolve reordering, corruption and omissions (reliability
is desired).
2012-10-15 23:09:36 +02:00
Pablo Neira Ayuso e472f44dd3 osmux: RTP timestamp has to be bumped in 160
Between two RTP messages that were extracted from a batch, the
timestamp difference should be 160.

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2012-10-15 23:09:36 +02:00
Pablo Neira Ayuso 4925acf297 examples: add osmux-test-input and osmux-test-output
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.
2012-10-15 23:07:12 +02:00
Pablo Neira Ayuso 384bdf630a osmux: release of batch message is controled by caller
Instead of internally released. This is required if we use the
osmo_dgram infrastructure, to avoid a double release.

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2012-10-15 18:14:59 +02:00
Pablo Neira Ayuso 6907ac37e1 osmux: use DLMIB instead of internal defined DOSMUX
Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2012-10-15 15:59:14 +02:00
Pablo Neira Ayuso aa33e591dc ipa: add osmo_ipa_parse_msg_id_resp
Code extracted from ipa_stream_server.c.
2012-08-21 02:28:46 +02:00
Pablo Neira Ayuso 06f49051c6 ipa: add ipa_cli_id_ack and ipa_cli_id_resp
This functions were before located in channel/abis/ipa_stream_client.c,
but they are generic for IPA units.
2012-08-19 20:14:25 +02:00
Pablo Neira Ayuso 169d2783a6 channel: abis: ipa-stream-server: fix crash while closing socket
This fixes the crash while closing socket with/without link with a
valid IPA unit.
2012-08-19 20:14:25 +02:00
Pablo Neira Ayuso 9ae91e594c ipa: add osmo_ipa_process_msg and remove osmo_ipa_recv_msg
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.
2012-08-19 20:14:25 +02:00
Pablo Neira Ayuso 7a3e8d01f5 consolidate ipa_unit infrastructure
Provide unified infrastructure for handling IPA units and modify
existing code to use it.
2012-08-19 20:14:17 +02:00
Pablo Neira Ayuso 5abf7f2ea4 stream: add osmo_stream_srv_get_master
To obtain the information of the server data that this connection
belongs to.
2012-08-19 18:35:10 +02:00
Pablo Neira Ayuso 060e46ea6d channel: add abis directory under channel
And move all existing A-bis channel implementation to channel/abis/
directory.

This is just a cleanup to reorganize the source code tree.
2012-08-19 01:06:57 +02:00
Pablo Neira Ayuso 775c1de089 channel: add subtype ID to osmo_chan_create
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.
2012-08-19 00:52:00 +02:00
Pablo Neira Ayuso b71627b1f7 channel: osmo_chan_init takes one pointer to set the talloc context
Also remove this parameter from osmo_chan_create
2012-08-19 00:50:01 +02:00
Pablo Neira Ayuso d73c757e6d channel: rename CHAN_* to OSMO_CHAN_* for correct namespace policy
Just to avoid unlikely possible problems while using this library
with any other that decided to define the CHAN_* constants.
2012-08-19 00:49:58 +02:00
Pablo Neira Ayuso c05485c90c channel: use linked list instead of array of existing channels
This also adds osmo_chan_init() that needs to initialize the
channel infrastructure.
2012-08-19 00:49:20 +02:00
Pablo Neira Ayuso 557e5c127a channel: define CHAN_SIGN_OML and CHAN_SIGN_RSL internally
These definitionsare not relevant for external client applications
using the library.
2012-08-19 00:12:18 +02:00
Pablo Neira Ayuso a7c1784937 channel: remove leftover unused definitions in header
They are not used anywhere in the code.
2012-08-19 00:10:37 +02:00
Pablo Neira Ayuso d092d6d4e8 channel: add name field
This will be useful to display some human-readable type in logs
and the VTY.
2012-08-18 23:58:28 +02:00
Pablo Neira Ayuso 487734e6d3 channel: abis-ipa-client: add missing header file
I forgot to commit this file:

osmocom/netif/channel/abis_ipa_client.h
2012-08-18 23:52:55 +02:00
Pablo Neira Ayuso 1584058c8e channel: abis-ipa-server: stream layer already destroy the socket for us
This reverts 373d1e6540.
2012-08-16 00:43:08 +02:00
Pablo Neira Ayuso b247d6df81 ipa: change osmo_ipa_rcvmsg_base to take argument depending on role
If we're acting as client, we don't have to reply ID_ACK to
one received ID_ACK (otherwise, we enter a loop).
2012-08-16 00:31:40 +02:00
Pablo Neira Ayuso 4ab2991438 channel: display error messages for channel_open()
Using generic osmocom logging infrastructure
2012-08-16 00:31:00 +02:00
Pablo Neira Ayuso 373d1e6540 channel: abis-ipa-server: fix connection closure 2012-08-16 00:31:00 +02:00
Pablo Neira Ayuso 0f46263777 add ABIS IPA example as client (BTS) 2012-08-16 00:31:00 +02:00
Pablo Neira Ayuso 3dc28ec6a3 add abis_ipa_client channel 2012-08-16 00:30:57 +02:00
Pablo Neira Ayuso b2f62cea7d add ipa_unit
This adds the generic ipa_unit object that is allocated and set
by the BTS while initializing the channels.
2012-08-15 23:34:38 +02:00
Pablo Neira Ayuso c12d9d97e4 channel: abis-ipa: shorter function names
%s/_server_/_srv_/g
%s/osmo_chan_abis/osmo_abis/g
%s/SERVER/SRV/g
2012-08-15 23:34:38 +02:00
Pablo Neira Ayuso cee5fb36da src: shorter stream function names
%s/_client_conn_/_cli_/g
%s/_server_conn_/_srv_/g
%s/_client_/cli/g
%s/server/srv/g
%s/RECONFIG/RECONF/g
%s/SERVER/SRV/g
%s/CLIENT/CLI/g
2012-08-15 23:34:35 +02:00
Pablo Neira Ayuso ad2e9d637e src: shorter names for datagram sockets
%s/_conn_/_/g
%s/_conn//g
%s/_server_/_tx_/g
%s/_client_/_rx_/g
%s/_SERVER_/_TX_/g
%s/_CLIENT_/_RX_/g
%s/_RECONFIG/_RECONF/g
2012-08-15 20:16:09 +02:00
Pablo Neira Ayuso 4fd56b6d2f osmux: fix ordering of RTP messages in the batching list
This patch fixes the ordering in RTP sequence number. Before this patch,
the list was inverted.

This also fixes the calculation of the room that still remains in the
batch.
2012-08-06 21:04:25 +02:00
Pablo Neira Ayuso 7a01104b88 osmux: add OSMUX_MAX_CONCURRENT_CALLS which is 8
Instead of harcoding the number all around the code.
2012-08-06 21:04:25 +02:00
Pablo Neira Ayuso 72a0aae500 osmux: support two concurrent calls in output path 2012-08-06 21:04:25 +02:00
Pablo Neira Ayuso b9cf903bbe osmux: add infrastructure to map RTP SSRC and osmux CCID 2012-08-06 21:04:25 +02:00
Pablo Neira Ayuso da0c9ab922 osmux: fix wrong calculation of csrc_count 2012-08-06 21:04:25 +02:00
Pablo Neira Ayuso 468d81b4ac osmux: batching factor can be explicitly configured by caller
Not hardcoded in osmux.c code anymore.
2012-08-06 21:04:25 +02:00
Pablo Neira Ayuso f366c924e2 osmux: store internal batching information in struct osmux_in_handle
The layout is not provided, as it is internal.

Thus, we don't allocate the internal batching information in BSS
anymore.
2012-08-06 21:04:25 +02:00
Pablo Neira Ayuso 6d72b4a729 osmux: print RTP header if debug logging level is set 2012-08-06 21:04:25 +02:00
Pablo Neira Ayuso 33817320cb rtp: add osmo_rtp_snprintf
To print the RTP header and payload.
2012-08-06 21:04:21 +02:00
Pablo Neira Ayuso f4b11c0717 osmux: extend debugging to make sure we don't lag in scheduled transmissions
osmux only lags ~0.15 ms at maximum to transmit one scheduled RTP message
according to my tests with PCAP traces.

Yes, only ~0.15 milliseconds, this is not wrong :-).

This is good news, our timer infrastructure seems to be quite precise.
2012-08-04 21:16:27 +02:00
Pablo Neira Ayuso d2ea108728 osmux: remove timeval parameter from osmux_tx_sched
We can internal allocate this in the stack, no need to expose it to
the caller.
2012-08-04 21:03:56 +02:00
Pablo Neira Ayuso 81979fa80a osmux: fix when to add the osmux header
This needs to be done for the first message in one RTP SSRC series.
Before this patch, it was always included due to wrong aritmethics.
2012-08-04 20:56:53 +02:00
Pablo Neira Ayuso 082d700a8f osmux: fix list ordering for RTP messages that will be included in batch
This fixes the algorithms to include the messages in order in the
batch based on the TRP SSRC (from lower to higher).

This is very important to reduce the amount of bytes that we
spend on the osmux header.
2012-08-04 20:53:57 +02:00