diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-06-29 10:57:24 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-06-29 10:57:24 +0200 |
commit | e2fbd3dee43bb3d47c53514200650db41b4f5ef7 (patch) | |
tree | ac734d1bdded7790705539f101ec0f6f3898013e /examples | |
parent | 7839556ca950f02e2dda48f8e10dd68e90266926 (diff) |
remove "channel" layer
The "channel" layer on top of IPA client + server was introduced in
2011 but never used in any osmocom program/project so far. Contrary
to the several other IPA multiplex related implementations in libosmo*,
it did not deal properly with segmented IPA messages, i.e. where a
single TCP segment (and hence recv/read call) does not contain a full
IPA message.
So rather than fixing it up and having yet another IPA related API in
our libraries, let's remove it.
Change-Id: I97c378750acb1637ee032fa88a968edf68d8979f
Diffstat (limited to 'examples')
-rw-r--r-- | examples/Makefile.am | 2 | ||||
-rw-r--r-- | examples/channel/Makefile.am | 14 | ||||
-rw-r--r-- | examples/channel/abis_ipa_stream_client.c | 92 | ||||
-rw-r--r-- | examples/channel/abis_ipa_stream_server.c | 79 |
4 files changed, 0 insertions, 187 deletions
diff --git a/examples/Makefile.am b/examples/Makefile.am index df13808..52f4c83 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -2,8 +2,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/include AM_CFLAGS=-Wall -g $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS) AM_LDFLAGS = $(COVERAGE_LDFLAGS) -SUBDIRS = channel - noinst_PROGRAMS = ipa-stream-client \ ipa-stream-server \ lapd-over-datagram-user \ diff --git a/examples/channel/Makefile.am b/examples/channel/Makefile.am deleted file mode 100644 index c417909..0000000 --- a/examples/channel/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -AM_CFLAGS=-Wall -g $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS) -AM_LDFLAGS = $(COVERAGE_LDFLAGS) - -noinst_PROGRAMS = abis_ipa_stream_server \ - abis_ipa_stream_client - -abis_ipa_stream_server_SOURCES = abis_ipa_stream_server.c -abis_ipa_stream_server_LDADD = $(top_builddir)/src/libosmonetif.la \ - $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) - -abis_ipa_stream_client_SOURCES = abis_ipa_stream_client.c -abis_ipa_stream_client_LDADD = $(top_builddir)/src/libosmonetif.la \ - $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) diff --git a/examples/channel/abis_ipa_stream_client.c b/examples/channel/abis_ipa_stream_client.c deleted file mode 100644 index 8795cc6..0000000 --- a/examples/channel/abis_ipa_stream_client.c +++ /dev/null @@ -1,92 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> - -#include <osmocom/core/select.h> -#include <osmocom/core/talloc.h> -#include <osmocom/core/msgb.h> -#include <osmocom/core/logging.h> -#include <osmocom/core/application.h> - -#include <osmocom/netif/channel.h> -#include <osmocom/netif/channel/abis_ipa_client.h> -#include <osmocom/netif/ipa_unit.h> - -static void *tall_example; - -#define DEXAMPLE 0 - -struct log_info_cat example_cat[] = { - [DEXAMPLE] = { - .name = "DEXAMPLE", - .description = "example", - .color = "\033[1;35m", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, -}; - -const struct log_info example_log_info = { - .filter_fn = NULL, - .cat = example_cat, - .num_cat = ARRAY_SIZE(example_cat), -}; - -void sighandler(int foo) -{ - LOGP(DEXAMPLE, LOGL_NOTICE, "closing test.\n"); - exit(EXIT_SUCCESS); -} - -static void signal_msg_cb(struct msgb *msg, int type) -{ - LOGP(DEXAMPLE, LOGL_NOTICE, "received signal message\n"); -} - -static struct osmo_chan *chan; - -int main(void) -{ - struct osmo_ipa_unit *unit; - - tall_example = talloc_named_const(NULL, 1, "example"); - msgb_talloc_ctx_init(tall_example, 0); - osmo_init_logging2(tall_example, &example_log_info); - log_set_log_level(osmo_stderr_target, LOGL_DEBUG); - - /* initialize channel infrastructure. */ - osmo_chan_init(tall_example); - - /* create channel. */ - chan = osmo_chan_create(OSMO_CHAN_ABIS_IPA_CLI, OSMO_SUBCHAN_STREAM); - if (chan == NULL) { - LOGP(DEXAMPLE, LOGL_ERROR, "Cannot create A-bis IPA client\n"); - exit(EXIT_FAILURE); - } - - /* set specific parameters (depends on channel type). */ - osmo_abis_ipa_cli_set_oml_addr(chan, "127.0.0.1"); - osmo_abis_ipa_cli_set_rsl_addr(chan, "127.0.0.1"); - - unit = osmo_ipa_unit_alloc(0); - if (unit == NULL) { - LOGP(DEXAMPLE, LOGL_ERROR, "Cannot create IPA unit\n"); - exit(EXIT_FAILURE); - } - osmo_ipa_unit_set_site_id(unit, 1801); - - osmo_abis_ipa_cli_set_unit(chan, unit); - osmo_abis_ipa_cli_set_cb_signalmsg(chan, signal_msg_cb); - - /* open channel. */ - if (osmo_chan_open(chan) < 0) { - LOGP(DEXAMPLE, LOGL_ERROR, "Cannot create A-bis IPA client\n"); - exit(EXIT_FAILURE); - } - - LOGP(DEXAMPLE, LOGL_NOTICE, "Entering main loop\n"); - - while(1) { - osmo_select_main(0); - } -} diff --git a/examples/channel/abis_ipa_stream_server.c b/examples/channel/abis_ipa_stream_server.c deleted file mode 100644 index 58a4e15..0000000 --- a/examples/channel/abis_ipa_stream_server.c +++ /dev/null @@ -1,79 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> - -#include <osmocom/core/select.h> -#include <osmocom/core/talloc.h> -#include <osmocom/core/msgb.h> -#include <osmocom/core/logging.h> -#include <osmocom/core/application.h> - -#include <osmocom/netif/channel.h> -#include <osmocom/netif/channel/abis_ipa_server.h> - -static void *tall_example; - -#define DEXAMPLE 0 - -struct log_info_cat example_cat[] = { - [DEXAMPLE] = { - .name = "DEXAMPLE", - .description = "example", - .color = "\033[1;35m", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, -}; - -const struct log_info example_log_info = { - .filter_fn = NULL, - .cat = example_cat, - .num_cat = ARRAY_SIZE(example_cat), -}; - -void sighandler(int foo) -{ - LOGP(DEXAMPLE, LOGL_NOTICE, "closing test.\n"); - exit(EXIT_SUCCESS); -} - -static void signal_msg_cb(struct msgb *msg, int type) -{ - LOGP(DEXAMPLE, LOGL_NOTICE, "received signal message\n"); -} - -static struct osmo_chan *chan; - -int main(void) -{ - tall_example = talloc_named_const(NULL, 1, "example"); - msgb_talloc_ctx_init(tall_example, 0); - osmo_init_logging2(tall_example, &example_log_info); - log_set_log_level(osmo_stderr_target, LOGL_DEBUG); - - /* initialize channel infrastructure. */ - osmo_chan_init(tall_example); - - /* create channel. */ - chan = osmo_chan_create(OSMO_CHAN_ABIS_IPA_SRV, OSMO_SUBCHAN_STREAM); - if (chan == NULL) { - LOGP(DEXAMPLE, LOGL_ERROR, "Cannot create A-bis IPA server\n"); - exit(EXIT_FAILURE); - } - - /* set specific parameters (depends on channel type). */ - osmo_abis_ipa_srv_set_cb_signalmsg(chan, signal_msg_cb); - osmo_abis_ipa_unit_add(chan, 1801, 0); - - /* open channel. */ - if (osmo_chan_open(chan) < 0) { - LOGP(DEXAMPLE, LOGL_ERROR, "Cannot create A-bis IPA server\n"); - exit(EXIT_FAILURE); - } - - LOGP(DEXAMPLE, LOGL_NOTICE, "Entering main loop\n"); - - while(1) { - osmo_select_main(0); - } -} |