Commit Graph

17 Commits

Author SHA1 Message Date
Harald Welte fb3e20b4b2 SCTP support for osmo_stream_{cli,srv} code
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-12-21 20:54:19 +01:00
Nikola Kolev 2f1ddb2709 Fix the compilation on FreeBSD. 2015-02-25 15:52:14 +01: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 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 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 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 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 60eb983964 stream: use debug loglevel instead of notice for spamming debug message 2011-10-17 12:10:30 +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 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 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 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 8bf16493f6 initial commit 2011-10-04 02:36:46 +02:00